WEBVTT

00:00.450 --> 00:08.700
Welcome to light portals in this video you will learn how to use light portals understand the limitations

00:08.730 --> 00:13.720
of their use see that they can dramatically increase quality.

00:13.860 --> 00:21.240
Given a fixed number of samples and see they're especially useful for indoor environments little by

00:21.240 --> 00:23.220
environmental lighting.

00:23.520 --> 00:29.590
So to talk about portals we need to talk first about cycles and how the lighting works.

00:29.850 --> 00:32.960
Light rays are fired out from the camera.

00:32.970 --> 00:36.640
The active camera until they hit a light source.

00:36.780 --> 00:42.240
Now this sounds a bit counterintuitive in to you imagine well that light source could be projecting

00:42.240 --> 00:46.630
light in any direction and to make sure we don't waste time.

00:46.740 --> 00:55.020
The Rays are fired from the camera so that we are capturing the light that only the camera can see.

00:55.760 --> 01:02.720
With the lamp blender knows where the light sources so only fires rays that will eventually hit the

01:02.720 --> 01:03.550
light source.

01:03.620 --> 01:07.570
And this often ends up with a nice clean image.

01:07.970 --> 01:15.350
Now with a missive materials blender doesn't know where the light sources so when the camera fires those

01:15.350 --> 01:18.560
rays some of them never reach a light source.

01:18.650 --> 01:21.460
And this introduces more noise.

01:22.610 --> 01:30.020
With environmental lighting when you've got a sky map in the scene or an HDR high dynamic range environmental

01:30.020 --> 01:38.120
or lighting in an interior with only windows letting light in the Rays bounce around a lot and only

01:38.120 --> 01:42.420
a few actually manage to go out the window and reach the light source.

01:43.400 --> 01:47.710
This introduces a lot of noise in the final image.

01:47.720 --> 01:50.150
Given a certain number of samples.

01:50.950 --> 01:53.040
So how do portal's help.

01:53.260 --> 01:57.800
Well portal's helped by telling Glendale where to aim those rays.

01:57.820 --> 02:01.690
This produces much less noise in the final image.

02:01.960 --> 02:04.870
However they do have some limitations.

02:05.050 --> 02:12.460
Poor tools are a cycle's lighting feature which means that they won't work externally to blend and they

02:12.460 --> 02:17.230
won't work with the blender internal rendering engine.

02:17.710 --> 02:20.650
They increase light calculation time.

02:20.650 --> 02:27.520
However that's offset by the fact you don't have to render as quickly so they produce much less noisy

02:27.520 --> 02:28.770
environments.

02:29.410 --> 02:37.560
Poor tools only work with environmental lights using them otherwise can reduce quality.

02:39.060 --> 02:40.850
And they have little impact.

02:40.860 --> 02:46.270
If you put something in the way so that's going to have a look at couple of examples before we hop into

02:46.270 --> 02:47.040
a blender.

02:47.220 --> 02:54.840
So this is in a missive plane that's placed outside that hole in the in this box and there is no portal.

02:55.050 --> 02:59.790
If we put a portal in the way when it actually looks worse and noisier.

02:59.940 --> 03:02.680
So that's an example of it not working.

03:02.850 --> 03:08.490
And in fact making things worse with a missive plane that's outside.

03:08.550 --> 03:11.290
So what happens if we bring the missing plane.

03:11.310 --> 03:13.400
So it's faking being the window.

03:13.410 --> 03:17.060
Well this is with no port that's a relatively clean image.

03:17.250 --> 03:21.960
In the missive plane acting as the window and a portal there to guide it.

03:21.980 --> 03:24.940
Well you see it actually makes it worse again.

03:25.020 --> 03:27.470
Now let's have a look at an environmental light.

03:27.480 --> 03:31.160
So at this point the environment is just white.

03:31.170 --> 03:38.250
To be consistent and there is no portal you can see that that image is very hard to even work out what

03:38.250 --> 03:38.820
that is.

03:38.820 --> 03:42.100
Is it a cube or is it just a bunch of noise.

03:42.120 --> 03:47.250
Well with a poor tool it makes a phenomenal amount of difference.

03:47.400 --> 03:49.310
And just for example.

03:49.320 --> 03:57.680
This is a sunlamp placed outside with a thousand samples and you can see yes the lighting slightly differently

03:57.690 --> 04:00.000
because it's not an environmental light.

04:00.000 --> 04:07.520
It's a point light source in the sky being a sunlamp it's still noisier than the previous one.

04:07.560 --> 04:13.210
So some examples of when you stick something in the way are we're going to see some familiar faces here.

