Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:04,299 --> 00:00:08,760
Displacement is useful for adding surface
detail that is inconvenient or too small to
2
00:00:08,760 --> 00:00:09,760
model.
3
00:00:09,760 --> 00:00:13,810
Displacement works by actually moving the
vertices of a mesh, based on a displacement
4
00:00:13,810 --> 00:00:18,020
map, though at the moment, this is only supported
in Cycles.
5
00:00:18,020 --> 00:00:23,269
We can use a shader to move vertices anywhere
in space, which is called vector displacement,
6
00:00:23,269 --> 00:00:27,539
but in this course we'll only cover the simpler
normal displacement, which uses a height map
7
00:00:27,539 --> 00:00:30,179
to displace along the surface normals.
8
00:00:30,179 --> 00:00:34,320
We can use any technique we want to generate
the height map, which consists of a single
9
00:00:34,320 --> 00:00:37,480
value that indicates how far to displace a
given point.
10
00:00:37,480 --> 00:00:41,510
For instance, here we have a Noise Texture
that we can use as a height map.
11
00:00:41,510 --> 00:00:45,750
The Material Output node has a socket for
Displacement, but it's expecting a vector
12
00:00:45,750 --> 00:00:50,190
indicating how far, and in which direction
to move, so we can't plug our height map in
13
00:00:50,190 --> 00:00:51,190
there directly.
14
00:00:51,190 --> 00:00:56,020
Note that the Displacement socket is just
like any other vector socket, so if we plug
15
00:00:56,020 --> 00:01:00,399
a value in there, it would just trigger the
usual value to vector conversion, and all
16
00:01:00,399 --> 00:01:04,920
three vector channels would carry the same
value, resulting in a diagonal displacement,
17
00:01:04,920 --> 00:01:07,170
which is basically never what we want.
18
00:01:07,170 --> 00:01:10,980
This is not to say that we would never want
a diagonal displacement, but just that this
19
00:01:10,980 --> 00:01:15,940
is not a reasonable way to achieve it, as
we have no control over the direction.
20
00:01:15,940 --> 00:01:20,180
To properly displace using a height map, we
can use the Displacement node, from the Vector
21
00:01:20,180 --> 00:01:24,440
category, not to be confused with the Vector
Displacement node.
22
00:01:24,440 --> 00:01:30,080
The Displacement node will compute the displacement
vectors along the surface normals for us.
23
00:01:30,080 --> 00:01:34,240
So let's apply a simple shader, connect the
Noise Texture to the displacement height,
24
00:01:34,240 --> 00:01:37,400
and connect the displacement vector to the
Material Output.
25
00:01:37,400 --> 00:01:40,970
This causes a change in shading, but the plane
is still flat.
26
00:01:40,970 --> 00:01:45,790
That's because by default displacement is
not enabled, so we need to go to the material
27
00:01:45,790 --> 00:01:50,020
settings, and change the displacement from
Bump Only, to one of the actual displacement
28
00:01:50,020 --> 00:01:53,750
options, let's use Displacement Only for now.
29
00:01:53,750 --> 00:01:57,770
The plane still doesn't seem to be displaced
properly, and that's because, as I mentioned
30
00:01:57,770 --> 00:02:03,170
before, displacement works on the actual mesh
vertices, and here we just have four of them.
31
00:02:03,170 --> 00:02:07,360
The way it works, is that before the actual
render starts, the displacement texture is
32
00:02:07,360 --> 00:02:12,910
evaluated at each vertex's exact location,
and the vertices are displaced accordingly.
33
00:02:12,910 --> 00:02:15,950
So to get the proper effect we'll need more
geometry.
34
00:02:15,950 --> 00:02:18,970
We can, for example, use a subdivision modifier.
35
00:02:18,970 --> 00:02:23,470
Now as we increase the subdivision levels,
we see the displacement also getting more
36
00:02:23,470 --> 00:02:24,470
detailed.
37
00:02:24,470 --> 00:02:29,360
So it's important to always have enough geometry
for whatever kind of texture we're using for
38
00:02:29,360 --> 00:02:31,090
displacement.
39
00:02:31,090 --> 00:02:33,950
Let's take a look at the displacement parameters.
40
00:02:33,950 --> 00:02:38,780
The Space parameter, when set to Object Space,
causes the displacement to inherit the object
41
00:02:38,780 --> 00:02:43,210
scale, so the amount of displacement gets
scaled together with the object.
42
00:02:43,210 --> 00:02:48,380
Meanwhile, when set to World Space, the displacement
always uses world units, so the amount of
43
00:02:48,380 --> 00:02:54,340
displacement is not proportional to the object
scale.
44
00:02:54,340 --> 00:02:59,520
As we saw, the Height input is where we plug
our height map.
45
00:02:59,520 --> 00:03:04,150
The Midlevel is the value that will be treated
as the object's typical surface level, meaning
46
00:03:04,150 --> 00:03:05,680
no displacement.
47
00:03:05,680 --> 00:03:10,110
For procedural textures, we can generally
set this to zero, but with image textures,
48
00:03:10,110 --> 00:03:14,680
negative values are often not supported, so
to be able to displace both into and out of
49
00:03:14,680 --> 00:03:18,450
the surface, a value of 0.5 is often reasonable.
50
00:03:18,450 --> 00:03:23,300
But all this does is offset the whole surface
in or out, by subtracting the Midlevel value
51
00:03:23,300 --> 00:03:25,130
from the whole height map.
52
00:03:25,130 --> 00:03:30,090
The Scale determines how much one unit in
our texture represents.
53
00:03:30,090 --> 00:03:32,630
This is really just a multiplier for our height.
54
00:03:32,630 --> 00:03:37,080
If the Scale is set to one, then one unit
in our texture represents one unit in the
55
00:03:37,080 --> 00:03:38,430
output space.
56
00:03:38,430 --> 00:03:43,360
So if we selected world space, that's one
Blender unit, and if we selected Object space
57
00:03:43,360 --> 00:03:45,700
it's also scaled by the Object scale.
58
00:03:45,700 --> 00:03:50,090
This parameter is important if you are working
with real world units, or just to have a sense
59
00:03:50,090 --> 00:03:52,010
of scale in general.
60
00:03:52,010 --> 00:03:57,000
Lastly, Blender will fill in the surface normals
automatically, so we can leave the Normal
61
00:03:57,000 --> 00:04:04,680
input disconnected, unless we have some different
normals that we computed in the shader.
62
00:04:04,680 --> 00:04:08,741
Now if we switch to Eevee, even though the
displacement is not supported, we see that
63
00:04:08,741 --> 00:04:12,550
the texture is affecting the shading, just
like it was with Cycles before we switched
64
00:04:12,550 --> 00:04:15,680
on the actual displacement in the material
settings.
65
00:04:15,680 --> 00:04:19,180
What's happening is that it's using our height
map as a bump map.
66
00:04:19,180 --> 00:04:22,499
This works in the same way as the Bump node.
67
00:04:22,499 --> 00:04:26,819
The way a bump map works is that whenever
a ray hits the mesh, even though the actual
68
00:04:26,819 --> 00:04:31,110
position is not affected by the height map,
it calculates what the surface normal would
69
00:04:31,110 --> 00:04:34,569
have been if it had actually been displaced.
70
00:04:34,569 --> 00:04:38,620
This way, the rays bounce off the surface,
as if the mesh was pointing in the displaced
71
00:04:38,620 --> 00:04:39,979
direction.
72
00:04:39,979 --> 00:04:45,259
It calculates the normal by evaluating the
height map at the point where the ray hit,
73
00:04:45,259 --> 00:04:49,280
but also at a couple of nearby points, and
based on the height difference, it calculates
74
00:04:49,280 --> 00:04:51,530
the normal angle.
75
00:04:51,530 --> 00:04:55,710
This means that this is one of the few instances
where something is calculated not only at
76
00:04:55,710 --> 00:05:00,449
the actual point where the ray hit the mesh,
but also some other nearby points.
77
00:05:00,449 --> 00:05:04,360
Though that also means that this is quite
an expensive operation, as the height map
78
00:05:04,360 --> 00:05:07,000
is evaluated three times for each ray.
79
00:05:07,000 --> 00:05:12,419
Now that we know about bump mapping, we can
go back to the material settings, and look
80
00:05:12,419 --> 00:05:14,589
at the displacement mode again.
81
00:05:14,589 --> 00:05:19,419
The compound Displacement and Bump mode is
useful as it will displace the mesh, but also
82
00:05:19,419 --> 00:05:22,789
compute the correct normal according to the
height map.
83
00:05:22,789 --> 00:05:27,020
This means that even if we don't have enough
subdivisions to show every tiny detail, we
84
00:05:27,020 --> 00:05:31,080
can still see them in the shading, while the
displacement takes care of the major shapes.
85
00:05:31,080 --> 00:05:36,509
Note that this will slow the render down significantly,
compared to using just displacement, but it
86
00:05:36,509 --> 00:05:41,009
can be worth it for the extra detail, thought
sometimes increasing the subdivisions is actually
87
00:05:41,009 --> 00:05:42,930
faster than enabling bump.
88
00:05:42,930 --> 00:05:47,529
This is something to benchmark case by case,
and it also depends if your priority is speed
89
00:05:47,529 --> 00:05:52,599
or memory usage, as subdivisions could cause
you to run out of memory, in which case adding
90
00:05:52,599 --> 00:05:54,039
the bump is the only option.
9690
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.