Hi,

I want to place a light into the scene without using fixed pipeline. Thus, I 
created uniforms to pass light parameters to shaders. These works fine except 
light position and light direction.

I want to pass light position in eye coordinates. I expect, I have to multiply 
light_local_position by local_to_world_matrix first, and then? I think, I 
should apply camera transformation as well, thus multiply it by perspective 
matrix as well, if I am not mistaken. Another problem follows: Can I store the 
the result (eyeCoordinateLightPosition) to the regular osg::Uniform while I am 
doing all above in the cull traversal? (I am worrying that the Uniform is 
added to "rendering graph" and the next frame cull traversal may modify the 
uniform before "rendering graph" is rendered, or is this scenario handled 
somehow?)

Thanks for explanation or pointing me to the right path.

John
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to