I have a pixel shader, and I want to calculate the position of each pixel according to my world cosmic coordinates. How can I do it? What I need?
I have a ps_input structure that has a position of float4: SV_POSITION . I suppose this is important, but the values โโstored inside seem ridiculous.
I canโt understand what they are related to. For example, if a pixel is 2d, then why does it have a w component or z component in this regard?
I am using DirectX , and the pixel shader is in HLSL . C++ as my programming language on the CPU.
Any help would be appreciated.
source share