Yanko Design

Creating realistic textures with displacement maps in Keyshot 8

KeyShot 8 Top New Features Overview

The guys at Luxion just released their latest version of Keyshot, and I’m absolutely thrilled because displacement maps are one feature I was rather impatiently waiting for! Displacement (or depth) maps are an absolutely great way to create real textures that can absolutely make your renders POP! Let’s take a look at what this newfangled feature is and how to master it!

DIFFERENCE BETWEEN BUMP AND DISPLACEMENT MAPS

Up until now, perhaps the biggest thing missing from Keyshot’s arsenal was its support for depth or displacement maps. You could only use bump maps in Keyshot to simulate textures, but that’s all. If you’re wondering what the difference between bump maps and displacement maps are, just take a look at the image below.

The one on the left uses a bump map, and the other on the right has a displacement map. Bump maps only simulate texture, they don’t create it. They manipulate light and shadow to make it look like a surface has a texture, but in reality, that texture is an optical illusion. Displacement maps, on the other hand, actually create that texture. They physically manipulate 3D geometry to make the texture, and if you look at the silhouettes of the two below, you’ll get the gist. The one on the left is still a perfect circle even though it looks like there’s a texture on it. The one on the right, however, literally has those bumps that you see in the image above.

This ability to actually manipulate 3D surfaces is great for a couple of reasons. Firstly, it makes materials incredibly realistic. Concrete LOOKS like concrete. Tiled surfaces literally have 3D tiles in them. Gravel looks great too, because it’s actual gravel, not a flat surface with gravel texture. Secondly, it takes the pain out of actually modeling minor details. You can make folds in cloth by just dropping a displacement map. Crinkles on paper, grass on a lawn. You don’t need to physically model these minor details anymore. You can rely on a good displacement map you downloaded (or created!) to give you instant results.

HOW DISPLACEMENT MAPS WORK

It’s quite literally black and white. Displacement maps use grayscale to determine height, just like bump maps do (you can actually use those bump maps as displacement maps). In short, if you look at a bump map, notice that the parts that usually stick out (like the bumps on the ball in the image way up top) are the white bits, while the parts that are black recess downwards. The whiter the pixel gets, the more elevated/extruded it is, the blacker the pixel is, the further inward or downward it moves. In theory anything that’s exactly 50% gray stays untouched. Here’s a snippet of the map along with the result alongside.

Most bump maps can be used as displacement maps. Make sure you have maps that are of a high resolution because a pixelated image will result in a pixelated surface, and that isn’t good. Conversely, if you’ve got details that are way too sharp, just carry the map image to photoshop and gently blur the parts you want softened. Blurring a sharp edge that’s black on one side and white on another will cause the colors to intermingle and form the grays in between. As a result, you’ll get softer edges with bevels/fillets without having even done anything!

You can find displacement maps online (the good ones come at a price) or you can even MAKE your own bump maps. Using the black-to-white principle, you can create maps of common textures like woven carpet in a software like Photoshop or Illustrator and just export the maps to hi-resolution images. Go ahead and experiment with the portrait-mode on your smartphone camera too. It has the ability to capture a decent amount of depth, and you can use websites like www.depthy.me to extract the displacement map from your image (depthy.me will give you an inverted version of the displacement map, so make sure you take it to PhotoShop and invert the colors to get the real map). You can see two images below of a ‘portrait-mode’ photo and the displacement map placed alongside. You won’t get incredibly crisp displacement maps with your phone, but using your phone’s portrait mode is a pretty nifty and handy way of learning about new textures, patterns, and shapes, and how they’re recreated in grayscale to allow computers to see depth.

ADDING DISPLACEMENT MAPS IN KEYSHOT 8

Just to fuel my curiosity, I carried that avocado displacement map and image file to keyshot to see what I got and boy! You notice a few things off the bat. The map is far from accurate, and here’s why. A. You’re using a pretty basic piece of 3D imaging hardware which mainly uses algorithms to calculate depth. And B. This ‘displacement’ map is actually a blurring map. It isn’t meant for creating 3D depth, it’s meant for blurring the background. It calculates what’s in the foreground and what’s in the background, and uses that data to create DoF, or depth of field. (That’s why the displacement map is inverted, because the algorithm blurs the white and doesn’t touch the black. It’s essentially the same principle but a different operation.)

So let’s look at Keyshot’s Displacement Map feature in depth (hehehe, get it?) The displacement, or the geometry, forms just one part of the entire material… which is why we’re looking at Keyshot’s material graph (right-click, edit material graph), which deconstructs everything for us to better understand and build materials. Keyshot separates materials into Surface and Geometry. Surface allows you to create materials, finishes, textures, and Geometry allows you to edit or tinker with the third dimension of the model itself. In the Surface section, you get to decide whether your material is plastic, or metal, or concrete, etc. You can add other aspects like color, roughness, graphical patterns to this. The Geometry section is where things get interesting. There are basically only two components to using a displacement map. One is your map… an image file. And the second is a displacement block, which tells Keyshot you want to use the map as a displacement map.

Connect the map to the block, and the block to the geometry tab, and you’re good to go. The geometry doesn’t change right away (because it’s processor-intensive), which is why you need to “execute” the map. First off, double click on the image map block and make sure you’ve got the size, scale, placement right. You can press the ‘C’ key to preview your map on your model and press it again to hide the map. Once you’re satisfied with how the map is laid out, double click on the displacement block and hit execute. Certain things happen. The map gets executed, and you get a first impression of how your geometry changes. In order to tweak the end-result, try changing the displacement parameters.

Displacement Height: Changes how high or low the highest and lowest points of your displacement map are. For something like large pebbles, you’d have a larger height. For something like gravel, the height would be negligible.

Offset: Determines whether your displacement map pushes stuff outward or inward. Grass sprouts out of a surface, but holes in Swiss cheese go inside a surface. You’ll need to tell the software which direction to process the map in.

Resolution: The lower the resolution amount, the clearer the pixels on the map are. The resolution value basically tells Keyshot how small you want the smallest detail to be. A large value creates lesser detail, a smaller value makes details more intricate.

Max Triangles: This tells the software how many pixels (or triangles) to allow your map to have. So for maps with lots of details (individual grains of gravel), you’ll need more triangles. For something fairly simple like a tiled surface, a low triangle count works just fine!

MAKING TEXTURES MORE REALISTIC USING DISPLACEMENT MAPS

Okay, at just over a thousand words, I’ll stop talking! Displacement maps are a great way to create geometry without creating it. If you’ve got bump maps lying around, try using them with the displacement block to get some stunning results! You can even go further to create wrinkles on skin, crumpled patterns on paper, or actual threads in a loosely woven material. I recommend checking out Poliigon for their incredible database of materials and textures. Just remember one thing. Keyshot is already rendering all your scenes in real-time. Telling it to start building 3D surfaces basically is going to require more resources. Very detailed or large depth maps may take more time to load as well as render, so depending on your needs, and how powerful your machine is, go ahead and give displacement maps a shot! They’ll “grow” on you!

Image Credits: Poliigon

KEYSHOT 8: POWERFUL RENDERING MADE EASY

Keyshot isn’t an unheard of name in the industry. Most design companies like Motorola, Microsoft, Oakley, Skullcandy, Nissan, Chrysler and DeWalt regularly use Keyshot, and nearly half of the designers we asked used Keyshot for their renderings. Its biggest achievement is making renders as simple as dragging and dropping materials, textures, environments. For a beginner, Keyshot is a great way to get the job done, and for a power user, Keyshot retains all the tools to make absolutely stunning visualizations. The rendering software released its 8th version at the beginning of this year, including a massive variety of easy-to-use features, from intersecting/cutaway materials, to the introduction of fog/smoke and volumetric lighting, to being able to add bubbles/flakes in solid materials, and perhaps the biggest update yet, support for displacement/depth maps!

Let us know what Keyshot feature you want us to talk about next!
Drop us a line here.

Exit mobile version