UnityShader gets the camera world space position

Knowledge points: Unity built-in: _WorldSpaceCameraPos.xyz

Example:

            //Get the unit viewing angle direction Camera world space position minus vertex world space position
            fixed3 viewDir = normalize(_WorldSpaceCameraPos.xyz-mul(unity_ObjectToWorld, v.vertex).xyz);

Guess you like

Origin blog.csdn.net/qq_26540577/article/details/106183201