Shadows and translucency

CI

Newcomer
I noticed this while browsing for Quake4 pics. Looking at the shadow of the iron maiden, it only exists for the top half of her body. The lower-half appears to be kinda translucent but is apparently treated as non-existant from the shadowing. Presumably care could be taken by segmenting the lower half of the body and assigning different values for shadow intensity but that's a very hackish way.

There's a lot of talk on soft shadowing but how bout' accounting for translucency? Is there currently any shadowing techniques taking care of translucency "automatically" or do they require special efforts on artists and programmers side? Or is it due to processing power requirements that makes it unfeasible for now?

monster_ironmaiden.jpg
 
A very reasonable question.

The vertex data is the same ... maybe rendering an opaque shadow body, than, painting it over with some translucency based value would not be that hard.
It should be doable in pixel shader. In my ignorant, non IT, peasent mind, of course.
 
Translucent shadows definitely are possible. There's some pretty cool demos floating around with stained-glass windows being projected as a "shadow"... Then again, I've only seen it for shadow mapping, not stencil shadows...

I don't know exactly how Q4/D3 engines work, but typically translucent geometry and "solid" geometry is treated differently in the pipeline - mostly due to the draw-order dependencies.

Jack
 
It's a bit hard to have translucent objects work with stencil shadows and requires a bit of fragment program work. Since Quake3 (Doom3 engine) looks almost the same in the range of cards it supports (GF3, GF4, Radeon 8500, etc), it would be dificult to make it work on all the cards.

Now with shadows maps, that's a diferent story. ;)
And I haven't seen anything regarding UE3 semi-translucent stencil shadows. With shadow maps yes, but not with stencil shadows...
 
Well, it'd be unrealistic to implement translucent transmission of light with stencil shadow volumes. You'd basically have to do the translucent object on a separate rendering pass from everything else, and you'd be limited to solid color only transmission.

Projected texture maps, instead, are the way to go. Projected texture maps are very similar to shadow maps in implementation, but they still have to be treated a bit specially. There's really no reason why one couldn't use projected texture maps along with shadow volume rendering (Hell, UE3 will use both shadow volumes and shadow maps, so why not?), it's just that the technique is more similar to shadow map rendering, and as such it's going to be quicker and easier to write a renderer that does shadow maps and projected texture maps than one that does shadow volumes and projected texture maps (since more code will be the same in the former case).
 
Chalnoth said:
Projected texture maps, instead, are the way to go. Projected texture maps are very similar to shadow maps in implementation, but they still have to be treated a bit specially. There's really no reason why one couldn't use projected texture maps along with shadow volume rendering (Hell, UE3 will use both shadow volumes and shadow maps, so why not?), it's just that the technique is more similar to shadow map rendering, and as such it's going to be quicker and easier to write a renderer that does shadow maps and projected texture maps than one that does shadow volumes and projected texture maps (since more code will be the same in the former case).

Agreed but D3 does have projected texture maps. I think the problem is the cost of having an extra projector around for that particular monster that is inline with the extruded shadow volume of the main light. Throw in extra lights in the scene and I think the performance hit isn't justifiable for the small quality increase (which I'd qualify as an image fidelity option).
 
For decent transparent shadows, you really want to use an improved version of shadow maps.

Standard shadow maps are a 1st hit approximation to light space transmission, the distance is explicitly stored and the filter colour is implicit (its black at all texels).

The first improvement is to store the filter colour at each texel. So instead of just storing depth, you store depth and filter colour. Then when something is further than the stored depth, rather than just assuming all light is blocked (filter colour was black) you modulate the incoming light value by the filter colour and then do the lighting colour (most demo's using transmitting shadow maps get this wrong, the light using the unfiltered light colour and the simple modulate the result with the filter colour). It can easily been seen as a superset of normal shadow mapping because anywhere light is completely blocked (standard shadows) the filter colour is set to black, as all incoming light is blocked. One neat side effect is that with the correct shader, even solid objects look better as you can soften the edges. This effectively lower the high frequency (infinite is pretty high) of the polygon edges, so having a shadow AA effect.

This gives you correct lighting for the 1st hit, the problem of course that if the light wasn't blocked completely, its now possible to have multiple filters per light. So you now need to store multiple depth maps per light and then work out where each object is relative to this 'stack' of depth maps.

So a really good shadow map algo, would have N maps with each map storing a depth and colour. Render from the light source N times, using depth peeling to get the correct depth at the far depth maps. Then when you project them onto the scene, the depth is compared against the N stack of depth map and the incoming light value filtered by the M filter colours that pass the test. The result of this is then used as the incoming light colour for the per pixel lighting algo...

Not cheap but it looks good and with an reasonable value of N can cope with any transmissive surface with an Index of Refraction of 1.0

Thats a bit quick and likely to have mistakes, got to goto work but hopefully you get the idea...
 
Back
Top