Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:05,200 --> 00:00:09,620
Coordinate spaces are the foundation of any
procedural texture, so it's important to understand
2
00:00:09,620 --> 00:00:12,500
what they represent, and how to work with
them.
3
00:00:12,500 --> 00:00:14,980
Let's quickly review coordinates in Blender.
4
00:00:14,980 --> 00:00:18,390
An object has a position defined by a vector.
5
00:00:18,390 --> 00:00:24,150
This vector is the position of the object's
origin, as indicated by the orange dot.
6
00:00:24,150 --> 00:00:27,960
Moving the object around changes these coordinates.
7
00:00:27,960 --> 00:00:33,000
Remember that the coordinates represent how
far along each axis a point is, in this case
8
00:00:33,000 --> 00:00:35,220
the object's origin.
9
00:00:35,220 --> 00:00:39,960
Now, if we switch to edit mode, and select
a single vertex, we can see it's coordinate
10
00:00:39,960 --> 00:00:41,180
as well.
11
00:00:41,180 --> 00:00:45,730
And now, if we look at the same object motion
from before, we see that the vertex's coordinates
12
00:00:45,730 --> 00:00:47,260
don't change.
13
00:00:47,260 --> 00:00:51,239
That's because the vertex coordinates are
given in the object's own local coordinate
14
00:00:51,239 --> 00:00:54,400
space, rather than the world's coordinate
space.
15
00:00:54,400 --> 00:00:59,500
While the origin of the world is where the
X and Y axis lines intersect, the object's
16
00:00:59,500 --> 00:01:02,649
coordinate space is based around the object's
own origin.
17
00:01:02,649 --> 00:01:07,240
It also has its own axis directions and unit
lengths, defined by the object's rotation
18
00:01:07,240 --> 00:01:08,579
and scale.
19
00:01:08,579 --> 00:01:16,320
We can visualize this by enabling the axis
display in the object properties.
20
00:01:16,320 --> 00:01:20,530
Now if we rotate and scale the object, we
can see the axis directions, and the unit
21
00:01:20,530 --> 00:01:24,810
size for each axis, indicated by the axis
length.
22
00:01:24,810 --> 00:01:29,069
This understanding of how coordinates can
exist in different spaces, already takes us
23
00:01:29,069 --> 00:01:33,009
most of the way to understanding coordinate
spaces for material nodes.
24
00:01:33,009 --> 00:01:37,659
Let's take a look at what we get from the
coordinate space inputs in the node editor.
25
00:01:37,659 --> 00:01:41,951
When we render an object, we are working with
each individual ray hitting that object, so
26
00:01:41,951 --> 00:01:43,789
let's look at an example.
27
00:01:43,789 --> 00:01:47,460
Here we have a point on the object, and when
we take the coordinates, Blender gives us
28
00:01:47,460 --> 00:01:52,240
the X, Y, and Z values for the vector spanning
from the coordinate space's origin to our
29
00:01:52,240 --> 00:01:53,240
point.
30
00:01:53,240 --> 00:01:55,869
Now we have the coordinates, and they are
ready to use.
31
00:01:55,869 --> 00:02:02,509
Often, we want to visualize them, so if we
plug the vector into a color socket, the XYZ
32
00:02:02,509 --> 00:02:05,930
coordinates get mapped to RGB, and we see
the resulting color.
33
00:02:05,930 --> 00:02:09,350
Now we have a color that represents the coordinates
of that point.
34
00:02:09,350 --> 00:02:14,030
If we repeat that with every ray hitting the
object, we get the coordinates for every point
35
00:02:14,030 --> 00:02:17,620
on the surface, which we can also visualize
as colors.
36
00:02:17,620 --> 00:02:22,390
Note that the colors are a limited representation
of the underlying coordinate vectors, for
37
00:02:22,390 --> 00:02:26,330
instance, on the lower left of the object
we can see a big section that is completely
38
00:02:26,330 --> 00:02:30,069
black, but all those points on the surface
don't have a coordinate of zero.
39
00:02:30,069 --> 00:02:35,140
Rather, those are points where the coordinates
are below zero in all three axes, and negative
40
00:02:35,140 --> 00:02:39,299
numbers can't really be displayed as colors,
so we get a render result that is clipped
41
00:02:39,299 --> 00:02:40,299
to zero.
42
00:02:40,299 --> 00:02:45,110
But the actual vectors do contain the negative
values, and we can work with them just fine.
43
00:02:45,110 --> 00:02:49,620
Even the colors in the shader carry the actual
negative values, as there is no conversion
44
00:02:49,620 --> 00:02:54,690
between vectors and colors, the only limitation
is that they get clipped in the final render
45
00:02:54,690 --> 00:02:58,320
output, so we can't visualize them in this
way.
46
00:02:58,320 --> 00:03:02,310
There are a few different coordinate spaces,
so let's take a look at some of the most common
47
00:03:02,310 --> 00:03:03,310
ones.
48
00:03:03,310 --> 00:03:06,450
Firstly, there is the Position output from
the Geometry node.
49
00:03:06,450 --> 00:03:10,829
While we can't find this output on the Texture
Coordinate node, it is probably the most fundamental
50
00:03:10,829 --> 00:03:12,340
coordinate space.
51
00:03:12,340 --> 00:03:16,319
The Position coordinates are based on the
scene's global coordinate space.
52
00:03:16,319 --> 00:03:20,810
So the origin of this space is the origin
of the scene, and the axes are aligned with
53
00:03:20,810 --> 00:03:22,260
the scene axes.
54
00:03:22,260 --> 00:03:26,420
This means that if we transform the object,
the coordinates stay put and the object moves
55
00:03:26,420 --> 00:03:28,030
through the coordinate space.
56
00:03:28,030 --> 00:03:33,010
This is useful whenever we need the global
coordinates, but is rarely useful for animated
57
00:03:33,010 --> 00:03:37,230
objects, as the textures will shift on the
surface as the object moves.
58
00:03:37,230 --> 00:03:41,390
Next, let's look at the Object coordinates.
59
00:03:41,390 --> 00:03:47,360
Initially, these look the same as the Position,
however, the Object coordinates are aligned
60
00:03:47,360 --> 00:03:52,650
to the object's transformations, just like
the coordinates of the vertices in edit mode.
61
00:03:52,650 --> 00:03:55,569
This difference is clear when we transform
the object.
62
00:03:55,569 --> 00:03:58,819
Here we see that the coordinates move along
with the object.
63
00:03:58,819 --> 00:04:03,000
These coordinates are probably the most useful
for procedural texturing, as they stick with
64
00:04:03,000 --> 00:04:04,000
the object.
65
00:04:04,000 --> 00:04:08,049
And unlike the next coordinates we'll look
at, Object coordinates keep the proportions
66
00:04:08,049 --> 00:04:12,749
of the axes based on the object scale, so
it doesn't cause texture stretching.
67
00:04:12,749 --> 00:04:19,650
Lastly, we'll look at the Generated coordinates.
68
00:04:19,650 --> 00:04:23,420
These are also aligned to the object's axes,
just like the Object coordinates.
69
00:04:23,420 --> 00:04:26,960
However, they don't care about the Object's
origin, or scale.
70
00:04:26,960 --> 00:04:31,490
The origin of the Generated coordinate space
is set to the front-bottom-left corner of
71
00:04:31,490 --> 00:04:36,390
the object's bounding box, so that corner
has a value of zero in all axes.
72
00:04:36,390 --> 00:04:41,790
And one unit in the coordinate space is defined
as the size of the bounding box, in each axis.
73
00:04:41,790 --> 00:04:46,100
This means that the rear-top-right corner
of the bounding box always has a value of
74
00:04:46,100 --> 00:04:47,660
one in all axes.
75
00:04:47,660 --> 00:04:52,410
And as a result, all the coordinates on the
object are within a zero to one range.
76
00:04:52,410 --> 00:04:56,640
Keep in mind that this means that the coordinate
space will have the same proportions as the
77
00:04:56,640 --> 00:05:00,510
object, which means there will be texture
stretching if the bounding box is not a perfect
78
00:05:00,510 --> 00:05:01,920
cube.
79
00:05:01,920 --> 00:05:06,010
This coordinate space is useful whenever we
want to make a texture that follows the object's
80
00:05:06,010 --> 00:05:10,410
proportions, or when we are texturing an object
that has deforming animations such as with
81
00:05:10,410 --> 00:05:14,860
an armature or shape keys, we'll look at why
in a moment.
82
00:05:14,860 --> 00:05:18,600
It's important to know that we can transform
coordinates.
83
00:05:18,600 --> 00:05:22,140
The easiest way to do that, is with a Vector
Mapping node.
84
00:05:22,140 --> 00:05:25,820
This node allows us to translate, rotate,
and scale the coordinates.
85
00:05:25,820 --> 00:05:30,750
If we change the location values, we can see
the coordinates moving in each axis.
86
00:05:30,750 --> 00:05:35,080
When doing this, you might notice the coordinates
moving backwards from what you'd expect.
87
00:05:35,080 --> 00:05:39,430
That's because when the Mapping node transforms
a coordinate to be further along an axis,
88
00:05:39,430 --> 00:05:44,050
the point stays in place, but outputs the
coordinates of a point further along the axis,
89
00:05:44,050 --> 00:05:46,930
which makes the coordinate space as a whole
move backwards.
90
00:05:46,930 --> 00:05:51,880
But most of the time, we want to transform
the actual texture on the surface of the object,
91
00:05:51,880 --> 00:05:55,860
so the mapping node has a Texture mode, which
inverts all the transformations, to make it
92
00:05:55,860 --> 00:05:58,470
more intuitive to work with textures.
93
00:05:58,470 --> 00:06:02,750
And now we can see how the location, rotation,
and scale all transform the coordinates in
94
00:06:02,750 --> 00:06:04,560
the way we would expect.
95
00:06:04,560 --> 00:06:08,760
These transformations are very useful to move
textures around, and they also allow us to
96
00:06:08,760 --> 00:06:13,100
transform some coordinate spaces into other
coordinate spaces.
97
00:06:13,100 --> 00:06:16,910
Note that there are also some other ways to
transform coordinates, which we'll cover throughout
98
00:06:16,910 --> 00:06:18,830
the course.
99
00:06:18,830 --> 00:06:22,710
Keep in mind that we're not transforming the
actual underlying coordinates.
100
00:06:22,710 --> 00:06:27,650
For instance, if we rotate the coordinates
on a plane, it's not rotating the underlying
101
00:06:27,650 --> 00:06:32,460
coordinates, or the texture around some pivot
point, but rather calculating a rotated version
102
00:06:32,460 --> 00:06:36,090
of each individual vector around the (0,0)
point.
103
00:06:36,090 --> 00:06:41,100
So if we feed a constant vector into the mapping,
we're looking at a single solid color.
104
00:06:41,100 --> 00:06:45,150
Rotating this might seem nonsensical, as there
appears to be nothing to rotate.
105
00:06:45,150 --> 00:06:48,900
But if we do rotate it, we see that the color
changes everywhere.
106
00:06:48,900 --> 00:06:53,780
That's because, again, it's not rotating the
texture we're looking at, rather, at each
107
00:06:53,780 --> 00:06:58,180
point, it's rotating the vector around the
(0,0) point, which doesn't have to be an actual
108
00:06:58,180 --> 00:07:00,220
point somewhere in the scene.
109
00:07:00,220 --> 00:07:03,900
What's happening is more clear if we plot
it on a Cartesian plane.
110
00:07:03,900 --> 00:07:09,180
We were inputting a vector with a value of
0.8 on X and 0.3 on Y.
111
00:07:09,180 --> 00:07:11,560
We can see that vector plotted here.
112
00:07:11,560 --> 00:07:16,940
On the left, I also placed three bars showing
the values of X, Y, and Z, though Z is irrelevant
113
00:07:16,940 --> 00:07:19,900
here, as we're dealing with 2D coordinates
only.
114
00:07:19,900 --> 00:07:25,350
And all the way at the left, the square shows
the color we get by mapping XYZ to RGB.
115
00:07:25,350 --> 00:07:30,000
Now, when we rotate the vector, it's rotated
around the (0,0) point.
116
00:07:30,000 --> 00:07:34,400
And then we see how the X and Y vector coordinates
are changing, and how this is represented
117
00:07:34,400 --> 00:07:36,030
as a color.
118
00:07:36,030 --> 00:07:39,841
This is the same thing that's happening with
the vector at every point on the plane, no
119
00:07:39,841 --> 00:07:46,560
matter if it's a coordinate from an input
node, or if it's a constant vector.
120
00:07:46,560 --> 00:07:50,370
In this next example, there is a node group
that is tiling the Object coordinates from
121
00:07:50,370 --> 00:07:51,370
before.
122
00:07:51,370 --> 00:07:55,510
At this point it's not relevant this works,
we just know that this node tiles whatever
123
00:07:55,510 --> 00:07:57,250
coordinates you feed it.
124
00:07:57,250 --> 00:07:59,950
Now, after tiling, we have this mapping node.
125
00:07:59,950 --> 00:08:04,000
If we use it to rotate the coordinates, each
tile rotates individually.
126
00:08:04,000 --> 00:08:08,120
Each of the repeated values will generate
the same result, because each vector is being
127
00:08:08,120 --> 00:08:12,450
rotated individually, and it goes back to
the fact that given the same inputs, a node
128
00:08:12,450 --> 00:08:17,150
always gives the same outputs, and the fact
that nodes don't have any awareness of what's
129
00:08:17,150 --> 00:08:20,950
around, and also can't change the result of
an earlier node.
130
00:08:20,950 --> 00:08:25,300
After the tiling is computed, it's fixed,
and nothing that happens afterwards can change
131
00:08:25,300 --> 00:08:26,300
it.
132
00:08:26,300 --> 00:08:30,000
If we wanted to rotate the whole thing in
one piece, we'd put the mapping before the
133
00:08:30,000 --> 00:08:34,310
tiling, that way the coordinates get rotated,
and then tiled.
134
00:08:34,310 --> 00:08:37,380
The order of operations is really important.
135
00:08:37,380 --> 00:08:41,539
In many pixel based applications, you can
transform the result of one operation with
136
00:08:41,539 --> 00:08:46,090
another operation, and that's because the
application can actually transform the pixels
137
00:08:46,090 --> 00:08:51,150
themselves, but here, we're working with rays
in a 3D scene, and we cannot access the results
138
00:08:51,150 --> 00:08:52,420
of other rays.
139
00:08:52,420 --> 00:08:57,150
This does mean that some operations can seem
backwards, and incidentally, this is also
140
00:08:57,150 --> 00:09:02,060
why there is no blur node, despite popular
request, it's simply not possible, or at least
141
00:09:02,060 --> 00:09:04,420
not in any remotely efficient way.
142
00:09:04,420 --> 00:09:08,770
There is still one thing that's important
to know about the different coordinate spaces.
143
00:09:08,770 --> 00:09:13,320
I mentioned earlier that Generated coordinates
are useful when we want to texture objects
144
00:09:13,320 --> 00:09:15,270
with deforming animations.
145
00:09:15,270 --> 00:09:20,140
The reason is that if we look at Object coordinates
on a deforming object, we see that the coordinates
146
00:09:20,140 --> 00:09:24,320
stay in place, and the mesh moves through
the coordinates as it deforms.
147
00:09:24,320 --> 00:09:30,550
Now here, we have Generated coordinates, that
I transformed to match the Object coordinates.
148
00:09:30,550 --> 00:09:33,490
This time, the coordinates deform with the
object.
149
00:09:33,490 --> 00:09:37,330
That's because the Generated coordinates are
computed on the mesh before any shape keys
150
00:09:37,330 --> 00:09:39,570
or deform modifiers are applied.
151
00:09:39,570 --> 00:09:43,650
This is very useful when we want a texture
to stick to a deforming object.
152
00:09:43,650 --> 00:09:47,770
We can see that really well if we feed the
coordinates into a Noise Texture.
153
00:09:47,770 --> 00:09:51,980
With the Object coordinates the object moves
through the texture.
154
00:09:51,980 --> 00:09:59,270
But with the Generated coordinates, the texture
sticks to the surface and deforms with it.
155
00:09:59,270 --> 00:10:03,680
And that's a general overview of what texture
coordinates are, how the different coordinate
156
00:10:03,680 --> 00:10:06,420
spaces work, and some basic vector transformations.
16726
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.