Weird ghosting / duplication effect with R3F postprocessing N8AO

When I use perspective projection I get a weird ghosting / duplication (or offset) effect when using N8AO. This is not visible with an orthographic projection, but my guess is that this is because I am so far zoomed out that it’s not visible, because when I zoom out with the perspective camera the effect goes away (is hidden).

See screenshots.




This is caused by altering dpr on the Canvas (for example throttled by performance being lowered in the context of R3F’s PerformanceMonitor.

I can see why this happens, but if anyone has a solution to this, like if it’s possible to recalculate the n8ao map somehow, please let me know.

<Canvas dpr={dpr} ...>