Take the 2-minute tour ×  What are the uses for SV_POSITION in
the pixel shader? Previously this was the POSITION semantic and
it wasn't readable in the pixel shader, but now that it is, what
can it be used for?  In an SM2 deferred renderer, you'd
typically take the texture coordinates, transform them to the
[-1, 1] range and then use an inverse view/position matrix to
get the world position of a pixel. Would SV_POSITION be usable
here to reduce any of the calculations? And if so, how would you
do that?  share|improve this question  1 Answer 1  up vote 4
down vote accepted  SV_Position in the pixel shader gives you
the the center point of the pixel being shaded, in a [0,
bufferWidth] x [0, bufferHeight] range. (It can also be used in
centroid mode with MSAA to get the centroid of the covered
samples.) This value can be passed directly to Texture2D.Load to
retrieve the corresponding pixel from a texture the same size as
the screen. So it may not be necessary to pass screen-space UVs
in an interpolator, for thi