Please disregard the post below.  I was resetting the vertex data
elsewhere.
 
Thanks,
Mike

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Schmidt, Michael M
Sent: Monday, December 10, 2007 2:38 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Shader Vertex Problems


Hi,
 
I'm getting odd behavior with a vertex shader.  The following
pseudo-code snippets do not produce the same results.  Can anyone tell
me why?
 
Program 1:

        
        //Outside the shader, set a shader attribute to negative offset.
        vertex_shader_attribute = -offset;
        ...
        //Then in the shader, set temp to the attribute.
        temp = vertex_shader_attribute;
         

Program 2:

        //Outside the shader, set a shader attribute to the vertex x
minus an offset
        vertex_shader_attribute = vertex.x - offset;
        ...
        //Then in the shader, set temp to attribute minus gl_Vertex x.
        temp = vertex_shader_attribute - gl_Vertex.x;

 
The "temp" should be set to -offset in both cases, but I'm not seeing
the same behavior in my app.  The "temp" value is the only thing that
changes between programs.
 
Is gl_Vertex equal to the vertex passed into geom->setVertexArray()?
 
Thanks,
Mike
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to