Quantcast
Channel: Questions in topic: "compute shader"
Viewing all articles
Browse latest Browse all 287

How would you index a texture in a compute shader to matched UV coordinates

$
0
0
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?

Viewing all articles
Browse latest Browse all 287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>