Author Topic: Masking - leaking issue  (Read 981 times)

2022-12-27, 17:49:49

Mac3DX

  • Active Users
  • **
  • Posts: 147
    • View Profile
Hi Guys, it was not supposed to behave like this, but I couldn't figure it out how to solve it. The textures are working fine in other 3D softwares.



« Last Edit: 2022-12-27, 18:01:00 by Mac3DX »

2022-12-27, 18:54:16
Reply #1

BigAl3D

  • Active Users
  • **
  • Posts: 879
    • View Profile
That mask and diffuse files are NOT exact fits for each other. There is a slight difference. Maybe some other apps do a better job anti-aliasing those artifacts or you. Not sure.

The first thing I see is the way you set up your Layered Material. That seems backwards. Think real-world. Metal on the bottom then the label on top. Here is a screen grab of what I changed to get a clean edge.

It also works by using a simple color in the diffuse channel and then use your mask in the Opacity channel. Add the metal material to the object, then stack the label material to the right of the metal. Hope this helps.

2022-12-27, 19:24:27
Reply #2

Mac3DX

  • Active Users
  • **
  • Posts: 147
    • View Profile
Well at least it should. They were saved out from PS and as I said before this do not happen in Cycles and RS for instance.

Of course I provided a very simple material setup, but it might become very complex specially with packaging labels.

In your example we can clearly see a dark edge overlaying the red color. So we conclude the stacking order is not an argument.

Also to reinforce this theory is not relevant I masked only dielectrics materials, same issue again.

Anyway, I appreciate your efforts.



2022-12-27, 19:44:06
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8830
  • Let's move this topic, shall we?
    • View Profile
    • My Models
It's not Corona's fault, it's simply your textures are flawed. Zoom in into your diffuse mask and you will see that you have white border baked into texture (look at the attachment). I don't know how your material setup looks like, but the easiest fix in this case would be replace "dif_mask.jpg" with the solid red colour.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-12-27, 19:48:21
Reply #4

BigAl3D

  • Active Users
  • **
  • Posts: 879
    • View Profile
Interesting. Well here is an example of a stacked material. Metal first, then the label is a solid color and just the mask in the opacity channel. I don't see a white or a dark edge on this technique.

I'm not a material master, but I'm good at finding workarounds to get me by. Curious to see the conclusion.

2022-12-27, 21:28:50
Reply #5

Mac3DX

  • Active Users
  • **
  • Posts: 147
    • View Profile
@BigAl3D Yes in this exemple it looks great! But it seems I'll have to add some sort of trapping to compensate the masks. I'll dig a bit more into this.

I've tried larger maps but it doesn't make a diference.

But I'm pretty sure Corona has some anti-aliasing going on behind the scenes and it is too strong.

2022-12-28, 12:05:42
Reply #6

burnin

  • Active Users
  • **
  • Posts: 1537
    • View Profile
When layering materials, if you simply just use a mask, then you're fine (no borders, since color fills whole area equally). But when you got texture to match then know your Alpha channels: premultiplied vs straight

2022-12-28, 13:50:02
Reply #7

Mac3DX

  • Active Users
  • **
  • Posts: 147
    • View Profile
Thanks @burnin
I've heard about it, I'll read the article. But I managed to get around the problem quickly by contracting the mask a tiny bit in PS. It becomes acceptable.

2022-12-29, 16:16:12
Reply #8

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12741
  • Marcin
    • View Profile
Hmm, here the diffuse color should not have any white in it, right? It should be all red.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-12-30, 17:32:41
Reply #9

burnin

  • Active Users
  • **
  • Posts: 1537
    • View Profile
Right... it's so simple, many just can't believe it ;)