Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
135 stars 2 forks source link

CTAA and TAA causes flicker artifacting in default cloud home #1752

Open Stellanora64 opened 5 months ago

Stellanora64 commented 5 months ago

Describe the bug?

When CTAA or TAA are selected the lamps in the default cloud home start too flicker. This likely affects other user's creations but this was the most prominent example that was also made by the resonite team.

To Reproduce

Go to the resonite default cloud home, enable CTAA or TAA and see the lamps start to flicker.

Expected behavior

There should be no artifacting/flickering.

Screenshots

Video: PHOTOSENSITIVITY WARNING (note the effect is worse in game)

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/91010433/0b7d86a6-21f4-4349-8e60-77eab4f691c6

Resonite Version Number

Beta 2024.4.17.1420

What Platforms does this occur on?

Windows

What headset if any do you use?

Desktop

Log Files

DESKTOP-F65B6FQ - 2024.4.17.1420 - 2024-04-18 17_31_05.log

Additional Context

No response

Reporters

Stellanora

Readun commented 5 months ago

I noticed that I have flickering/material issues with all new 3 of them sadly. TAA is the most prone while smaa is the least/rare. TAA specially when looking through invisible materials or shiny stuff, CTAA is doing it but not that much and SMAA very rarly. I think mostly on Material stacked stuff and even than, it appears to bug out after a while has passed.

lxw404 commented 5 months ago

This might be something to do with the order in which the antialiasing methods and scene are being computed. Specifically you can see this with any material that is stacked with the same Z offset as in the cloud home example shown above (Regardless of actual render order offset). Here is a basic cube example to demonstrate:

resrec:///U-LuxKitty/R-935A4427725F17161DDAD89BF566048BA0EC586ED77E0F4671EEC918A42B78BF

Notice that the OffsetFactor and OffsetUnits are the same for each material, and even though the SortingOrder are different per renderer, the flickering occurs. Adjusting either of the offsets will stop the flickering, but is not a complete solution to the problem as the SortingOrder should be respected even with postprocessing.

shiftyscales commented 5 months ago

Material stacking is not a supported feature and is on our list of things to avoid @Readun.

However, I investigated the lamp in the cloud home and found that the materials present are stacked on top of each other (but rather using separate mesh renderers which is something we have stated we do support) but there is no offset factor set on those materials, so I suspect that it is a content issue @AegisTheWolf @RyuviTheViali and @RueShejn could look into.

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/54213390/74ae5102-be5e-4431-b458-b15d36641ae8

By setting an offset factor of -1 on the overlapping materials, I was able to resolve this issue.

Seeking input from @Frooxius and @Geenz if this is something that could be fixed/addressed in the renderer/AA solutions more broadly?

After looking into it, I'm not certain why it doesn't z-fight in other contexts, e.g. in VR- I wonder if it's something to with driver level optimizations/hackery on the part of Nvidia?

Readun commented 5 months ago

I feel like there is more to it than just that. On last fridays meetup, people were sometimes seeing peoples eyes through their heads or had normal pictures taken by fingerphotos render through avatars or Inspectors. Interestingly it often helps to "reset" the AA, by switching back and forth.

Only FXAA and off having no issues so far.

shiftyscales commented 5 months ago

That is a separate issue caused by the TAA in VR. I tried looking into it on Friday but hadn't had time to make an issue for it yet, @Readun. In short, when enabling TAA (even just cycling to it) if a user then resizes themselves- the z-sorting messes up until they re-set the TAA on. That breakage persists until the user restarts.

If you could make a separate issue for that- please do.