Author Topic: Displacement map rendered jagged  (Read 524 times)

2024-05-17, 12:43:23

mac_bean

  • Active Users
  • **
  • Posts: 9
    • View Profile
    • Boon Visuals
I try to recreate the textures of facade panels. (See the attached example)
To recreate this texture I use a Physical Material with a displacement map so that it becomes an infinite texture that I can place on the facade. Only the displacement is rendered a little bit jagged.

How do I get this line tight?
Is the use of displacement the correct one or are there better alternatives?
« Last Edit: 2024-05-22, 09:23:09 by mac_bean »

2024-05-17, 14:36:07
Reply #1

lollolo

  • Active Users
  • **
  • Posts: 225
    • View Profile
Have you tried to lower the pixels of the displacement to 1 in the render settings?
Also, have you checked the mesh, is it clean and with uniform polygons?

2024-05-17, 14:46:49
Reply #2

mac_bean

  • Active Users
  • **
  • Posts: 9
    • View Profile
    • Boon Visuals
Have you tried to lower the pixels of the displacement to 1 in the render settings?
Yes, i did.

Quote
Also, have you checked the mesh, is it clean and with uniform polygons?
How do you mean?

In the preview of the material editor it also shows that the displacement will become jagged.

2024-05-20, 13:10:58
Reply #3

Nejc Kilar

  • Corona Team
  • Active Users
  • ****
  • Posts: 1264
    • View Profile
    • My personal website
To me that looks like you might be using sub 32bit displacement maps. Can you check the bit depth on that displacement map and report back please?
Nejc Kilar | chaos-corona.com
Educational Content Creator | contact us

2024-05-20, 15:46:55
Reply #4

mac_bean

  • Active Users
  • **
  • Posts: 9
    • View Profile
    • Boon Visuals
It's just an 8 bit images im using as displacement map.


2024-05-21, 11:22:18
Reply #5

Nejc Kilar

  • Corona Team
  • Active Users
  • ****
  • Posts: 1264
    • View Profile
    • My personal website
It's just an 8 bit images im using as displacement map.

I would dare say that is the culprit. 8 bits are typically to be avoided for displacement - they may work depending on the bitmap and what you are trying to do with it but more often than not they'll produce artifacting and one of the most common ones are jagged straight lines.

I'd really suggest looking into 16 bit or 32 bit displacement maps. If you created it on your own then I think it would be best if you'd recreate it from scratch but in 16 or 32 bit mode.
Nejc Kilar | chaos-corona.com
Educational Content Creator | contact us

2024-05-21, 14:58:25
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8897
  • Let's move this topic, shall we?
    • View Profile
    • My Models
The issue is not in the bit depth, the displacement texture attached in the first message has only few shades of grey, increasing bit depth won't help in a slightest. The problem is this texture is pushing Corona displacement too hard. You need to blur it slightly, so displacement would have some room to work nicely. The more variance between neighbouring pixels the texture will have, the more chances for artifacts in displacement will be. You can try to reduce displacement size in render settings to combat that, but it has its limits - eventually increased parsing time and RAM consumption will make this solution impractical.

I would also suggest to consider using Corona pattern instead displacement - i think it would be more preferable solution in your case.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-05-21, 15:06:04
Reply #7

mac_bean

  • Active Users
  • **
  • Posts: 9
    • View Profile
    • Boon Visuals
Awesome, thanks a lot @romullus! This helped 💪🏻

2024-05-21, 16:23:24
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8897
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Glad to help!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-05-22, 15:18:05
Reply #9

Nejc Kilar

  • Corona Team
  • Active Users
  • ****
  • Posts: 1264
    • View Profile
    • My personal website
The issue is not in the bit depth, the displacement texture attached in the first message has only few shades of grey, increasing bit depth won't help in a slightest. The problem is this texture is pushing Corona displacement too hard. You need to blur it slightly, so displacement would have some room to work nicely. The more variance between neighbouring pixels the texture will have, the more chances for artifacts in displacement will be. You can try to reduce displacement size in render settings to combat that, but it has its limits - eventually increased parsing time and RAM consumption will make this solution impractical.

I would also suggest to consider using Corona pattern instead displacement - i think it would be more preferable solution in your case.

Schooled! Thank you though :)

In retrospect, I should have paid closer attention to the attached displacement map.

@mac_bean please do report back on whether you got it working as intended or not.
Nejc Kilar | chaos-corona.com
Educational Content Creator | contact us