Is this diagram for OpenGL data types correct?

后端 未结 1 927
渐次进展
渐次进展 2021-01-15 06:14

I\'m trying to understand glVertexAttribPointer, and I noticed that it accepts many more types than those that have an equivalent in GLSL. So to write down ever

相关标签:
1条回答
  • 2021-01-15 06:30

    No.

    You cannot feed a VS int, uint, or double input variable (or vectors of these) from a call to glVertexAttribPointer. This function only feeds float types. If you use non-normalized integers with this function, then they will be cast to floats as if by a standard cast operation (255 becomes 255.0f). GL_FIXED is just another floating-point representation, where a 32-bit integer is treated as a 16.16 fixed-point value. Naturally, this will be converted to a floating-point number when fed to the VS.

    To feed the VS integers, you must use glVertexAttribIPointer. To feed doubles, you must use glVertexAttribLPointer.

    bool types cannot be input variables of any kind.

    0 讨论(0)
提交回复
热议问题