Unity Shader 获取模型空间坐标


CGPROGRAM
        // Physically based Standard lighting model, and enable shadows on all light types
        #pragma surface surf Standard fullforwardshadows vertex:vert
struct Input {
            float2 uv_MainTex;
            float3 worldPos;
            float4 modelPos_;
        };
void vert(inout appdata_full v, out Input o) { UNITY_INITIALIZE_OUTPUT(Input, o); o.modelPos_ = v.vertex; }

        ENDCG
float lat = degrees(acos(IN.modelPos_.y / _R));//[0,180]

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM