Author Topic: Best way to make something visible in reflections but not refractions  (Read 1174 times)

2023-08-06, 19:29:56

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
I'm rendering a scene that looks directly at a glass window.  The environment beyond the window will be replaced with photography.  I've modelled some dummy geometry to replicate the environment so that I get accurate shadows and reflections, but I don't want these dummy objects visible through the glass so that I can get a clean alpha for comping the backplate in later.

It's worth noting that I don't really want to use the Direct Override because there are other glass objects in the scene.  So is there a way to override just the refractions of the main window glass?

What's the best setup to achieve this?

2023-08-07, 05:44:32
Reply #1

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www
Hi,

What I usually do is create the backplate directly in 3ds Max using a plane with a CoronaLightMtl rather than doing it later in post production. This way you don't have to worry about such issues.

Is there a particular reason why you don't want to create the backplate in 3ds Max?

2023-08-07, 07:39:30
Reply #2

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Purely because I don't have the photography yet. And because you don't get correct shadows from a flat backplate.

The photography will be a very last minute job.  Typical British weather has meant we're only able to shoot 2 days before the deadline, so trying to have the renders ready to go in advance so all we have to do is drop the backplates in and submit the work to the client.

Out of interest, why do you use Light Materials?  I normally shoot 360's and then just drop that into the direct overrides.

2023-08-07, 09:06:39
Reply #3

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www
I use a LightMtl as a way to adjust the exposure of the backplate.

2023-08-07, 09:18:34
Reply #4

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Ah ok, yeh i just use exposure in a CC node for that, or adjust it before dropping it in

2023-08-07, 09:28:00
Reply #5

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www

2023-08-07, 09:29:10
Reply #6

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
On what? The materials of the dummy geometry?

2023-08-07, 09:31:12
Reply #7

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www

2023-08-07, 10:54:19
Reply #8

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Did you try to set Alpha mode to "Always black"?

That does the job, perfect, thanks

2023-08-07, 11:38:56
Reply #9

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www

2023-08-11, 23:09:39
Reply #10

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Hmm, this doesn't quite fix the problem after all.  it gives you the correct alpha, but you still get the reflections/refractions of the dummy objects in the glass.

I've attached a screenshot of the scene, the glass is currently hidden, but essentially the red blocks are behind the glass.  They're intended purely to cast the correct shadows into the scene and to affect the reflections of the objects infront of the glass.  So their current properties are - Visible to Camera Unchecked, Receive Shadows Unchecked, Cast Shadows Checked, Visible to Reflection/Refraction Checked.  If I make them invisible to reflection/refractions then the reflections of the objects infront of the glass will be far too bright reflecting just the sky.  This would look strange once the backplate is dropped in as the reflections won't match the backplate at all.

I'm attached some images.

"RENDER" - this is how it looks in the VFB

"ALPHA" - looks good using the 'Always Black' option on the background materials

"RENDER WITH ALPHA" - looks good so far

"RENDER WITH ALPHA BLACK BACKGROUND" - now you see the problem

"RENDER WITH ALPHA WITH BACKPLATE" - I've just dropped a random photo in to prove the point, it doesn't look as obvious but you can still see the brickwork from the dummy objects over the blue shutters

How do we solve this scenario?  Is it a case of rendering twice?  Once with the glass hidden and the dummy objects visible, then again with the glass visible but the dummy objects hidden?  Then comp the two together by masking the glass back in?  Although technically this still isn't right because now the objects infront of the glass wouldn't have the correct brightness/reflections when viewed in the glass reflections but that wouldn't be obvious at all.

Any ideas anyone?
« Last Edit: 2023-08-12, 09:37:33 by dj_buckley »

2023-08-12, 00:37:30
Reply #11

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Solved it.  Use the Legacy material.  Turns out this is an old issue I highlighted when the Physical Material was first released.  I thought it had been fixed.

Physical Material - Diffuse 0 - Glossiness 1 - Refraction 1 - Thin Shell Unchecked = Problem

Physical Material - Diffuse 0 - Glossiness 1 - Refraction 1 - Thin Shell Checked = Problem

Legacy Material - Diffuse 0 - Reflection 1 - Refraction 1 - Thin (no refraction) Unchecked = Problem

Legacy Material - Diffuse 0 - Reflection 1 - Refraction 1 - Thin (no refraction) Checked - Problem Solved

So it seems that checking Thin Shell on the Physical Material isn't fully disabling refraction like the Legacy Material Thin (no refraction) does.


Edit:  This is the original thread where I highlighted the weird behaviour of PhysicalMaterial Thin option back in 2021 https://forum.corona-renderer.com/index.php?topic=34168.msg189151#msg189151

It seems the explanation was that "Thin Shell in the Physical Material now takes Refraction Overrides into account".  The way I see it, as the tooltip states, Thin Shell should disable refraction.  Any refraction overrides should also be ignored if refraction is effectively disabled.

And that's exactly the problem I'm having.  The dummy geometry is visible to reflection/refraction because I need it visible to reflections.  I don't want it visible to refractions though because I want to render on black.  So I tick "Thin Shell" aka disable refractions.  And theoretically that should solve the problem.  The dummy objects would be visible to reflections still, but because the glass has refractions disabled (Thin Shell ticked), then the dummy geometry wouldn't be visible through the glass despite 'Visible to Reflections/Refractions being checked.
« Last Edit: 2023-08-12, 01:28:47 by dj_buckley »

2023-08-12, 03:57:28
Reply #12

Tom

  • Active Users
  • **
  • Posts: 249
    • View Profile
    • www
Very intersting scenario, thanks for sharing.
Glad you found a workaround and I hope the Corona team will fix the behaviour of 'Thin shell' in PhysicalMtl in the future.

I'm not too sure, but maybe you could have fixed your problem by playing around with the 'Reflect BG override' in the 'Maps options' settings of the PhysicalMtl?

2023-08-13, 09:32:46
Reply #13

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Very intersting scenario, thanks for sharing.
Glad you found a workaround and I hope the Corona team will fix the behaviour of 'Thin shell' in PhysicalMtl in the future.

I'm not too sure, but maybe you could have fixed your problem by playing around with the 'Reflect BG override' in the 'Maps options' settings of the PhysicalMtl?

I have a feeling that would also stop it reflecting the interior, maybe a flat plane would work ...

2023-08-13, 22:18:09
Reply #14

dj_buckley

  • Active Users
  • **
  • Posts: 879
    • View Profile
Found a downside to the Legacy Material - you can't get a proper RawComponent Reflection or CESSENTIAL Reflection pass when Thin is checked, it always seems to have transparency when Thin is checked.

So my choices are Physical Material - just doesn't work but can get a decent Reflection element out of it.

Legacy - works as I want but can't get a decent element out of it.

So whichever I use I have to render twice if I want the element as well.

Can't have it all I guess.