Jump to content
  • Advertisement
Sign in to follow this  

Newbie GLSL Question

This topic is 4090 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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!