In our first article we covered how we can write a simplified Photoshop-style API for displaying multiple textures on the screen, and we have since extended the code to several extra features:
Adding Parallax scrolling to your XNA code
Adding video layers to your XNA code
Reporting performance statistics in your XNA code
Adding 2D Pixel Effects to Layers
Collection of Layer Effects
I was going to hold off on showing you any more pixel shaders, but I recently wrote one which seems cool enough to show you now!
One of our original ideas for a level in Lunar Panda was for Mr Panda to disappear down a ‘wormhole’ at some point, and enter a ‘retro’ universe. We’d change our screen art so it was pixellated and had a limited color palette, making it look like it would in the ‘old days’ of gaming.
Alas that was never implemented, and shelved for a future game, but that didn’t stop me from investigating whether we could automatically achieve this effect using a pixel shader. It turns out we can get pretty close!