Shadow Mapping Ambient

Thanks in advance for any help…

I don’t want my shadows to be pitch black. It looks like ARB_shadow_ambient or GL_SGIX_shadow_ambient both address this, but I can’t seem to get them to work.

Here is a small bit of code:

//Init Depth Map Texture


But the shadows are still solid black. Everything still shadows correctly, and my understanding is that the only thing I need to get non-black shadows is the call to:

Should’nt this change the luminance of the affected fragments from 0.0 to something else?

Any help is greatly appreciated…this is driving me nuts…

Even better, any other technique to get non-black shadows is welcome - must work on GeForce 4 and above…

I would guess that it’s not working because the extension is not available on geforce cards (at least up to v56.56 drivers and fx 5900’s - ie. my configuration). Might be different for later drivers (I have doubts) or cards…

I am not aware of any other techniques that can be used to get the desired effect with shadow buffers.

Thanks rgpc - That does definitely explain why it isn’t working…

Is there anyway to accomplish this in geforce 3+ hardware using register combiners or something?

Thanks again…

Yep. ARB_shadow_ambient has very light support. I used register combiners to achieve transparent shadows.

PT - Can you elaborate on how you used register combiners?


Sorry I can’t supply a code sample right now. But the approach I took isn’t very sophisticated. Here’s the gist of it:

shadow_color * (1 - shadow_texture) + fragment_color * shadow_texture

. set a constant color to be grey
. for the shadow color, blend the constant color with the incoming fragment color to darken it
. use your shadow map texture result (which is 0 or 1) to modulate between the shadow color and the fragment color

BTW: Having set up register combiners has made me really appreciate high level shading languages.

Good luck!

could you supply code? ^^