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 [Elkoura et al. 2019]. Both UsdPreviewSurface and MaterialX [Smythe et al. 2019] material network nodes are supported.
Gatling features a BVH builder with binned SAH [Wald 2007], spatial splits [Stich et al. 2009], SAH-preserving widening to nodes of 8 childs, compression, and an efficient traversal kernel [Ylitie et al. 2017]. Complex BSDFs like the Autodesk Standard Surface and the Disney BRDF are supported and importance sampled.
Build
The following is required:
- CMake 3.11+
- C11 compiler and C++14 compiler
- Vulkan SDK
- USD 21.08 with MaterialX support
- MDL SDK 2021.0.1 binaries
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=
\
-DMDL_ROOT=
\
-DCMAKE_INSTALL_PREFIX=
/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
DXC
On Windows, Microsoft's DirectX Shader Compiler (DXC) can be used instead of Khronos's glslang. This allows for validation of the generated HLSL shader.
Download the DXC June 2021 binaries and set -DDXC_ROOT
in the CMake generation phase to point to the unpacked folder. You can switch between both shader compilers using the -DGATLING_USE_DXC
option.
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
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
Basic texturing is the next important feature. After that, support for MDL materials will be considered.
Further Reading
Smythe et al. 2019
Doug Smythe, Jonathan Stone, Davide Pesare, Henrik Edström. 2019. MaterialX: An Open Standard for Network-Based CG Object Looks. ASWF Open Source Day SIGGRAPH 2019. Retrieved October 25, 2021 from https://www.materialx.org/assets/MaterialX_Sig2019_BOF_slides.pdf.
Elkoura et al. 2019
George Elkoura, Sebastian Grassia, Sunya Boonyatera, Alex Mohr, Pol Jeremias-Vila, and Matt Kuruc. 2019. A deep dive into universal scene description and hydra. In ACM SIGGRAPH 2019 Courses (SIGGRAPH '19). Association for Computing Machinery, New York, NY, USA, Article 1, 1–48. DOI:10.1145/3305366.3328033
Ylitie et al. 2017
Henri Ylitie, Tero Karras, and Samuli Laine. 2017. Efficient incoherent ray traversal on GPUs through compressed wide BVHs. In Proceedings of High Performance Graphics (HPG ’17). Association for Computing Machinery, New York, NY, USA, Article 4, 1–13. DOI:10.1145/3105762.3105773
Stich et al. 2009
Stich, Martin & Friedrich, Heiko & Dietrich, Andreas. 2009. Spatial splits in bounding volume hierarchies. In Proceedings of the Conference on High Performance Graphics 2009 (HPG ’09). Association for Computing Machinery, New York, NY, USA, 7–13. DOI:10.1145/1572769.1572771
Wald 2007
Ingo Wald. 2007. On fast Construction of SAH-based Bounding Volume Hierarchies. In Proceedings of the 2007 IEEE Symposium on Interactive Ray Tracing (RT '07). IEEE Computer Society, USA, 33–40. DOI:10.1109/RT.2007.4342588
License
Copyright (C) 2021 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
.