Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => [Max] Resolved Bugs => Topic started by: Dionysios.TS on 2022-06-21, 12:29:19

Title: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 12:29:19
Hello Corona team!

I found that using a Displacement map with quite high displacement values on objects with thickness (box for example), the direction of the displacement effect is not correct: It's not perpendicular on the surface but has an angle direction!
Same material applied on a Plane or a detached polygon WITHOUT thickness works correctly.

I've attached a test scene with a height map as well.

Guide to replicate the bug:

- Open the scene and use the included height map.
- Render and you'll notice the box on the left having the defect while the plane on the right is ok.
- Now select the plane and in the modifiers list TURN ON the Shell modifier.
- Render again and now the plane is incorrect as well!

Corona 9 last Daily Build but it happens on Corona 8 as well.

Let me know what you think!

Thanks,

Dionysios -
 
Title: Re: Displacement Bug - Objects with thickness
Post by: pokoy on 2022-06-21, 13:41:34
Maybe it's due to smoothing groups - what happens if you add a Smooth modifier on top of the Shell modifier and leave 'Autosmooth' unchecked to clear smoothing groups? Does it still render wrong?
Title: Re: Displacement Bug - Objects with thickness
Post by: BardhylM on 2022-06-21, 13:42:39
As far as I know it is how it's been working for a while now, saw this on another thread (sorry I did not find the link).
A workaround is to chamfer the edges of the volume and it fixes the angles. Can not say if it is possible to fix it as a default cause it is a problem on connecting the displaced corners maybe.
Anyway it was weird for me too when I first encountered as you can not distinguish on organic displacements, only on these regular patterns that need perpendicular displacement.
Hope this helps!
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 13:48:47
As far as I know it is how it's been working for a while now, saw this on another thread (sorry I did not find the link).
A workaround is to chamfer the edges of the volume and it fixes the angles. Can not say if it is possible to fix it as a default cause it is a problem on connecting the displaced corners maybe.
Anyway it was weird for me too when I first encountered as you can not distinguish on organic displacements, only on these regular patterns that need perpendicular displacement.
Hope this helps!

I also found a solution to apply a Subdivide modifier on the object, more you subdivide, more the result is perpendicular but it shouldn't work like this...
First time it happened to me some days ago on a terrain object where I had some small and tiny stones on it and I saw this strange behavior!
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 13:53:22
Maybe it's due to smoothing groups - what happens if you add a Smooth modifier on top of the Shell modifier and leave 'Autosmooth' unchecked to clear smoothing groups? Does it still render wrong?

I've tried and nothing happens, same result. It's not linked to the smoothing groups.
Thanks for helping! :)
Title: Re: Displacement Bug - Objects with thickness
Post by: BardhylM on 2022-06-21, 13:54:00
Maybe that helps too, as there are more edges close to the borders the more you subdivide it.
But as you said it is not a solution cause you need to subdivide a lot, and still have some angles (small but noticable). Chamfer worked for me the best, just mind the corners not to have something huge displaced, like in your case balconies if I'm not wrong. It may seem weird results, but again I can not say how it should be and don't know how a better solution would be.
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 13:57:16
Maybe that helps too, as there are more edges close to the borders the more you subdivide it.
But as you said it is not a solution cause you need to subdivide a lot, and still have some angles (small but noticable). Chamfer worked for me the best, just mind the corners not to have something huge displaced, like in your case balconies if I'm not wrong. It may seem weird results, but again I can not say how it should be and don't know how a better solution would be.

Yes it's true, chamfer helps but these are not solutions, are tips to deviate the problem! :)
You have a bounce of walls and you apply with Corona Decal a Substance material with a wall plug, you'll see this problem immediately. Chamfer each wall or subdivide it is something I am not very comfortable about it.
Title: Re: Displacement Bug - Objects with thickness
Post by: romullus on 2022-06-21, 14:01:11
[..] but it shouldn't work like this...

It not always worked like this. It used to displace perfectly perpendicular to surface, but we had tears in geometry wherever there was hard edges. Needless to say, people weren't too ecstatic about this neither. It's a compromise and i think it's much better to have current solution, than to have to deal with tears.
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 14:06:11
Look at the wall plug, is not perpendicular at all, it has a slight direction to the right!
This is a Corona Decal by the way.
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 14:08:38
[..] but it shouldn't work like this...

It not always worked like this. It used to displace perfectly perpendicular to surface, but we had tears in geometry wherever there was hard edges. Needless to say, people weren't too ecstatic about this neither. It's a compromise and i think it's much better to have current solution, than to have to deal with tears.

I subdivided the box and the plug now is correct.
So you're saying is done on purpose to avoid the tearing results we were getting in the past?
Title: Re: Displacement Bug - Objects with thickness
Post by: romullus on 2022-06-21, 14:09:34
I think you already have been told how to fix it - just add support edges near the corners and between these edges all displacement will be perfectly perpendicular to the surface.
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 14:11:05
I think you already have been told how to fix it - just add support edges near the corners and between these edges all displacement will be perfectly perpendicular to the surface.

Ok, got it and thanks!
I was not aware of this change tell you the truth.
Title: Re: Displacement Bug - Objects with thickness
Post by: romullus on 2022-06-21, 14:15:18
It's easy to get caught and get annoyed by this behaviour, but when you think for a moment how displacement should act when it meets hard corners, it's not as easy to find a proper solution as one might think.
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-21, 14:17:07
It's easy to get caught and get annoyed by this behaviour, but when you think for a moment how displacement should act when it meets hard corners, it's not as easy to find a proper solution as one might think.

Well, know that I know, I prefer it like this knowing that the workaround is chamfer or subdivide in the worst case.
Thanks for your support guys!
Title: Re: Displacement Bug - Objects with thickness
Post by: GeorgeK on 2022-06-22, 11:13:30
It's easy to get caught and get annoyed by this behaviour, but when you think for a moment how displacement should act when it meets hard corners, it's not as easy to find a proper solution as one might think.

Well, know that I know, I prefer it like this knowing that the workaround is chamber or subdivide in the worst case.
Thanks for your support guys!

Although it depends on what exactly you are trying to apply the decal on, an alternative would be to break surface vertices, in a case where your object is a box "wall" rather than just a plane, it will treat each polygon as a flat plane (granted no flat displacement is applied on the wall).
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-22, 11:17:20
It's easy to get caught and get annoyed by this behaviour, but when you think for a moment how displacement should act when it meets hard corners, it's not as easy to find a proper solution as one might think.

Well, know that I know, I prefer it like this knowing that the workaround is chamber or subdivide in the worst case.
Thanks for your support guys!

Hi George and thanks, actually that's another solution too!

Although it depends on what exactly you are trying to apply the decal on, an alternative would be to break surface vertices, in a case where your object is a box "wall" rather than just a plane, it will treat each polygon as a flat plane (granted no flat displacement is applied on the wall).
Title: Re: Displacement Bug - Objects with thickness
Post by: maru on 2022-06-22, 15:04:23
This is an intended behavior. Displacement is following the direction of averaged normals. I understand that the behavior that you would like to see would be displacement being always perpendicular to the surface, right? So for example if we create a box with just 6 faces (no additional subdivisions), each face would be displaced exactly in the direction of each of the faces' normals.

But if we do this, what would the corners of this box look like? :)
Title: Re: Displacement Bug - Objects with thickness
Post by: Dionysios.TS on 2022-06-22, 15:20:28
This is an intended behavior. Displacement is following the direction of averaged normals. I understand that the behavior that you would like to see would be displacement being always perpendicular to the surface, right? So for example if we create a box with just 6 faces (no additional subdivisions), each face would be displaced exactly in the direction of each of the faces' normals.

But if we do this, what would the corners of this box look like? :)

Thanks Maru and thanks to all the other people here as I wasn't aware of this change on Displacement.
At this point is easy to deal with, knowing how it works and specially we got rid of the corners problem! :)

Thanks again!