Author Topic: Masks in reflection/refraction playgound!  (Read 18610 times)

2020-02-03, 18:04:20

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
As you may have noticed, there is a new feature in Corona Renderer 6 daily builds, which lets you store masks of objects seen through glass and reflected in mirrors:
Quote
Masking render elements can be propagated through refraction/reflection. To propagate them you have to set it in the material (Corona Mtl -> advanced ->propagate masks)
https://coronarenderer.freshdesk.com/support/solutions/articles/12000066916-how-to-use-masks-with-reflection-refraction

Please share your experiments here and point out any possible issues/requests/doubts as we would love to see how exactly you are using this feature, and make sure it works as expected in Corona.
I am also attaching a very simple scene here, which can be used to try it.

Full V6 changelog: https://forum.corona-renderer.com/index.php?topic=26830.0
Get the daily build here: https://coronarenderer.freshdesk.com/support/solutions/articles/5000570015

« Last Edit: 2020-02-05, 11:34:41 by GeorgeK »
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-02-05, 12:01:43
Reply #1

scionik

  • Active Users
  • **
  • Posts: 182
    • View Profile
good option, but I don't use masks at all in my pipeline

2020-02-05, 21:30:58
Reply #2

jop

  • Active Users
  • **
  • Posts: 71
    • View Profile
Great !
Crucial for fvx/post-production !

2020-02-05, 22:07:00
Reply #3

davemahi

  • Active Users
  • **
  • Posts: 192
    • View Profile
    • iamstatic
Step in the right direction, but man Cryptomattes with this working would be the best. I am so sick of setting up RGB mattes and ID Mattes for so many objects.

2020-02-27, 12:47:28
Reply #4

enrico.lapponi

  • Active Users
  • **
  • Posts: 8
    • View Profile
Hi, here is a first test trying out the new masking feature. It works great, no problem in setting the correct option in the respective materials. It works with IDTool as well, if anybody is wondering about that.
Few notes:
1- It would be nice to have a way to set simultaneously the Propagate masks option in multiple materials.
2- maybe I missed something but once the Propagate masks option is used is not possible to have a mask of the object anymore (in the attached image the vase and the mirror). If I need to change the refraction or reflection in post how can I mask those objects?

Thanks for all the great work!
3D Artist / R&D Manager @ State of Art in Venice, Italy

2020-02-27, 14:46:00
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8781
  • Let's move this topic, shall we?
    • View Profile
    • My Models
1- It would be nice to have a way to set simultaneously the Propagate masks option in multiple materials.

Maybe it's worth to ask the author of Batch Material Edit script to update this tool to be compatible with the latest changes in Corona material?

https://forum.corona-renderer.com/index.php?topic=12857.0
or directly on scriptspot: http://www.scriptspot.com/3ds-max/scripts/batch-material-editor
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2020-02-28, 11:59:07
Reply #6

enrico.lapponi

  • Active Users
  • **
  • Posts: 8
    • View Profile
Maybe it's worth to ask the author of Batch Material Edit script to update this tool to be compatible with the latest changes in Corona material?

https://forum.corona-renderer.com/index.php?topic=12857.0
or directly on scriptspot: http://www.scriptspot.com/3ds-max/scripts/batch-material-editor

Great! Thanks, I wasn't aware of that tool!
3D Artist / R&D Manager @ State of Art in Venice, Italy

2020-03-05, 11:20:51
Reply #7

lgk

  • Users
  • *
  • Posts: 1
    • View Profile
Would it be possible to extend this function also to "CESSENTIAL_Volumetrics"?
It would also be useful in ZDepth
« Last Edit: 2020-03-05, 16:02:47 by lgk »

2020-03-06, 13:14:26
Reply #8

rowmanns

  • Corona Team
  • Active Users
  • ****
  • Posts: 1892
  • Corona for 3ds Max QA Team
    • View Profile
Would it be possible to extend this function also to "CESSENTIAL_Volumetrics"?
It would also be useful in ZDepth
Hi,

Thanks for the feedback, I will log this as a feature request and put it to the dev team.

Rowan

(Internal ID=474801667)
Please read this before reporting bugs: How to report issues to us!
Send me your scene!

2020-03-06, 16:47:54
Reply #9

