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.
gatling implements complex BSDFs like Autodesk's Standard Surface and the glTF shading model via MaterialX's MDL code generation backend. The MDL SDK is then used to generate evaluation and importance sampling functions, which are emitted as GLSL code. This code is compiled to SPIR-V and executed via Vulkan.
* hardware ray tracing is required. MacOS will be supported in the future.
Build
You need to
- install the Vulkan SDK
- download the MDL SDK 2022.0 binaries
- build USD 22.08 with MaterialX support
- have NASM 2.13+ or YASM 1.2.0+ in your PATH
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: HWRT, texture support, 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.

