PDA

View Full Version : shadow colors



remdul
04-19-2006, 02:08 PM
Hi,

I render static and dynamic shadow maps by blending them onto shadow receiving objects (multi-pass). The shadow maps are stored as GL_LUMINANCE. This is simple, fast and works great.

However, I would like to give the shadows a tint (usually blueish, but color and intensity varies per location) so it blends in better with the environment.

I tried many blendfunc combinations, but it seems that the blend mode I'm looking for isn't there. All it needs to do is darken the underlying surface with a specific color and intensity...

Is there a way to do this (fixed function pipeline)?

Thanks. :)

Obli
04-20-2006, 03:22 AM
I'm not sure, but I think there's an extension. Something like ARB_shadow_ambient perhaps. Don't ask me how widespread this is, I don't care for FFP - sorry for that.

Without extension, I believe the thing is somewhat involved and I'm not even sure of it ("manual" texture comparisons maybe?), I write this just do give you some paths to follow.

Are you using at least register combiners or NV_texture_shader?

remdul
04-20-2006, 01:21 PM
According to the 'OpenGL extension Viewer' GL_ARB_shadow_ambient is only supported on ATI cards. I found this a little odd, so I read up on the extension specification. The ARB actually recommends that if the effect can be done otherwise it should not be supported:

"Those who already implement advanced texture combine modes probably won't want to implement this extension."

Apparantly nVidia agrees. So, it can be done otherwise, I'll make sure to check out the ARB_texture_env_combine extension.


Are you using at least register combiners or NV_texture_shader?I'll probably want hack it into my shaders yeah, but I want to support this effect on older cards, if possible, as well.

Thanks! :)

* Any additional hints are always welcome.

remdul
04-21-2006, 05:49 PM
Does the texture combine stuff even apply to regular blending? I'm not doing (and can't do) multi-texturing, multipass is the only option...