AI / Rendering
Neural BRDF
Approximating a Disney BRDF using a small MLP running on the shaders via Slang and SlangPy.
It is based on NVIDIA Neural Shading SDK and adapted to SlangPy.
01
Video
Showing the real time optimization process.
02
Training & Inference
The application features two modes:
- Training Mode: It shows Reference / Neural / Difference side by side while optimizing the network.
- Inference Mode: It loads a model and runs Neural BRDF in inference mode.
Training Mode
Inference Mode
03
Architecture
Network Input (5 Floats)
NdotL
NdotV
NdotH
LdotH
Roughness
Network Output (4 Floats)
Diffuse
Specular
Fresnel
Clearcoat
Network Model
- Encoding: Frequency encoding (6 bands)
- Layers: 3 hidden layers of 32 Neurons with LeakyReLU
- Activation: Exponential Activation at the end
- Loss: Optimized using L2Relative loss with per component weights
04
Requirements
This project uses Cooperative Vectors for acceleration.
- Vulkan Cooperative Vector extension: Requires release driver R570+
- Python 3.9+
- Slang & SlangPy
Fallback: If Cooperative Vectors are not supported, the project will run significantly slower.