Towels, Carpet Or Grass Material Using Displacement By Neil Blevins Created On: Sept 1st 2008
Updated On: Dec 15th 2024
Software: Photoshop and Blender or 3dsmax (vray)
An object like a towel is made up of thousands of little fibers, all
packed closely together. To replicate this is cg, the obvious solution
is to use a hair system to produce those fibers. The results will look
good, especially close up, but that technique is perhaps overkill,
especially if the object is off in the distance. Hair can be expensive
to render, and time consuming to set up. So this tutorial
explains a method to do objects such as Towels, Carpets or well cut
Grass using
displacement.
Reference
Here's the photo the towel from a catalog we will be using as reference.
Software Agnostic Material
The basic ingredients are as follows:
Shader: Oren Nayar (very rough)
Color: whatever color, for this example I'm picking a light blue.
Spec: No spec
Displacement: Very small speckly noise.
Ways to make it more realistic:
For towels, and
especially carpets, some larger areas are worn down, or the pattern is
brushed in a specific direction causing the fibers to appear shorter
from far away.
Making The Displacement Map in Photoshop
From far away, a towel looks like a bunch of chaotic bumps.
So one way to produce your displacement map is to make a lot of tiny
bumps using a small procedural noise.
Another idea is to use some sort of cellular noise for the pattern...
But for this example, I'm going to make a slightly more detailed
texture map in
photoshop. It will probably also render
faster than using the Noise or the Cellular Pattern.
Open photoshop, open a new document that's 1024x1024 pixels, and has a
black background color. Then get
the hard brush.
Modify the brush and give it a little size jitter
Give it a scatter and increase the count.
Under Color Dynamics, give it a brightness jitter. This will fake each
fiber of your towel being a slightly different height.
Now pick the color black and fill your image with the brush. Here's a
small cropped area of the bitmap.
Replace the default principled BSDF with a Diffuse BSDF node set
to Roughness of 1, since this is a rough
material. This will use an Oren Nayar shader instead of the standard
Lambert.
Color to Blue (or whatever color you need)
This shader doesn't have specular reflectivity, so you don't need
to worry about turning it off.
Add an Image node, get your photoshop towel Displacement map.
Hook a Mapping node up to it, and a Texture Coordinates node set to
UVs. Then hook the image node into a displacement node, and hook that
into the displacement slot of your Material Output.
The scale parameter in the Displacement node controls how strong
the displacement is, I found a value of 3 for my scene worked well. And
the Scale parameter of the Mapping node controls how large or small
your pattern is, a value of 3 worked well for me.
Now it's time to turn on displacement.
Make sure you're using Blender 4.3 or after. Displacement is
still an experimental feature.
Go to the render tab, change Render Engine to Cycles, Feature Set
to experimental.
Select your object and apply a subdivision Surface Modifier to it.
Because you're in experimental mode, you'll see a new checkbox
called "Adaptive Subdivision", check it.
Dicing scale is the resolution of your polygons when displaced.
Reducing this number gives you finer detailed displacement.
Finally, in the material tab, go to "settings" and make sure
Displacement is set to "Displacement and Bump Map"
Remember to turn on "Rendered" as your viewport shading mode if you
want to see the displacement in the viewport.
Here's the resulting render.
Looks good. But lets add that wear or brushed pattern.
Create a Noise Texture, connect it to a Texture Coordinates set to
Object. Hook the noise into a Color Ramp to control the contrast of the
noise. Hook that into a Math node set to Multiply, and multiply the
original Towel Disp image with the noise.
Notice how the Larger Noise is set between grey and white in the Color
Ramp, never black. This is to avoid any areas having no speckly
displacement, or to
avoid any areas of 100% wear.
Here's the larger noise by itself.
And here's the result of multiplying your original small noise by the
larger noise, this looks far more organic.....
Change the Diffuse Roughness to 1, since this is a rough
material. This will use an Oren Nayar shader instead of the standard
Lambert.
Color to Blue (or whatever color you need)
Make sure it has no reflectivity, so reflection color is black
Now select your object and assign a VrayDisplacementMod
Set amount to 5 (the height of the disp, play with this value to
get the results you want.
Set edge length to 1 (lower number, the more detailed the
displacement, but slower to render)
Add a bitmap texturemap to the Texmap slot.
Add the bitmap you painted in photoshop to this texmap.
Change its tiling to get the size of the fibers on the towel the
size you want
Reduce the blur if you want more detailed looking fibers.
Change to summed area filtering to get less blur at glancing
angles.
Here's the resulting render.
Looks good. But lets add that wear or brushed pattern.
Turn your bitmap into a Composite Map, that contains both your original
bitmap,
and a larger noise. The larger noise is then multiplied onto your
original pattern, causing some areas to not be as strongly displaced as
others, hence creating a worn pattern.
Notice how the Larger Noise never goes to black, always to a medium
grey. This is to avoid any areas having no speckly displacement, or to
avoid any areas of 100% wear.
Here's the larger noise by itself.
And here's the result of multiplying your original small noise by the
larger noise, this looks far more organic.....