View on GitHub

RayScale - Ray Tracer

Microservices based ray tracer designed to run in containers for scaled & batch operation

RayScale

RayScale is a network distributed 3D graphics renderer based on ray tracing. Written in Node.js, RayScale is designed for scaling out using containers. The objective of RayScale as a project is to demonstrate several points:

What Is Ray Tracing

In computer graphics, ray tracing is a rendering technique for generating an image by tracing the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects. The technique is capable of producing a very high degree of visual realism, usually higher than that of typical polygon based scanline rendering methods, but at a greater computational cost.

Ray Tracing Features

It is not the goal of this project to create a completely fully featured ray tracer, as the scope of that is almost limitless. RayScale currently provides:

Sample Images

These are some sample images rendered with RayScale

Core Components (Microservices)

RayScale is comprised of two separate microservices, the Controller and the Tracers. Both are written in Node.js using TypeScript, and all interaction to/from these services is via REST API (using Express).

RayScale is intended to be run with a single Controller and one or more Tracers (either on the same machine as the controller (each on different TCP ports) or elsewhere on the network). Tracers can be started & stopped at any point, more added etc. and the Controller keeps track of tracers via health checks much like a network load balancer.

Basic System Architecture

diagram

Controller

Acts as control point and main interface with RayScale. It provides the API and Web UI for submitting jobs. It also coordinates the Tracers, keeps tracks on which tracers are online etc. The Controller splits up jobs into tasks and sends them to Tracers, and also reassembles & saves the results as they are sent back

๐Ÿ“˜ Controller documentation

Tracer

Renders and ray traces tasks given to it via the Controller. Each Tracer registers itself with the Controller on startup. The Tracer carries out scene parsing and also the work of actually computing the ray tracing algorithm of the task it has been given. Once completed, the results are POSTed back to the controller as a binary buffer of image data

๐Ÿ“˜ Tracer documentation

Web UI

The Controller provides a simple web UI, available at http://<controler-addres>:<port>/ui. The UI allows for:

Objects & Terms

As well as Controller & Tracer RayScale has several named objects and concepts which itโ€™s worth understanding:

Running RayScale

As RayScale uses Node.js and is also containerised there are numerous ways you can run RayScale, here are a few that have been tried tested:

๐Ÿ“˜ Full Docs - Running & Deploying RayScale

Scene Definition Language

The way Scenes are defined is in YAML, thereโ€™s

๐Ÿ“˜ Full Docs - Job & Scene Definition Reference

Limitations and Design Constraints

These constraints are either by design or known issues