Raymarching with Refraction


A little hacky but working. The sky is actually just a hollow textured sphere, which unfortunately required me to bump the iteration count on the march up to avoid getting a seam on one side (should probably have just used a cubemap).

TODO: Caustics for the shadows, and reworking the hacks into something more robust (e.g. in the current implementation transparent objects will occlude other transparent objects).

NOTE: It will render at the size of your browser window! If you have performance issues, try resizing your browser.

Play online here