BGE easy and beautiful 2D shaders, + demo!

So, I really hate 2D shaders because I have a hard time finding good ones, and now that I have, I’d like to share them with you guys! But that’s not all, because I also have a demo scene with nice lighting and the shaders included, just to give an example of realtime lighting setup combined with shaders! And one more thing, I’d prefer if you used the standalone button when playing the game to get full resolution and working SSAO.

Blend file:

As for the 2D shaders, all you need to do is download the .txt files, open them in blender, insert them into the 2D filter logic brick (set to custom), add a sensor for it and done! the only different one is the DOF shader.

For the DOF shader, use the “dof_depthblur.txt” in a custom shader, then use “readDepth.txt” and “readLuminance.txt” into seperate python logic bricks, then plug them in to an always sensor set to true “pulse mode”.

Here are the shaders and their scripts:


Chromatic aberration:


DOF scripts:

P.S. Sorry for the long links! I don’t usually use all the text tools like links and scripts, etc.

Very nice!
I will certainly be using your bloom shader for my current project (and any other project that would need it). The old bloom filter I used made my game run at 30fps. Your bloom shader not only looks a lot better, it runs a smooth 60fps. Bravo!

I would also like to possibly incorporate the DoF filter, although I would want to modify the code to handle the focal point. Is there a way you could have the focal point be set to the worldPosition of an object?

This .blend runs at 16 FPS in small window without filters. I may rather like to see an example for low-end GPUs.