BrainsOnBoard / compound-ray

A hardware-accellerated compound eye perspective renderer
https://brainsonboard.github.io/compound-ray/
MIT License
11 stars 5 forks source link

CompoundRay: A hardware-accellerated compound eye perspective renderer

CompoundRay is a hardware-accellerated compound eye perspective rendering system and API built on top of the NVidia OptiX raytracing engine.

Building

To build the software you must first install NVidia CUDA and the Nvidia OptiX framework. Once these have been installed, follow the build instructions in compound-ray/build/<make or ninja>/readme.txt

This software was built and tested first on Manjaro Linux (so the build rules should still work under this), and then on Ubuntu 20.04.2 LTS and Ubuntu 20.04.3 LTS. It uses OptiX SDK 7.2.0 or higher, and has been tested on 7.2.0 and 7.3.0. It requires Cuda version 5.0 or higher and has been tested on version 11.5. The Make build path is preferred over the ninja build path as it has been more thoroughly tested.

In order for the OptiX SDK to work, you will need a new version of the Nvidia graphics drivers (460 or higher is recommended).

An in-depth build guide under Ubuntu 20.04 can be found here.

If you wish to build under Windows, limited support can be found here.

Creating Environments

The eye renderer ingests glTF format files with extra tags appended to the "extras" tag within any given camera's definition. An example of this can be seen in compound-ray/data/test-scene.gltf on line 229, in which a camera is given the additional properties of being compound with the "compound-eye" : "true" property, the projection schema selected with the "compound-projection" : "spherical_orientationwise" property, and a link to the relative .eye eye descriptor file (test.eye) added with the "compound-structure" : "test.eye" property. These properties can be set manually by editing the .glTF file format (which is in human-readable json, or edited directly on each object (and camera) using the properties panel in Blender3D.

Sky shaders (as are all shaders) are pulled in from shaders.cu in libEyeRenderer3. Currently there is one sky shader available, simple_sky, which can be added as an extra property on the scene itself (see line 19 of the natural environment stand-in gltf file).

Eye structure files can be made as CSVs with the .eye file extension, contents defined here.

Using the Renderer

A quick way to validate your model is to load it using the stand-alone rendering tool, which will be placed into the compound-ray/build/<ninja or make>/bin folder. Running this tool with the -h switch will give instructions to usage.

However, the more efficient way of using the tool is by using the underlying API directly. This is best achieved through use of Python and the ctypes binding library - the primary example of using this (along with the bundled python eyeRendererHelperFunctions) can be found here, although other useful examples (including those from the CompoundRay paper can be found in the compound-ray/python-examples folder, or through the minimumSampleRateFinder tool script.