Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there really a reason for glEnableVertexAttribArray to exist?

Tags:

opengl

It seems to me that between glVertexAttribPointer (which specifies the attribute index to associate with a particular set of data from a VBO) and glBindAttribLocation (which specifies which program vertex attribute variable names the indices are assigned to, there's not really a need to enable or disable the attribute indices themselves. What would be a situation that might require an index to be "disabled"?

like image 390
Steven Lu Avatar asked Jan 30 '26 22:01

Steven Lu


1 Answers

What would be a situation that might require an index to be "disabled"?

If you want to set a constant vertex attribute value with glVertexAttrib, without passing a full blown array.

http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml

like image 119
datenwolf Avatar answered Feb 02 '26 13:02

datenwolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!