- Home /
The question is answered, right answer was accepted
Light Colors Vertex Lighting
I have a simple shader for vertex lighting. I have it set to emission so it will self-illum.
This is four blocks that are a dark colour
This is a few more blocks with a light colour.
This is what the light blocks colour is suppose to look like. (These have the self-illum diffuse shader)
What is wrong with the shader code that doesn't allow lighter colors to show up as strong? (i.e, why doesnt the middle image look like the third image)
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
ColorMaterial Emission
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant DOUBLE, previous * constant
}
}
}
Fallback "VertexLit", 1
}
Thanks!
EDIT: The answer was the texture if anyone else has this same issue. Use this bit if you want pure colour only.
Shader "VertexColor" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader {
Pass {
ColorMaterial Emission
}
}
Fallback "VertexLit", 1
}
Follow this Question
Related Questions
Vertex Lit Shaders 1 Answer
Changing the vertex color by script 2 Answers
Changing vertex colors and mesh leak fix 1 Answer
Shader question: Alpha value of 0 not entirely transparent 2 Answers
Shader which supports vertex colors and pixel lights? 1 Answer