Faking Low Resolution

BlitzMax Forums/BlitzMax Programming/Faking Low Resolution

Benjamin(Posted 2005) [#1]
Here's the problem - I'm trying to write an old-school-style platformer. One that looks and feels like an NES game, if that gives you an idea of what I'm going for. The problem, of course, is that my video card (I'm using a Mac Mini) is only capable of going down to 640x480 resolution, which is still too high. I don't have a 320x240 option, so I've been trying to cheat...
I set the graphics to 640x480 and then, at the top of my code, call SetScale 2,2. This makes everything the right size, but now I have a new problem - my once-sharp-and-blocky pixel outlines have been filtered somehow, resulting in a mushy blur. Is there some easier way to get the effect I want without having to simply provide all of the graphics double-size to begin with? Or some way to turn off SetScale's filtering?


fredborg(Posted 2005) [#2]
Setting the image flag to 0...LoadImage( "whatever.png",0 )...Should do the trick.


FlameDuck(Posted 2005) [#3]
I set the graphics to 640x480 and then, at the top of my code, call SetScale 2,2.
Incidently a better method would be to allow the user to chose whatever resolution they want, and then using SetScale GraphicsWidth()/320, GraphicsHeight()/240.


ImaginaryHuman(Posted 2005) [#4]
If you use bglCreateContext() to create your display rather than Graphics(), you can possibly set up the glOrtho() command to define a viewport that looks upon the 3d world in a magnified manner. Everything you render should then show as double size, or half, or whatever you like. I noticed when I experimented a little that changing the parameters in that command could, for example, automatically shrink the whole display to half size without having to add any other commands or change any dimensions or multiply anything or implement any kind of zooming. Think of it as a set-scale that applies to the whole scene - rather than making all your objects twice the size which is what SetScale would do.

Note that if you do this, and if you have FILTEREDIMAGE as an image flag, it will interpolate the pixels rather than show them as blocky - you probably want to have images what are not filtered so that you get the blocky look.


Benjamin(Posted 2005) [#5]
Thanks - didn't read closely enough about image flags. AutoImageFlags is what I needed...

The point about multiple resolutions is well taken, but at anything besides 640x480, 960x720 (does that even exist?), 1280x960, or other exact multiples of 320 and 240, that'll lead to pretty strange-looking warping of pixels.


EOF(Posted 2005) [#6]
How abou using Fredborgs SetViewZoom function?
That way you set the screen to 640x480 and simply zoom in to make everything appear as 320x240.


FlameDuck(Posted 2005) [#7]
The point about multiple resolutions is well taken, but at anything besides 640x480, 960x720 (does that even exist?), 1280x960, or other exact multiples of 320 and 240, that'll lead to pretty strange-looking warping of pixels.
No it won't. It will be scaled perfectly to fit your display. The only cases warping will occur is if people have incorrectly configured monitors (for example using a 5:4 aspect ratio resolution, like 1280x1024 on a 4:3 screen). Incidently it'll also look perfectly fine on 800x600 and similar resolutions (which are also a 4:3 aspect ratio).


Benjamin(Posted 2005) [#8]
I just tried it out (at 800x600) and it looks quite a bit less than perfectly fine; since I'm using unfiltered scaling (to get the blocky look), the pixels come out all different sizes from each other. The aspect ratio might be right, but on the pixel level it looks pretty bad.


BadJim(Posted 2005) [#9]
Yes unfiltered scaling requires exact multiples or it looks wierd.

But I find the ultra-sharp blocky pixels look wrong to me, just as filtered scaling looks wrong to you. The definition was never that good (or even close) when I was playing Turrican through my TV.

If you have the time, I suggest that filtering be optional. You don't like it, but I do. Emulators tend to have this option.

Another thing that emulators do: scanline effect. Simply blacking out every other scanline on the screen gives you a nice TV effect which is just sooo oldskool.


RexRhino(Posted 2005) [#10]
Yeah, on a traditional TV the TV is not pixel perfect, the image is kind of "anti-aliased" by the way the analog electron beam goes over the screen.

This is why hardcore MAME emulation people will go out and buy an adapter and use old arcade analog displays when they want to accuratly emulate old arcade games.