Author Topic: Displacement Bug - Objects with thickness  (Read 2833 times)

2022-06-21, 12:29:19

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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 -
 

2022-06-21, 13:41:34
Reply #1

pokoy

  • Active Users
  • **
  • Posts: 1850
    • View Profile
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?

2022-06-21, 13:42:39
Reply #2

BardhylM

  • Active Users
  • **
  • Posts: 56
    • View Profile
    • Behance
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!

2022-06-21, 13:48:47
Reply #3

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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!

2022-06-21, 13:53:22
Reply #4

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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! :)

2022-06-21, 13:54:00
Reply #5

BardhylM

  • Active Users
  • **
  • Posts: 56
    • View Profile
    • Behance
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.

2022-06-21, 13:57:16
Reply #6

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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.

2022-06-21, 14:01:11
Reply #7

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
[..] 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'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-06-21, 14:06:11
Reply #8

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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.

2022-06-21, 14:08:38
Reply #9

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
[..] 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?

2022-06-21, 14:09:34
Reply #10

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-06-21, 14:11:05
Reply #11

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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.

2022-06-21, 14:15:18
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-06-21, 14:17:07
Reply #13

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
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!
« Last Edit: 2022-06-22, 11:16:24 by Dionysios.TS »

2022-06-22, 11:13:30
Reply #14

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
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).
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us