Jump to content
  • Advertisement
Sign in to follow this  
lightfoot

OpenGL Hardware scaling

This topic is 4157 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm writing a couple of games that I want to keep a very retro feel - therefore I'm using a nice SVGA resolution of 320x240... however, on todays monitors this looks awful. At the minute I'm setting up OpenGL to have a viewport of 640x480, but then restricting the ortho coords to 320x240, so its doing some simple hardware scaling. The only issue I have is that when textured quads are rendered - its using some sort of interpolation and making them look horrible. 1) Is there any way to tell it to just pixelate it? 2) Is there some way I could implement some sort of 2xSai scaler but use hardware? I'm not so fussed about the second, it would look nicer - but I don't want to compromise speed of the game. Cheers, Chris

Share this post


Link to post
Share on other sites
Advertisement
Scale2x is a relatively straightforward scaling algorithm that has a pixel shader based implementation. (If you've messed with emulators much, you've probably seen mention of it.) The original implementation appeared on Beyond3D as part of a shader contest, but that page has apparently died. The easiest way to get the shader now is on this page. Basically it's the shader that Pete's GPU plugin uses for PSX emulation to scale things. Once you crack open that zip, there's a pretty decent amount of documentation and explanation in comment form about what's going on.

As for pixelation, set the texture to use nearest sampling, which you can do via glTexParameteri.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!