WEBVTT

00:00.150 --> 00:07.080
Welcome to texture's with transparency in this video you will learn how to use cycles nodes to apply

00:07.080 --> 00:14.610
transparency to your image and use groups for nodes for simplicity and then use those node groups again

00:14.650 --> 00:16.500
on other materials.

00:16.500 --> 00:19.150
So let's hop straight on over in a blender.

00:19.170 --> 00:23.280
So this is where we left off before and of course I'm now going to guide you through.

00:23.280 --> 00:28.910
First of all the solution to the last challenge and I'll talk through the workings as I go.

00:29.100 --> 00:32.190
So I'm going to make this a lot larger here.

00:32.190 --> 00:36.410
All I need to see is a thin sliver of the material at the top.

00:36.490 --> 00:42.570
So I'm going to get rid of this tangent nodes that I've added and I'm going to add in now the first

00:42.570 --> 00:48.880
thing we need to interact with light how light is interacting with a surface that's going to be a shader.

00:48.900 --> 00:52.340
So I'm going to add a shade darker shade a shade.

00:52.350 --> 00:53.110
There we go.

00:53.160 --> 00:55.280
And it's how it's going to be transparence.

00:55.360 --> 00:59.520
Along here we've got a transparent B sdf.

00:59.610 --> 01:03.950
Now some of you might want to know what B S D F stands for.

01:04.080 --> 01:08.390
Well it stands for bi directional scattering distribution function.

01:08.610 --> 01:15.780
And if we have a look at the wikipedia article for it we can see it's a series of Count relations of

01:15.780 --> 01:19.300
how light interacts with surfaces where it hits them.

01:19.470 --> 01:23.100
And there's loads of other types of interactions as well.

01:23.100 --> 01:30.110
Do you go ahead and read this wikipedia article for more information on how it actually works.

01:30.180 --> 01:34.390
But suffice to say it details how light interacts with a surface.

01:34.620 --> 01:37.650
So let's get rid of that and hop straight back into a blender.

01:37.650 --> 01:42.000
So we need to link both of these outputs to the surface.

01:42.030 --> 01:47.880
Now the surface determines what's the actual surface of the middle of the geometry is going to look

01:47.880 --> 01:48.450
like here.

01:48.450 --> 01:54.000
So if we try and link them together we'll see we get one or the other.

01:54.000 --> 02:00.720
Now the good thing there is it does look like when we had transparency and just transparency we it goes

02:00.720 --> 02:04.430
transparent so that's a good thing Hello that is working.

02:04.440 --> 02:10.730
Now we've got to mix these two together and they're both shaders So we need to mix a shader.

02:10.980 --> 02:15.260
Now I'm going to go to add and shade and then let's say there's something called mix in here.

02:15.270 --> 02:17.250
There is mix shader.

02:17.460 --> 02:23.370
So if we select that and literally we can pop anything on top of something like that and it puts it

02:23.370 --> 02:23.820
in.

02:23.910 --> 02:27.770
Now before we connect the other one let's just move this factor up and down.

02:28.600 --> 02:35.620
Okay so I can see there that when the factor is at zero this top one is 100 percent.

02:35.680 --> 02:41.670
And as we go down it gets less and less and less and eventually becomes black which is zero.

02:41.680 --> 02:46.250
So that means it's got nothing of this one and 100 per cent of this bottom one.

02:46.270 --> 02:51.220
So with that in place Let's disconnect that for a moment and play with the other one that's this one

02:51.220 --> 02:52.690
in and see what happens.

02:52.690 --> 02:57.840
So again with it's at 100 percent of the bottom one here it's black.

02:57.840 --> 02:59.200
There's nothing going on.

02:59.270 --> 03:01.890
And if we move it all the way this way.

03:02.740 --> 03:06.820
It becomes all black and white still so we still got the alpha channel plugged into the colour let's

03:06.840 --> 03:13.270
read link the colour to the colour so we can see what's going on so we can see here it goes from 100

