Diffuse mirror reflection

Is there any way to get the " mirror" shaders to work with shadows, like a default diffuse texture? I mean so it receives dynamic shadows.

If someone could help me with an example :slight_smile:

I’m currently using this shader:

anyone?

you would not want it to be affected as it otherwise will not render any shadows in its reflection.

If you are talking about a normal mirror, with almost no reflective loss, then shadows aren’t really realistic on top of that.
As a mirror reflect’s its surroundings light intensity with no regard to its own color, recieved shadows would make it look weird. You can talk about shadows on a mirro as being the lightsource blocked from the view of the mirror, but that will indeed work, as the reflection cam will not be able to see the lamp, or whatever from the mirrors point of view, if something is blocking it. That is a shadowing effect, in the raw sense.
If you, on the other hand, are making a material that is only partial reflective, then received shadows would indeed make the reflection look darker.
I’m not sure what dreamora is talking about, as shadows are just a darkening effect, and could be done on top of whatever renderTexture with reflection data is put on a shader supporting shadows. It’s not like the reflection would need to disappear in the shadows.

But again, if you are indeed making a real mirror, then shadows will make it look wrong, compared to a real life scenario…

As for actually making the shader support shadows, that’s for another evening… have to go :slight_smile:

I use the mirror effect for a reflecting floor. It’s not very reflective, but it’s a nice effect.

I still want it to receive shadows, because now the entire room receives shadows except for the floor.

If you could help me out with it, that would be awesome :slight_smile:

Use two layers of geometry. One for the Diffuse Bump and another for Reflective Transparent Bump. Offset the transparent geometry by a mouse whisker +Y. Not exactly shader code but will do the trick…I think… :slight_smile:

Thanks for the comment Bluster. I don’t think it looks right + duplication geometry is not a very good solution.

unless you get between mirror and ground there will be no visual difference. the “slightly” is something in the range of 0.001 actually, enough to not run into zbuffer precision issues basically.

and using 2 models is actually a quite normal thing because you will likely want the reflection to stop at some distance but the ground does not mean to stop there → 2 models or a complex material switching solution and further model subdivision etc depending on the setup

also I doubt that the ground has that many polys that a dublicate is a problem (if the pure ground has that many, that would be the first thing to fix before adding eye candy. I think you agree :slight_smile: )

Hi SneakySoft,
Have you seen this post? (last screenshot)
http://forum.unity3d.com/viewtopic.php?t=34458

Isn’t it what you are looking for?

Greg