Author Topic: Need to render a mask that is behind glass  (Read 10199 times)

2018-07-27, 18:17:28

RobH2

  • Active Users
  • **
  • Posts: 14
    • View Profile
I have an object behind glass. I need to render a mask of it. The transparent material obscures the mask and if I render the mask with the glass turned off, the mask is not in the correct location due to refraction.

How can it pull a mask from something behind glass while leaving the glass enabled?

2018-07-27, 18:45:03
Reply #1

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Currently you can't. Simply that. Vote for

"Refraction/Reflection working with masking render elements (CMasking_Mask,CTexmap, etc...)"

here:

https://forum.corona-renderer.com/index.php?topic=96.0

if you need it desperately.


Good Luck



Never underestimate the power of a well placed level one spell.

2018-07-27, 18:58:07
Reply #2

RobH2

  • Active Users
  • **
  • Posts: 14
    • View Profile
Good enough. I'll vote.

Well, we all think that everything we need is "desperate" don't we...lol...? I'll render the mask in VRay I guess. I think it can do it.

Thanks for the fast response.

2018-07-27, 23:38:43
Reply #3

iancamarillo

  • Active Users
  • **
  • Posts: 281
    • View Profile
or hide the glass and re render only masks. I dreaded this workflow but surprisingly was very fast for an animation I did

2018-07-31, 18:59:15
Reply #4

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
You don't get a refractive mask doing so. Depending on the (glass) object you only get some approximation but usually just a wrong mask.


Good Luck



Never underestimate the power of a well placed level one spell.

2018-07-31, 19:16:11
Reply #5

iancamarillo

  • Active Users
  • **
  • Posts: 281
    • View Profile
yes sorry, I misread the initial post

2018-07-31, 20:18:15
Reply #6

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
Smartass alert here but can't you disable all lights, set the glass reflection to zero, set the object that you need a mask of to self illumination 1/white and render that? Not a direct solution but maybe a viable workaround.

2018-07-31, 20:48:05
Reply #7

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Interesting hack! Now we have shadowcatcher workaround for opacity masks and self illu for refraction - and a horrible workflow :) But for that one mask quickly needed, why not.


Good Luck




Never underestimate the power of a well placed level one spell.

2018-07-31, 21:06:22
Reply #8

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
Yeah it's not very elegant but will probably work, I've used this setup on a few occasions. Forgot to specify that you'd probably need to use a LightMtl because you need to make the object not emit any light.

If you need the mask for reflections too you need to keep reflections enabled for the glass material. 

2018-07-31, 21:59:32
Reply #9

iancamarillo

  • Active Users
  • **
  • Posts: 281
    • View Profile

2018-09-19, 19:28:10
Reply #10

actrask

  • Active Users
  • **
  • Posts: 142
    • View Profile
    • actrask.com
I just had to do a similar trick that pokoy used. Put a Rayswitcher on the object behind the glass and have only the 'refract override' set to a self illuminated RG or B color. This will stop the self-illum from kicking out any GI. Put a flat black material on everything except the glass and refracted object. I'd save a scene state before doing this.

Aside from all that, is it really that hard to implement this or is it just not a high priority?


« Last Edit: 2018-09-19, 20:02:20 by actrask »

2019-07-13, 15:56:48
Reply #11

julienbe

  • Active Users
  • **
  • Posts: 6
    • View Profile
Same problem for me here.
I'm working on a commercial with a fish in an aquarium. It is practically impossible to use the render elements for post-production because of the refraction of the aquarium glass.

JULIEN

2019-07-15, 19:02:49
Reply #12

actrask

  • Active Users
  • **
  • Posts: 142
    • View Profile
    • actrask.com
What if you set the aquarium glass object to "not visible to camera"?


2019-07-26, 16:45:45
Reply #14

actrask

  • Active Users
  • **
  • Posts: 142
    • View Profile
    • actrask.com
Wow, I never knew about that. Thank you!

2019-07-29, 11:11:50
Reply #15

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
i found this...

dont know if it helps.

https://coronarenderer.freshdesk.com/support/solutions/articles/5000529357-how-to-make-an-object-invisible-in-masks-render-elements-

Wow, I never knew about that. Thank you!

That still won't allow you to render a mask which is affected by refraction.
We have this logged in our internal tracker as one of the top 10 feature requests from the users.
(internal id=291805959)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-09-18, 19:29:05
Reply #16

Nate101

  • Active Users
  • **
  • Posts: 33
    • View Profile
Coming up against this limitation of Corona right now, albeit with reflections instead of refractions.  This is really a killer for me given the way I'm using Corona.  I know this has been asked for for years, any chance we'll see this implemented soon?  I'm trying to figure out workarounds so I don't have to switch to Vray.

2019-10-14, 22:09:43
Reply #17

RobH2

  • Active Users
  • **
  • Posts: 14
    • View Profile
I have to say, "Wow" on this too. I've been trying for a year to find a way to render masks behind glass and decided to read today to see if anyone ever solved it in a manner that didn't take too may extra contortions. I don't know when this switch showed up but "Visible in masks" is my new BFF.