-
Notifications
You must be signed in to change notification settings - Fork 0
Attribute and VAO locations
David Komer edited this page Jun 5, 2018
·
6 revisions
Attribute locations are can be set manually/globally or automatically/per-shader.
Therefore, vertex array objects can be set manually (via createVertexArraysForRenderer
) or automatically (via the createVertexArraysForShaders
helper).
In GLTF it's done manually, because this allows uploading data as a separate step from the shader, as well as re-using attribute data across different shaders that would have otherwise given different indexes.
If using other shaders with Gltf, attributes must also be set manually otherwise they will conflict with gltf.
This is simple - just append the new variable names to the renderer.globalAttributeLocations
Set before creating the shader, and use createVertexArrays
for the vao