00:00 Are you also struggling with
00:02 

00:02 displacement textures and nanite after
00:04 

00:04 importing your maps from Gaia?
00:08 

00:08 Let's fix this problem together in this
00:10 

00:10 tutorial.
00:15 

00:15 Hey everyone, today we're tackling a big
00:18 

00:18 issue in Unreal Engine. When you import
00:20 

00:20 a height map and activate nanite, parts
00:23 

00:23 of the terrain suddenly disappear. Let's
00:25 

00:25 fix that once and for all.
00:39 

00:39 Hey,
00:53 

00:53 hey, hey.
01:04 

01:04 Parallax occlusion mapping, POM, is a
01:08 

01:08 technique used to create realistic
01:09 

01:09 surface depth and detail on flat
01:12 

01:12 geometry without adding any extra
01:14 

01:14 polygons. In simple terms, it makes your
01:17 

01:17 textures like rocks, ground or bricks
01:21 

01:21 appear 3D and bumpy even though the mesh
01:24 

01:24 is completely flat. This is done using a
01:26 

01:26 height map to fake the illusion of
01:28 

01:28 depth. Now let's see how it actually
01:30 

01:30 works. First, we need our displacement
01:33 

01:33 texture. And here we'll extract it from
01:36 

01:36 our other DP texture. Then we make a
01:39 

01:39 copy of it. And to connect it to the POM
01:41 

01:41 node, we convert it into a standard
01:43 

01:43 texture.
01:47 

01:47 Now we need to connect the UV output to
01:49 

01:49 all of our textures. For the UV input,
01:52 

01:52 we'll use the same texture coordinate we
01:54 

01:54 multiplied earlier.
02:08 

02:08 Next, for the other input, press the
02:11 

02:11 number four key to create a color node
02:13 

02:13 with four outputs. Convert it to a
02:15 

02:15 parameter.
02:27 

02:27 and rename the channels to height ratio,
02:30 

02:30 minstep and max step. Because this node
02:33 

02:33 creates strong displacement, keep the
02:36 

02:36 height map value very low. The minstep
02:38 

02:38 and max step values control the quality
02:40 

02:40 of the height effect, but try not to set
02:42 

02:42 the max too high as it can make your
02:44 

02:44 scene heavy.
02:49 

02:49 The next input is the render shadow
02:52 

02:52 which we promote to a parameter. In the
02:54 

02:54 parallax occlusion mapping node, the
02:56 

02:56 render shadow input controls whether or
02:58 

02:58 not the fake parallax depth should
03:01 

03:01 affect the way the surface casts and
03:03 

03:03 receive shadows.
03:15 

03:15 Light vector. The light vector input
03:17 

03:17 tells the POM node where the main light
03:20 

03:20 is coming from. It defines the direction
03:22 

03:22 of light used to calculate internal
03:25 

03:25 micro shadowing within the parallax
03:27 

03:27 effect. We connect the sky atmosphere's
03:29 

03:29 directional light to this node so that
03:31 

03:31 as the sun moves, the shadows generated
03:34 

03:34 by the POM update dynamically and stay
03:37 

03:37 consistent with the lighting.
04:18 

04:18 The reason the settings didn't work here
04:20 

04:20 is that I forgot to link our displays
04:22 

04:22 texture from the ORDP to the height map
04:25 

04:25 channel input. To fix this, create a
04:27 

04:27 color node, set the blue value to one,
04:30 

04:30 and connect it to the input. That will
04:33 

04:33 solve the problem.
05:06 

05:06 To get better shadow results, use a lurp
05:09 

05:09 node. Make a copy of your texture and
05:11 

05:11 darken it using a multiply node. Then
05:14 

05:14 take the shadow output from the POM and
05:16 

05:16 connect it to the lurp's alpha input.
05:19 

05:19 This way you'll achieve much more
05:21 

05:21 realistic and balanced shadows.
05:58 

05:58 Wow. Wow.
06:12 

06:12 To make the displacement align more
06:14 

06:14 accurately with the objects in the
06:16 

06:16 scene, we can also connect the pixel
06:18 

06:18 depth offset output to its corresponding
06:20 

06:20 node in the material.