Creating Realistic 3D Plant 5: The Final Touch Of Hyperrealism
As we reach the final step in this plant creation series, we're about to unveil a technique that will truly elevate your 3D plants, setting them apart from the rest!
Now, it's time to leverage the height maps from our PBR atlas material to transform the flat leaves into a lifelike, bumpy surface. We'll delve into the techinique of manipulating the height texture, transforming it into a versatile asset that seamlessly integrates with our Double-Sided Geometry.
We're thrilled that you've made it all the way to the final chapter, and we can't wait to share this last piece of knowledge with you!
UNDERSTANDING THE DISPLACEMENT IN 3D SOFTWARE
Displacement
Displacement in 3D software refers to a technique used to add intricate detail to a model by altering its geometry based on an input texture. It involves displacing the surface of an object based on the pixel values of the texture, creating the depth and complexity. This allows the light to be reflected from irregularities of the object, casting shadows and presenting beautiful sub-surface scattering. This way, we can transform the flat leaves into a hyperrealistic 3D plant.
Height Map
Textures.com height maps offer exceprional 16-bit depth displacement quality. However, applying them directly as displacement map to our current leaves would result in excessive strength, causing numerous intersections and nasty edges.
In the upcoming steps, we'll explore a workflow that transforms the standard height map into a functional displacement map designed for our Double-Sided Geometry.
SOFTWARE
We'll be using Photoshop for this workflow, but rest assured, you can easily adapt these steps to any other 2D image manipulation software of your choice.
Creating The Mask
To start, we'll create a mask that defines the edges of the leaves. This will enable the software to specify which parts of the mesh should remain unaffected by displacement.
1.Texture Import
Let's begin the process by importing the height and alpha textures into Photoshop. It's crucial to import the height texture first, as it has a 16-bit depth, whereas the alpha texture is 8-bit.
2.Alpha Select
Select the outline of the leaves and proceed with the following steps:
- Click on the
Channelstab. - Ctrl + Left Mouse Click on the
Graylayer.
3.Modyfing The Selection
Lets contract the selection by clicking on the Select tab Modify Contract. We want to make it smaller by 20px so lets continue by writing 20 in the Contract By: area and click OK.
4.Filling The Selection
Next, create two new layers and ensure that the top one is selected. Press Ctrl + Shift + i to inverse the selection, then use the Paint Bucket Tool to fill the selected area with white.
5.Painting The Bottom Black
Select the bottom layer and Paint Bucket Tool it with black color. This should lead to a black and white texture that resembles an inverted Alpha texture.
6.Gaussian Blur
Now, select the white top layer and click the Filter tab Blur Gaussian Blur. Because we've contracted the selection by 20 pixels, we can now blur the white layer by 10 pixels. So lets type 10 in the Radius: area and press OK.
7.Completed Mask
Lastly, select both white and black layer, press Right Mouse Click and select Merge Layers.
With that, we've completed the texture, which is now ready to be used as a mask!
128 Layer
Now, we require something to cancel the displacement of the leaves' edges while retaining the rest. With the mask we've created, we can easly do that. But first, we need to understand how displacement utilizes colors.
- In 3D softwares, displacement operates by using grayscale value from the selected texture to determine polygons position. White values elevate the mesh, while black values lower it. To instruct the software not to displace certain areas, we need middle grey, represented by a value of 128 on the red, green, and blue channels.
Lets proceed with creating a new layer with such color. You can either type 128 in the color channels, or type the HEX code which is 808080.
8.Copying The Mask
Now, hide the 128 layer so that only the Mask is visible on the canvas. Select everything with Ctrl + A and press Ctrl + C to copy, then deselect everything by pressing Ctrl + D.
By following these steps, we have succesfully copied a texture, which will be utilized in the upcoming steps!
9.Adding A Layer Mask
To specify where the 128 color should appear, let's add a layer mask. Unhide the layer, select it, and then click on the layer mask icon located on the bottom of the Layers panel.
This action will generate a layer where we'll be able to place our mask texture.
10.Paste The Mask
To paste the texture into the layer mask, follow these steps:
- Alt + Left Mouse Button on the layer mask.
- With the coursor on the canvas press Ctrl + V.
This step should place our black and white texture that we copied earlier into the layer mask.
If it didnt't work as expected, revisit step 8 to copy the texture again and try once more.
11.Functional Layer Mask
Now, you can observe that the layer mask is functioning as intended, with the grey color blending onto the edges of the leaves in a gradual manner!
Using this texture as a displacement map at this stage would result in an overly strong effect. We need to reduce its intensity. Thankfully, there's a filter called High Pass that can help us achieve this by flattening the texture.
High Pass
In Photoshop, a High Pass filter is a tool used primarily in image editing to enhance sharpness and increase clarity. It works by emphasizing the edges within an image while minimizing the low-frequency details and smooth areas. This filter is often used in conjunction with other techniques to improve the overall quality of an image. In our case it will serve flawlessly in bringing down the larger scale gradients, while preserving the high frequency details.
12.Adding The High Pass
Lets add a High Pass filter by following these steps:
- Select the height texture layer.
- Navigate to
Filtertab on the top, selectOtherHigh Pass. - Change the
Radiusto 50 pixels. This value may vary depending on the resolution of the texture and other factors. Adjust it later to suit your needs.
13.The Final Touch Of Light
(This stage is optional, and you can return to it if there are issues in step 15)
Now, we can brighten the height texture a little bit. This will ensure a bigger elevation of the displacement and minimise the intersections of the mesh.
To do this, add a new Levels adjustment layer above the Height map layer. Adjust the highlight input level, which is positioned on the right side of the Levels Properties. In our case, the value is 248, but this may vary depending on how precisely you aligned the UVs in the first tutorial.
Final Displacement Map
With these modifications, you've completed the adjustment of the height map to suit our double-sided needs!
Adding Displacement Modifier
14.Displace
Now, let's navigate to Blender and apply a Displacement modifier to our leaves.
Go into Modifier Properties tab and add a Displacement modifier to the leaves. To better visualize the effect, increase the subdivisions by adding a Subdivision Surface modifier above the Displace. Now, set the Strength of the Displace to 0.025. Play around with the strength until it looks close to the real world references.
If you wish to increase the thickness of the leaves, adjust the Midlevel value. Additionally, for a higher resolution mesh with more crisp details, you can increase the Subdivision Surface levels.
15. Intersections
If you encounter any intersections, don't worry.
To better visualize intersections on the leaf, switch to Matcap viewport shading.
The easiest way to fix this is by adjusting the mesh faces. First, enable Edit Mode and the On Cage options for both the Subdivision Surface and Displace modifiers. Then, in Edit Mode, move the faces near the intersections until they are resolved.
If there are many intersections, but the Displace modifier strength accurately reflects the real world and you don’t want to reduce its effect, proceed to step 13 or return to step 12 and increase the high-pass filter strength.
Final Results
And with that, we've achieved our goal! A functional Displacement on our Double-Sided Gometry is now in place, ready to add depth and realism to the leaves.
Well done!
Go ahead and apply the Displace modifier with our modified height map into the 3D plant and enjoy the beautiful results!
We're absolutely delighted that you've reached the closure of this Peace Lily tutorial series! Your dedication and perseverance have brought you to this point, and we hope you've gained valuable insights and skills along the way.