Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:05,240 --> 00:00:08,240
Let's take a basic look at how a scene is
rendered.
2
00:00:08,240 --> 00:00:11,320
This explanation describes path tracers, like
Cycles.
3
00:00:11,320 --> 00:00:15,080
Meanwhile, rasterizers like Eevee use very
different methods.
4
00:00:15,080 --> 00:00:19,210
But this is still relevant when working with
Eevee, because it tries to emulate the same
5
00:00:19,210 --> 00:00:24,199
behavior as much as possible, so to the user
a lot of the same rationale applies, even
6
00:00:24,199 --> 00:00:27,000
though it works differently behind the scenes.
7
00:00:27,000 --> 00:00:31,300
Also keep in mind that this is extremely simplified,
and doesn't accurately describe what's actually
8
00:00:31,300 --> 00:00:36,020
going on in Cycles or in the real world, but
it's enough as a foundation to start making
9
00:00:36,020 --> 00:00:37,020
shaders.
10
00:00:37,020 --> 00:00:38,640
Here we have a very simple scene.
11
00:00:38,640 --> 00:00:42,660
Let's take note that the cone which has a
very matt surface, and the sphere has a polished
12
00:00:42,660 --> 00:00:46,550
mirror-like surface, perfectly reflecting
almost all the light that hits it.
13
00:00:46,550 --> 00:00:50,630
The scene is lit with a single lamp, which
we can see as a little white dot reflected
14
00:00:50,630 --> 00:00:51,980
on the sphere.
15
00:00:51,980 --> 00:00:56,230
There is also the ground, and some environment
light, but we can ignore those for now.
16
00:00:56,230 --> 00:00:59,750
Let's keep the rendered scene in the corner
as a reference, and let's look at it from
17
00:00:59,750 --> 00:01:01,059
outside the camera.
18
00:01:01,059 --> 00:01:05,700
If this were a real scene, the lamp would
emit photons in all sorts of directions, some
19
00:01:05,700 --> 00:01:08,690
of which are represented here by the yellow
dots.
20
00:01:08,690 --> 00:01:12,939
These photons would mostly travel in a straight
path, until they hit an object.
21
00:01:12,939 --> 00:01:17,299
This is a lot of paths, so let's just focus
on one of them, to see what happens.
22
00:01:17,299 --> 00:01:20,380
Here, the path hit the cone, which has a matt
surface.
23
00:01:20,380 --> 00:01:24,649
Basically, this means that when light hits
it, it bounces in a random direction.
24
00:01:24,649 --> 00:01:29,229
The cone also has a color, which means that
some of the light gets absorbed, and the light
25
00:01:29,229 --> 00:01:33,609
that gets reflected determines the surface
color, in this case red.
26
00:01:33,609 --> 00:01:37,850
So now our light that was previously white,
gets colored red, and continues in a random
27
00:01:37,850 --> 00:01:39,180
direction.
28
00:01:39,180 --> 00:01:43,579
It happened to hit the sphere, which has a
sharp reflective surface, so that means that
29
00:01:43,579 --> 00:01:48,329
the ray can only bounce in a specific direction,
in which the outgoing angle is a perfect mirror
30
00:01:48,329 --> 00:01:50,350
of the incoming angle.
31
00:01:50,350 --> 00:01:54,539
Also note that the sphere is not completely
reflective, so it absorbs a bit of light,
32
00:01:54,539 --> 00:01:57,350
but being gray, it absorbs all colors equally.
33
00:01:57,350 --> 00:02:02,829
Finally, our reflected ray hits the camera,
contributing to the color of a specific pixel.
34
00:02:02,829 --> 00:02:07,609
Now, the thing is that this was a very specific
ray, which happened to hit the camera, but
35
00:02:07,609 --> 00:02:11,900
there would have been many more rays that
didn't hit the camera, and thus wouldn't contribute
36
00:02:11,900 --> 00:02:13,750
to the resulting image.
37
00:02:13,750 --> 00:02:17,930
But luckily, this whole process is mostly
reversible, so render engines usually do the
38
00:02:17,930 --> 00:02:19,590
whole thing backwards.
39
00:02:19,590 --> 00:02:24,030
We start by shooting many rays from the camera,
and trace them until they hit an object.
40
00:02:24,030 --> 00:02:26,710
Again, let's focus on a single ray.
41
00:02:26,710 --> 00:02:29,090
At this point, the shader is evaluated.
42
00:02:29,090 --> 00:02:32,911
This happens each time a ray hits an object,
and information about the object and the ray
43
00:02:32,911 --> 00:02:37,570
is passed in as input to the shader, which
we can retrieve with a number of nodes.
44
00:02:37,570 --> 00:02:40,180
We'll look more at this in a later chapter.
45
00:02:40,180 --> 00:02:44,860
Since this object has a fully sharp glossy
surface, the ray can only do one thing from
46
00:02:44,860 --> 00:02:47,060
here, a perfect reflection.
47
00:02:47,060 --> 00:02:50,650
Now the ray hits the cone, which having a
diffuse surface, would cause the ray to bounce
48
00:02:50,650 --> 00:02:52,520
off in a random direction.
49
00:02:52,520 --> 00:02:56,380
This would be very inefficient, as lots of
rays would never hit a light source, and be
50
00:02:56,380 --> 00:02:57,380
wasted.
51
00:02:57,380 --> 00:03:01,840
So instead, we check if this ray could reach
a light source without hitting any obstacles.
52
00:03:01,840 --> 00:03:05,940
For all we care, this has the same result
as if many rays were actually randomly bounced
53
00:03:05,940 --> 00:03:07,540
off the surface.
54
00:03:07,540 --> 00:03:12,030
Now that we reached the light, we can take
it's color and intensity, and trace it back,
55
00:03:12,030 --> 00:03:16,800
basically multiplying the light with the object
colors along the way, to get the final color.
56
00:03:16,800 --> 00:03:21,480
In reality it's a bit more complicated, but
that's the general gist.
57
00:03:21,480 --> 00:03:25,261
Now that we traced this path, let's check
it by just keeping that one dot from the ray
58
00:03:25,261 --> 00:03:30,170
that comes directly from the camera, and let's
get back into the camera view.
59
00:03:30,170 --> 00:03:34,110
Now if we fade in the actual render, we see
that the dot is very close in color to that
60
00:03:34,110 --> 00:03:35,590
point in the image.
61
00:03:35,590 --> 00:03:39,590
The only differences are because we ignored
world lighting and because we got the color
62
00:03:39,590 --> 00:03:43,690
by tracing a single ray, which kinda works
in such a simple scene, but generally you'd
63
00:03:43,690 --> 00:03:45,850
need many more rays.
64
00:03:45,850 --> 00:03:50,290
Once this whole process of shooting rays from
the camera is done many times for each pixel,
65
00:03:50,290 --> 00:03:54,730
their individual results get integrated into
the pixel color, which in rough terms is kinda
66
00:03:54,730 --> 00:03:57,790
like averaging the results of all the rays.
67
00:03:57,790 --> 00:04:00,180
And that's how we get the final image.
68
00:04:00,180 --> 00:04:04,540
The key point to remember about path tracing
in Cycles, is that the rays always start at
69
00:04:04,540 --> 00:04:07,980
the camera, and bounce around the scene until
they hit some light source.
7246
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.