PDA

View Full Version : Fading volumetric shadows



DopeFish
11-04-2002, 02:02 AM
Ive implemented stencilled shadow volumes into my renderer, using the depth-fail approach (aka Carmacks reverse), but as youd expect, the shadows are all just as dark as each other, at each point in them.

Does anyone know of how one would make volumetric shadows fade with distance, as they do in Doom3 and the Quake1 mod, Tenebrae?

Nakoruru
11-04-2002, 04:56 AM
I am not sure if the shadows actually fade with distance. Maybe you are noticing an effect caused by light attenuation? In other words, I do not think it is the shadow that is fading, but the light.

DopeFish
11-04-2002, 05:28 AM
It appears to be the shadow, the area directly behind the shadow-caster is quite dark, but the areas in the same shadow but further away from the object arent quite as dark.

Pentagram
11-04-2002, 06:19 AM
Well actually the shadows don't fade but the light fades...
So the further you are off a lightsource the less light object recieve so everything gets darker and thus the shadows seem to "fade".
This is called atenuation and can be done in various ways. Dunno about doom3 but tenebrae uses 3d textures (on gf4 & radeon9700)

Charles

[This message has been edited by Pentagram (edited 11-04-2002).]

pocketmoon
11-04-2002, 10:32 AM
Yes they do fade. The occluded area very close to the occluder sees very little ambient light. As you move further away the shadow lightens as more 'ambient' light becomes visible and the occluder takes up less of the 'sky'. Of course the most important effect in penumbra http://www.opengl.org/discussion_boards/ubb/wink.gif

Nakoruru
11-04-2002, 10:41 AM
Pocket, We are not discussing real shadows, but shadows in Doom 3 and Tanebrae Quake ^_^

I do not believe (100 percent do not believe) that they fade in those engines, mainly because of how difficult it would be to do occluder distance faded shadows like yours with stenciled shadow volumes.

ToolTech
11-04-2002, 12:23 PM
Just a comment. The demo I put up on the board a couple of weeks ago uses stencil shadows and correct calculation of umbra/penumbra so it is not that difficult to do it... If you forgot it you can look at the demo at www.tooltech-software.com (http://www.tooltech-software.com) (softshadow)

dorbie
11-04-2002, 12:57 PM
Yep, the light fades with distance not the shadow. Other sources of illumination may make the shadow appear to fade as the light is attenuated and the secondary contribution increases. This effect can be simulated by adding more than one light source to the scene and accumulating the illumination terms accurately.

pocketmoon
11-04-2002, 01:20 PM
What about some shadows like this ?
http://www.baddoggames.com/volshad2.jpg

:->

ToolChest
11-04-2002, 01:24 PM
Originally posted by pocketmoon:
What about some shadows like this ?
http://www.baddoggames.com/volshad2.jpg

:->



Can you make the image big enough to see?

pocketmoon
11-04-2002, 03:02 PM
http://www.baddoggames.com/volshad3.jpg

w.i.p.

DopeFish
11-04-2002, 06:45 PM
Hmm thanks for the info http://www.opengl.org/discussion_boards/ubb/smile.gif

dorbie
11-04-2002, 08:02 PM
The correct thing is still to accumulate light even for the volumetric effect.

The (fast) method described to do this in a couple of papers is to shade the enclosing light volume with depth and subtract front depth from back face depth. Attenuating that contribution with other parameters is also described.

[This message has been edited by dorbie (edited 11-04-2002).]

ToolChest
11-05-2002, 05:47 AM
Originally posted by pocketmoon:
http://www.baddoggames.com/volshad3.jpg

w.i.p.



Thanks, looks good... http://www.opengl.org/discussion_boards/ubb/smile.gif

SirKnight
11-05-2002, 06:02 AM
The (fast) method described to do this in a couple of papers is to shade the enclosing light volume with depth and subtract front depth from back face depth. Attenuating that contribution with other parameters is also described.


Which papers exactly?

-SirKnight