04:13.620 --> 04:17.820
A There's some bunnies lamps and bowling pins and a chess set.

04:17.820 --> 04:23.220
So we have four different scenes here that we're going to run through and show you the difference.

04:23.220 --> 04:29.120
The top two are with and without a portal and so are the bottom two.

04:29.450 --> 04:35.760
However the bottom two have a glass window in the way so let's go have a look at these in a bit more

04:35.760 --> 04:36.570
detail.

04:36.660 --> 04:40.940
So this is the scene rendered with a portal.

04:41.660 --> 04:47.150
So you can see it's only 30 samples in this case so there is still noise in the scene.

04:47.150 --> 04:54.200
It took about 30 odd minutes to do this particular scene render on a g.t. X 980 just to give you an

04:54.200 --> 05:01.160
idea of times taken even that 30 samples because there's there's a lot of complexity in this particular

05:01.160 --> 05:01.980
scene.

05:02.360 --> 05:08.900
Now if we see it without support or you can see that it's much more noisy especially in the darker areas

05:08.930 --> 05:10.610
of the scene.

05:10.610 --> 05:15.950
Now it changes slightly when you go and put a window in.

05:15.950 --> 05:18.730
So at the moment that's just a hole in the wall.

05:18.830 --> 05:20.180
Go and put a window in.

05:20.360 --> 05:25.970
Well much less light actually enters the room because it's bouncing in and out of that glass.

05:26.030 --> 05:27.920
So less light comes in.

05:27.920 --> 05:32.610
So one of these has a portal and this next one does not.

05:33.550 --> 05:35.380
What did you see the difference there.

05:35.390 --> 05:36.520
This is before.

05:37.310 --> 05:38.580
And this is after.

05:39.680 --> 05:41.660
Well I struggle to see the difference there.

05:41.710 --> 05:47.290
And that just goes to show that if you stick something in the way like glass that you think well actually

05:47.290 --> 05:52.330
if it's an environmental light in the air yet of the glass it will help guide the Rays.

05:52.330 --> 05:57.310
No one fortunately certainly at the moment that doesn't help at all.

05:57.310 --> 06:01.500
In fact in this case it seems to make no difference whatsoever.

06:01.960 --> 06:07.290
So let's now hop on over into blender and play with some light portal's.

06:08.400 --> 06:15.300
So let's start off with a basic cube in our scene so I've opened up a brand new blender file and will

06:15.300 --> 06:17.080
take it from there.

06:17.100 --> 06:22.740
The first thing this I'm going to do is remove the lamp from this basic scene because it's no longer

06:22.740 --> 06:24.100
required.

06:24.420 --> 06:26.880
And we're going to add a different light source.

06:26.910 --> 06:30.590
So we're going to go to the world propertys.

06:30.640 --> 06:36.930
We're going to change the colour of the world to a white and just go ahead hit render and see how that

06:36.930 --> 06:37.750
comes out.

06:37.800 --> 06:40.680
That's exactly what I'll be expecting for it to happen.

06:40.680 --> 06:47.220
This cube is uniformly lit from the outside so we can't see any details because it's white all around.

06:47.220 --> 06:48.110
Perfect.

06:48.120 --> 06:54.150
So let's hop back into the 3-d view and let's make this cube much much much bigger.

06:54.150 --> 06:57.700
So hop into edit mode and scale it up.

06:59.210 --> 07:01.320
By let's make it 10 times bigger.

07:01.490 --> 07:03.410
And then we can exist in it.

07:03.590 --> 07:09.980
And I'm going to lift it up by 10 on the z axis 2 and that should place on the ground.

07:09.980 --> 07:14.550
Excellent so we can easily be inside here and have a switch to the camera mode.

07:14.590 --> 07:19.200
I'm inside it so you've created a fake building very quickly.

07:19.340 --> 07:22.130
The next thing I'm going to do is subdivide.

07:22.130 --> 07:24.440
This keeps on going to come out of a camera mode.

07:24.470 --> 07:30.020
I'm going to subdivide this cube a couple of times so I'm gonna use the tool shelf here.

07:30.090 --> 07:33.820
I want it so I can just remove some of these faces.

07:33.980 --> 07:41.070
So I'm going to go ahead here and remove a zigzag pattern going down.

07:42.310 --> 07:44.110
And for those too there why not.

07:44.110 --> 07:45.670
In fact let's just remove those.

07:45.670 --> 07:47.170
They're perfect.

07:47.170 --> 07:48.940
So let's delete.

