The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
OpenGLES 3.0 bug with assigning vertex attribute locations
josh43


Joined: 14 Aug 2015
Posts: 4
There seems to be a bug with how OpenGL is getting assigned vertex attribute location. I compile all shaders just fine, and I bind the attribute locations before linking, but somehow it always switches the position location with the normal location.

posLocation = glBindAttribLocation(progID,0,"position");
glBindAttribLocation(progID,1,"normal");
glBindAttribLocation(progID,2,"texCoord");

And even when I make a call get glGetAttribLocation it does give me the right index of the position, however when I use glGetActiveAttrib(programID,posLocation...)
The other information returns that it is a vec3 named "normal" which makes me believe it somehow got switched. And when I render the object it definitely looks like I'm rendering a bunch of random normals instead of positions.

The thing is that I use SDL on my pc and the code is almost identical and it works there but not on iOS(I've changed all of the shaders and some other things though of course). Does anyone have a similar problem or any idea on what it might be?