So, i ´ve been playing arround with the vboMeshDrawInstanceExample from the “gl” folder.
Im completly noob to vertex shaders.
Im looking to extrude the Z value from a texture that i passed.
If you look to the code :
// extrude our primitive along the z coordinate, based on current PixelDepth. vPos.z = (vPos.z -5.0) * pixelDepth * 500.0+t2.r*5000.0 ; // this will pull pur vertices apart by four time their original coordinate values, // then move them by an snoise value which is the same for every primitive // simplex noise makes things look a little more organic. vPos.x = vPos.x * 8.0 ; vPos.y = vPos.y * 8.0 + snoise(vec2(1.0-instanceX,instanceY)) * 0.0; // this will distribute our boxes in space,
You can see that the function snoise its been used for adding the different Z values to the rectangles.
I want like the same effect but using a texture that i´ve input (so I can make it from the kinect or other sensors).
Is it posible? Is there a correct way to map a texture to the individual instances?