07:48.940 --> 07:50.860
I want the faces gone sir.

07:50.860 --> 07:52.020
There we go.

07:52.030 --> 07:52.390
There we go.

07:52.390 --> 07:54.840
There is our funky window in the wall.

07:54.970 --> 08:01.090
And the final thing we're going to do before we actually start playing inside is to add a modifier which

08:01.090 --> 08:07.640
is a solidify which will make the walls for us and that's under generate solidify.

08:07.800 --> 08:11.650
And I'm going to increase the thickness to point one.

08:11.650 --> 08:15.670
Now one of the things you have to watch out here for is if you look through that there's a bit of a

08:15.670 --> 08:17.050
curve going on.

08:17.140 --> 08:24.460
And if we have a look in fact this is a very thick cube some was going to make it maybe point four so

08:24.460 --> 08:28.900
we can see more what's happening now as it's moving around the edge.

08:28.930 --> 08:30.790
Can we see an wireframe mode.

08:30.790 --> 08:33.370
More detail.

08:33.370 --> 08:35.350
It's not exaggerating it that much.

08:35.350 --> 08:41.740
But basically if you take even thickness It'll make sure that the thickness is applied evenly throughout

08:41.740 --> 08:42.480
the model.

08:42.730 --> 08:47.730
So let's hop inside and I'm going to move my camera about so I can see more.

08:47.770 --> 08:50.190
I'm going to use the walkaround feature.

08:50.190 --> 08:53.620
So we've got our window there.

08:53.620 --> 08:55.270
This is quite a large room.

08:55.300 --> 09:01.150
And I think I've just gone through so I'm just going to come out of wireframe and do that again.

09:01.630 --> 09:07.210
So I know when I pass there and I might want a wide angle lens in fact I think I do in this case.

09:07.380 --> 09:15.130
So I'm going to go ahead and change the camera properties so it has a wider focal length.

09:15.130 --> 09:16.280
I'm going to go for 80.

09:16.340 --> 09:17.740
There we go see much more.

09:17.740 --> 09:20.850
So let's see how this looks at the moment.

09:21.430 --> 09:22.060
There we go.

09:22.060 --> 09:26.740
We have quite a noisy scene now on the render results.

09:26.740 --> 09:27.660
Down at the bottom.

09:27.670 --> 09:34.870
I'm going to change your it's slot one to slot two so we can compare in a few moments and I'm just going

09:34.870 --> 09:38.720
to make this a bit larger so we can compare them much more closely.

09:38.740 --> 09:40.740
So let's now hop to the 3-d view.

09:40.790 --> 09:51.580
Now in order to add a now in order to go ahead and add in a portable is actually a type of lamp some

09:51.580 --> 09:56.290
going to add the portal here and I'm going to cover all four windows with it if they're close together

09:56.290 --> 09:58.210
you can cover them all together.

09:58.210 --> 10:03.310
Obviously the number of portals if you have too many of them may add up and cost you more in calculation

10:03.310 --> 10:03.790
time.

10:03.820 --> 10:08.950
But in this case we can just cover this middle square because it doesn't really matter compared to the

10:08.950 --> 10:10.310
other ones around it.

10:10.360 --> 10:12.670
We could of course add four portals.

10:12.670 --> 10:23.620
So let's go in add a lamp of type area and in the properties for the lamp we can change it so says portal.

10:23.620 --> 10:26.350
That's all we need to do in terms of setting that up.

10:26.560 --> 10:33.880
Apart from we need to rotate it round so I'm going to rotate it's on the y axes and ungless looking

10:33.880 --> 10:36.030
down there so it's going to be why by 90.

10:36.070 --> 10:40.350
You see that dotted line that white dotted line now orange coming out of it.

10:40.360 --> 10:42.070
That's the direction it wants to face.

10:42.070 --> 10:44.710
The light is going that way.

10:44.890 --> 10:46.630
So the final thing here is to do the size.

10:46.630 --> 10:51.370
Now there's an option over in the properties to have it square or rectangular.

10:51.370 --> 10:56.610
So you can have it different proportions under the leave it set square since it's there.

10:56.690 --> 10:59.980
And I'm going to just go up and up and up.

11:00.040 --> 11:04.030
I think this is end up going to be 10 No 12.

11:04.090 --> 11:04.470
There we go.

11:04.470 --> 11:07.980
So 12 covers the entire thing I'm going to add a little extra.

11:08.050 --> 11:15.160
And now when we go back inside the building and hit render we should end up with a much less noisy image.

11:15.160 --> 11:19.030
Now I've got the default settings here so that's 10 samples.

