Explicit vs Automatic attribute location binding for OpenGL shaders

后端 未结 3 1946
清酒与你
清酒与你 2020-11-27 10:12

When setting up attribute locations for an OpenGL shader program, you are faced with two options:

glBindAttribLocation() before linking to explici

3条回答
  •  孤独总比滥情好
    2020-11-27 10:34

    The third option, ie layout(location=0) in vec4 position; in the shader code, is now available in OpenGL ES 3.0/GLSL 300 es. Only for vertex shader input variables though.

提交回复
热议问题