Jump to content
  • Advertisement
Sign in to follow this  
ilys4

3rd Attribute is not passed (GLSL)

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

I have to pass the three normals through each vertex. So, I wrote, //.cpp glBindAttribLocation( ShaderNum, 1, "Normal1" ); glBindAttribLocation( ShaderNum, 2, "Normal2" ); glBindAttribLocation( ShaderNum, 3, "Normal3" ); glVertexAttrib3f( 1, mobj->pvVertexNormalArray[num1].x, mobj->pvVertexNormalArray[num1].y, mobj->pvVertexNormalArray[num1].z ); glVertexAttrib3f( 2, mobj->pvVertexNormalArray[num2].x, mobj->pvVertexNormalArray[num2].y, mobj->pvVertexNormalArray[num2].z ); glVertexAttrib3f( 3, mobj->pvVertexNormalArray[num3].x, mobj->pvVertexNormalArray[num3].y, mobj->pvVertexNormalArray[num3].z ); // vertex shader attribute vec3 Normal1; attribute vec3 Normal2; attribute vec3 Normal3; But, in vertex shader, Normal3 was assigned to vec3( 0.0, 0.0, 0.0 ) but Normal1 and Normal2 are... just normal.... Plz help me... I have to solve this problem until today...

Share this post


Link to post
Share on other sites
Advertisement
Use glGetAttribLocation() rather than glBindAttribLocation(). nVidia cards have fixed attribute bindings for fixed pipeline opengl attributes and you've and trampled all over them :-O ATI cards might do the same thing.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!