I'm reading through and trying to learn shaders, but I suddenly got confused with passing information into the shader.
What is the difference between glVertexAttrib and glVertexAttribPointer? Are there different times to use them? Are they just two different ways to do the same thing? Does one provide better or worse performance?
glVertexAttrib sets the value of an attribute for a given set of vertices.
glVertexAttribPointer sets the location of the attribute for every vertex.
So essentially these two are different functions, and you can't compare them in terms of speed. Anyway, setting the attribute pointer isn't the bottleneck in most rendering appliances.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With