In the default mesh vertex construction we do this.
//v = vertex, p = position, c = color
buffer = { v0 , p0, c0,
v1 , p0, c0,
v2 , p0, c0 };
And we have an triangle. But I want to reuse the obvious attributes something like this:
//p and c are the same for all vertexes
buffer = { v0, p0, c0 ,
v1,
v2 };
We can do this with uniform values on the shader, but i will render thousands of triangles with different positions on the same buffer:
buffer = { v0, p0, c0 ,
v1,
v2,
v3, p1, c1,
v4,
v5,
v6, p2, c2,
...};
My solutions for now is:
1) Send a copy of attributes for each vertex like first example (don´t want to, but may be the best solution).
2) Send an index attribute(for search) and uniform array for position/color (Uniform size limit problem?)
3) Best solution?