Nvidia’s MDL is a shading language that describes material’s behaviour against light rays.
It is quite popular among certain user base which depends on Iray renderer (since Iray uses MDL).
e.g. Daz Studio users
After having discussed with Daz users in online forums, they showed enthusiastic interest in the potential ability to render MDL materials in Blender Cycles.
Since then, I have been researching for a month now on how to make code changes to Cycles in order to render MDL materials that look very close or idential to Iray renders using equivalent MDL materials.
This topic is to discuss what would be the best way to make this code change to Cycles.
Add a custom Material Node that represents MDL material.
The node will work like how OSL script node works currently.
Following is a screenshot that shows proposed MDL script node with MDL file path and function parameters:
Code change to the following sections in Cycles codebase.
The following changes will have to be made within Cycles:
- BSDF evaluation code
- BSDF sampling code
A custom open sourced Blender build. It is unclear at this point whether it’s possible to gracefully integrate MDL support without tempering with Cycles’ intended functionalities. Therefore, code changes will be released as a custom Blender build for the time being.
This change will rely on MDL SDK to compile the MDL script into executable shader bytecodes. Currently, MDL SDK only supports the following backends:
- CPU (LLVM-IR or x86_64)
- GLSL (experimental)
Therefore, MDL support in Cycles will be limited to following device backends:
To make it easier to communicate and collaborate ideas, I created a public page that documents my planned technical design for MDL support.
This page will contain technical details such as exactly what function within Cycles will be changed, etc.