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