szellmann / visionaray

A C++-based, cross platform ray tracing library
https://vis.uni-koeln.de/visionaray.html
MIT License
431 stars 37 forks source link
c-plus-plus cuda path-tracing ray-tracing ray-tracing-template-library simd template-library

Visionaray

A C++ based, cross platform ray tracing library

Getting Visionaray

The Visionaray git repository can be cloned using the following commands:

git clone --recursive https://github.com/szellmann/visionaray.git

An existing working copy can be updated using the following commands:

git pull
git submodule sync
git submodule update --init --recursive

Build requirements

To compile the viewer and the examples, the following additional packages are needed or recommended:

Building the Visionaray library and viewer

Linux and Mac OS X

It is strongly recommended to build Visionaray in release mode, as the source code relies heavily on function inlining by the compiler, and executables may be extremely slow without that optimization. It is also recommended to supply an architecture flag that corresponds to the CPU architecture you are targeting.

cd visionaray
mkdir build
cd build

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native"
make
make install

Headers, libraries and binaries will then be located in the standard install path of your operating system (usually /usr/local).

See the Getting Started Guide and the Troubleshooting section in the Wiki for further information.

Windows

The "CMake -> Visual Studio Solution" code path is tested from time to time. Visionaray is primarily developed on Linux and Mac OS, though, so you may encounter the occasional "Commit XY breaks builds on Windows" etc. On Windows, use CMake to generate a Visual Studio solution file that can be loaded by the IDE, or compiled on the command line using msbuild.exe.

Visionaray Viewer

The viewer is optional but built by default. It supports a number of 3D file formats. The viewer is primarily targeted at developers, as a tool for debugging and testing. Use the CMake variable VSNRAY_ENABLE_VIEWER to exclude the viewer from building. With a standard install, the viewer can be invoked using the following command:

vsnray-viewer <file>

Supported file formats are wavefront .obj, .ply, and `.pbrt.

Documentation

Documentation can be found in the Wiki.

Source Code Organization

Library

Visionaray is a template library, so that most algorithms are implemented in header files located under include/visionaray.

Visionaray can optionally interoperate with graphics and GPGPU APIs. Interoperability with the respective libraries is compiled into the Visionaray library. When GPU interoperability isn't required, chances are that you don't need to link with Visionaray at all, but can use it as a header only library.

Files in detail/ subfolders are not part of the public API. Code in namespace detail contains private implementation. Template class implementations go into files ending with .inl, which are included at the bottom of the public interface header file.

Applications

Visionaray comes with a viewer (see above) and a set of examples. Those can be found in

Common library

The viewer and the examples link with the Visionaray-common library that provides functionality such as windowing classes or mouse interaction. The Visionaray-common library is not part of the public API and interfaces may change between releases.

Third-party libraries

The viewer and the examples use the following third-party libraries (the Visionaray library can be built without these dependencies):

Revision History

See the file CHANGELOG.md for updates on feature addition and removals, bug fixes and general changes.

Citation

If you use Visionaray or some of its code for your scientific project, please cite this paper:

@inproceedings{zellmann:visionaray,
author = {Zellmann, Stefan and Wickeroth, Daniel and Lang, Ulrich},
title = {Visionaray: A Cross-Platform Ray Tracing Template Library},
booktitle = {2017 IEEE 10th Workshop on Software Engineering and Architectures for Realtime Interactive Systems (SEARIS)},
year = {2017},
publisher = {IEEE},
pages = {1-8},
}

License

Visionaray is licensed under the MIT License (MIT)