On 5.10.2013 20:15, Sajjadul Islam wrote:
Code:

#version 400

in vec3 VertexPosition;
in vec3 VertexColor;

out vec3 Color;

void main()
{
     Color = VertexColor;

     gl_Position = vec4(VertexPosition,1.0);
}


Please try it on your end and let me know!!

Hi Sajjadu,

I can't try your code at the moment, but from what I can tell, the vertex shader is missing :

uniform mat4 osg_ModelViewProjectionMatrix;

and then in vertex shader main use:

gl_Position = osg_ModelViewProjectionMatrix*vec4(VertexPosition,1.0);

The osg_ModelViewProjectionMatrix, osg_ModelViewMatrix and others are automatically set by the osg. Also, don't forget to call:

gc->getState()->setUseModelViewAndProjectionUniforms(true);

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

Reply via email to