three-gpu-pathtracer icon indicating copy to clipboard operation
three-gpu-pathtracer copied to clipboard

Allow disabling jitter

Open Codezigineer opened this issue 10 months ago • 5 comments

Jitter is what makes raytracers grainy, by shooting pixels at slightly different directions than normal. This allows disabling it, for tasks that don't need it.

Codezigineer avatar Apr 18 '24 21:04 Codezigineer

Hello! Thanks for the contribution.

Jitter is what makes raytracers grainy, by shooting pixels at slightly different directions than normal. This allows disabling it, for tasks that don't need it.

Can you provide some screenshots of cases where this disabling jitter helps with the final image and how? Jitter is effectively performing antialiasing - it can contribute to the graininess but every ray bounce is scattered in a random direction regardless of this perpixel jitter which is primarily where the graininess should be coming from.

gkjohnson avatar Apr 19 '24 20:04 gkjohnson

https://www.shadertoy.com/view/4ljGRd is an example. Some tasks don't need jitter. Not only that, FXAA can run over raytracing without any major impact. Here's an example of FXAA:

https://github.com/gkjohnson/three-gpu-pathtracer/assets/53050996/cb1a62f1-1fe5-4be8-af1e-c009bcbbed82

Codezigineer avatar Apr 20 '24 01:04 Codezigineer

https://www.shadertoy.com/view/4ljGRd is an example. Some tasks don't need jitter.

This is a very different kind of ray tracer, though. There is no randomness used anywhere and all diffuse lighting is calculated analytically rather than stochastically with random rays. Removing the pixel jitter from this project shouldn't result in the same kind of result.

What's the motivation for this PR? Are you using this for a project and need this change? Do you have screenshots showing what a render looks like before and after so I can understand how disabling the jitter affects the image?

gkjohnson avatar Apr 21 '24 00:04 gkjohnson

I made this for a project I am working on, that I'm specifically using raytracing because RectArealights don't have shadows. Yes that is the only reason.

Codezigineer avatar Apr 21 '24 06:04 Codezigineer

Got it - without a demonstration showing the improvements that this PR will bring to the project I won't be able to merge it. I don't think this will address any of the graininess issues in the image generation due to random sampling.

gkjohnson avatar Apr 24 '24 01:04 gkjohnson

Closing this until it can be shown that there's an improvement to image quality.

gkjohnson avatar Apr 28 '24 22:04 gkjohnson