How can I ‘repeat’ GLSL attributes with a divisor? For example, I have a cube (for instanced rendering), and I want to set the normals for each of the 6 faces (12 triangles). If I set the attribute divisor to 2, and I have 4 instances, it simply stops taking the normals after the 2 provided in the array!
Share
Instancing is not a way to force OpenGL to allow you to render meshes with arbitrary attribute indexing. You can only repeat attributes via instanced rendering, and only each of the non-divisored attributes will be repeated.
If you want to give each face normals, then each vertex within that face must have the same normal, repeated.