Shadow and depth-texture question

Hi (again)!

I’m still using the shadow map algorithm, but now I’m trying to make my shadows appear “dimmed” (less black - transparent). I can’t use NV_register_combiners or the dual texture approach.

Is it possible to adjust the result from “TEXTURE_COMPARE_MODE (=COMPARE_R_TO_TEXTURE) and TEXTURE_COMPARE_FUNC (=LEQUAL)” to be something else than 1 or 0 (how?)? Or is there another way to achieve this effect?

I’m also interested in how to compute this number (“r”) from more than one depth texture.

Thanks,

  • Monica

I guess the hardware that does your shadow compare only generates YES (in shadow) or NO (not in shadow) = 1 or 0.

You could use the fixed-function pipelines’s blending and multipass on top of your black pixel and make it look transparent.

Cheers.

http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow_ambient.txt

is this what you’re looking for?

Hi!

Thanks for good answers Unfortunately I can’t use GL_ARB_shadow_ambient either (not supported)…

Originally posted by fritzlang:
You could use the fixed-function pipelines’s blending and multipass on top of your black pixel and make it look transparent.

How can I do this? I’m not very experienced with OpenGL… (Need more details )

If anyone has more ideas on how to solve this problem, I’ll be happy to hear them!

  • Monica

Hi,

I’m not familiar with the details of the hardware shadow mapping mechanism (I only have a TNT…), perhaps you could use an additional texture unit to apply some mapping to the shadow coverage factor, like cov=cov*0.5+0.5.

With blending this is easy, just first draw your light with half intensity, without shadows, and in another pass add the same light with shadows, again with half intensity.

Additive blending:

glDepthTest(GL_EQUAL);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);

For multiple lights you typically start from a black scene, and add each light’s contribution in a seperate pass. It might be possible to use several shadow maps in a single pass if you have enough texture units, but I don’t know how. I’d start from one pass per light.

-Ilkka