Compositing a reflection onto an image

Hello good people.

I’m working with a real photograh in which there’s a mirror reflecting a building. What I want is to add a 3D airplane (which I created) reflected in that mirror as well.

I created a plane and placed it where the mirror is. I tried some different materials for that plane (glass, glossy, etc) but I can’t see the original reflection in the mirror now. The only I can see reflected now is my 3D airplane and the HDRI that I use in the scene.

How can I do it in order to see the original reflection of the building in the mirror (just the way it was before) along with my 3D object reflected as well? (and, obviously, I don’t want the HDRI reflected either)

I’d appreciate any help. Thank you

This is not a simple thing to do. If the mirror is flat and the plane is the only 3D in the scene, it might be quicker to create a second plane model to be reflected in your mirror, and rather than a mirror, use a plane with a holdout material (holdout will always render as transparent, even if there’s something behind it) and a hole in it where the window is: this will hide the second plane except for when it’s reflected in the window.

You should be able to cut out hdr reflections with light path option “ray depth”, which will be one for hdr part and higher for plane reflections (depends on material though, might not always work) . Use it to mix between mirror shader and holdout/transparent shader. Comp your plane reflection to mirror with over operation, reflection must cover original reflections, not add to them. Grade reflection to match footage.

Sounds interesting - could you post a node tree?

Tried it, looks like my idea does not work as I thought it would.