03:13.300 --> 03:18.430
percent the image itself all the way down to nothing because there's nothing plugged into the bottom

03:18.430 --> 03:18.800
one.

03:18.820 --> 03:24.240
So let's go ahead and plug in the transparent shade and see what happens.

03:24.250 --> 03:26.650
So let's move this backwards and forwards.

03:26.890 --> 03:34.070
So we can see we're going from 100 percent of the diffuse to a hundred percent of the transparence.

03:34.210 --> 03:37.550
That's not quite what we want to do.

03:37.810 --> 03:40.220
Let's try these round the other way.

03:41.090 --> 03:45.650
And moving them up and down that won't replug them in looking going to swap these round here and see

03:45.650 --> 03:47.420
what that does it swaps it around for us.

03:47.540 --> 03:53.100
So we go to 100 percent of the transparency to the image itself.

03:54.010 --> 04:00.910
Okay that's starting to look better but we need to control this not on an overall scale but on a pixel

04:00.910 --> 04:02.610
wide pixel case.

04:02.650 --> 04:08.800
Now what we can do is we can use this alpha channel which we've already seen creates a mask a black

04:08.800 --> 04:09.810
and white image.

04:09.820 --> 04:10.840
That's what it looks like.

04:10.840 --> 04:17.680
So if I plug the alferd channel straight into one of these shaders and remove that then we can see here

04:17.710 --> 04:23.530
that the alpha channel itself just gives black and white how we can use that to control because it's

04:23.530 --> 04:26.830
a great node it's output in a value for every single pixel here.

04:26.980 --> 04:33.000
We can use that Alpha channel here to plug in to the factor.

04:33.070 --> 04:34.000
Excellent.

04:34.000 --> 04:40.060
Let's remove it from the shade of air and let's link these back up and see what effect we have.

04:40.060 --> 04:43.240
Right that doesn't look quite right at the moment.

04:43.240 --> 04:45.490
Let's try reversing these round.

04:45.490 --> 04:48.140
So let's put the diffuser on the bottom.

04:49.030 --> 04:50.020
Ah ha.

04:50.200 --> 04:50.770
Brilliant.

04:50.770 --> 04:52.510
That's looking much better.

04:52.510 --> 04:54.100
It's completely transparent.

04:54.100 --> 04:59.760
I think I'm going to move over the top of this one here and lift it up.

04:59.920 --> 05:00.430
Excellent.

05:00.430 --> 05:02.950
So we're seeing straight through it.

05:02.950 --> 05:05.490
That's absolutely brilliant right.

05:05.490 --> 05:11.020
So now we've got a nice little set up here with these three areas here.

05:11.110 --> 05:15.670
We've got these two shaders being plugged into a mix shader And that's.

05:15.670 --> 05:19.960
I'm just going to reorganize it here to make it look a little bit better.

05:20.020 --> 05:20.530
Yes.

05:20.890 --> 05:22.270
Lines crossing over everywhere.

05:22.280 --> 05:24.450
I think I'm going to be able to avoid that that easily.

05:24.480 --> 05:30.190
But what we can do now is we've got essentially a system we've set up a series of nodes here to do a

05:30.190 --> 05:34.000
task and that is to make a background image transparent.

05:34.000 --> 05:38.830
Now if you had hundreds of images that you would go to do this too you'd want a quicker way of doing

05:38.830 --> 05:44.740
it without having to add to shaders to your defence one that comes automatically.

05:44.740 --> 05:46.610
And we can do that by grouping.

05:46.690 --> 05:52.560
So holding down shift I can select the others in our group that we want to make.

05:52.660 --> 06:00.790
When I go down to node I can go to make a group and we can see here its control and G.

06:01.090 --> 06:08.140
Now when we go into the group we can see it's got a group inputs the actual shaders themselves and the

06:08.140 --> 06:09.550
group outputs.