Anatoly

  • Active Users
  • **
  • Posts: 6
    • View Profile
Also would it be possible to render mask for the transparent/reflective object at the same time?
Example:

I see a white building (White material has MatID:1) with large windows with glass (glass has MatID:2) and gray interior stuff (gray material has MaiID:3)
I Create Mask render element and put there all three material IDs. So Red (MatID:1) masks a white exterior walls, blue (MatID:3) masks a refracted interior stuff.
Would there be a plain green channel for the glass in windows?

Same for reflections, Red - object in front of mirror and it's reflection, and green for the mirror. So reflected object supposed to becomt Yellow (Red+Green) it would be this way? Or what should we expect in situations like this?
« Last Edit: 2020-03-06, 16:52:39 by Anatoly »

2020-03-14, 09:18:41
Reply #10

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
I am genuinely elated about this feature - it is fantastic! ❤️ I have not experienced any issues with the implementation so far, but I will report any bugs to the forum should they appear.

For this image, several masks were generated to control the appearance of objects refracted through the crystal ornament.

« Last Edit: 2020-03-15, 10:10:03 by cjwidd »

2020-03-27, 16:57:55
Reply #11

JG_monomiru

  • Active Users
  • **
  • Posts: 125
  • JG
    • View Profile
    • www.gehrcken.de
currently I dont exactly understand how it should work.

I expected to get some combined color in viewpoint overlapping refractive objects. But it seems it shows just the mask of the foremost object, where non object is behind - so showing every mask behind.


2020-03-27, 17:02:53
Reply #12

JG_monomiru

  • Active Users
  • **
  • Posts: 125
  • JG
    • View Profile
    • www.gehrcken.de
hmm... should have read the help-file.
hoped it will behave like in vray when using RGB masks, where you can render full masks of each overlapping-refractive and non refractive objects.

So i still need to render 2 times to get the mask of the foremost and hidden objects?


2020-04-02, 11:09:42
Reply #13

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
Investigated and reported:
(Internal ID=488395374)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-04-16, 11:29:51
Reply #14

Fluss

  • Active Users
  • **
  • Posts: 553
    • View Profile
currently I dont exactly understand how it should work.

I expected to get some combined color in viewpoint overlapping refractive objects. But it seems it shows just the mask of the foremost object, where non object is behind - so showing every mask behind.

+1

2020-05-30, 13:28:55
Reply #15

Alex Kondratev

  • Active Users
  • **
  • Posts: 6
    • View Profile
How can this be turned off globally in the whole scene? When there is a large amount of material in a complex scene, it is impossible to disable it all over the scene to get a "clean" mask. Is it possible to add this option to system settings or converter?

2020-06-02, 16:01:32
Reply #16

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
How can this be turned off globally in the whole scene? When there is a large amount of material in a complex scene, it is impossible to disable it all over the scene to get a "clean" mask. Is it possible to add this option to system settings or converter?

Try the attached script.
Yes, we are planning to add this to the converter script.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-06-03, 11:22:57
Reply #17

Rhodesy

  • Active Users
  • **
  • Posts: 553
    • View Profile
Life saver with that script, thanks! Yes some sort of global control would be good. Or a way not to get the noise in the passes, if that is at all possible.

2020-06-03, 11:55:05
Reply #18

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
We still do not know how people end up with all scene materials with the option enabled. If you are able to reproduce this behavior, please let us know.
So far it seems that it is related to opening older scenes and re-saving them. But like I said, no way to reproduce it on our end so far...
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-06-03, 12:05:21
Reply #19

Rhodesy

  • Active Users
  • **
  • Posts: 553
    • View Profile
Hmm annecdotally from me. The noisy materials in this scene are new materials created with v6 alpha and the clean ones are old ones. I have run the script and that has fixed all my materials, thank you.

Any new material I am creating now with Alpha 15-05 seems to have it set to NEVER as intended so I'm not sure how this has happened as it wasnt actively changed by me to always - which is what it was set to before I ran the script. Perhaps it was accidentially changed in the previous build?
Hopefully its a passing glitch. Glad to know its intended to be off as default.

Thanks

2020-07-17, 14:04:23
Reply #20

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Hello all, we would love to hear your thoughts and receive some feedback regarding the changes in Masks/propagation for Corona version 6.

