Row and column index of fragment, HLSL shader

255 Views Asked by At

Can you get the row and column of the current fragment in an HLSL (DX11) fragment shader?

1

There are 1 best solutions below

0
On

You can pass the size of the texture as a uniform and use texture coordinates to find out where the fragment lies in pixel space.

May I ask why?