法线是用在光照模型中,使用模型自带的法线或者赋予法线贴图。前向渲染的两种光照模型为:
-
half4 Lighting<Name> (SurfaceOutput s, half3 lightDir, half atten);
This is used in forward rendering path for light models that are not view direction dependent (e.g. diffuse).
用于不依赖视角的光照模型计算,例如漫反射。
-
half4 Lighting<Name> (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten);
This is used in forward rendering path for light models that are view direction dependent.
用于依赖视角的光照模型的计算,例如高光反射。