06:09.550 --> 06:18.310
Now it's very important that you tend not to put in input nodes i.e. this image texture or output nodes

06:18.730 --> 06:20.960
with in a group itself.

06:21.340 --> 06:26.320
Now in order to get back we can tab out because that will go between the two screens.

06:26.320 --> 06:32.620
However what you can do is put the groups inside groups and if you do do that you can't just tab out

06:32.620 --> 06:34.880
it or take you to the next level down.

06:35.050 --> 06:40.240
And on the header bar of the know this this little up arrow so it would not use nodes.

06:40.240 --> 06:45.610
Take a little drawing pin and then this bakara And that will also take you up a level which is brilliant.

06:45.610 --> 06:48.720
Now this looks a lot better.

06:48.850 --> 06:53.600
Its much more clean with back down to three nodes so its easy to see whats going on.

06:53.770 --> 06:58.750
Now as you can see there's little arrows next to the names of these groups that you can collapse down

06:58.750 --> 07:02.830
if necessary if it starts getting really busy very useful.

07:03.070 --> 07:07.610
And of course what you can do isn't named this node group.

07:07.610 --> 07:09.630
Some think more useful.

07:09.670 --> 07:15.940
So if we open up our properties and we can see it's called node group and I'm going to be calling It's

07:16.000 --> 07:21.340
trans make image essence.

07:21.340 --> 07:24.780
Now I have named it when I needed it to use it again.

07:24.790 --> 07:32.170
I can go down to add and go to search and I can go make Inish transparencies actually now in the file

07:32.200 --> 07:37.090
and I can use it again and again and again if I bring this up make image transparent.

07:37.090 --> 07:37.980
There it is.

07:38.050 --> 07:42.040
And we can open that up and see that ARG group still exists.

07:42.100 --> 07:43.100
Brilliant.

07:44.400 --> 07:46.800
Okay a bit of a transition there.

07:46.830 --> 07:51.750
I am Michael from the future and I'm here just to make sure that you guys are fully informed.

07:51.750 --> 07:57.870
We've had a couple of questions and hopefully this will help clear up and give you guys further knowledge.

07:57.870 --> 08:00.110
I've started a new blender file here.

08:00.180 --> 08:03.470
I'd like you to do the same Make sure you saved your work.

08:03.750 --> 08:07.220
And we've got the default cubin so now we're going to get rid of that.

08:07.680 --> 08:10.470
Hit the x key and delete.

08:10.560 --> 08:13.270
Now that's gone instead of going add.

08:14.370 --> 08:17.150
We scroll down just a little images as planes.

08:17.160 --> 08:21.330
This time we're just going to have a simple plane right at the top.

08:21.330 --> 08:22.380
There we go.

08:22.830 --> 08:25.050
Okay now we have the plane in the sea.

08:25.050 --> 08:30.040
We're going to was sign everything manually and see how that comes across.

08:30.060 --> 08:32.080
So I'm going to have to create a new window.

08:32.100 --> 08:37.760
I'm going to make the tool shelf and propertys panel disappear and drag a new window so we can see what's

08:37.770 --> 08:38.700
going on.

08:39.030 --> 08:46.020
I'm also going to switch this view ports on the left over to rendered mode.

08:47.090 --> 08:50.960
And it goes that's rendering ready to go on this side.

08:50.960 --> 08:56.480
We need to first of all give this material we don't have a material just yet.

08:56.480 --> 09:01.240
So let me pole open the propertys panel and go to materials.

09:01.370 --> 09:03.120
I'm just going to click on you.

09:04.120 --> 09:05.760
It's got materials 0 0 1.

09:05.770 --> 09:07.810
Let's call this grass.

09:08.650 --> 09:09.540
There we go.

09:09.910 --> 09:13.780
Now I'm just going to make that disappear a bit more so we've got some room here.

09:13.780 --> 09:19.690
We're going to switch this viewport across to a different view point we're going to go to the node Ed.

