Home avatar

Ilia thoughts

Thoughts on data analytics, software development, and other things.

Updated on My Ray Tracer

My little ray tracer project has had a few improvements since my last post at the start of the year so I thought it would be good to do a new post on the progress. I have mainly been working on a native version using SDL2 for user input (moving the camera) and presentation. However the web version in my previous post was simply returning a list of RGB values which I would then draw directly to the canvas, and using the left-right buttons for input. Then I discovered that Emscripten has a port of SDL2 so I could use the same approach for the web version as for the native one.

Ray Tracer

My implementation of Chapters 1-15 of The Ray Tracer Challenge book by Jamis Buck. Implemented in C++ and compiled to WebAssembly.

Just select a scene description from the dropdown (or enter your own according to the style used in the book) and click “go!” to generate the render.

Let me know what you think. Code is available on my Github. Let me know if you have any tips for me.

EDIT: If it doesn’t run, please clear your cache. I messed up the http headers the first time I pushed this and the wasm module cache never expires… so if you ran the site previously it won’t update.