11:19.030 --> 11:22.580
And the difference between that and.

11:22.600 --> 11:30.020
Okay that was a great example I didn't switch to slot before hitting render cilice just render it without.

11:31.800 --> 11:32.480
So there we go.

11:32.490 --> 11:37.980
This one is much noise zarine slot to them with out.

11:38.370 --> 11:45.720
Now one thing that should be noted at this point is that the rough render did take just over three seconds

11:45.720 --> 11:49.530
and the other one was I think it was five and a bit seconds.

11:49.530 --> 11:52.350
Well we can quickly go and check it would go to slot 1.

11:52.350 --> 11:57.780
I'm going to turn my area lamp back on and then render again.

11:57.780 --> 12:03.120
Now this isn't these aren't optimal squares for this particular render they need to be made a bit smaller.

12:03.120 --> 12:03.620
So there you go.

12:03.620 --> 12:05.830
Five point six so it's taking a bit longer.

12:05.940 --> 12:12.740
But let's see if doubling the sample counts on slot three makes a difference because.

12:13.690 --> 12:14.580
I don't think it.

12:14.590 --> 12:22.420
Well I think that's the one at stenn samples with a portal is going to be much cleaner than 20 samples

12:22.440 --> 12:24.070
with out a portal.

12:25.660 --> 12:32.660
So it should take at least twice as long to do this is the one with the portal that 20 samples.

12:32.800 --> 12:38.290
And let's go to slot four and do the one with out the portal just to demonstrate that it's still going

12:38.290 --> 12:39.680
to be noisy.

12:40.590 --> 12:44.080
And we can see straightaway it's going to be much more noisy.

12:44.250 --> 12:50.040
So let's just have a look through these then so we've got slot 1 which was 10 samples with a portal

12:50.220 --> 13:00.030
slot who is 10 samples without a portal slot three is 20 samples with a portal and slot four is 20 samples

13:00.030 --> 13:01.230
without a portal.

13:01.230 --> 13:07.290
So we compare the one that's taken nearly the same time as the first one with a portal.

13:07.350 --> 13:10.840
You can see it's still much much cleaner.

13:10.920 --> 13:15.440
So now we understand about portals and how to put them into a scene.

13:15.600 --> 13:17.600
I've got a small challenge for you.

13:18.320 --> 13:22.290
I would like you to add some portals to your interior.

13:22.430 --> 13:29.450
So add in environment texture or indeed just adjust the world surface like I did in the example hide

13:29.480 --> 13:32.340
or remove any other light sources.

13:32.360 --> 13:34.170
So it's a fair comparison.

13:34.640 --> 13:37.830
Render your interior at about 20 sample.

13:39.330 --> 13:48.570
Render your teria about 20 samples first for a baseline ad like poor tools to those windows and then

13:48.570 --> 13:53.450
render the scene and share in the discussions the difference it's made.

13:53.460 --> 13:55.730
Pause video now and give that a go.

13:57.330 --> 13:58.350
Okay guys welcome back.

13:58.350 --> 14:01.500
Let's go add some portal's to our interior.

14:01.500 --> 14:04.450
So I've made sure my camera is in roughly the right position.

14:04.470 --> 14:11.150
I managed to make it a little bit wonky and the first thing that I'm going to do is do the render.

14:11.160 --> 14:13.290
But make sure the render settings are fair.

14:13.290 --> 14:15.960
So let's just check the number of samples.

14:15.960 --> 14:17.850
The number of samples is 50.

14:17.850 --> 14:20.280
Let's drop it down to 20.

14:20.280 --> 14:24.340
Go ahead and hit render the moment that's done.

14:24.370 --> 14:29.400
Oh I haven't added my environmental lighting yet or remove the other lights from the scene.

14:29.400 --> 14:31.410
I'll be back in a few moments.

14:31.410 --> 14:32.220
There we go.

14:32.220 --> 14:34.830
I've added an environmental light.

14:34.830 --> 14:40.680
It's just going to be a white one for the moment and now I've added that I just can see how that renders

14:40.770 --> 14:43.780
out looking pretty noisy at the moment.

14:43.780 --> 14:46.500
Be interesting to see whether it makes a difference.

14:46.590 --> 14:52.830
Once we add light portals and the reason why I say that is great cause there's a lot of gaps in the

14:52.830 --> 14:58.050
in the in the building at the moment which may cause or may not cause some problems.

14:58.170 --> 15:00.830
But there we go that's gives us a nice base level.

15:00.840 --> 15:04.220
Now I'm going to go ahead and add portals to the rest of these.

