Hello,

I've been trying to solve the back-projection issue when doing
projective texturing, with the goal of having it work with shadow maps.
I know the simplest thing is to use a shader, and that part is already
working, it's the 'support older hardware' requirement that's biting me.

I modified the 'osgshadowtexure' example by adding a 1D texture that
maps to the r coordinate used by the projective TexGen and trying to use
this to control the application of the shadow texture. The idea is to
give the projected texture an alpha of 0 (invisible) when it has
negative r coordinate, using TexEnvCombine.

I almost got the result I was looking for, but it not only wipes out the
shadow texture, but the base texture as well.

The frustrating thing is that it seems that 'setCombine_Alpha' is being
ignored, and I can't see an RGB operation that will give the proper result.

The example is meant to be dropped into the examples dir in the sources,
 then added to the CMakeLists.txt file.

There was another thread dealing with a similar issue 'TexGenNode &
TexEnvCombine' but while David mentioned using a masking texture, there
were no details.

Cheers
Mihai Radu

Attachment: osgshadow-backproj.7z
Description: Binary data

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to