14
$\begingroup$

I am trying to work out how to have a fake mirror in my scene.

Character A walks by a mirror on the wall, which should reflect the room and everything in it, except Character A. Instead of Character A, it reflects Character B.

So, basically, I want a simple reflective surface, but:

  • Character A should not be visible in what the surface reflects. Reflections should be rendered as if Character A is not in the scene
  • Character B will be in the scene, but only visible in the reflective surface, not in the world itself.

Here, crude graphic to show what I mean :D

enter image description here

Less crude graphic here:

enter image description here

Is this possible with Blender? I'm familiar with all of the most general functionality, but I can't think of anything that would achieve this. Are there data properties I can tweak? Is there a modifier that'll achieve it? Reflection probe trickery?

I intend to use Eevee for the rendering, but if Cycles achieves this better, I can switch.

EDIT: I can of course elect to not using a reflective but a transmissive surface and just model the contents of the mirror behind the surface. So instead of having any reflection at all, I'll just copy and mirror the geometry and do everything manually, but 1) that's a lot of work, 2) not really an answer to the technical question I'm asking.

$\endgroup$
1
  • $\begingroup$ Your Character B is definitely doable, I once did a render with a camera inside a character's head (FPV) where they were looking in a mirror. The head had to be hidden from direct view but visible in the reflection. I'll try to remember how I did it and post later. $\endgroup$
    – Ron Jensen
    Aug 31 '20 at 6:48
18
$\begingroup$

You can use "Is reflection ray" output from "Light path" node and plug it into the alpha input of the "Principled shader".

This will work for both Eevee and Cycles. For Eevee you need to set "Blend mode" to alpha hashed in the material setting.

enter image description here

For the one that reflects in the mirror but is not visible outside of it:

enter image description here

For the one that is visible only outside of the mirror:

enter image description here

For Eevee, set both objects to alpha hashed in the material settings:

enter image description here

$\endgroup$
3
  • $\begingroup$ Sneaky bastard XD Thanks! Works brilliantly!: imgur.com/a/SubvWIS $\endgroup$
    – Eldamir
    Aug 31 '20 at 9:10
  • 1
    $\begingroup$ So basically, I'll parent two different meshes to the same armature. One for world, and one for the mirror. Then the animations will sync up and grant the desired effect with no added work except for the shader magic. Thanks again..! $\endgroup$
    – Eldamir
    Aug 31 '20 at 9:13
  • 1
    $\begingroup$ Yes... Eevee does it simply. Cycles is more complicated due to its accuracy for shadows... but it seems you don't need Cycles. $\endgroup$
    – lemon
    Aug 31 '20 at 9:15
9
$\begingroup$

You must use the Input > Light Path node as a factor between the material of the object and an Transparent node.

For your green cube use the Is Glossy Ray output (non visible in the mirror):

enter image description here

For the red cube use the Is Camera Ray output (only visible in the mirror):

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks. Good answer. Worth the upvote. The accepted answer is slightly simpler though, just using the default principled shader, so that's why I awarded the green checkmark there :) $\endgroup$
    – Eldamir
    Aug 31 '20 at 9:12
  • $\begingroup$ sure, you're right ;) $\endgroup$
    – moonboots
    Aug 31 '20 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.