Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  



Next, I'll take a break from the navigation, and I'll add decal support to the level editor. My engine has fairly advanced support for decals right now. I am using a variant on deferred shading, where you composite your diffuse textures first, including any terrain layers, decals like scorch marks, dirt, etc., then composite your tangent space normal maps, then once all is composited, lighting & shadows are applied. This has the advantage that decals are correctly lit, shadowed and fogged, including bump mapping.

Right now decals are only applied in the engine dynamically, when a laser bolt hits a wall or floor or other static obstacle. My plan is to use decals to spice up the levels as well. I will add the ability to apply decals to any static geometry, which will be useful for adding scratch marks, scorch marks to represent an earlier battle, cracks, blood, dirt, and even carved writing, murals, and bas-relief.

The decals can be diffuse, normal map, or both. Applying just a normal map decal will be a great way to make the stone walls & floors look carved.

Here an older shot of the level editor, and the in-game level, showing some scorch-mark decals.

Sarcophagus In Level Editor

Decals Zoomed Out

Decals Close Up
Sign in to follow this  


Recommended Comments

Wow thats quite cool. The first screenshot is a bit wide on my resolution though, it breaks layout for me.

Share this comment

Link to comment
As a general aside ... deferred shading over a multi-pass buildup for lighting/shadows?

I have to admit that I've only had a cursory glance over the details of deferred shading (looks quite cool).

I'm quite keen to redo some of my multi-pass lighting code, and wondering whether to rip it out and stick some deferred shading in there - given that a lot of people seem to like it [grin]


Share this comment

Link to comment
I actually don't like classic deferred shading. I should do an article on this at some point.

Classic deferred shading typically has three aspects.

1) Compositing. Putting down the lighting parameters into off-screen buffers, before lighting happens. This is the essential part. This corresponds to the RenderMan concept of 'Material Shaders'.

2) Multiple Render Targets. This is often employed to accomplish #1, and do write out depth from to a buffer, but it is only an optimization, not a requirement, plus it breaks hw anti-aliasing, so I don't like this portion.

3) Drawing the light geometry instead of the world geometry. This also has problems with AA. Again, this is an optimization, and is not needed, and can cause problems with light volume capping. Has the advantage of reducing draw calls over per-geometry chunk draw calls.

I just use #1 in my engine - that way it works with AA, and works on GeForce3 and above, rather than only on the highest-end cards.

Share this comment

Link to comment
I actually don't like classic deferred shading. I should do an article on this at some point.
Consider this an open invitation to write for us any time you want.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!