Open Shading Language developed by Sony Pictures Imageworks is an advanced shading language specification for production GI renderers. OSL shaders can be used to implement anything from simple texture patterns to full materials using closures.
Shaders can be written in Open Shading Language, an advanced shading language for production GI renderers. OSL shaders placed in the shader search path are automatically registered as Arnold shader nodes, with their parameters converted to Arnold parameters. Once loaded, they can be inspected, instantiated and linked in the same way as C++ shaders. OSL shaders can be used to implement texture patterns and materials using closures.
- The shaders must have unique names. If the name conflicts with an existing shader, the OSL shader won't load. You should see a warning in the log in this case.
- Multiple outputs are not supported at the moment.
More information about using OSL shaders can be found here.
|An example .osl shader and .mtd file can be found here.|
Just like any other third-party shader libraries, OSL shaders placed in the shader search path are automatically registered as Arnold shader nodes. The OSL shader parameters are converted to Arnold parameters. Once loaded, they can be inspected, instantiated and linked in exactly the same way as C++ shaders.
You can render OSL shaders directly in MAXtoA. You must do the following:
Create a folder where the OSL shader will reside. Setup the following Environment Variable (location of the .osl shaders):
- Place the OSL shader (with .mtd metadata file) in the
ARNOLD_PLUGIN_PATHfolder and they will automatically be available as shader nodes. Arnold will automatically compile the .osl file and produce a dill (.oso) file.
OSL in 3ds Max 2019
In 3ds 2019, there is a new way of using OSL. Arnold will take advantage of this automatically. Simply use the OSL maps provided with 3ds max, or use the OSL editor built into the OSL map to write your own, or load up external OSL files. In this mode, the actual OSL sources are embedded into the Arnold scene and exported as text into .ass file, so there will be no dependency of external OSL files when rendering, and the limitations about shaders not having the same name are lifted. You could, in theory, have twenty totally different shaders named ‘Bob’ and it would still work (not that we recommend this).
See the 3ds Max documentation for more information about OSL. There is also a GitHub for OSL shader exchange which also contains developer documentation and more info a:t https://github.com/ADN-DevTech/3dsMax-OSL-Shaders ”