Hey guys,
What I am trying to do in to project a texture onto a mountain side, and have it overwrite the texture that is there completely where my alpha is 1 and fade to the underlying texture as my alpha approaches zero.
After a bit of tinkering with the standard projector shaders and a bit of documentation I got the code below.
What I need is this texture to be solid, right now it blends with the underlying texture (and of course fade off to that texture) Next, I need it to receive lights and shadows as if it were a texture on my terrain.
Next, I want this thing to overwrite a previous projection. (if possible) Right now it is doing this addative blending that really is unattractive.
The point of this is to add large texture maps in various positions and rotations without affecting the versatility of the terrain. (meaning I can create really cool, large scale cliffs and such without being forced into tiled terrain maps.)
Shader "Projector/Overlay" {
Properties {
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
}
Subshader {
Tags { "RenderType"="Opaque" }
Tags { "LightMode" = "ForwardBase" }
Pass {
ZWrite Off
Fog { Color [_AddFog] }
AlphaTest Greater 0
ColorMask RGB
Blend SrcColor SrcAlpha
Lighting On
SetTexture [_ShadowTex] {
combine texture lerp (texture) previous
Matrix [_Projector]
}
}
}
}