realism-effects icon indicating copy to clipboard operation
realism-effects copied to clipboard

Reduce trailing effect for a larger scene

Open SudevKiyadaTR opened this issue 1 year ago • 1 comments

Although, am not using any environment map for the scene, I quite love the way SSGI lifts up the scene. Is there a way to avoid the trailing effect at longer distance?

Am using this settings as option

options = {
  "distance": 1.5,
  "thickness": 20,
  "autoThickness": false,
  "maxRoughness": 1,
  "blend": 0.95,
  "denoiseIterations": 1,
  "denoiseKernel": 3,
  "denoiseDiffuse": 20,
  "denoiseSpecular": 0,
  "depthPhi": 14.022,
  "normalPhi": 0,
  "roughnessPhi": 0,
  "envBlur": 0.55,
  "importanceSampling": true,
  "directLightMultiplier": 1,
  "maxEnvLuminance": 50,
  "steps": 8,
  "refineSteps": 1,
  "spp": 3,
  "resolutionScale": 2,
  "missedRays": false
};

https://user-images.githubusercontent.com/111417465/226257265-01a9946b-892d-4545-86eb-d042c89f2477.mp4

Screenshot 2023-03-20 at 11 17 24 AM

SudevKiyadaTR avatar Mar 20 '23 05:03 SudevKiyadaTR

This seems to be an issue with the depthDistance and worldDistance being too low in the temporal reprojection pass (they are defined here: https://github.com/0beqz/realism-effects/blob/main/src/temporal-reproject/TemporalReprojectPass.js#L17). I think at that distance there are issues with precision so that the temporal reprojection pass constantly sees disocclusions there (due to a too high depth/distance difference between the current pixel and the reprojected pixel) which causes that flickering.

You can try to set depthDistance and worldDistance to higher values when passing the options when creating the SSGIEffect object. I'll look into it, maybe I can make distance play a role to account for the precision loss at higher distances.

0beqz avatar Mar 27 '23 20:03 0beqz