Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Instanced drawing with different Texture Coordinates

$
0
0

@vpr wrote:

Hey there,

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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles