Author Topic: Corona masks RGB no clean edges why?  (Read 13341 times)

2017-12-05, 18:28:08
Reply #15

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
It's actually a limitation of Corona :)...
Sorry then, I assumed it's the typical white fringe problem in PS. Not working with opacity masked geometry too often so didn't come across this one... yet. Sorry for the confusion!

2017-12-05, 19:23:26
Reply #16

sebastian___

  • Active Users
  • **
  • Posts: 197
    • View Profile
I just did some tests. I'm curious about opinions. It seems much easier to me, you don't need to process with special premult nodes in Nuke, or run a defringe, or other stuff. And the objects are always perfect with no dark or white edges.

I saved some renders on a black background with alpha channel and merged them on a background in After Effects. The images are zoomed in 200% for clarity

regular png render - notice the dark edges :



..........

png and in AE I selected "premultipled with black. Notice the white edges



..........

tga saved with premult checked. Again dark edges.



.....

tga with premult unchecked - perfect edges


2017-12-06, 09:43:09
Reply #17

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
I saved some renders on a black background with alpha channel

Well, that's the difference. Alpha works correctly. But this issue is about masks created by render elements like Cmasking_Mask. Try to do a standard rendering + mask for your foliage and adjust e.g. levels with that mask. It will be wrong because CMasking_Mask does not respect opacity values between 0 and 1 but only 0 (=no mask) and different from 0 (=mask).


Good Luck


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

2017-12-06, 10:34:49
Reply #18

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9283
  • Let's move this topic, shall we?
    • View Profile
    • My Models
And what about if material would have clip opacity checked on, would it still render wrong in masks?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-12-06, 11:53:27
Reply #19

Romas Noreika

  • Active Users
  • **
  • Posts: 163
    • View Profile
    • romasnoreika
Simple - if you will always render your beauty pass with a background in it. Your BG/Backplate blue/white/light pixels will bake in all of your corner pixels of your alpha channel. Windows corners etc and trees are the worst.

If you know that you will change you bg later on - render your image with black BG.


If you rendered it with a sky or some kind of color - sometimes in photoshop Layer>Matting (Defringe 1px) or remove white matte helps. But sometimes it does not help. Sometimes you can get artifacts etc - make it even worse.

Remember the smaller resolution you are rendering the worse it will get. I think 3-4k image minimum is good. For doing Layer>matting.

Good luck
RN

2017-12-06, 17:25:57
Reply #20

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
And what about if material would have clip opacity checked on, would it still render wrong in masks?

In theory the mask would be ok because mask clips values > 0 and opacity clips values > 0.5 afaik. So the mask would be correct but only if those objects do not occlude each other. And you need a base rendering with clipping turned on of course. So all in all not feasable. Only solution is the ShadowCatcher workaround so far.


Good Luck


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

2017-12-06, 19:21:17
Reply #21

sebastian___

  • Active Users
  • **
  • Posts: 197
    • View Profile
Well, that's the difference. Alpha works correctly. But this issue is about masks created by render elements like Cmasking_Mask.

But it seems like when using regular methods and using png or other formats you will get edges - if you are not using the method I posted above. You'll get some kind of edges and you'll need to remove those with certain methods in AE or Nuke.

2017-12-06, 19:39:31
Reply #22

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9283
  • Let's move this topic, shall we?
    • View Profile
    • My Models
@Frood, when rendering foliage, clipping opacity is the prefered way, but of course if occlusion is a problem, then that isn't solution either...
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-12-07, 00:54:15
Reply #23

mferster

  • Active Users
  • **
  • Posts: 525
    • View Profile
I saved some renders on a black background with alpha channel

Well, that's the difference. Alpha works correctly. But this issue is about masks created by render elements like Cmasking_Mask. Try to do a standard rendering + mask for your foliage and adjust e.g. levels with that mask. It will be wrong because CMasking_Mask does not respect opacity values between 0 and 1 but only 0 (=no mask) and different from 0 (=mask).


Good Luck


I'm not convinced alpha is working correctly (and by extension the masks aswell). I set up a scene with a tree that has a black background and a 1.0 white self-illumnated material on the tree(no opacity maps), with tonemapping disabled and the image filter set to none. In my screen caps from the VFB you can see the difference between the two... Perhaps I'm misunderstanding something, but in this scenario shouldn't they be identical? What's stranger is that the alpha shows it actually encroaches 1px into the beauty with a black background. If you do the opposite scenario, 0 albedo tree with white background, the alpha expands past the bounds of the beauty by 1px, producing the halo effect. Peculiar.

2017-12-07, 10:23:41
Reply #24

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
I'm not convinced alpha is working correctly (and by extension the masks aswell).

I think you have to apply gamma 2.2 to alpha or 1/2.2 to the beauty and then compare the result - it should match (don't use JPG doing so), maybe you can check this.

But once again @sebastian___ and RomasNoreika: The original issue is NOT about alpha or premultiply or rendering on non-black or whatsoever. It's the Corona mask which does not take opacity fully into account, appart from any post problems that may arise. The comparison I posted here has a white alpha everywhere (BG and FG is rendered).

Render a gradient opacity object (you can use this map from that thread for convenience) and try to get a mask from objects using it. This is what happens in small scale using opacity maps with values other that 0 or 1 on foliage and causes dboldicotti's problem.

Vote Refraction/Reflection working with masking render elements (CMasking_Mask,CTexmap, etc...) to hopefully someday get rid of it :)


Good Luck


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