AlphaVertexColor

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

Jump to: navigation, search

An Alpha/VertexLit shader that modulates result with per-vertex colors. Requires dual-texture hardware (NVIDIA TNT2, ATI Rage 128).

See also: VertexColor for a non-alpha version of this shader.

<shaderlab>Shader "Alpha/VertexLit Colored" { Properties {

   _Color ("Main Color", Color) = (1,1,1,1)
   _SpecColor ("Spec Color", Color) = (1,1,1,0)
   _Emission ("Emmisive Color", Color) = (0,0,0,0)
   _Shininess ("Shininess", Range (0.01, 1)) = 0.7
   _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}

}

SubShader {

   ZWrite Off
   Alphatest Greater 0
   Tags {Queue=Transparent}
   Blend SrcAlpha OneMinusSrcAlpha 
   ColorMask RGB
   Pass {
       Material {
           Shininess [_Shininess]
           Specular [_SpecColor]
           Emission [_Emission]    
       }
       ColorMaterial AmbientAndDiffuse
       Lighting On
       SeperateSpecular On
       SetTexture [_MainTex] {
           Combine texture * primary, texture * primary
       }
       SetTexture [_MainTex] {
           constantColor [_Color]
           Combine previous * constant DOUBLE, previous * constant
       } 
   }

}

Fallback "Alpha/VertexLit", 1 }</shaderlab>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox