- Home /
Problem with simple projection shader
First time messing around with shaders, i've got what im after however the projected texture is projected black, loosing all it's colour.
Here's the shader:
Shader "Projector Shader" {
Properties {
_Tex ("Projector", 2D) = "" { TexGen ObjectLinear }
}
Subshader {
Pass {
Blend DstColor Zero
SetTexture [_Tex] {
Matrix [_Projector]
}
}
}
}
What's causing this to happen?
Comment
Could still use a hand if anyone knows why this is happening.
Best Answer
Answer by ScroodgeM · Aug 27, 2012 at 07:33 PM
you forgot about falloff the texture where projector should be hided.
add this to property:
_FallOff ("FallOff", 2D) = "white" {}
add this as second texture block:
SetTexture [_FallOff] { constantColor (1,1,1,0) combine previous lerp (texture) constant Matrix [_ProjectorClip] }
and attach fallof texture (gradient alpha from 1(left) to 0(right))