TexGen:主要用于Fixed Function Shader, 自动生成一些目标特效的UV。当有vertex函数时会被自动忽略。该函数直接对应OpenGL的texgen modes。
有如下模式ObjectLinear, EyeLinear, SphereMap, CubeReflect, CubeNormal ;
- Shader "Texgen" {
-
Properties { -
_MainTex ("Base", 2D) = "white" { TexGen EyeLinear } -
// 2D贴图 和Cube 贴图都可以用 -
// _Tex ("Cube", Cube) = "white" { TexGen EyeLinear } -
} - SubShader {
- Pass {
- SetTexture [_MainTex] { combine texture }
- }
- }
- }