Blended materials won't recive shadows.

As i said i can’t get shadows on my reflective shader.

here is my shader codes;

Shader "FX/Mirror Reflection Blend" { 
Properties {
	_Blend ("Blend", Range (0, 1)) = 0.5
    _MainTex ("Texture", 2D) = "white" {}
    _ReflectionTex ("Reflection", 2D) = "white" { TexGen ObjectLinear }
}

// two texture cards: full thing
Subshader { 
 	Tags { "RenderType" = "Opaque" }
          Pass {   
	       SetTexture[_ReflectionTex] { matrix [_ProjMatrix]  }
	       SetTexture [_MainTex] {constantColor (255, 255, 255, [_Blend] ) combine texture lerp (constant) previous}   }
  		  }   
}

I just added blend attribute on mirror reflection shader.
Here you can see the orjinal shader; http://wiki.unity3d.com/index.php?title=MirrorReflection2

And here is my results;

Floor Bumped Spec;

Floor Reflective;

As you can see, there is no shadow on reflective floor. So i really dont know what should i do for shadows. I m waiting for your suggestions.

Thanks for your help.

You’ll need to use a proper programmable shader to get shadows. Fixed function won’t work with them.

For some reason when I add Fallback “Something” it adds shadows but keeps my original shader, not sure whats going on there though… When I comment it out, it goes away

1294471--59626--$this.jpg

Your shader needs shadow caster and collector passes. Adding a fallback works because Unity will look through the fallback chain when looking for those passes, and eventually find one of the VertexLit ones.

Thanks, I didn’t know that :razz: