3DS MAX 2020 : Randomly assign colors to elements using OSL

Опубликовано: 28 Июль 2026
на канале: 3DLA
4,756
64

OSL provides a fast and easy way to assign random colors to sub-object elements using OSL maps in 3ds Max 2020.3.

For this tutorial we need to apply a MaterialbyElement modifier to our object, so that our sub-object elements receive random material ID's. Otherwise they will all have the same ID.

Then we use these maps with a Physical material:
OSL: 1 of 5 (color)
OSL: Random Index by Number/Color
OSL: Material ID

With almost the exact same setup we can apply random colors to objects, rather than elements. Instead of using OSL: Material ID, use OSL: Node Handle

More information about OSL:
Introduction to OSL by Zap Andersson of Autodesk:
   • 3ds Max: Introduction to OSL  

OSL on GitHub with source code:
https://github.com/imageworks/OpenSha...

Stay tuned for many more tutorials for 3DS Max, Houdini, and Blender.

Paul Bertino - 2020