BakedLightingDetailTexture

From Unify Community Wiki
Revision as of 19:26, 19 October 2009 by NCarter (Talk | contribs)

Jump to: navigation, search

A shader that has main texture and detail texture, with lighting precomputed in per-vertex colors. Note: this shader does not respond to lights at all; all illumination is expected to be stored in vertex colors.

Requires dual-texture graphics card (TNT2, Rage 128) to display the detail texture. For older dinosaurs, displays only main texture.


<shaderlab>Shader "Baked Lighting/Detail Texture" { Properties {

   _MainTex ("Base (RGB)", 2D) = "white" {}
   _Detail ("Detail (RGB)", 2D) = "gray" {}

}

Category {

   // Bind per-vertex color for use
   BindChannels {
       Bind "Color", color
       Bind "Vertex", vertex
       Bind "TexCoord", texcoord
   }
   
   // Two texture cards: main and detail texture
   SubShader {
       Pass {
           SetTexture [_MainTex] { Combine texture * primary }
           SetTexture [_Detail] { Combine previous * texture DOUBLE, previous } 
       }
   }
   
   // Single texture cards: only main texture
   SubShader {
       Pass {
           SetTexture [_MainTex] { Combine texture * primary }
       }
   }

}

}</shaderlab>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox