Doing Tay Tracing in WebGL is kind of Painful.
As we know, doing ray tracing needs an index of the output image. Classic graphic API like OpenGL and WebGL doesn’t really support this. So there is a kind of cheating technic that we need to do is render a Quad with a texture of the whole scene on it. In this way, we are able to get the row and col index of the output image.
Implementation
You can adjust the way for render this image and increase the Sphere Count and Bounce limit by drag the slider on the panel.