Sign in to follow this  
Paddon

Newbie GLSL Question

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this