Hi Fred,

As i understand you set your vertex array in osg to vertexattrib slot 0, setup 
vertexattrib binding for shader program to slot 0 for in_vertex. What result 
you have when use in_vertex in shader instead of gl_Vertex, exactly? Did you 
convert your in_vertex to vec4 with w=1.0 in shader?  Shader compiler complains 
about something or it just dont draw anything? 

Cheers,
Sergey.

29.03.2011, 13:06, "Fred Smith" <[email protected]>:
> I can get my square if vertices reside in attribute slot number 0, not 6.
>
> But in this case, my shader needs to be:
>
> Code:
> // vertex shader
> #version 150
>
> uniform mat4 osg_ModelViewProjectionMatrix;
> in vec3 in_vertex;
>
> void main(void)
> {
>    gl_Position = osg_ModelViewProjectionMatrix * gl_Vertex; // gl_Vertex 
> here, not 'in_vertex'
> }
>
> My understanding is that gl_Vertex automatically maps to attribute index 0 
> with GL 2.x. What I do not understand, however, is why replacing 'gl_Vertex' 
> with 'in_vertex' does not work - it should do exactly the same.
>
> My aim being to work with a GL3 context, I'm now going to test this code with 
> OSG_GL3_AVAILABLE. There, I should not be able to use gl_Vertex at all, so I 
> expect in_vertex to work. If it doesn't, I'll really, really be puzzled.
>
> Fred
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=37994#37994
>
> _______________________________________________
> 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