09:19.920 --> 09:21.380
And where we've been before.

09:21.400 --> 09:22.870
Now we're going to have to build this up.

09:22.870 --> 09:26.130
Bit by bit we know all the components that we need.

09:26.230 --> 09:28.770
But there is one extra.

09:28.840 --> 09:29.650
So what do we need.

09:29.650 --> 09:33.640
We need to diffuse shader we need a.

09:33.750 --> 09:38.530
And before I go and add this in if you do want and little micro challenge pause a video and see if you

09:38.530 --> 09:41.030
can populate the other bits that we need.

09:41.810 --> 09:43.980
If you've done that great Welcome back.

09:44.030 --> 09:47.810
Now are we going to need a mix shaded to mix these two together.

09:47.810 --> 09:51.760
We are also going to need a.

09:52.190 --> 09:54.770
That's right a transparent shade.

09:54.980 --> 09:59.330
I'm going to put that transparent on top because it's going to plug into me top.

09:59.790 --> 10:02.110
Oh I put that in the wrong place.

10:02.120 --> 10:07.040
I'm looking at the wrong part of the screen that's linked these back up so we've got this coming through

10:07.040 --> 10:07.430
fine.

10:07.430 --> 10:12.370
And we needed to control the fuse by an image says go ahead.

10:12.370 --> 10:16.610
I'm going to use the menu this time and actually search for image.

10:16.610 --> 10:18.750
There we go image texture.

10:18.800 --> 10:23.610
Plop that in there and we're going to link the colour into the colour here.

10:23.720 --> 10:27.590
And the Alpher into the factor that looks good so far.

10:27.590 --> 10:30.140
Now it's gone pink over on the left hand side.

10:30.150 --> 10:32.810
And that's because it doesn't have a texture.

10:32.920 --> 10:38.480
So the kind of standard colour when it doesn't know what to do we go ahead and open up a texture and

10:38.480 --> 10:41.480
I'm going to go to where I've stored my assets.

10:41.690 --> 10:47.820
Now at the top of the head were beheaded bar basically for the file viewer.

10:47.840 --> 10:52.640
We've got these thumbnail views and this is a great way of having a look at these are done which will

10:52.640 --> 10:53.470
I'm going to pick.

10:53.470 --> 10:57.160
I'm going to pick grass blade 7 for this example.

10:57.940 --> 10:59.640
And we can't see anything.

10:59.650 --> 11:02.980
And this is set up exactly how we had it before.

11:03.220 --> 11:10.630
But there's one thing that the insert images Plains is doing which even though it looks the same is

11:10.630 --> 11:12.130
slightly different.

11:12.130 --> 11:18.980
Now at the moment we're not explicitly telling blender how to map this image to that plane.

11:19.000 --> 11:22.140
Now to you and I it's obvious it can only exist one way on that plane.

11:22.150 --> 11:28.030
Perhaps if you rotated it round but essentially it's still be the same blender needs a bit more help

11:28.030 --> 11:30.590
than that so we need one more note.

11:30.970 --> 11:38.470
So let's go ahead and add in is a type of inputs because we're telling blender information and it's

11:38.470 --> 11:40.660
called a texture a walnut.

11:41.730 --> 11:45.750
If we go ahead and put that in there at the moment we can't see anything.

11:46.590 --> 11:52.810
And we don't have many of these other options available you'll see here there are lots and lots of options

11:52.830 --> 11:58.160
generate normal uv's object camera window and reflection by all means play with those.

11:58.170 --> 12:02.510
But since we have a very simple plane it certainly doesn't need unwrapping.

12:02.640 --> 12:09.310
We can get away with using generated if we link up the generated to the vector.

12:09.330 --> 12:12.150
Suddenly our grass will appear.

12:12.150 --> 12:17.670
So if you go through manually you may have to put this texture coordinate in as well.

12:17.670 --> 12:23.010
Or indeed if you alter something or give it a different type of mapping you may lose that.

12:23.010 --> 12:29.190
This is done automatically when you add images as planes even though it doesn't look like it does in

12:29.190 --> 12:30.270
the node editor.

12:30.450 --> 12:32.330
So a slight subtle difference there.

12:32.370 --> 12:35.550
And of course now it's time for a challenge.

12:36.370 --> 12:42.670
I would like you to apply transparency so make your three shaders into a group if you've not done already

12:42.870 --> 12:50.590
and then apply transparency to the other P N G files you have imported using the group you've just created.

12:50.890 --> 12:54.130
So I'd like you to pause the video now and give that a go.

12:55.930 --> 12:57.610
OK guys welcome back.

12:57.610 --> 12:59.940
Let's hop straight on over into blender.

13:02.910 --> 13:08.430
Okay so now that we are back over in blender I'm going to go up a level and I don't need this one here

13:08.480 --> 13:11.470
I was just the demonstration so I'm going to get rid of that.

13:11.530 --> 13:15.530
Some are just going to grab this other image and move it.

13:15.540 --> 13:21.000
And you'll notice there it doesn't look the same as it does usually and that's because I've got my pivot

13:21.000 --> 13:27.240
points at the 3D Curson was going to send it back to medium point and then it sits on top of the origin

13:27.240 --> 13:27.750
itself.

13:27.750 --> 13:29.000
Brilliant.

13:29.070 --> 13:35.700
Now that that's there we can select the other image how we're going to get rid of this diffuse STF because

13:35.790 --> 13:41.580
that's built in to our module that we've created that we can just drop straight in some of the leite

13:41.590 --> 13:46.790
that's an I'm going to go to AD search and making farraj transparent.

13:46.790 --> 13:48.550
Brilliant and pop it in.

13:48.650 --> 13:56.060
Oh you can go colour into colour and Alpha into a factor and then shape that onto a Surface.

13:56.820 --> 14:00.890
And that should have worked and why hasn't it.

14:00.900 --> 14:06.840
Let's dive in and have a look through what the facts are coming in and across here we've got the transparent

14:06.840 --> 14:10.920
on top and this on the bottom and it goes to an output.

14:11.070 --> 14:15.790
So let's just make sure everything is working as it should be.

14:15.930 --> 14:18.490
Let's go and compare it to the previous one.

14:18.510 --> 14:21.260
So you've got the grass image here it coming in.

14:23.380 --> 14:28.970
And we can zoom out here transparent tops all of this seems to be absolutely fine.

14:28.970 --> 14:33.350
Question is why is that not showing it's as transparent.

14:33.350 --> 14:35.380
And here is the problem.

14:35.420 --> 14:43.670
I haven't selected use Alpher cellmates that's now ticked and sorted and I'm going to set the Alpher

14:43.670 --> 14:46.440
to pre multiplied here.

14:46.710 --> 14:53.950
They do look very similar but pre multiplied tends to be better with small edges that change rapidly

14:53.960 --> 15:01.250
much like these seeds we've got at the top here and the way the grass moves quite rapidly and it's quite

15:01.250 --> 15:03.670
thin so we want the best quality possible.

15:03.770 --> 15:10.700
So armed with that knowledge over on this one I'm going to select my image texture the user helfer is

15:10.700 --> 15:14.190
already applied to its Which is excellent.

15:14.300 --> 15:23.270
I can delete the diffuse shader add in a source while search for my make image transparence and when

15:23.270 --> 15:24.440
I plug this one in.

15:24.470 --> 15:26.830
It should work without issue.

15:29.700 --> 15:30.750
There we go.

15:30.780 --> 15:31.890
Perfect.

15:31.890 --> 15:33.330
How did you guys get on.

15:33.330 --> 15:35.540
I'd love to see your transparent grass.

15:35.550 --> 15:39.850
Do share it in the discussions and I will see you in the next lecture.
