- Home /
Question by
SubBassman · Nov 24, 2014 at 10:50 AM ·
shadershadowprojector
Need help with projector shader
Hi there Can anyone help me fix this? I'd like to have shadows cast on the projected image. Is this possible? Thanks in advance.
Shader "Custom Projector/Alpha Blended" { Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
_FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear } } Subshader {
Tags { "RenderType"="Transparent-1" }
Pass {
ZWrite Off
AlphaTest Greater 0
Offset -1, -1
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
Color [_Color]
SetTexture [_ShadowTex] {
constantColor [_Color]
combine texture*constant
Matrix [_Projector]
}
SetTexture [_FalloffTex] {
constantColor (0,0,0,0)
combine previous lerp (texture) constant
Matrix [_ProjectorClip]
}
}
Comment