Overgrowth takes place in the savage world of Lugaru where rabbits, wolves and other animals are forced to use paws, claws and medieval weaponry to engage each other in battle. Combining 3rd person adventure platforming with intricate melee combat, Overgrowth achieves a unique feel. Overgrowth also benefits from Wolfire's brand new Phoenix Engine which has been built from the ground up to allow the use of cutting edge graphics, animation, and physics. Add to these exciting features Overgrowth’s realistic artificial intelligence and streamlined control system and the result is an astoundingly immersive experience.

Post news Report content RSS feed Two part shadow maps

The shadow maps we use in Overgrowth are unusual in that they contain two parts: direct shadows and ambient occlusion. These correspond to the two light sources in outdoor scenes, the sun and the sky. Here is an explanation of how it works using an example.

Posted by jeffr on Mar 26th, 2010

The shadow maps we use in Overgrowth are unusual in that they contain two parts: direct shadows and ambient occlusion. These correspond to the two light sources in outdoor scenes, the sun and the sky. To explain how this works, let's consider this scene with a house in the desert:

The first part of the shadow map consists of direct shadows. We calculate them by dividing the scene into a grid and accumulating high-precision depth map shadows. This is done on the graphics card in order to achieve a much higher calculation speed. Here are the direct shadows for this scene:

There are some texture alignment artifacts here, but they're subtle when lit, so I'm saving them for later

The second part of the shadow map is ambient occlusion -- how much total light is received from the sky. This is calculated by accumulating the direct shadows from 64 points on the sky hemisphere. Here is the ambient occlusion for this scene:

See this post for more complex examples of ambient occlusion.

We could store both of these shadow maps separately, but for efficiency we can combine them into one shadow map. The graphics card stores images with three color channels (red, green and blue), so we can store the direct shadows in the red channel and the ambient occlusion in the green channel. Below you can see the direct shadows, the ambient occlusion, and the combined two-part shadow map.

To apply shadowed lighting, we just modulate the direct lighting by the direct shadows, and the ambient lighting by the ambient occlusion. We then add the modulated direct and ambient lighting to get the total lighting for each pixel. Below you can see the modulated direct lighting, modulated ambient lighting, and combined total lighting.

Now all we need to do is combine the lighting with the color map, and we have our finished image! Here is the total lighting, the color map, and the final image.

We recently discussed why ambient occlusion is important for characters (in this post), and it's important for environments for the same reasons -- it helps define the space and adds depth to shadowed areas. Below we have a comparison shot without ambient occlusion on the left and with ambient occlusion on the right. Look under the awning and the wooden walkway to see how it helps define enclosed spaces.

Many games approximate direct and indirect lighting using cascading shadow maps, screen-space depth comparisons, and deferred light accumulation. These techniques are powerful and fun to use, but their rendering artifacts and hardware requirements make them inappopriate for Overgrowth. For us, the efficiency and accuracy of baked shadow maps make them a better choice.

Track us
on ModDB (visit our page)

Please join us here too:
Facebook icon ModDB icon Steam icon Twitter icon YouTube icon

Post comment Comments
Martanz Mar 26 2010 says:

It looks realy good!

+3 votes     reply to comment
P4TRICK Mar 26 2010 says:

I really like your methode, Valve uses some of the same style for "TF2", just more cartoon like. Nice job!

+4 votes     reply to comment
xXMaNiAcXx Mar 26 2010 says:

Wooooooo!Awesome :D

+1 vote     reply to comment
Nauz Mar 26 2010 says:

nice technique, interesting article. well done

+1 vote     reply to comment
Dragonlord Mar 26 2010 says:

I doubt a single depth comparison shadow mapping tech is slower than a dynamic shadow map approach especially in more complex scenes. Unless we talk of static sun light here.

+1 vote     reply to comment
jeffr Author
jeffr Mar 26 2010 replied:

Could you elaborate on that? I am not sure I understand.

+1 vote   reply to comment
Dragonlord Mar 26 2010 replied:

You say that baked shadow maps (aka dynamic shadow/light mapping) is more efficient and accurate than for example CSM, screen space depth comparison (which I'm not sure what you mean... SSAO?) and deferred light accumulation. I doubt this is the case especially if the complexity of the scene increases. For producing baked shadow/light maps you need to render to multiple textures grouping geometry triangles in color mode. For CSM for example you render for the entire view 3-4 depth textures in depth mode. Besides requiring a constant number of render turns depth mode rendering is double as fast as color mode rendering and depth comparison comes nearly for free (hw accelerated including hw-pcf or fetch4 if not using multi-tap PCF or something similar).

Would be a different situation if the lighting is all static but from what I get you use dynamic sun-light so you need to update frequently the direct lighting map (as AO is pre-processing and does not change no matter the direction of the sun-ligth so no update required).

+1 vote     reply to comment
jeffr Author
jeffr Mar 27 2010 replied:

Ah, the sun is indeed static (unless you are in the editor, then you can update it in realtime on a modern graphics card).

+1 vote   reply to comment
Dragonlord Mar 27 2010 replied:

Ah okay, then it's something else. In that case baking it is faster.

+1 vote     reply to comment
RogerRamjet Mar 27 2010 says:

Improvements are subtle, but do improve the overall look... nice...

+1 vote     reply to comment
Post a comment

You are not logged in, your comment will be anonymous unless you join the community. Or sign in with your social account:

Windows, Mac, Linux
Developer & Publisher
Wolfire Games
Send Message
Release date
Game watch
Start tracking
Post news
Related Games
Overgrowth Adventure
Related Engines
Phoenix Engine
Phoenix Engine Commercial TBD
Related Groups
Wolfire Games
Wolfire Games Developer & Publisher with 4 members