Moiré / banding effect on cloth/fabric

Started by KlaasK, August 31, 2018, 05:44:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KlaasK

Hello everyone,

I have a problem with rendering cloth/fabric: it always generates some kind of Moiré or banding-effect.
I know how the moiré effect works and why it generates in my renderings, I just can't find a way of removing it.
It's not just my computer screen, it's the image itself, even at 100% scale.

I tried:
- rendering at large resolutions (5000px)
- Long render times (30 mins on interior mode)
- Custom control with high settings & anti-aliasing on 8x
- Removing it in Photoshop - not really a succes

Who has experience on cloth materials or knows how to fix the moiré-effect?
It would really help me!

P.s. see attached image

Regards,
KlaasK

RRIS

You'd have to wonder how useful the map is at that size if moire becomes a problem. I'd try upscaling the texturemap and bring down antialiasing to keep rendertimes acceptable.

KlaasK

Thanks for your reply RRIS.

In my opinion, upscaling the texture looks unrealistic on the matress (too coarse).
Completely removing the texture also doesn't look realistic in my eyes.
For now i'm just using white plastic with 0,5 roughness and bump map but it's not perfect..

Will Gibbons

This is really difficult. I once addressed this by rendering at 10K, bumping AA and scaling down. I know, unfortunate, but a challenge that's fairly unavoidable.

Lenio

Hello KlaasK, just came across your post while having a similar issue -- I found that by turning on the camera's depth of field it all but removed the moire effect, at least in my situation (rendering a window shade's fabric when in the rolled up state). If you haven't found another solution yet, it might help you.

-Lenio

mattjgerard

The DoF will work as it is adding an ever so small bit of blur to the texture which breaks up the sharp edges that cause the moire. This is an age old trick in video if the interviewee's tie or shirt had to small of a crosshatch pattern or something, and it would moire on the monitor. Long standing visual arguments between the DP (his face is in focus, its not my problem) to wardrobe (he picked the tie, its his favorite and he's the CEO of the company being interviewed) to the director (fix it in post), so bump the focus ring and its gone. Poor DP always lost that battle. Problem is that once the moire is in the video, adding blur in post wouldn't get rid of it.

So, adding a minute amount of blur helps the problem, I wonder if the Pixel Blur option in the custom control could be used to manage the moire? Also, this would be another plug for the inclusion of a gaussian blur node or option in the MatGraph that one could plug the texture into?

KlaasK

@Lenio and @mattjgerard,

I tried the DoF-trick and for now it seems like the best solution! (see attached image, both rendered at ~115 samples).
It does not remove moire completely, but it gets greatly reduced..

Blurring in PS does absolutely not work, it will ruin the render.

I also tried to render custom control with very high anti-aliasing and pixel blur, but that results in excessive render times, even on 32-core CPU.

For now I'm using the DoF-trick as the best option, thanks all!

mattjgerard

You are correct, blurring in PS will not work as the moire is already in the image. The goal is to try to get rid of that fine detail before the render bakes it in.
Its a fine line, and one of the problems that need to be solved on a case by case basis. Glad you are making some headway!

andy.engelkemier

Have you considered blurring the texture Before applying it? Moire is caused by sampling contrasting colors. It happens in real life with just your eyes, so it's just an optical phenomenon that can't really be avoided. For those that have never experienced it in the physical world, it's because it's not incredibly common. Large, long, straight chain link fences or spaced out screen doors is one place you see it, just as an example.

It will be less likely if the neighboring pixels don't have much contrast. And, well yeah, you get less texture in your image. But one idea is to create  multi-material to use two different textures. One is the existing, the other is the blurred enough to not have that effect. Then you can use a nice soft brush to paint a layer mask to reveal the blurred version where the moire patterns appear.

Increasing sampling and size enough to remove it will likely increase rendering time that exceed this method quite a bit. Sometimes just doing more renders is faster.

I know, most keyshot users aren't about that. But I don't even remember a time, at this point, that I produced a final render in less than 3 completely separate renders. Usually more. But that's mostly because of how keyshot treats reflections, shadows, and refraction alpha.