varying vec3 normal;
varying vec3 vertex_to_light_vector;
void main()
{
// Transforming The Vertex
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// Transforming The Normal To ModelView-Space
normal = gl_NormalMatrix * gl_Normal;
// Transforming The Vertex Position To ModelView-Space
vec4 vertex_in_modelview_space = gl_ModelViewMatrx * gl_Vertex; // error is here
// Calculating The Vector From The Vertex Position To The Light Position
vertex_to_light_vector = vec3(gl_LightSource[0].position – vertex_in_modelview_space);
}
Anyone willing to help my newb soul? It would be greatly appreciated.
Thanks.
Newbie GLSL Question
Hey all,
I am new to GLSL (by new I mean I started today and I am working through the NeHe tutorial on it) and I was wondering why something will not work. I am using the Shader Builder for MacOSX and it gives me this error when I copt and paste Vertex Program from then NeHe tutorial.
Error on line 13: undeclared identifier (hint: 'gl_ModelViewMatrix')
I was under the impression that gl_ModelViewMatrix was a intrinsic part of GLSL. Anyway here is the vertex program I am working with.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement