geefr / WebGL-Ray-Tracing

Simplified ray tracing renderer implemented in WebGL2 (glsl 300 es)
Other
3 stars 1 forks source link
opengl-es raytracing webgl2

WebGL2 Ray Tracing - 'realtime' ray tracing in a browser

This is a fairly basic (and currently proof of concept) ray tracer written in an opengl fragment shader.

Shader is hosted by a renderer written in javascript (or C++ in the prototypes dir).

A live version should be available on my website

Before viewing the page I recommend:

Current status / next steps

I've got this to a point where it could be useful, but mainly it's a side-effect of me learning the concepts. Watch this space if you like but I don't expect rapid development on this.

General TODO list:

Primitives

Currently only spheres and planes are supported, but the interfaces should be extensible enough for new functions.

Shader Interface

The shader setup is fairly messy and inefficient at the moment, but boils down to

Performance / Hardware supported

So far testing has been limited, mostly performed on Linux, NVidia Quadro M2000, running the proprietary drivers. A rough benchmark here is 25-30fps for an 800x800 pixel window. Performance is slightly lower in the browser, so the browser version is set to render at a lower resolution.

Some testing was performed on an Intel 530, but the performance is not acceptable at the moment (Will need heavy resolution scaling / a small canvas)

Thanks / Credits

Various sources were used to implement this, but a large credit goes to the book "The Ray Tracer Challenge" by Jamis Buck. I didn't follow it that closely in the end but it's well written, and covers the concepts in a clear manner.