vertex shader with alpha channel
Hello! I have been working on a space exploration game for the past month or so. The planets in this game are procedurally generated and the color of each vertex is dependent on the height. Unfortunately, I have run into a problem with creating a seamless Level Of Detail (LOD) for my planets. Each of my LOD's is a sphere that has less vertices than the LOD beneath it. When I get a certain distance from my planet, one of the LOD's gets disabled and another one enabled. This creates an ugly popping as the Level of Details are switched. What I want to do is have an alpha channel in my vertex shader so that I can fade out the LOD's instead of instantly enabling/disabling them. I do not need each vertex to have an individual transparency, just the entire mesh as a whole. Here is the shader I am using:
Shader "Simple Diffuse" {
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
}
}
}
}
}
Thanks in advance, - Mark