OSL in 3DS Max Tips and Tricks
OSL provides a flexible way to build shaders.
In this example the proceedural Weave is used to create a material texture and is randomly coloured using 1 of N nodes driven by the Thread ID output from the Weave. It is also using Object ID’s to control different colours and UV coordinates on objects in the scene.