BakedLightingDetailTexture

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Removing all content from page)
m (Reverted edits by Joseph05408 (Talk); changed back to last version by NeARAZ)
Line 1: Line 1:
 +
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>

Revision as of 19:26, 19 October 2009

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