I want to have one point light in my scene. It is set to use GL_LIGHT1 calling myLight->setLightNum(1);. This light should cast shadows. I set up ShadowedScene with ShadowMap technique.

All these things I want to prerender to texture and then I want to attach the texture to a quad (see sample graph in my first post).

Jan




On 06/15/2010 12:23 PM, Robert Osfield wrote:
Hi Jan,

I don't really know enough about your setup to know exactly why it's
not doing what you want it too.  You don't mention anything about what
light numbers you are trying to use, is it the same?  Have you tried
disabling the GL_LIGHT0?  Have you tried assigning your own global
light source node?

Robert.

On Tue, Jun 15, 2010 at 11:08 AM, Jan Navrátil<[email protected]>  wrote:
Hi Robert,

thank you for your answer but it still didn't solve my problem. If my graph
starts at 'root' node, it will render correctly. The problem appears when I
add 'group' as a starting node (with the 'camera' node as a child).

Is it possible that 'camera' node activates the global directional light? If
it does, how could I disable it? Because I don't want the global directional
light lit my scene.

Jan


On 06/15/2010 10:02 AM, Robert Osfield wrote:
Hi Jan,

The OSG by default enables a global directional light on GL_LIGHT0.
If you have a LightSource node that targets GL_LIGHT0 it'll override
this for the rendering stage that it's within.

Robert.

On Tue, Jun 15, 2010 at 7:38 AM, Jan Navratil<[email protected]>
  wrote:

Hello,

I need help with setting lights in OSG.

My scene graph look like this:

      group
       /     \
quad       camera (PRE_RENDER)
                |
               root
                |
        shadowedScene (with ShadowMap)
        /             \
model           pointLight

First, I pre-render the shadowedScene to a texture (using FBO) and
then attach this texture to the quad. When OSG traverses the graph, it
correctly goes through the pointlight code (in ShadowMap) BUT after it
goes through the directional light code as well.

Where does this directional light come from? How could I disable it?

Thank you for you help.

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


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

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

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

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

Reply via email to