i am trying to display a texture from a video on many (lets say 20000) boxes. The boxes are arranged in way so that you usually wouldnt see its being drawn on 20000 boxes and it looks like one big surface. Something like this.
I did achieve exactly that by making 20000 boxes and correctly adjusting the texture coordinates of each box.
Now i want to optimize this (im around 15fps) and draw the boxes instanced. I found some forum posts and i checked the examples. I know how i can give each instanced box a different position via the shader and that works.
Whats unclear to me is how i can tell the shader the different texture coordinates of each vertex.
The position attribute is given per instance and the texture coordinate attribute should be given per vertex, right? So do i need to create a buffer on the GPU with all texture coordinates of each vertex? If yes, how can i tell the shader which one of them to pick?
Any help/hints are appreaciated!