pbrlab-hair.mp4
pbrlab
is well-verified(through brute force human verification and debugging) path tracing + PBR shading/rendering implementation in portable C++11.
pbrlab
is good for verifying your renderer and PBR shading.
- PrincipledBSDF
- with random-walk(brute force) pathtraced subsurface scattering.
- https://disney-animation.s3.amazonaws.com/uploads/production/publication_asset/153/asset/siggraph2016SSS.pdf
- https://disney-animation.s3.amazonaws.com/uploads/production/publication_asset/153/asset/siggraph2016SSS.pdf
- Extending the Disney BRDF to a BSDF with Integrated Subsurface Scattering https://blog.selfshadow.com/publications/s2015-shading-course/
- with random-walk(brute force) pathtraced subsurface scattering.
- (Principled) Hair BSDF
- Our Hair BSDF is based on Cycles(pbrt-v3) and applies the fix of pbrt-v3 bug https://github.com/mmp/pbrt-v3/pull/256/files
- Implements an improved robe evaluation method https://jo.dreggn.org/path-tracing-in-production/2018/index.html
- Cycles and Arnold compatible shading parameters.
- cmake
- C++11 or later compiler
- We recommend to use clang++ since g++ is slow to compile embree-portable
- Embree
- embree-portable is added as git submodule.
- OpenGL 3.x
- For GUI. CLI build is also available.
- Linux
- x64_64
- aarch64
- Windows 10 64bit
- arm64 macOS
- x86 macOS may compile.
Install clang recommended. Install OpenGL dev package(+ X11) required if you want to build GUI.
$ sudo apt install clang cmake
$ sudo apt install libgl1-mesa-dev libglu1-mesa-dev
$ sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
$ sudo apt install ccache
Checkout submodules
$ git submodule update --init --recursive
> vcsetup-2022.bat
Or if you using bash(e.g. from Git for Windows)
$ cmd //c vcsetup-2022.bat
Then open solution file at build
folder.
VS2019 may work(please modify generator settings in vcsetup-2022.bat
)
$ ./scripts/bootstrap-linux.sh
$ cd cmake-build-relwithdebinfo
$ make
$ ./scripts/bootstrap-macos.sh
$ cd cmake-build-relwithdebinfo
$ make
Standard cmake build procedure should work. for exmaple:
$ mkdir build
$ cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo
For ARM target, add -DEMBREE_ARM=1
cmake option recommended(otherwise SSE/AVX compile flags are used)
TODO: provide CMakePresets.json
TBB is required to build.
(you can install tbb through sudo apt install libtbb-dev
on Ubuntu)
Please set the following cmake option. (See an example bootstrap script in scripts/bootstrap-linux-aarch64.sh )
-DPBRLAB_USE_EXTERNAL_EMBREE=On \
-Dembree_DIR=external/embree-4.0.x86_64.linux/lib/cmake/embree-4.0
embree_DIR
points to a folder containing embree-config.cmake
Optionally, set path to TBB
package if required.
Run demo scene.
$ pbrlab data/cornellbox_suzanne_lucy.obj
Surface mesh only.
$ pbrtlab input.obj
Hair only(cyhair format. Download here http://www.cemyuksel.com/research/hairmodels/).
$ pbrtlab input.hair
Mesh and Hair.
$ pbrtlab input.obj input.hair
(No xform/scene graph support at the moment)
Currently pbrlab supports wavefront .obj + .mtl with PBR + SSS extension
https://benhouston3d.com/blog/extended-wavefront-obj-mtl-for-pbr/
or please take a look at tinyobjloader's note: https://github.com/tinyobjloader/tinyobjloader/blob/release/pbr-mtl.md
SSS extension is pbrlab specific.
Please see src/material-param.h and AutodeskStandardSurface
https://autodesk.github.io/standard-surface/#closures/subsurfacescattering
for details.
param name | value | description |
---|---|---|
subsurface | float | Subsurface weight |
subsurface_radius | RGB | Subsurface radius(dmfp) |
subsurface_color | RGB | Subsurface color |
subsurface_scale
is not supported(Please premultiply it to subsurface_radius
)
subsurface_anisotropy
is not supported yet.
- NanoRT only ray tracing.
- More detailed description of Shader/Material parameter.
- Log
- nanolog
- Interactive GUI
- Draw rendering
- ImGui UI
- Curve Mesh
- CyHair loader
- xpd loader
- Cycles's Principled Bsdf
- Lambert
- Principled diffuse
- Subsurface
- Diffusion model
- Random walk SSS
- Henyey Greenstein
- single instance intersect
- Microfacet
- reflection
- clearcoat
- refraction
- sheen
- Arnold Standard Shader
- Principled Hair Bsdf
- Support render config file
- Scene file
- json(W.I.P)
- obj
- gltf
- USD
- Texture
- jpg, png
- OpenEXR
- Light
- Area light
- Point light
- Directional light
- IBL
- Camera
- Pinhole camera
- Thin lens camera
- realistic camera
- GPU acceleration
- OptiX
- HIP RT
- Vulkan RT
- Random walk SSS
- Slightly darker result compared to Cycles' results
- Clearcoat -> Clearcoat component is too small
pbrlab is licensed under MIT license.
The following files are derived from these;
- src/closure/microface-ggx.h: Open Shading Language (3-clause BSD license)
- Principled BSDF, Principled Hair BSDF. Based on Cycles' code. Apache 2.0 license.
- TinyObjLoader : MIT license.
- TinyEXR : BSD license.
- imgui : MIT license.
- ImGuizmo : MIT license.
- stb_image, stb_image_write, stb_image_resize : Public domain
- glfw3 : zlib/libpng license.
- glad : unlicense?
- ionicons : MIT license.
- Roboto font : Apache 2.0 license.
- toml11 : MIT license.
- rapidjson : MIT license.
- StaticJSON : MIT license.
- ghc filesystem : BSD-3 license.
- mpark variant : BSD-1 license.
- Embree : Apache-2.0
- pcg-random : Apache-2.0
- pbrt : BSD-2 license.
- Cycles : Apache 2.0 license
- OpenShadingLanguage : BSD-3 license.
- OpenImageIO : BSD-3 license
- miniz: MIT license. https://github.com/richgel999/miniz