half4 LightingName (SurfaceOutput s, half3 lightDir, half atten){} This function is used for forward rendering when the view direction is not needed.
Unity3d Shader的属性块结构例如以下:
当中属性类型包含:
三种自己定义光照模型方法:
half4 LightingName (SurfaceOutput s, half3 lightDir, half atten){} //This function is used for forward rendering when the view direction is not needed. half4 LightingName (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten){} //This function is used in forward rendering when a view direction is needed. half4 LightingName_PrePass (SurfaceOutput s, half4 light){} //This function is used when you are using deferred rendering for your project.
版权声明:本文博主原创文章,博客,未经同意不得转载。