ydrive / EasySynth

Unreal Engine plugin for easy creation of synthetic image datasets
MIT License
181 stars 31 forks source link

how to get a better anti-aliasing? #61

Open noelhumane opened 1 year ago

noelhumane commented 1 year ago

Hi Nikola!

I just start using your plugin and it is amazing!

I have big issues with anti-aliasing (see attached image). Switching to different type of AA didn't help. Do you have any suggestion to get a better AA? (like adding the AA option in the Movie Render Queue settings) ? Thanks!

Noel.

test_01 0005

UE 5.0, 5.1 Windows 11 pro RTX 4090

NikolaJov96 commented 1 year ago

Hi @noelhumane,

Is this a semantic image? Is AA working well on color images?

If the answers are yes and yes, then this is intended. Semantic images should only contain colors that represent defined semantic classes. If AA was enabled, various blended colors that do not match any semantic class would appear on object edges.

Edited comment:

AA in color images comes from the usage of the PostProcessInput inside the color image post-process material. Semantic images use a different post-process material in order to extract the exact base color of the pixel, which implicitly disables AA.

image

Hope this helps!

noelhumane commented 1 year ago

Hi Nikola, Thanks for your quick reply. I noticed the AA issue on my rgb and depth renders (see attached image). Segmentation is perfect (no aa)

aa_issue

I think that AA is defined in the project settings and could be overwritten by the render settings in the MRQ. Usually, to get a smoother aa, I adjust the aa values and method in the render setting tab. Do you know a way to do the same thing in EasySynth?

Screenshot 05-26-2023 10 19 25

Thank you!!

NikolaJov96 commented 1 year ago

Hi @noelhumane,

Yeah, that is a pretty bad RGB result. I can reproduce a similar effect using the default project AA setting (FXAA). When changing the AA method in Project Settings/Engine/Rendering/Anti-Aliasing Method, I get different RGB outputs (no need to tweak the rendering config). I get the best results when set to temporal AA (TAA), but I just noticed that is only true if the camera is moving at least a little bit. If the camera is stationary, TAA has little effect, since it utilizes the difference between previous frames to generate AA. Do you get different outputs depending on the project AA setting? Is your camera stationary? This was quite an issue for us until we found this TAA trick.

Regarding depth, it is also intentionally not anti-aliased. Otherwise, it would interpolate a surface between separate objects that happen to be one in front of another in the scene.

noelhumane commented 1 year ago

Hi @NikolaJov96, Thank you for looking into this!

Yes, my camera is not moving. I did some test with the 4 different AA available in UE5. I think that, for my project, the best "looking" one is TSR even if my camera is stationary (no temporal estimation). AA_compared