Deferred Shading


Hello Readers,

Long time since my last post, have been busy with school and such but I also learned how GLSL shaders work. Basically what it comes down too is that I wanted a lighting system fully in shaders, yet I wanted a good fps while having many lights. So I started searching for techniques how to do this and came across deferred shading. It took me a while to implement (mainly because I had no knowledge of GLSL before I started) but I think the results are good 🙂 I also made the engine save to my own mesh format (P3D) which is basically a light binary version of an obj model. I’m planning to expand it to support everything my engine would need in the future (animations and such). I don’t have any pictures of the lighting system on my terrain system because I still need to edit my terrain shaders to support the new lighting system, so I’m just using a test map I found online with a grass texture applied to the whole scene. The red light is a light that is 400 units above the marine and has a radius (all point lights btw) of 1000.0 units. The rest of the lights have a range of 400.0 units and maintain their position. Don’t mind the texturing, I still need a modeller or such to create the models and textures for it.
Anyway, Here are some pictures of the lighting system:
Picture 1 (Test Map)
Picture 2 (SC2 Terran Command Center)
Looks great doesn’t it?

Next step would be to add support for directional and spot lights, and also some real-time shadow mapping technique.

Thanks for reading,
Calsmurf2904