Luaray

An experimental programmatic raytracer with Lua

Luaray is implemented in C++ with scenes described in the Lua scripting language. It's an experimental raytracer and a learning project; experimental in the sense that the author experiments with it, not that it has a novel approach to tracing rays. Backward ray-tracing is used to determine object visibility and shading, as described by Turner Whitted in his 1980 paper "An Improved Illumination Model for Shaded Display" . Orthographic projection is used when casting rays.

Scenes written in Lua look like the following:

        s = Scene()
        c = Camera(1280, 800, s)

        sphere = Sphere(Vec3(600, 600, 10), Color(4, 10, 1), 50)
        light = light(Vec3(300, 300, 5), 10)

        s:add_object(sphere)
        s:add_light(light)

        c:render()
        

Scenes are written this way so that multiple cameras can be defined, and multiple images can be rendered from different vantage points in a single scene. Some functionality is still being implemented, and this raytracer is a work in progress.