1) Should we include a Hidden option for CoronaMtl, that would hide the object in masks? (similar to version 5 "Visible/invisible to masks") It would then show the background "mask" instead. (Currently, this is not possible)

2) In a scenario where masks are propagated through an object and the background is being hit, should we show the object's mask or the background "mask"? (Currently, it shows the object A mask). This is in regard to both Corona Mtl and CoronaLight MTL. Although the current implementation can allow for separate control between masking elements (i.e. editing separate color range for reflection-refraction) it leads to issues when editing the background element. Example: https://corona-renderer.com/comparer/3ShyQ8

3) If the propagation is set to reflect/always (with both reflection/refraction level 0.0) and diffuse material is used, what should happen? (Currently, diffuse reflection is treated the same way as a specular reflection -> this leads to noise in masks, since diffuse reflection goes all over the place). Example of wire color mask for table surface between always/never: https://corona-renderer.com/comparer/73zQV7
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-07-17, 16:45:23
Reply #21

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
I reworded the questions a bit, hope it helps:

1) In V5 you can hide an object from masking render elements (make it invisible in masks and see objects behind it). In V6 this is not possible because this was replaced with mask propagation. Do you ever need the V5 behavior?

2) In masking render elements, should the environment visible through glass have black color or the glass object's mask color?

3) In V6, In masking render elements, with mask propagation on, diffuse objects are treated similar to 0 glossiness reflective objects. Should they be solid-colored like in V5? Is there a case where rendering diffuse objects like 0 glossiness reflective objects makes sense to you?

We would really appreciate your feedback, because this is one of the cases where something might make perfect sense from developer's point of view, but may not be expected by the users.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-07-23, 14:04:05
Reply #22

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
The lack of feedback here is amazing. Maybe because it's a complex matter and hard to imagine all its consequences without actually using it in production instead of fooling around with test scenes. Tbh, I haven't played around much with mask propagation, Corona v6 generally (was hoping for some improvement relating to opacity handling which I would need most) but let's see:

1) I remember using the "visible to mask" checkbox repeatedly as some kind of last resort in some cases without being able to provide them. Misuse like alpha stencil seems to work in v6 as well (with propagate mask -> Always instead of invisible mask). So a tentative "no" here.

2) The consequentially correct result would be black. It's not the object we see in beauty, so why should we see its mask? It should be handled like alpha is treated in such a case.

3) The idea is tempting and may be somewhat realistic, but I vote less tentative for solid here. It may only lead to confusion - and to unusable masks due to that noise from what I've seen. Most puzzling result is the mask "mix" you get using high(er) glossiness reflection with low diffuse amount. No one will like or understand that I think. And rendering 120 passes for a usable mask may be far away from production reality.

I may be wrong with all above! :) Curious if others can contribute their thoughts,


Good Luck



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

2020-07-23, 16:34:12
Reply #23

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
The lack of feedback here is amazing. Maybe because it's a complex matter and hard to imagine all its consequences without actually using it in production instead of fooling around with test scenes. Tbh, I haven't played around much with mask propagation, Corona v6 generally (was hoping for some improvement relating to opacity handling which I would need most) but let's see:

1) I remember using the "visible to mask" checkbox repeatedly as some kind of last resort in some cases without being able to provide them. Misuse like alpha stencil seems to work in v6 as well (with propagate mask -> Always instead of invisible mask). So a tentative "no" here.

2) The consequentially correct result would be black. It's not the object we see in beauty, so why should we see its mask? It should be handled like alpha is treated in such a case.

3) The idea is tempting and may be somewhat realistic, but I vote less tentative for solid here. It may only lead to confusion - and to unusable masks due to that noise from what I've seen. Most puzzling result is the mask "mix" you get using high(er) glossiness reflection with low diffuse amount. No one will like or understand that I think. And rendering 120 passes for a usable mask may be far away from production reality.

I may be wrong with all above! :) Curious if others can contribute their thoughts,


Good Luck

Thank you Frood, feedback is logged.
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-09-02, 23:54:48
Reply #24

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
Hello,

I opened a ticket a few weeks ago, but I have never received answer.
 
