This repository contains a Windows/CUDA/OptiX hair rendering codebase centered on path tracing for hair and several acceleration baselines and experiments.
It currently includes:
render_path_tracing: path tracing renderer, plus SHARC-style radiance caching extensions used for experiments in this reporender_nrc: neural radiance caching baselinerender_hair_msnn: Hair-MSNN baseline from the original paper- Python scripts for batch rendering, equal-time/equal-spp evaluation, and figure generation
The repository has been trimmed to keep only the curly and wWavy example scenes and the envmaps needed by those scenes.
Use this repo if you want to:
- render hair scenes interactively with OptiX
- run path tracing, NRC, Hair-MSNN, and SHARC-based variants
- reproduce figure-generation workflows in
scripts/ - extend the renderer for research experiments on hair multiple scattering
Important directories:
- cuda: CUDA kernels
- cuda_headers: CUDA-side headers and shared device code
- headers: host-side headers
- scenes: scene configs, hair assets, envmaps
- scripts: batch rendering and figure scripts
- tasks: generated task JSONs for scripted runs
- output: rendered EXR/PNG/JSON outputs
Main entry points:
Tested primarily on Windows with NVIDIA RTX GPUs.
- Windows 10/11
- Visual Studio 2019 or 2022 with C++ toolchain
- CMake 3.18+
- CUDA 12.1
- OptiX 7.4
- Recent NVIDIA driver
- GPU with RTX support
This project uses submodules and third-party dependencies under extern/.
Clone with submodules:
git clone --recursive <your-repo-url>
cd HairMSNN_code2If you already cloned without submodules:
git submodule update --init --recursivemkdir build
cd build
cmake ..
cmake --build . --config RelWithDebInfo --target render_path_tracing render_nrc render_hair_msnnBuilt executables will be under:
build/RelWithDebInfo/render_path_tracing.exebuild/RelWithDebInfo/render_nrc.exebuild/RelWithDebInfo/render_hair_msnn.exe
This trimmed repo keeps two hair scenes:
Main hair assets:
Included envmaps used by these scenes:
Some scene JSON files still contain absolute paths from the original local machine. Before running on a new machine, check these fields:
hair.geometrylights.environment.exrintegrator.image_outputintegrator.stats_outputtcnn.config- optional
surface.geometry
Typical files to edit:
Use repository-relative paths where possible.
.\build\RelWithDebInfo\render_path_tracing.exe scenes\curly\config.json.\build\RelWithDebInfo\render_nrc.exe scenes\curly\config.jsonThe MSNN renderer takes an extra integer beta argument:
.\build\RelWithDebInfo\render_hair_msnn.exe scenes\curly\config.json 5render_path_tracing.exe supports task mode:
.\build\RelWithDebInfo\render_path_tracing.exe --task tasks\some_task.jsonTask JSONs can override:
- scene
- spp
- output path
- PT parameters
- SHARC parameters
- snapshot times / snapshot spp
Many scripts under scripts generate and run these task files automatically.
Useful scripts in this repo:
- scripts/run_tasks.py: generic task runner
- scripts/run_beta_bounce_tasks.py: write/run beta comparison tasks
- scripts/run_beta_bounce_figure.py: compose beta comparison figures
- scripts/run_compare_methods.py: compare PT / NRC / MSNN / SHARC-style methods
- scripts/run_voxel_scale_and_jitter.py: voxel scale and jitter ablations
- scripts/run_equaltime_continuous_wwavy.py: continuous equal-time rendering on
wWavy - scripts/run_equalspp_continuous_wwavy.py: equal-spp evaluation on
wWavy - scripts/run_sharc_hair_tangent_ablation.py: ablation for tangent-aware SHARC query modes
Example:
python scripts\run_voxel_scale_and_jitter.pyExample task-based run:
python scripts\run_beta_bounce_tasks.py --mode write
python scripts\run_beta_bounce_tasks.py --mode run
python scripts\run_beta_bounce_figure.py --mode composerender_path_tracing in this repo contains SHARC-style hair caching experiments beyond plain path tracing. These controls are exposed through:
- the interactive UI under
SHARC Cache - task JSON fields under
"sharc"
Examples of configurable options:
- cache enable / update enable
- query bounce / max update bounces
- query jitter
- scene scale / log base / level bias
- hair tangent query mode
- tangent threshold / parallel scale / perp scale
- adjacent-level blending during resolve
Rendered images and batch outputs are typically written to:
- output
- scene-local paths set by
integrator.image_output
Task mode also writes metadata JSON next to EXR outputs.
Usually caused by stale absolute paths inside scene JSON files. Fix the paths in the scene configs.
Check lights.environment.exr in the scene JSON and confirm the referenced EXR exists locally.
Some scripts decide whether to skip work based on existing EXR/JSON outputs. If you want clean reruns, delete the specific outputs first or use the script's rerun flag if available.
This repo includes scene assets, envmaps, figures, and external research code. Generated outputs under output/ are ignored by Git but can still take a lot of local disk space.
See LICENSE.