Can anyone give me a few tips on how I might make a shader that will take an input mesh and texture, then draw a 2d array of that mesh, the same x/y count as the texture, with each pixel of that texture defining attributes of each relative mesh, eg z position?
I know I can use tex2dlod to get the texture data into the vertex shader, but I’m not sure how to setup the transform for the array of meshes. I need the equivalent of a linear spread > cross 2d > translate combo, but inside the shader.
GPU particles 3d static I would have thought would do it…?
The mesh part of it is probably what your missing, it does the spread count, the textures do the positon, or am I missing the point?
Yes any object, the example has cubes and spheres I think, its worth having a look and reading dottore’s documentation pdf too, where he explains whats going on!
@mrboni:
individual texture transforms is possible.
either do it in the shader via an extra controltexture xy translate and xy scale fit nicely into rgba.
if you only need a static transformation for each particle its feasible to change the texcoord2 in mesh input patch directly
I’m using the texture coordinates from a grid the with the same x/y resolution as the number of particles in the x/y array, into the vertex buffer join in the mesh input patch.
This has ‘tiled’ 4*4 copies of the texture across the array. Any idea why?