Hi! My name is Tom.

Report RSS Current state and deferred shading

Posted by on

Hey folks!

Today I want to tell you what I'm currently working on and what the next steps in the development of my dungeon-game will be.



As I already said, I have made a prototype a few months ago. Included were mainly graphical and physical tests and some attempts to generate good looking dungeons.
But as usual for prototyping my code was ugly and not flexible enough to build upon it.


Therefore I started working on the proper version of the game a few weeks ago and now I'm at a point having the following features:

  • flexible and suitable physics engine
  • ressource-manager for loading ressources (like textures, shaders, ...)
  • component-based entity system for good logic-encapsulation
  • easy to use graphics pipeline
  • very very flexible dungeon-generation-framework

Most of them will sound quite boring to you but it is very important to have a solid base to build on.

My current goal is still to achieve the same functionality as in my prototype, so more graphical improvements, a particle-system and the lighting system are needed.

Talking about lighting-system, I am currently focusing on a rendering technique called "deferred shading". It allows me to render as many lights in the scene as I want without big loss of performance. To summarize this shortly:

Deferred shading is a technique in which the lighting-calculations and the rendering of the objects is divided into two passes. In the first pass all the information of the current viewed scene needed to calculate the lighting is stored in several textures which then are passed to a second rendering-step. With the help of some stencil-buffer improvements for each light only the affected region on the screen is then processed and all light-calculations simply get added together.

Sorry for my bad explanation-skills but if you really want to learn more about that, simply google it.

The result of using this technique is, that the complexity of rendering lights turns from O(n * k) to
O(n + k), where n is the number of objects and k the number of light sources.

And for the more visual people I have a screenshot:

Deferred shading tests

Here you can see the different textures I'm rendering the scene to. In the top left there is the diffuse-component, in the bottom left corner you can see the position of each rendered pixel encoded to simple RGB-values and in the bottom right there are the normals.
Some insiders might already have noticed that I am also using bump-mapping for better details and more realistic lighting.

That's it for now! I think my next post will be about how I (plan to/already) generate random dungeons.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: