Feathered Texture Projection

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]
         }
		}
   }
}

Projectors won’t get shadow, no matter what you do, nor do they get light.
They are no geometry, they are a projected texture only (thus also the redraw of every single affected object → required to do the rerender with the texture projection shader on top of whats below)

If you need light and shadow interaction, check the showcase board for the decal system thats now open source.

Cool, thanks for pointing me in the right direction. I can see alot of good things for it… :slight_smile: