Jump to content
  • Advertisement
Sign in to follow this  
guvidu

OpenGL GL INVALID OPERATION when writing to a uniform GLSL variable

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

Hello there im new to glsl and write now im trying to write a list of vertices to o vertex shader. the problem is that i get an invalid operation when doing this. below is my code Here is where i write my vertices to the shader

	for(int i = 0; i< pObject->numOfVerts; i++)
			{
				string temp = "vertInfo[" + IntToString(i) + "]";
				cout << temp << endl;
				m_animShader.SetFloat3(m_animShader.GetVariable(temp), pObject->pVerts.x, pObject->pVerts.y, pObject->pVerts.z);
				cout << "scrie " << endl;

				GLenum	enumError;
				enumError = glGetError();

				while(enumError != GL_NO_ERROR)
				{
					cout << gluErrorString(enumError) << endl;
				}
			}


//here is my shader code

#define NUM_OF_VERTS 1452
uniform vec3 vertInfo[NUM_OF_VERTS];

void main()
{
...
}

can you guys point out whats wrong? im writing to the variable vertInfo from the shader in the Initialization opengl function and after i initialized the shader:P Thanks alot

Share this post


Link to post
Share on other sites
Advertisement
Well you know, there's a limit in the number of float components and size of uniform variables, 512 is the minimum by the GLSL spec, you're using 1452 * 3 = 4356 float components, which probably is over the limit your video card imposes. So, you get the error :)

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!