Closed ytgui closed 4 years ago
float4 UnityObjectToClipPos(float3 pos) | Transforms a point from object space to the camera’s clip space in homogeneous coordinates. This is the equivalent of mul(UNITY_MATRIX_MVP, float4(pos, 1.0)), and should be used in its place. |
---|---|
float3 UnityObjectToViewPos(float3 pos) | Transforms a point from object space to view space. This is the equivalent of mul(UNITY_MATRIX_MV, float4(pos, 1.0)).xyz, and should be used in its place. |
https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html
Name | Value |
---|---|
UNITY_MATRIX_MVP | Current model view projection matrix. |
UNITY_MATRIX_MV | Current model * view matrix. |
UNITY_MATRIX_V | Current view matrix. |
UNITY_MATRIX_P | Current projection matrix. |
UNITY_MATRIX_VP | Current view * projection matrix. |
UNITY_MATRIX_T_MV | Transpose of model * view matrix. |
UNITY_MATRIX_IT_MV | Inverse transpose of model * view matrix. |
unity_ObjectToWorld | Current model matrix. |
unity_WorldToObject | Inverse of current world matrix. |
https://forum.unity.com/threads/what-does-the-function-computescreenpos-in-unitycg-cginc-do.294470/