I think something is wrong when Propagate masks is set to "Always". Look at the next image.
In v6.0 18 June, I was able to see the Corona logo on the 4th glass and also the Environment (green arrow).
In v6.0 FINAL, the Environment isn't displayed (good),  but also the Corona logo disappeared (red arrow).

Is it a bug or what?



« Last Edit: 2020-09-03, 00:28:37 by cecofuli »

2020-09-03, 09:37:57
Reply #25

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Hello,

I opened a ticket a few weeks ago, but I have never received answer.
 
I think something is wrong when Propagate masks is set to "Always". Look at the next image.
In v6.0 18 June, I was able to see the Corona logo on the 4th glass and also the Environment (green arrow).
In v6.0 FINAL, the Environment isn't displayed (good),  but also the Corona logo disappeared (red arrow).

Is it a bug or what?


Hey, I believe an answer was given by skype, but we will look into this further in case something was missed.

I will update you as soon as possible. Thanks!

(internal id=559670082)
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-09-07, 15:10:35
Reply #26

VIZSET

  • Active Users
  • **
  • Posts: 33
    • View Profile
    • Behance
Hi! I can't already understand, is it possible to get reflection and refraction propagate masks together during one render? Do the masks have to overlap? (I hope no). I activate Always mode for glass, but it shows me masks only on refraction. I need to render it 2 times?
Thanks!
« Last Edit: 2020-09-07, 15:24:00 by adlkhkmlln »
More works: behance.net/vizset

2020-09-07, 15:16:52
Reply #27

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
Eh eh eh ... good question ^__^

It was possible with v6.0 18 June, then, they changed something inside the code when "Always" is selected.
What they wrote in the help-desk and in the blog is not 100% correct, and they must update the text.

2020-09-07, 17:19:53
Reply #28

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Eh eh eh ... good question ^__^

It was possible with v6.0 18 June, then, they changed something inside the code when "Always" is selected.
What they wrote in the help-desk and in the blog is not 100% correct, and they must update the text.

Guilty for this, my apologies for not updating it earlier, we were in the process of updating some details. Please expect some minor edits here and there explaining the entire masking functionality better. You can find some of the updated details here: https://coronarenderer.freshdesk.com/support/solutions/articles/12000066916-how-to-use-masks-with-reflection-refraction

Hi! I can't already understand, is it possible to get reflection and refraction propagate masks together during one render? Do the masks have to overlap? (I hope no). I activate Always mode for glass, but it shows me masks only on refraction. I need to render it 2 times?
Thanks!

As cecofuli mentioned, due to the fact that we started treating the background functionality of masks differently, and the background hit is now being considered for the reflection/refraction of the mask, this leads to a limitation (of sorts) for the "always" state to take into account reflectivity or refraction based on parameter strength. In the future, we plan on having some crypto or multi-matte that will allow us to capture more masks per pixel.

In some cases, it is still possible to reflect and refract surrounding objects of your "always" material in its mask if both reflection and refraction values are closer together. https://corona-renderer.com/comparer/TZUjZr




George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-10-27, 10:48:58
Reply #29

Jpjapers

  • Active Users
  • **
  • Posts: 1644
    • View Profile
Does this technique work with non-glossy reflections?

2020-10-27, 10:58:37
Reply #30

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Does this technique work with non-glossy reflections?

It works equally for low-gloss surfaces but needs more time to clear the mask. Any feedback is welcome if you are planning on utilizing it.
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-10-27, 11:53:43
Reply #31

Jpjapers

  • Active Users
  • **
  • Posts: 1644
    • View Profile
Does this technique work with non-glossy reflections?

It works equally for low-gloss surfaces but needs more time to clear the mask. Any feedback is welcome if you are planning on utilizing it.

Im very much planning on using it. Its the missing piece in being able to swap textures out of rendered images ;)
My only issue is that since Deadline isnt compatible with Corona 6 yet, im unable to test it on live projects.

2020-10-29, 19:14:45
Reply #32

Stig

  • Users
  • *
  • Posts: 3
    • View Profile
Hello all, we would love to hear your thoughts and receive some feedback regarding the changes in Masks/propagation for Corona version 6.

1) Should we include a Hidden option for CoronaMtl, that would hide the object in masks? (similar to version 5 "Visible/invisible to masks") It would then show the background "mask" instead. (Currently, this is not possible)

