- Home /
Shader to change Vertex Colors
Hello Forum!
I really don't know much about shaders, so I wanted to ask you guys what's possible and what not.
Right now I have a vertex shader (from somewhere on the internet) that I modified a bit to fit my needs.
I want to use vertex colors to light my levels. That's working pretty good.
I'm now coming to the day/night cycle part and I'm stuck. I've read that people change their vertex colors with shaders? I'm changing my vertex colors in my mesh update, where I pass a Color32[] to my mesh.
I'm hoping that someone can give me some hints on how to approach this!
Thanks!
Here is the shader I'm using right now:
Shader "Vertex Colored Transparent" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
ZWrite On
Alphatest Greater 0
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Material {
}
ColorMaterial AmbientAndDiffuse
Tags {Queue=Transparent}
Lighting On
SeparateSpecular Off
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant DOUBLE, previous * constant
}
}
}
Fallback "Alpha/VertexLit", 1
}
Your answer
Follow this Question
Related Questions
Need help with using world position in shader 1 Answer
Strange artifacts on Vertex Color Shader 0 Answers
Color depending on vertex normal 1 Answer
Material doesn't have a color property '_Color' 4 Answers
vertex color questions! 1 Answer