Half-Life 2 Shadows

Started by
23 comments, last by MikeyO 19 years, 2 months ago
speakin of game shadows.
does anyone know how blizzard makes the shadows in world of warcraft?
i mean the big ones, casted by trees and buildings, not the character shadows which are weak.

shadow maps as well?
thanks
Advertisement
Okay, it seems that hl2 uses projected shadows, which I had never heard of (blush). Thanks for the info, I might use it in my game.
Quote:Original post by HardguyThis technique is used in Ogre for example. It has some limitations like no self-shadowing and (at least in Ogre) shadowscasting objects can't recieve shadows.


Why doesn't Ogre allow self shadowing anyway? The "basic" shadow mapping algorithm allows for self shadowing..
Quote:Original post by ehmdjii
...does anyone know how blizzard makes the shadows in world of warcraft?
i mean the big ones, casted by trees and buildings...


They look to me like prerendered lightmaps. The sun changes and I think the shadows change, but thats just too much geometry to be dynamically drawing shadows all the time. Plus its static.
If the objects in question aren't animated, couldn't they use prerendered shadowmaps? i.e. a projected texture that is an 'accurate' shadow for a given range of light directions. If they set up three or four per building they could just fade between them as the time of day changes.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

A problem with projected shadows (at least the way hl2 does it) is this:

2 objects close together wil re-shadow the area they were projected onto. Is there a way to remedy this?
the rug - funpowered.com
I noticed that problem in their demo when the crane with the magnet picks up that box.
>> Is there a way to remedy this?

In the source engine or your own program?

If you want to fix it in game.... well, cross your fingers and hope that valve releases a patch for it, which is unlikely. Shadowing is a major component of any engine that includes it, and patching/correcting after the fact would be dodgy.

If your curious about correcting this effect in your own programs, of course you can! Easiest method: Don't use this type of shadow. Both Shadow Volumes and Shadow Maps give good results, and follow logic that helps correctly shadow ANY surface as long as the render pipline is set up correctly.
// Tojiart
This is easy to fix if you light properly. I use rendering black objects onto white backgrounds without this double-darkening effect.

The key is to do additive lighting instead of subtractive or multiplicative shadows.

Start with ambient, then calculate shadows for the 1st light, either to dest alpha or stencil, then calculate light for 1st light, only adding it where shadow is not marked.
So HL2 is not using true shadow mapping ever? Or is it only on the cheaper paths where they use projected texture shadows?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement