Yes sure I will share it, but I would like to clean the code before, right now it's just a bunch of experiments
. For the record, I'm basing my code on
XEffects, which is a set of extensions to Irrlicht mainly to add post-processing and shadow mapping (I can't believe shadow mapping is not the standard shadowing method in Irrlicht...)
As for my SSAO attempt, the principle is that for each pixel P, we randomly select neighbouring points and estimate how much those points "occlude" the point at P. This estimation is based on the depth buffer.
The thing is that in the borders, the difference in depth is obviously big, so the borders appear as very occluded...
What should be done to get something correct is to take into account the normal at P, and weight the occlusion term by the dot product between this normal and the vector going from the occludee to the occluder, as is done in
http://www.gamedev.net/page/resources/_/reference/programming/140/lighting-and-shading/a-simple-and-practical-approach-to-ssao-r2753. This way, the occlusion is stronger as the occluder is in close to the axis of the normal at P.
Yesterday I managed to get the normals working by using gl_Normal in the vertex shader, see below:
Here I have a question: I know the black quads on the floor represent the shadows of the karts, but what about this black cylinder? What is this for?
What I'm trying to do now is to pack the normal and the depth values in a single 32 bits buffer, and use this as input to my SSAO shader, which will be based on the code from GameDev.
I will be quite busy this week-end, but I will try to communicate my results through this thread, for those who are interested
Other (sometimes stupid) post-processing ideas:
- mirroring (would need to mirror input as well)
- toon shading
- painting rendering
- motion blur
- bloom
- ASCII mode (as was suggested in the blog's April's fool joke
)
Note that this kind of bonuses could be items unlocked by challenges