Tutorial 3: Using Procedural textures and displacement mapping
From LuxRender Wiki
In this tutorial, we will be looking at using procedural textures with LuxRender.
LuxRender supports both Blender's procedural textures and offers a range of procedural textures of its own, such as the checkerboard texture. The textures that correspond to Blender's textures can be recognised by their name as they are always prefixed with blender; for example blender_clouds or blender_musgrave. In this tutorial, we will use some of both texture types but not all, so there will be some left to discover on your own.
Basic modelling knowledge in Blender is assumed as this tutorial does not cover modelling and lighting. Also basic familiarity with LuxRender are assumed. If some of the instructions are unclear, please leave some feedback on the forum.
This tutorial uses Blender 2.47 and the latest CVS version from LuxRender, but it should apply to the stable 0.5 release as well.
We will be applying textures to a scene containing three flower vases and a monkey object. You can use your own or download this one from here.The vases are low-poly so remember to use Subdivide in LuxRender or a subsurf modifier in Blender to get a smooth result.
using procedural textures
Select the left vase and create a new material in Blender's materials panel (it's a good practice to give it a meaningful name). In LuxBlend you will most likely start out with a matte material, change it to plastic. Now, you have the choice to either change the color or add a texture; we will add a texture by pressing the T button next to the RGB values.Next, choose blender_clouds. Notice now we get settings for blender_clouds that are similar to blender's own cloud procedural texture, such as 'noisesize' and 'noisedepth'. Note also that LuxRender adds a level control that allows you to modify the brightness and contrast of the texture. I modified the colors to pink and light pink.
For now, let's keep everything else to the defaults, activate Subdivision (level 2 should be enough) and render.
And there is our procedural texture. Now, if we play with the scale settings of the texture the texture would scale up, just as it would in blender. Try for example setting the z scale to 10.
One thing you might have trouble with is visualizing the look of the texture as LuxBlend does not have any material preview window yet (this will change in the next release). To work around this limitation, I apply the texture settings in both LuxRender's material editor AND Blender's material editor (unless I notice it is really slowing me down).
If we scale the vase itself, notice that the texture scales along with it.
Now let's do something new. In the material editor, to the left of the color boxes for the cloud texture, you'll notice a menu with constant in it. This tells LuxRender to use a constant color for the texture. You can add a texture instead of this color. Let's add a blender_musgrave texture to one of the colors of the blender_cloud texture and re-render.
Notice that one color now has a musgrave texture with the colors black and white. You can change those colors or even add textures to them in the same way we just did. “Nesting” textures can get confusing so be careful not to go crazy with it.
Bump maps can be added to all material types. To add a bump map, click the large Bump Map button at the bottom of LuxBlend's material panel, then click the T beside it to add a texture. From there, you can change the texture type to anything you want. You can also use nesting with bump maps, for example if you want to apply more details to the bumps. Choose musgrave as a texture type, then change the tex1 value to 1.0 and render. Note that you change a value instead of a color for bump maps.
mix material and procedural textures
The mix material is a special material in LuxRender that allows you to mix two different materials (say matte and substrate) in one material. You can control the amount of mix by the numerical value next to the amount field. You can also add a texture that controls the mix. So when you add a black and white checkerboard, the white portion would show the first material and the black portions of the texture would show the second material. Select the right vase and add a mix material to it. Press the T button on the right of the amount value to activate the texture.
Add a blender_wood texture and modify the settings to what you see in the picture. Let's mix plastic and glass together for this vase. Set the first material to plastic and change the color to green. Set the second material to glass and keep the default settings. Now render and watch the mix texture do its magic.
The noise in the middle is just caused by the caustics effect of the glass material. This would needs a little more rendering time to achieve a higher number of samples per pixel, but we'll stop it here since this is just a preview.
Since we textured two buckets, let's not leave the last one. Select the middle bucket, add a texture to it and name it. In LuxBlend material editor, add a plastic material, activate the T button to add a texture and set the texture to what you see in this picture. This time we used a blender_stucci texture. Now we also want parts of the stucci texture to have bumps, so let's add a bump map. Use the same settings as for the diffuse channel, except leave the tex1 value at 0.0 and change the tex2 value to 1.0 (because we want the lines to appear as if they were engraved). Now render the scene to see the effect. The bump effect might not appear as pronounced with the current settings, but we'll leave adjustments to this as an exercise to the reader.
Here is the final image with all the textures applied. Try to find another good material for Suzzane!
Procedural textures are powerful tools to give your model a more appealing look. In this tutorial, we used some of the many textures LuxRender has to offer. To get a full list of available proceural textures (with previews), refer to the LuxRender Textures page.