If you have a compute shader with 16 by 16 by 1 threads, run 32 by 32 by 1 times, for a texture size 512 * 512, how would you index that in a way that would match the UV coordinates of a texture.
This would be the indexed texel of the texture:
e.g. float2 texelID = dispatchThreadID.xy
uv coordinates would come from a vertex buffer created for a compute shader:
float2 uv = inputBuffer[index].UV
Put the texelID into the UV coordinate space (scale at least)
texelID /= 512
Question is: is there any coordinate inversions I need to do to ensure I am mapping the texel into the UV coordinates correctly?
↧