VertexColor

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m (Text replace - "</shaderlab>" to "</syntaxhighlight>")
m (There is no shaderlab syntax highlighting)
 
Line 3: Line 3:
 
See also: [[AlphaVertexColor]] for a transparent version of this shader.
 
See also: [[AlphaVertexColor]] for a transparent version of this shader.
  
<syntaxhighlight lang="shaderlab">Shader " Vertex Colored" {
+
<syntaxhighlight lang="javascript">Shader " Vertex Colored" {
 
Properties {
 
Properties {
 
     _Color ("Main Color", Color) = (1,1,1,1)
 
     _Color ("Main Color", Color) = (1,1,1,1)

Latest revision as of 22:18, 2 February 2016

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

See also: AlphaVertexColor for a transparent version of this shader.

Shader " Vertex Colored" {
Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _SpecColor ("Spec Color", Color) = (1,1,1,1)
    _Emission ("Emmisive Color", Color) = (0,0,0,0)
    _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    _MainTex ("Base (RGB)", 2D) = "white" {}
}
 
SubShader {
    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 " VertexLit", 1
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox