Press keys 0 to 9 to control the number of samples per pixel:
0 ➡ 20, 1 ➡ 21, 2 ➡ 22, ... 9 ➡ 29
Samples Per Pixel: 1
FPS: 0
WebGPU Status: 😰 ...
The source code of this toy could be found in my GitHub repository
In this toy, I was just experimenting with generating pseudo-random numbers inside the fragment shader. I eventually settled on using the xorshift algorithm.
Each pixel/fragment has a different PRNG for which the seed is a mix of the fragment coordinates and a counter that is incremented for each frame by the shader.
The fragment shader then uses the resulting seed to generate each pseudo random sample. It averages all the generated samples to output the final fragment color.