rt.
well, I want to get a bright scan line from down to top in my model.this scan line’s brightness (in fragment shader) is calculated by this pixel’s spacial position.
VPOS
thx
I think it is worth noting that VPOS was replaced by SV_Position in DirectX 10 and above. But I guess Unity will handle that for you.
aucually what I want is the position in word space not in screen space, sv_position is in world space?
SV_Position is going to be either clip space position (in the vertex shader and in DX9 pixel shader) or exact pixel coordinate (in the pixel shader). If you want world space position you need to calculate that in the vertex shader and pass it to the pixel shader yourself.
Look for _Object2World or unity_ObjectToWorld, or really just search for getting world position in unity shader.
thx anyway, but I still dont know how…