Adding Textures to 3D models; Texture, Bump, and Displacement Mapping: How to Make Photo-realistic Models
In our previous tutorials, we discussed applying colour to 3D printed models.
But the Stratasys J750™ and J735™ also have more advanced capabilities, including the ability to create photorealistic lifelike product models incorporating company logos, detailed text, and graphic elements. It can also produce models with surface finishes that mimic various materials, such as leather and wood.
This tutorial will explain the theory behind how these effects are applied. In future tutorials we will investigate how to quickly use these tools to achieve fantastic realistic parts.
Step 1: Exploring the enhanced design capabilities of the J750/J735.
First lets take a look at a what a texture is and some of the main types that can be applied to models for 3D Printing
Now lets look at some of these concepts in more detail:
The advanced design techniques mentioned above can be divided into two sub-groups:
1) Image textures: Where graphics such as logos, text, images, and barcodes can be applied
· When these elements are applied to a model they are referred to as an image texture. We will be using the word “texture” a lot, so it is important to keep in mind that we are referring to an image or graphic and not necessarily a surface finish.
2) Bump and displacement mapping: Fully mimicking real-world materials in terms of both colour and physical touch
· This technique also uses an image texture to achieve a certain colour or photorealistic effect (as above), but it can also include image textures that control other aspects of the model such as surface height, reflectiveness, roughness etc.
· A bump map, for example, is used in animation to provide instructions to the computer rendering engine about how the object should interact with the light. This typically results in a part that looks very realistic from a distance, but a closeup look at an acute angle reveals that the model geometry is flat.
Rendered part with a bump map applied allowing the light to interact with the part
· In 3D printing, we can further leverage this bump map by turning it into a displacement map that does alter the surface geometry of the part, resulting in a part that mimics the original, not just in terms of appearance, but in actual topography. Displacement translates the bump map’s simulation of these features into their actual surface shape. 3D printers can use displacement to imitate complex materials and finishes like leather, wood, stone.
Rendered part with bump map converted into a displacement
The benefit of applying a texture or bump / displacement map directly onto a CAD model is that you can utilize existing graphics and images, making dramatic changes to the surface geometry without having to model any complex surfaces by hand. It is the software that applies these complex affects, saving time and effort and enabling otherwise impossible levels of detail and imaging.
Below we will explain how both design techniques work.
Step 2: Texture, how does it work?
The overall process for applying a texture onto a 3D mesh involves mapping the texture (image, logo, decal etc.) directly onto the mesh before printing.
Many CAD packages offer this feature. For greatest control of the how the texture is placed, you can use a design / animation software like Autodesk®, Maya®, or 3DS Max™. You can also achieve very impressive results using Adobe® Photoshop®, a more accessible software package with image editing tools that adjust and edit the textures being applied. The output file can then be exported as an OBJ or WRL and sent to a preprinting software like GrabCAD Print.
Rendering packages are typically not designed to output a watertight mesh suitable for 3D printing. Usually, you need to make changes in the model export settings and/or repair the file mesh in an external/third party program to achieve this.
The main steps for applying texture are:
a. Design a 3D object, such as the cube shown below.
b. Map and unwrap the 3D object’s geometry, so that it is represented in a 2D plane.
c. Import the 2D image texture.
d. Align the geometry map and texture image.
e. Overlay the texture image onto the part’s geometry map. This process is called UV mapping. (UV are coordinates found on the 2D image plane that are mapped to the 3D XYZ coordinates)
f. Use these mapped UV coordinates to “wrap” the 2D image onto the original 3D geometry.
In visual terms, the above process looks something like this:
Step 3: Bump mapping, how does it work?
As we explained above, bump maps create the illusion of height and topography by using light and shadow to trick your eye into thinking that the object has a more complex surface. In reality, the surface stays flat.
The difference between bump and displacement is summed up in the below image:
Texture and bump map Texture with bump converted to displacement
So, how do bump maps work? The design software uses a bump/height map comprised of white, black, and grays to dictate the height differences that need to be displayed.
White = high points
Black = low points
Grayscale = gradients in between
A height map of just black and white will result in abrupt changes in height. Grayscale adds smoother transitions.
This bump / height map is saved as an image file (e.g., JPEG, IMG…) and applied the same way as an image texture(see the cube picture in step 2). Often these two images (both the texture and the height map) are used in conjunction to achieve fully realistic material effects.
These bump / height maps were originally used to minimize model file size and increase processing speed for in-game animations. Programmers manipulated light and shadow to make models look realistic while keeping their surface geometry unchanged and therefore easier and faster for the graphics engine to process.
Step 4: Displacement. How does it work?
The process of changing this simulated bump geometry into an altered surface geometry is called displacement. Displacement maps take that bump / height map that was applied as a texture and use it to displace the surface of the mesh’s geometry to give it true highs and lows.
Typically, all that needs to be defined when converting bump to displacement is the severity of the displacement, that is, the difference in height between the black areas and the white areas of the map that will be applied during displacement. This height difference is typically measured in millimeters.
For example, here is the 3D Print Settings window in Photoshop, where you assign displacement under Surface Detail.
And below, we can see the effect on the model of varying the minimum / maximum surface detail value (i.e., height value).
Note: You can enter a negative minimum value (below zero).
It is important to be aware that displacement occurs across the whole colour range, from full white to full black. If your height / bump map covers a narrower band of colour, perhaps all in grayscale, you may have to increase your surface detail min / max values to achieve a more noticeable effect.
A height map / bump map using the full spectrum of black to white.
A height / bump map that uses grayscale only (not full white or black).
To achieve the same displacement in greyscale as the black / white image above, you would need to input a larger min / max value range.
This process can be achieved using a number of popular design software packages. In future tutorials we will discuss how to achieve these affects using Adobe Photoshop.
How was it for you? Great? Fantastic! Comment below.
NOTE: Textures used in this tutorial were downloaded from www.textures.com