Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => [Max] Resolved Bugs => Topic started by: pokoy on 2015-07-09, 15:15:48

Title: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2015-07-09, 15:15:48
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)
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: maru on 2015-07-09, 15:40:29
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2015-07-09, 15:47:07
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2015-07-14, 13:39:22
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: romullus on 2015-07-14, 13:45:17
I've noticed it while ago, but thought it is intended behaviour, hence didn't reported.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: romullus on 2015-07-27, 11:34:32
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: Ludvik Koutny on 2015-07-28, 16:37:03
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?
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: maru on 2015-07-28, 17:14:24
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. :)
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2015-07-28, 17:25:23
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
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: romullus on 2015-07-28, 17:42:46
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?
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: Ludvik Koutny on 2015-07-29, 09:16:44
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: romullus on 2015-07-29, 11:00:39
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2015-07-29, 11:29:33
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: Ondra on 2015-10-07, 17:45:38
moved to mantis: https://corona-renderer.com/bugs/view.php?id=1346
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2016-01-27, 14:21:51
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.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: romullus on 2016-01-27, 14:28:55
Really? Fixed?! That would be great news indeed. Although i can't remember seeing this in changelog.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2016-01-27, 14:34:05
It's marked as fixed on Mantis so I hope it really is.
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: Ondra on 2016-01-27, 17:44:26
it is fixed in 1.3
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: pokoy on 2016-01-27, 17:47:45
Great, thanks!!
Title: Re: Bug - Inverted bump with Mirror or Symmetry modifier
Post by: Dippndots on 2016-03-18, 17:52:51
We're currently on 1.3 and it doesn't seem like this was fixed? The brick on the right is the mirrored geometry. Oddly, that is the only geo/material that is exhibiting the problem... Any ideas, flipping normals doesnt solve it?

EDIT:  Might've jumped the gun here sorry, looks like its directly related to mighty tiles, I'll do some more testing and report back.