what is SV_POSITION in v2f structure??? what does SV mean???

,

you could find it in unity wiki,The position of the vertex after being transformed into projection space.
You can find it here,http://wiki.unity3d.com/index.php?title=Shader_Code

It means “system value”, see here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647(v=vs.85).aspx#System_Value
I don’t know why Unity’s built-in shaders and examples use SV_POSITION instead of POSITION for the vertex output (as far as I remember both worked for me when I tried it).

thanks a lot ,great help 2 me

It’s a minor optimisation. SV_POSITION won’t pass through the o.pos to the fragment shader, where as POSITION will.

I just found this out, and now I’m going to go and replace SV_POSITION with POSITION in shaders which have screen space texture lookups.

I think there’s some compatibility reason for it, too.

Xbox expects SV_POSITION and not POSITION or something similar… I can’t remember which platform it was.

1 Like

Currently working on PlayStation things and can confirm that this is the case in some situations where it requires SV_POSITION in order to work on the hardware.