1 模型空間轉裁剪空間 UnityObjectToClipPos(v.vertex)git
2 模型空間轉世界空間 mul( unity_ObjectToWorld, v.vertex )orm
3 霧三件套blog
UNITY_FOG_COORDS(3) UNITY_TRANSFER_FOG(o,o.pos); UNITY_APPLY_FOG(i.fogCoord, c);
4 環境光 UNITY_LIGHTMODE_AMBIENT
光照模型:ip
blinnphone:it
c = ambient * diffuse + diffuse * saturate( dot( worldnormal , lgithdir ) ) + specular * pow( max( 0, dot( h, worldnormal ) , _Gloss )class