Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: mac_bean on 2024-05-17, 12:43:23

Title: Displacement map rendered jagged
Post by: mac_bean on 2024-05-17, 12:43:23
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?
Title: Re: Displacement map rendered jagged
Post by: lollolo on 2024-05-17, 14:36:07
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?
Title: Re: Displacement map rendered jagged
Post by: mac_bean on 2024-05-17, 14:46:49
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.
Title: Re: Displacement map rendered jagged
Post by: Nejc Kilar on 2024-05-20, 13:10:58
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?
Title: Re: Displacement map rendered jagged
Post by: mac_bean on 2024-05-20, 15:46:55
It's just an 8 bit images im using as displacement map.

Title: Re: Displacement map rendered jagged
Post by: Nejc Kilar on 2024-05-21, 11:22:18
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.
Title: Re: Displacement map rendered jagged
Post by: romullus on 2024-05-21, 14:58:25
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.
Title: Re: Displacement map rendered jagged
Post by: mac_bean on 2024-05-21, 15:06:04
Awesome, thanks a lot @romullus! This helped 💪🏻
Title: Re: Displacement map rendered jagged
Post by: romullus on 2024-05-21, 16:23:24
Glad to help!
Title: Re: Displacement map rendered jagged
Post by: Nejc Kilar on 2024-05-22, 15:18:05
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.