compute-toys / compute.toys

Website source code
https://compute.toys/
MIT License
89 stars 8 forks source link

Bug: blue-noise in wrong gamma space #70

Open AllenPocketGamer opened 10 months ago

AllenPocketGamer commented 10 months ago

I found a bug in compute.toys (it seems);

The texture provided in compute.toys, blue-noise (the last one), is not stored in linear space but has been mapped to gamma space;

Because the distribution of blue-noise between 0.0 ~ 1.0 is unbiased, the number of pixels >0.5 should be roughly equal to the number of pixels <=0.5;

However, the blue-noise provided by compute.toys obviously does not conform, as shown in the picture:

image

The left side is <= 0.5, the right side is >=0.5;

Only by applying a gamma correction of pow(blue_noise, 1 / 2.2) can the correct image be obtained;

So I suspect that an incorrect gamma mapping, pow(color, 2.2), was added when generating the blue-noise.

__THE BUG SHOWCASE__: https://compute.toys/view/928
munrocket commented 9 months ago

Submit pull request please 🙏