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

Investigate floating point averaging bias

Open gkjohnson opened this issue 3 years ago • 3 comments

https://twitter.com/BenHouston3D/status/1521962488807444481?t=gOGmOLpXPF55D4ihTdc9Ig&s=19

See banding in BG gradients

gkjohnson avatar May 04 '22 21:05 gkjohnson

If this is related to RGBA floating point packing, I think I have an idea how to solve this floating point precision issue.

munrocket avatar May 27 '22 21:05 munrocket

The issue is floating point precision and error resulting in artifacts like banding in gradients when performing math operations.

This three.js SSAA demo demonstrates the same kind of issue but with a fixed number of samples. The difference is that the pathtracer is performing a continuous average instead of fixed sample count.

gkjohnson avatar May 29 '22 04:05 gkjohnson

I think Kahan summation can help with this. The thought came to me the other day but is also noted here.

richardassar avatar Jun 15 '22 01:06 richardassar