Here’s a simple shader I got from the Unity Wiki. It’s great because it applies the vertex colour in a way that lets me create my own lighting (which is necessary in a Minecraft game - normal lighting looks dark and ugly because of the angle of the block faces).
All I want to do is add a fog colour based on distance. What’s the simplest way to do it for this shader?
Shader "Custom/Vertex color unlit" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
}
Category {
Tags { "Queue"="Geometry" }
Lighting Off
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
SubShader {
Pass {
SetTexture [_MainTex] {
Combine texture * primary DOUBLE
}
}
}
}
}