gatling icon indicating copy to clipboard operation
gatling copied to clipboard

Hydra-enabled GPU path tracer that supports MaterialX and MDL

gatling

1965 Ford Mustang Fastback from Wire Wheels Club, rendered in Gatling.

About

This is my toy path tracer I work on in my free time.

It is exposed as a Hydra render delegate and comes with a standalone that accepts Universal Scene Description (USD) files. It is cross-platform, GPU-accelerated, and supports MaterialX, MDL and UsdPreviewSurface materials.

Technically, gatling uses the MDL code generation backend of the MaterialX project to support and importance-sample complex BSDFs like the Autodesk Standard Surface or the glTF shading model. The MDL SDK then generates HLSL code which is compiled to SPIR-V for use in Vulkan. A compressed 8-wide BVH is used to speed up rendering, but hardware ray tracing will be used in the future.

Build

You need to

Note: EXR export requires building USD with OpenImageIO support.

Do a recursive clone of the repository and set up a build folder:

git clone https://github.com/pablode/gatling --recursive
mkdir gatling/build && cd gatling/build

Pass following parameters in the CMake generation phase:

cmake .. -Wno-dev \
         -DUSD_ROOT=<USD_INSTALL_DIR> \
         -DMDL_ROOT=<MDL_INSTALL_DIR> \
         -DCMAKE_INSTALL_PREFIX=<USD_INSTALL_DIR>/plugin/usd
         -DCMAKE_BUILD_TYPE=Release

Note: If you're using MSVC, be sure to select a 64-bit generator.

Build the relevant targets and install the Hydra delegate to the USD plugin folder:

cmake --build . -j8 --target hdGatling gatling --config Release
cmake --install . --component hdGatling

Usage

Gatling can be used by every application which supports Hydra, either natively or through a plugin.

cekuhnen's Coffee Maker (CC-BY), slightly modified, rendered using Gatling inside Pixar's usdview tool.

A headless standalone is provided that accepts a USD file (.usd, .usda, .usdc, .usdz) as input. Make sure that there is a polygonal light source in the scene.

./bin/gatling <scene.usd> render.png \
    --image-width 1200 \
    --image-height 1200 \
    --spp 1024 \
    --max-bounces 8

Note: Disable the system's GPU watchdog or set an appropriate timeout value.

Outlook

Work in progress: texture support, material network patching, NEE/MIS.

License

Gatling is licensed under the GNU General Public License, as included in the LICENSE file.


    Copyright (C) 2019-2022 Pablo Delgado Krämer

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <https://www.gnu.org/licenses/>.

It contains code from the Ray Tracing Gems I book, which is MIT licensed and copyrighted:

  • Copyright 2019 NVIDIA Corporation

It contains code from the MDL SDK, which is BSD licensed and copyrighted:

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.