[osg-users] Simulating Light Lobes with Projected Textures (Range mapping)

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Thu Aug 11 14:57:20 PDT 2016

Hi Community,

I have F+ lighting system and I am about to "integrate" projected textures
to act as lights instead of the original physics based lighting. I have
managed to have the projected textures to work nicely and the only thing
left is light (the projected texture) attenuation to fully simulate lights.

The shaders are very simple ( I can post them here if needed ). The thing
that hurts my head is the construction of the texture matrix - I am
updating it via  uniform update callback where the computation is done, it
is something like:

osg::Matrixf m = osg::Matrixf::inverse(worldMatrix) * viewMatrix *
osg::Matrixf::perspective(120, 1.0, 0.001, 10);

For reasons I guess the far/near planes are not being taken into account,
if that is the way of how this texture matrix calculus should work

Anyway, I am struggling with this and will appreciate any hints or insights

Thanks a bunch as always!


trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160811/1f815ad8/attachment-0001.htm>

More information about the osg-users mailing list