• Advertisement
Sign in to follow this  

Newbie GLSL Question

This topic is 3943 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement