Best way to create full screen, 320x240 surface, no anti-aliasing?

Started by
4 comments, last by Sik_the_hedgehog 11 years, 1 month ago

I'm hoping to develop a game engine that essentially can simulate a full screen, tile based graphics system similar to old video game consoles (NES, SNES, etc.). I would like to do this with all open source software that is likely to be maintained well into the future. No proprietary, heavy game engines.

From initial research, it sounds like my best bet would be a combination of SDL and OpenGL, where SDL would just be for window management and getting my game full screen, and then I would use OpenGL to scale all my low-res textures to full-screen size, to emulate a 320x240 mode. Is it possible to do this with absolutely all anti aliasing off? I want it to look pixel-sharp.

Advertisement
Draw onto a 320x240 texture, then draw that texture as your screen. The only way to keep it sharp is to scale it at an even ratio (2x,4x, etc..), and use the NEAREST/POINT filtering mode.

But we don't have square screens anymore. You'd have to center it over a background image, or use a 16:9 or 16:10 resolution in the original image. Such as 320x180 (16:9).

Honestly, to mimic consoles of yor, you don't even really need anything as complex as OpenGL (though its certainly an option).

The straight-forward approach you describe will also only be good for simple tile-based games, and won't really recreate the console experience. Alot of that console magic had to do with the use of palettes, and with manipulating the hardware between raster lines. You'll have to emulate those things too if you really want that olde time experience. Most of that stuff is easy enough with a software renderer, but utilising GL or D3D draw calls complicates things like per-scanline effects (still doable, of course).

Still more of the console feel is around hardware limitations, so you'll have to decide whether you want a truly realistic approach, or something that's more like an old console with unlimited but largely static resources.

throw table_exception("(? ???)? ? ???");

But we don't have square screens anymore. You'd have to center it over a background image, or use a 16:9 or 16:10 resolution in the original image. Such as 320x180 (16:9).

I found 384×240 (16:10) and 384×216 (16:9) to be better options.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

It occurred to me perhaps I can up-scale all the low res graphics I have for this project and then just use normal SDL blitting. If I make sure this always is up-scaled using powers of 2 I should get perfect sharpness correct? I don't really care if it fits the screen perfectly (just that it doesn't get clipped by the screen...). Does that sound like a viable option?

You probably mean integer multiples instead of powers of two (e.g. 3 is OK, 2.75 is not). And SDL defaults to no texture filtering, for the record. (EDIT: wait, I think you mean upscaling the textures - upscaling the coordinates of the triangles should be enough, no need to change the textures)

The problem is that then you risk the coordinates to not be aligned to the fake (scaled) pixels, which completely ruins it (this is probably the biggest issue with pixelart on modern games). You'll need to take this into account and modify the coordinates to make sure they always end up aligned to the scaled grid.

Note the above workaround only works if you're drawing the sprite as-is and you limit special effects to just flipping (things like coloring aside). If you add scaling or rotation, you're pretty much guaranteed to break the alignment (though those effects on pixelart don't look very good anyway, faking them with hand-drawn sprites is usually better).

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

This topic is closed to new replies.

Advertisement