GLSL Attribute VBO Matching

Started by
0 comments, last by 21st Century Moose 11 years, 5 months ago
Hey Guys/Gals:

I got a quick question regarding GLSL. If I have a shader who's inputs only take position/texture and bind those to attribute id's 0 for position and 1 for texture. If my VBO is interleaved with position/normal/texture... that should be ok assuming I match the vertex pointers up correctly binding attribute 0 to position + 0 offset and a size of my structure and bind attribute 1 to texture + texOffset and a size of my structure right?

Another words, it shouldn't matter that normals are in my VBO even though the shader doesn't use it, correct?

I'm pretty sure of this answer.

Thanks
Jeff.
Advertisement
Yup, that'll work. Unused space in the VBO/vertex struct is just ignored.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement