GPUOpen-LibrariesAndSDKs / RadeonProRender-Baikal

MIT License
334 stars 78 forks source link

# Summary

Baikal initiative has been started as a sample application demonstrating the usage of AMD® RadeonRays intersection engine, but evolved into a fully functional rendering engine aimed at graphics researchers, educational institutions and open-source enthusiasts in general.

Baikal is fast and efficient GPU-based global illumination renderer implemented using OpenCL and relying on AMD® RadeonRays intersection engine. It is cross-platform and vendor independent. The only requirement it imposes on the hardware is OpenCL 1.2 support. Baikal maintains high level of performance across all vendors, but it is specifically optimized for AMD® GPUs and APUs.

Image

Build

System requirements

The renderer is cross-platform and the following compilers are supported:

The following packages are required to build the renderer:

Build instructions

Baikal is using git submodules, use the following command line to recursively clone the repo including submodules:

git clone --recursive https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRender-Baikal.git

Windows

cmake -G "Visual Studio 14 2015 Win64"

OSX

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install homebrew/science/openimageio

brew install glfw3

mkdir build

cd build

cmake -DCMAKE_BUILD_TYPE=<Release or Debug> ..

make

Linux(Ubuntu)

sudo apt-get install g++

sudo apt-get install libopenimageio-dev libglew-dev libglfw3-dev

mkdir build

cd build

cmake -DCMAKE_BUILD_TYPE=<Release ro Debug> ..

make

Options

Available premake options:

Run

Run Baikal standalone app

Possible command line args:

The list of supported texture formats:

You can download additional test scenes from RadeonProRender-Tests. Once extracted, you can load e.g. the Classroom example like this:

../build/bin/BaikalStandalone -p /path/to/extracted/folder/Classroom/ -f classroom.obj

The path can be absolute or relative to BaikalStandalone.

Run BaikalDataGenerator

Mandatory command line args:

Possible command line args:

Run unit tests

Unit tests are producing test images into BaikalTest/OutputImages and compare them to reference images expected to be at BaikalTest/ReferenceImages.

Possible command line args:

Hardware support

The renderer has been tested on the following hardware and OSes:

Linux

Windows

OSX

Known Issues

Windows

AMD: export $AMDAPPSDKROOT=<SDK_PATH> NVIDIA: export $CUDA_PATH=<SDK_PATH>


Features

Being more of an experimental renderer, than a production rendering solution, Baikal still maintains a good set of features.

Light transport

Baikal is essentially a biased path-tracer, however it is highly configurable and might be configured to run ray-tracing (sampling multiple light sources at once) instead of pure path tracing. Implementation of bidirectional path tracing solver is currently work in progress.

Geometry

To maintain high efficiency Baikal only supports triangle meshes and instances. However quads can be used while working with Baikal via RadeonPro Render API, since API layer is capable of pre-tessellating quads and passing triangle meshes down to Baikal. The size of triangle meshes is only limited by available GPU memory. Instancing can be used to greatly reduce memory footprint by reusing geometric data and acceleration structures.

Internally meshes and instances are represented using Shape interface. If used through RPR API meshes and instances are represented by rpr_shape opaque pointer type.

Materials

Baikal supports compound materials assembled from the following building blocks:

Each of these building blocks can have:

Building blocks are combined together using one of the following blend modes:

Materials can use RGBA uint8, float16 or float32 uncompressed textures for albedos, weights and normal/bump maps.

Internally materials are represented as a subclasses of Material class: SingleBxdf for individual components and MultiBxdf for compound materials. At RPR API level they are represented by rpr_material_node opaque pointer. Note, that not all RPR materials are currently supported by Baikal (see section below on that).

Lights

Baikal supports the following types of lights:

All the lights are internally represented by different subclasses of Light interface. If being used via RPR API, lights are represented by rpr_light opaque pointer.

Sampling

Baikal can use one of the following samplers for random points/directions generation:

In addition Baikal is using multiple importance sampling to reduce variance for both direct and indirect illumination. It also applies Russian roulette to terminate low-probability paths.

GPU execution model

Baikal is based on split-kernel architecture to avoid VGPR occupancy bottlenecks and broadly uses GPU-optimized parallel primitives to restructure the work to better fit massively parallel GPU architecture. First, the renderer is designed for progressive preview and has synchronous nature. Meaning it has Render function which is getting called by the user in the loop and every call to this function adds a single sample to each pixel refining the image. This model allows to keep the latency under control and manipulate the scene and the camera while doing rendering. Inside the Render function each OpenCL work item is assigned a single pixel, but as iterations(bounces) progress, less and less rays remain alive, so Render function compacts the work to minimize GPU thread divergence.

Image

Performance

In terms of latency the renderer is capable of maintaining high FPS while doing progressive rendering for moderately sized scenes. For example on the following “Science Fiction” scene (775K triangles) Baikal is producing 15 FPS in full HD resolution on R9 Nano card.

In terms of intersection throughput performance is determined by underlying RadeonRays engine. Several examples using “Science Fiction” scene on R9 Fury X:

Image “Science Fiction” scene is a courtesy of Juan Carlos Silva, 3drender.com.

Primary rays: 773Mrays/s (2.68ms)

Secondary rays: 285Mrays/s (7.27ms)

Shadow rays: 1109Mrays/s (1.87ms)

Image “Science Fiction” scene is a courtesy of Juan Carlos Silva, 3drender.com.

Primary rays: 470Mrays/s (4.42ms)

Secondary rays: 195Mrays/s (10.66ms)

Shadow rays: 800Mrays/s (2.59ms)

Image “Science Fiction” scene is a courtesy of Juan Carlos Silva, 3drender.com.

Primary rays: 562Mrays/s (3.69ms)

Secondary rays: 270Mrays/s (7.67ms)

Shadow rays: 1219Mrays/s (1.7ms)

RadeonPro Render API support

We provide an implementation of RPR API with Baikal, which is still in an early state of development, so many features available in internal RPR core are not available in open-source back end. The list of unsupported features follow: