How to get fragment X,Y,Z,W in a fragment shader using DX9 (Pixel Shader 2.0)?
I've written a shader that uses the input fragment's screen X,Y,Z,W. Using DX11, the VPOS semantic works just fine for this input parameter. However, for compatibility reasons, I must use DX9.
When I switch Unity over to use DX9, it no longer compiles my shader, complaining that the VPOS semantic is not supported in Pixel Shader 2.0. I checked Microsoft's site and it states that DX9 does in fact support VPOS. Unity claims otherwise.
So my question is: is there a pixel shader input parameter semantic that is equivalent to VPOS, that is, provides the screen X,Y,Z and W of the input fragment when using DX9 and Pixel Shader 2.0 in Unity?
If the short answer is "No", is there some other clever way to get the fragment's screen Z and W to the pixel shader with PS 2.0/DX9?
Your answer
![](https://koobas.hobune.stream/wayback/20220612044745im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Shader MVP matrices: what does vertex position mean at each step? 2 Answers
Unity 5 - Shader error in VertexBlend : Too many output registers declared (12). How to fix it? 1 Answer
Player Party Save 0 Answers
How do I make a glowing texture. 0 Answers
Is it possible to add RimLight to standard shader?? 1 Answer