Hi,

How can I pass vertices in GLSL1.4 shaders 
 How can I pass values to "in vec4 vertex"

Code example.

Code:
#version 150

uniform mat4 projectionMatrix; //Specifies that the value is passed to the 
shader from the
application and is constant across a given primitive.
uniform mat4 modelViewMatrix;

in vec4 vertex;//Specifies that the variable is an input to the shader stage.
in vec3 normal;

out vec3 fragmentNormal;
out vec3 fragmentEye;//Specifies that the variable is an output from a shader 
stage.

void main(void)
{
        fragmentNormal = (modelViewMatrix*vec4(normal, 0.0)).xyz;

        fragmentEye = (modelViewMatrix*vertex).xyz;
        fragmentEye = -normalize(fragmentEye);

        gl_Position = projectionMatrix*modelViewMatrix*vertex;
}




Thank you!

Cheers,
John

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=31856#31856





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to