2) In a scenario where masks are propagated through an object and the background is being hit, should we show the object's mask or the background "mask"? (Currently, it shows the object A mask). This is in regard to both Corona Mtl and CoronaLight MTL. Although the current implementation can allow for separate control between masking elements (i.e. editing separate color range for reflection-refraction) it leads to issues when editing the background element. Example: https://corona-renderer.com/comparer/3ShyQ8

3) If the propagation is set to reflect/always (with both reflection/refraction level 0.0) and diffuse material is used, what should happen? (Currently, diffuse reflection is treated the same way as a specular reflection -> this leads to noise in masks, since diffuse reflection goes all over the place). Example of wire color mask for table surface between always/never: https://corona-renderer.com/comparer/73zQV7

To be honest, it's absolutely horrible. We are suddenly no longer able to render masks, which is causing a lot of problems for us. We have tried all different Propegation-settings, but the masks always comes out messy and useless. It would be relly nice if you could test these big changed internally to see if it works before releasing them in an update.

2020-10-30, 07:05:56
Reply #33

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Hello all, we would love to hear your thoughts and receive some feedback regarding the changes in Masks/propagation for Corona version 6.

1) Should we include a Hidden option for CoronaMtl, that would hide the object in masks? (similar to version 5 "Visible/invisible to masks") It would then show the background "mask" instead. (Currently, this is not possible)

2) In a scenario where masks are propagated through an object and the background is being hit, should we show the object's mask or the background "mask"? (Currently, it shows the object A mask). This is in regard to both Corona Mtl and CoronaLight MTL. Although the current implementation can allow for separate control between masking elements (i.e. editing separate color range for reflection-refraction) it leads to issues when editing the background element. Example: https://corona-renderer.com/comparer/3ShyQ8

3) If the propagation is set to reflect/always (with both reflection/refraction level 0.0) and diffuse material is used, what should happen? (Currently, diffuse reflection is treated the same way as a specular reflection -> this leads to noise in masks, since diffuse reflection goes all over the place). Example of wire color mask for table surface between always/never: https://corona-renderer.com/comparer/73zQV7

To be honest, it's absolutely horrible. We are suddenly no longer able to render masks, which is causing a lot of problems for us. We have tried all different Propegation-settings, but the masks always comes out messy and useless. It would be relly nice if you could test these big changed internally to see if it works before releasing them in an update.

Could you please be more specific in what way your results are messy and useless?
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-12-04, 11:17:08
Reply #34

JG_monomiru

  • Active Users
  • **
  • Posts: 125
  • JG
    • View Profile
    • www.gehrcken.de
already posted this suggestion to bring back at least "visble in mask" option back in V7...

this was a good way to work around with 1.full rendering and 2nd.rendering with "mask not visble" (render only masks) ---- to get some speedy elemets for all postproduction work with glass materials.

The removal of "visible in Mask" option is quite a headache when working with multi-submaterials and some submaterials are glass to be invisble/visible in masks.


currently this "behaviour" is not possible with V6 and dailyV7 ...as you can't make "glass material" invisible to zdepth/normal etc. and keep the other visible materials on a multi-submaterial object.
Only way would be to detach glass-material and turn it invisible to camera in object property modes - which is not an option in many cases - specially when working with Railclone etc.
« Last Edit: 2020-12-04, 11:25:51 by Jens_Gehrcken »

2021-01-26, 23:53:03
Reply #35

DPS

  • Active Users
  • **
  • Posts: 118
    • View Profile
Not sure if this is a bug or user error?

See attachment.

The reflections in the masks don't align with the reflection in the beauty. Is this user error?

Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3

2021-01-27, 09:51:06
Reply #36

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Not sure if this is a bug or user error?

See attachment.

The reflections in the masks don't align with the reflection in the beauty. Is this user error?

Can you please make sure that your IDs are set properly, also which version of Corona renderer you are currently using?

I am afraid we might have to further investigate your scene, I was unable to reproduce this on a very simple setup: https://corona-renderer.com/comparer/axbP6q

Thanks
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2021-01-27, 14:06:43
Reply #37

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12714
  • Marcin
    • View Profile
Is there some kind of denoising used here? It looks like the lines are there in the beauty, but barely visible. Maybe they got blurred because of denoising?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us