browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

Pixel shader fun

Posted by on August 17, 2008

Finally, I’m making some progress with this “pixel shader” stuff. Basically, this enables one to do nice effects on a “per-pixel” basis, e. g. soft shadows and glass refraction effects. Though I find it difficult to comprehend I managed to create basic implementations of these two effects in a prototype (see the following screenshot).

This is so rewarding – to enter some dry and often frustrating program code that in turn produces beautiful eye-candy. I think this is why so many people are attracted by games / graphics programming.

There is a glass effect on the beater, which correctly distorts the image of the scene behind the beater. Though barely visible in the screenshot, it actually looks quite nice in motion.

Soft shadows are implemented using a simple 3×3 PCF filter. This looks much better than the hard shadows of the last prototype but the shadows still look somewhat “striped”, especially in higher screen resolutions. Variance Shadow Maps and screen space blur might be ways to overcome this – if I find enough courage to try and comprehend this stuff sometime ­čśë

Next step will be to create an interactive, playable prototype. ┬áIntegrating the physics engine should be fairly simple, judging from my experience with the 2Dprototype. Sound isn’t that difficult either.
I think most difficult (and interesting) will be to create an extensible object oriented game system that allows one to easily add more game objects and interaction bit by bit without the need of rewriting large parts of the source. Or at least make this refactoring easier ­čśë

Update:
– Added tinting effect to the beater shadow. You can see that the shadow caused by the translucent part of the beater is now slightly coloured to give a better impression of light falling through glass. This was fairly easy to implement.

Leave a Reply

Your email address will not be published. Required fields are marked *