Playground for graphics

Deferred rendering

During my experience in various commercial and non-commercial projects I’ve came across some interesting CG ideas, algorithms and approaches. Some of them I get to implement on those projects, some of those are already implemented and I just have to use them. Those that are left behind are still lingering in my mind with the label “I wanna do this”. That’s how I’ve decided to create a playground for myself.

First, it would be used to have slightly more organized (than regular drafty piece of code while trying something out) collection of various methods, tools and algorithms relating to 3D rendering and CG. Although it is way slower than just to bash some lines of code, but trying to fit methods I want into somewhat nice framework and pipeline is part of the task. In other words, it’s not really a playground, but more like a tool for myself, were I can play around with new CG and 3D stuff.

Another reason why I wanted to do this is to have a playground for shaders. There are plenty of shader authoring tools on the vast Internet, but I still haven’t found one that would fit my needs. At the moment I am using a set of ShaderMaker, Shader Toy and Shdr. Having my own environment suited for my style and needs is something I was misssing.

I’ve started it as a very simple “load and show” program. Since I had OBJ file loader implemented some time ago (here), I’ve started with using/adapting/adjusting the same code. And, implemented simple Phong shading with forward rendering using OpenGL. I did some more stuff on top of that, such as some GUI implementation, some abstract classes to support extensibility to some sort, etc.

Finally, as my next step (and one of those “I wanna do it”), I’ve started with deferred rendering. And I had my ups and downs. Idea is extremely simply. But it took me a lot of time to figure out and find that rendering empty vector of light objects results in empty/dark scene. Stupid me. Anyways, picture above is current screenshot of my test scene rendered with 500+ point lights and couple of objects. This is still not optimized version of the algorithm so frametimes are just around 15ms.

Coming up next: the shadow! Probably. Well, first I will optimize the rendering and then most likely will want to go for shadows. Or some spotlight implementation and some other cool stuff related to that. Argh, so much stuff, so little time… 🙂