15:04.230 --> 15:05.770
Now I've got two choices.

15:05.910 --> 15:13.260
In this particular case I could go in and light portals to the original mesh and then re append them

15:13.290 --> 15:14.620
into the scene.

15:15.000 --> 15:21.940
Or I could stretch one along this entire wall for instance and then the rest groups too.

15:21.990 --> 15:28.800
In this case I am going to do that rather than modelling modifying the original having to reimport and

15:28.800 --> 15:30.780
change over these bits.

15:30.780 --> 15:32.360
Not going to do that at the moment.

15:34.780 --> 15:39.100
And there we go so I've added several portals into my scene.

15:39.100 --> 15:46.630
I think that's for future iterations I probably will make the poor tour with in the models themselves

15:46.930 --> 15:53.740
so that I never have to redo this but for the sake of this particular model I've gone ahead and done

15:53.740 --> 16:00.180
it anyway and I'm just going to go ahead and render the image so I've overwritten my original.

16:01.190 --> 16:02.400
Which is pretty silly.

16:02.640 --> 16:09.450
Okay so straightaway I can see that this particular render I inadvertently overwrote my first one for

16:09.450 --> 16:10.440
comparison.

16:10.440 --> 16:14.900
This one's taking as significantly less time.

16:14.910 --> 16:20.600
I can see straight away it's quick of the rendering with the light portal took one minute twenty four.

16:20.800 --> 16:27.120
And this was already on 24 seconds because it's counting up and it's an I don't know about the quality

16:27.120 --> 16:27.330
though.

16:27.360 --> 16:31.930
This is this is going to be one of these things where I am not sure whether the big holes in here are

16:31.930 --> 16:35.410
letting enough light in any way that we won't see much of a difference.

16:35.460 --> 16:36.470
But now it's rendered.

16:36.480 --> 16:38.200
Let's go and have a look.

16:38.220 --> 16:44.050
I'm going to make this as big as I possibly can for comparison so I look through the doorway here.

16:44.130 --> 16:47.530
And this is with portals without.

16:48.000 --> 16:56.100
With Okay I think in this particular instance portals aren't going to help us until I've got this roof

16:56.190 --> 16:57.830
sealed in.

16:58.020 --> 17:03.330
I can do a few checks to see whether that is the case but otherwise I think that's just not letting

17:03.510 --> 17:05.910
or is letting enough light in already.

17:05.930 --> 17:12.270
The camera is finding a light source and that's especially true at the moment because the camera is

17:12.270 --> 17:14.730
facing these big gaps.

17:14.730 --> 17:20.700
There is a lot of light that will naturally just bounce off of these floor bits etc and automatically

17:20.700 --> 17:23.620
end up hitting this sky box in the background.

17:23.650 --> 17:28.440
That's something to bear in mind the areas perhaps where that's not the case where it doesn't have a

17:28.440 --> 17:33.750
great big hole in the wall may be slightly different so I'm going to move the camera down and just check

17:33.790 --> 17:35.780
that hypothesis as well.

17:37.330 --> 17:44.350
So I'm just rendering here with out at the light portals and then I'll enable them and compare.

17:44.350 --> 17:48.070
And here's the final render with those light portals turned and was is finished.

17:48.070 --> 17:53.620
I'll compare the two and see if my hypothesis that facing a giant light source any weighed with the

17:53.620 --> 17:58.460
camera is going to mitigate most of the benefits of a light portal.

18:02.110 --> 18:09.250
Okay so looking at the two I can quite comfortably say at this point I think enough light is entering

18:09.250 --> 18:14.680
our scene that we don't particularly have a problem lighting it.

18:14.680 --> 18:19.560
So with that in mind I'm glad any more light portals at the moment.

18:19.570 --> 18:25.060
In my particular scene I think if I didn't have quite so many windows we might be able to see more of

18:25.090 --> 18:32.350
an affect of this whole building didn't have this great big open archway at the top as well.

18:32.500 --> 18:38.290
So I will keep the portals in mind for my particular model if it starts to get noisy I can start adding

18:38.290 --> 18:42.500
them in later and I will start adding them into the actual pieces themselves.

18:42.610 --> 18:48.470
So when I link for more highly detailed models in it will bring across the portal information as well.

18:49.360 --> 18:55.300
I'd love to see your models did using light portals of make your scene less noisy.

18:55.300 --> 18:58.600
Did it make no difference at all like it has done mine here.

18:58.630 --> 19:02.850
Please post in discussions and I will see you guys in the next lecture.
