has anyone a starting point for the following problem ?
i have a RWStructuredbuffer rendering my custom particle datatype consisting of pos, vel etc. and i want to save the Pos to a texture. could this be done with a texture fx shader ? but how do i iterate through a buffer with a texture fx ?
Hi, this is really isn’t that hard:
So position buffer is basically a 1d spread, and position texture is a 2d spread.
In tfx we have SV_Position, and UV. SV_Position would give us a pixel coordinate…
So we can do something like:
flaot2 x = SV_Position; (this line is pseudo code)
float4 col;
col.rgb = sbPos [x.x + x.y * widthInPixels] //(R:TARGETSIZE int width = R.x)
col.a = 1;
return col;
Also you need use default size pin On, and specify Width and Height, and Output format R32G32B32A32_Float