Author Topic: Bug - Inverted bump with Mirror or Symmetry modifier  (Read 11805 times)

2015-07-09, 15:15:48

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
Bump renders with inverted intensity/direction when an object has been mirrored at some point. This happens even if mesh normals face in the correct direction.
I consider it a bug since it doesn't happen with Scanline and I can't imagine a situation where you'd want this to happen.

Repro steps:
- Create a sphere
- Apply UVW modifier
- Apply a Mirror or a Symmetry modifier
- create a material and use a bump map
- render

-> The original part of the mesh will render the bump correctly, the mirrored/symmetrical part will render the bump as inverted

See attached image for a better explanation, left - original mesh with positive bump direction, right - mesh from a symmetry modifier with negative bump direction (from the same material)

2015-07-09, 15:40:29
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12789
  • Marcin
    • View Profile
Confirmed. Happens with both max and corona bitmap. Both normal map and greyscale bump. Also confirmed that this does not happen with scanline or MR.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2015-07-09, 15:47:07
Reply #2

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
Great! I took me while to figure out why bump looked great on some parts but was totally funky on others. Ideally this should be fixed very soon, I imagine this affects a lot of projects.

2015-07-14, 13:39:22
Reply #3

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
Another effect of this bug is that if you flip UV coordinates it'll also change the bump direction. That's probably what causes it, it's not the flipped normals but flipped UVs from the mirror/symmetry modifier.

2015-07-14, 13:45:17
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8881
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I've noticed it while ago, but thought it is intended behaviour, hence didn't reported.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-07-27, 11:34:32
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8881
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Also this bug affects objects with shell modifier, since shell modifier flips UV coordinates. Would be great if it'd be fixed ASAP, since shell modifier and flipped UVs in general are pretty common in archviz.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-07-28, 16:37:03
Reply #6

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
I did some tests and results come in surprising.

Corona - flips bump orientation with both symmetry modifier and when manually flipping faces using normal modifier

Mental Ray - keeps bump orientation correct regardless of symmetry modifier or normal modifier

Vray - keeps bump orientation correct with symmetry modifier, but when you intentionally flip faces using normal modifier, bump flips as well.

What would be the most desired behavior?

2015-07-28, 17:14:24
Reply #7

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12789
  • Marcin
    • View Profile
What would be the most desired behavior?

I would say this:
Quote
Vray - keeps bump orientation correct with symmetry modifier, but when you intentionally flip faces using normal modifier, bump flips as well.
Because it happens anyway, right? If you create a plane, it will have inverted bump on one side.

OR, if it's possible, all objects could have the same ("positive") bump applied to both sides. I can't imagine a situation where one would want to have a flipped bump on one side for some reason. On the other hand, transparent/refractive objects... My brain hurts. :)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2015-07-28, 17:25:23
Reply #8

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
I'd say Vray's because it allows both ways, where you can set it to be inverted intentionally but won't end up with inverted bump by accident.

As long as it renders correctly (without being inverted) for these actions:
- mirror object
- mirror modifier
- symmetry modifier

2015-07-28, 17:42:46
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8881
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Wait till you come to normals map.

I vote for Mental Ray's approach. How vray can distinguish between flipped normals by various modifiers anyway? It must be something else. Fliped faces in case of symmetry modifier maybe?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-07-29, 09:16:44
Reply #10

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
Wait till you come to normals map.

I vote for Mental Ray's approach. How vray can distinguish between flipped normals by various modifiers anyway? It must be something else. Fliped faces in case of symmetry modifier maybe?

Symmetry doesn't really invert normals, it just does negative scale in the symmetry axis, which is kinda nasty. It should not invert normals, but it sort of does, but not really. It's sort of a hack, and depends on how renderer interprets it.

2015-07-29, 11:00:39
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8881
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Funny enough that in alpha 5 and 6 Corona didn't have such problems with normals. Unfortunatelly A7 isn't accesible anymore, so i can't trace exactly when there was changes made (could be when add gamma checkbox was introduced). Anyway, Corona v1 really suffer from this in certain scenes. Take a look at the attached examples. Alpha 6.1 renders normals perfectly well despite the fact that half UVs are flipped, while V1.2 struggles much. I tried to flip all UVs back - results are much better, but still not the same as in alphas.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-07-29, 11:29:33
Reply #12

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
On a second thought, we already have a rule and that's the bump value, positive or negative.
As long as the bump value is positive it should always render in positive way, regardless of normal, flipped UV etc. Since we don't care about face directions in Corona bump should always render identically.

Btw, the same happens for normal maps as far as I remember, these will need a fix too.

2015-10-07, 17:45:38
Reply #13

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-01-27, 14:21:51
Reply #14

pokoy

  • Active Users
  • **
  • Posts: 1873
    • View Profile
I just followed the mantis updates and am happy to see that it's fixed. In which version of DB/Corona exactly is this fixed? I still haven't moved to 1.3, need to test some things, so knowing when the fix was available would be good.