STEP BY STEP: Master 3ds Max 2019’s open shading language
Rainer Duda takes us through creating a hyperreal wooden floor
the goal of computer generated imagery is to re-create natural environments with rich details and the simulation of physically plausible interaction between light and matter in digital scenes. the most important aspect of this, after physically based rendering, is probably feature-rich textures. in this tutorial you will learn how to utilise the capabilities of osl in 3d studio Max to create a realistic-looking and heavily used mosaic parquet floor. all details including scratches, colour variation and many more will be created with procedural textures.
the start of this tutorial will cover how the underlying geometry must be prepared in order to have a proper base for an advanced shader setup. the tiles of the mosaic parquet will be composed of polygonal sticks in their original size to create 16 by 16cm tiles. the shader work starts by using osl nodes for the initial colour definition and the per instance variation of the hue. to break the continuity of the pattern, osl code will help to create a gradient which will visually separate the tiles from each other. You will also learn how to use procedural noises for the creation of interestinglooking wood patterns which are derived from photo references. it is important to use a variety of different noise patterns to break the procedural look. at the end, you will learn techniques to blend and mix different noises together for a working visual composition.
Prepare the mosaic parquet floor First, create proper floor tiles. the first floor tile consists of seven wooden sticks with a size of 16cm x 2.28cm x 0.5cm. one wooden stick will be created. its pivot will go to the down left corner. Via the array function it is easy to create additional instances in a fixed offset such as 2.28cm. all seven wooden sticks will be grouped together. the group pivot must be placed at the centre of the object. this group will be instanced with the array function and include a fixed offset and a rotation offset of 90 degrees.
Colour variation across all sticks now it is time to set up one initial colour in the material editor as osl colour. the tone will be something between brown and orange. the osl colour node will go into an osl lift/ gamme/gain node as input.
now it’s time to read out all the individual ids with an osl node handle. Besides this node there must be also an osl random by index node created. the ladder input will be the osl handle node. the range will define the colour variation across the individual wooden sticks. therefore the random by index node output must lead into the gamma input of the osl lift node.
Tile separation with gradients the pattern looks fine but for heavily used tiles it’s necessary to add more detail to separate them. an osl uv Channel node will help call the first uv channel. afterwards use an osl node filled with self-made code to create a gradient. this gradient will be connected with an osl add node in the second input called B. the first input must be connected with the lift/gamma node. the addition can be controlled by changing the scale parameter. to slightly add the gradient it’s enough to reduce the scaling for B until the visual result looks acceptable.
Add the first layer pattern in the procedural world a pattern comes from a procedural noise – it’s the same in this tutorial. an osl noise node will be the core of this step in combination with an osl uv transform node. a perlin noise must be scaled down to 0.1 with 3 octaves and a low step of 0.15. the value 0.8 will give a decent pattern. the uv channel node must lead into the UVW input of the uv transform node. the Y tiling of the uv transform needs a smaller value like 0.35. the offset of the uv transform will be connected with the random by index node.
Prepare deeper wood patterns to create more interesting details, you can create another osl (2d) noise node with activated perlin noise containing a scaling of 0.05. the uv input of the noise node must be connected with the uv transform node to achieve variation on each object instance. Five octaves and an amplitude of 3 will help to create good detail. the result of the noise must be inverted with an osl invert node. an osl tweak node will help to refine the pattern. as output minimum it is necessary to increase the value up to 0.65. the result can be multiplied with the rest of the branch.
the uv input of the noise node must be connected with the uv transform node to achieve variation on each object instance
Add more colour variation now create another set of osl nodes: a random by index node, followed by an uv transform and a noise node. the max values at the random by index node must be set to 360. the output of this node goes into the rotate input at the uv transform node where the tiling for xy is set to 0.0125. the output must be piped into the noise input. the noise is a perlin noise with a scale of 0.8. Five octaves and an amplitude of 3 will create a working pattern. in addition, the low and high step can be modified for a more intense look.
the result will be multiplied with the second wood pattern which is properly masked and coloured
Combine the previously made steps all previously created branches must be combined together in a way that enables easy modifications. at this step it is recommended to add two osl add nodes from the colour menu and one osl multiply node – from the colour menu as well. the first osl add node will combine in input a, the plain colour including gradient and the first iteration of wood pattern. the wood pattern scale must be reduced to something like 0.15. the result will be multiplied with the second wood pattern which is properly masked and coloured. that result will be multiplied with the dark areas where the dark areas got a brightness correction.
Enhance the wooden sticks to give the wooden sticks in each mosaic tile more character, arnold nodes can be combined with the osl graph. a curvature node with a radius of 0.15 and an amplitude of 1.5 must be piped into an osl invert node followed by an osl tweak node to make the output look a bit brighter. the black must be pushed up to a grey. the result will be multiplied with an osl multiply (Colour) node with the big graph. as a result the individual tiles appear more visible to the viewer.
Work on a proper specular reflection the specular reflection of the arnold standard surface will get a full contribution by setting the first parameter to one. the roughness will be driven by an osl tweak node. the tweak node defines an incoming value range and allows modification of the incoming values with another filter via a minimum and maximum value. the spec reflection will be the reflection of the wood itself without coating. therefore the tweak node will get, as input, the noise node from the darker areas. at the tweak node the input maximum must be set to 0.4 to get a nice contrast.
Refinement of the specular reflection up until now, only the darker and larger areas were taken into account in the specular roughness. there are plenty of other details like the wood patterns that must be included in the reflection roughness as well. let’s now create an osl add node. input a will be the tweak osl map for the darker areas, which is already connected to the roughness slot. input B will be an osl invert node, of which the input is the osl noise node from the previous step. the result will be piped into the specular reflection roughness.
Enhancements from procedural bumps to give the material much more realism apart from the base colour appearance and specular reflection, activate the coat reflection. as coat reflection roughness works best with the curvature node, and this removes the reflection on the borders of the wooden sticks. afterwards an arnold Bump 2d node will help to convert the osl noise from the first wooden pattern to a bump map. the intensity of the bump map can be reduced to 0.25 before it will be plugged in the normal slot of the arnold standard surface. that will give the mosaic tile reflection much more visual quality.
the specular reflection of the arnold standard surface will get a full contribution by setting the first parameter to one
Combine reflection with colour layers now fine-tune the coat reflection against the bump layer and the specular reflection. an intensity value of 0.5 for the coat layer against a value of 1 for the specular will guarantee a proper mixture of both specular details. at this stage the colour of the wooden tiles can look like raw beech, but on most parquets there is a special coating on top, which is a warmer colour most of the time, like a mixture of brown and ochre. this coat layer colour can be achieved by adding osl multiply node from the colour menu.
Adjust bump intensity per instance the bump intensity is working fine but it is too uniform across the whole ground. time to break this up. You must now create another osl random per instance node with a value range from 0.05 up to 0.25. this random per instance node will drive the height parameter at the arnold bump 2d node, which is connected with the normal slot of the standard surface. the pattern should look now more natural and worn out. there should be some spots that are more worn, and some spots that are less but they should still match the overall style.
Create masks for colour discolourations at this stage it’s time to add some small dark discolourations with some round shapes to break the lines from the wood patterns. now create three osl nodes: random by index, uv transform and noise. the random per instance node will get a range from 0.05 up to 1 but for the Y axis use a value around 10 to maintain proper scaling. this node must be piped into the offset input of the uv transform with a tiling of 1 but for Y around 6. the noise scaling must be 0.25 with simplex as type and between a low step of 0.4 and a high step of 0.5.
Seamless transition of discolourations the noise must be inverted with an osl invert node from the colour menu. afterwards, you can control how dark the dots should be by adding a new osl tweak node. With a brighter output minimum the dots will appear lighter. if the visual appearance is just fine and matches old wood, it’s time to add the dots by using an osl multiply node on the base colour branch. the last colour correction must be multiplied with the dots to show all details on the wood. if you want more control over the dot appearance, the octaves for the noise are important for modelling details.