Welcome to how light interacts with a surface.
So in this video you'll gain a better understanding of how word light works in the real world and how
it transfers across into the cycles rendering engine.
Now we've already got a rough idea when it comes to plain surfaces.
And we started building that up by mixing shaders together and we starting to change how light interacts
with the surfaces depending on the angle of which is viewed from or even just with a texture applied.
So we're starting to control how that light actually is being reflected and seen by the cycles rendering
engine.
And that's how we can start building up more and more realistic materials.
Now we're going to look at six ways that light and surfaces can interact.
And of course in real life they don't just act him one way they act in multiple ways.
Also going to gain some understanding about the physics behind how our materials are working and don't
worry we're not going to get too deep into the maths behind it.
So in order to start this we're going to grab a pen and pencil or in this case a digital version of
it and start having a look at how light interacts with the surface.
Okay so in front of us here we have six different setups in front of us.
And these are suppose are analogous to the having a just a a a rectangle there with one individual shader
attached to it.
So for instance reflection now when reflection happens and we've covered this right earlier on in the
course when we started talking about shaders we have the angle of incidence where the light comes in.
So the angle here.
Is it called the angle of reflection.
Of course nothing is a perfect reflector in the real world.
So this is a perfect example.
In reality you would end up mixing it with something else.
And in fact that's what we're aiming to do here to get a little bit of a deeper understanding what's
actually happening to light when it hits the surface so we can set up more realistic material so we
can think more in-depth about what is happening.
So scattering.
So for instance here diffuse.
So we have again the light ray coming in but instead was a bit of a wobbly light ray.
We would have it scattering off in different directions at different magnitudes depending on the surface
itself.
And that is very useful when we combine the two.
Of course if we did combine the two you may end up with a big reflection coming out if it was quite
a glossy surface and some diffuses well and that would be a mix of these two put together.
Of course then we can add other things into control how that mix happens and that's what we've been
doing very recently.
Now what happens with absorption well as it sounds as light hits a surface some of it will be absorbed.
It's just the way the world works.
So it'll go into the material and be lost forever.
Now it won't be everything that gets lost because that's impossible.
Mass is a black hole which case this would be an entirely black material.
No we're talking earlier about not having materials that was zero on anything.
So let's say green or white light hits the surface and some green is absorbed.
That means we've got the blue and the yellow.
So we have a little bit of the blue and the red.
We have a little bits reflecting here.
Red might come in and get absorbed a little bit but be reflected off much more or bounced off or whatever
it happens to be.
And then of course the blue light itself if that also struck the surface that may be the biggest one
of all.
And that would be a kind of a a pinky colour.
Overall it would be somewhere around here probably would get that type of shade or this particular material
would look a kind of magenta in colour.
Now refracted that is an interesting one you can do this at home when you stick a pencil or a straw
into a cup of water.
You'll see light comes in and then it will bend towards or away from the normal.
So we've got our normal running through here either burn burn turn towards it or away from it depending
whether it's entering a less dense material or a denser material.
So if it's more dense it will tend towards the north of it's less dense it will tend away from that
normal.
So if it was going from glass into air we would find that out.
Well let's do that.
So in from air into glass would do this.
And then as it struck the other side it would carry on roughly at the same angle it was before.
So it slows down and then picks up speed again.
And now this here that we've just drawn is an example of transmission where light doesn't have to be
refracted.
The majority of the light that enters an object goes through that surface and comes out the other side.
Now of course it could be transmitted.
And instead of coming out in a straight line it might be scattered on the surface.
Incidentally when things go inside a model you can end up with subsurface scattering.
So we go back to scattering up here.
If this was a subsurface scattering node we'd find that light would enter the material and then bounce
around and some of that light would find its way out.
And some of it would be absorbed as well.
So there's a lot that joins all of these things together.
Now some of the particular shader nodes that we have are to make our lives easier.
Before a while not that long ago actually the subsurface scattering node didn't exist.
And before we had to do a mixture of all of these things blending them together to try and get a subsurface
scattering or something that at least emulates it.
The final one here there's no direct shade before but it happens in real life and it's worthwhile knowing
about it.
So when light or energy would hit piece surface and let's say it gets absorbed and it gets absorbed
almost fully with very little reflections so we get most of the energy coming in.
Now this particular object would have absorbed energy so it will start emitting energy as well.
Now usually that would be infra-red energy or something along those lines.
But it could also be visible light if it was energetic enough.
So we can't really do the radiated by a shader.
But I think the closest thing to that if you were to emulate something that was hot perhaps something
that was glowing because a lot of energy had been put into it it would be radiating to be emitting so
an emission shader would be quite a useful one here.
I'm sure you could set up a couple of maths nodes and other things to calculate a certain amount of
radiation depending on light hitting the surface as well.
So let's go have a closer look at some shaders now and hop on over into blender.
Okay so we're on a default blender file here.
And one of the things we can do to try out these different Shaila types and then turn snapping on an
With lift this object up by one and move it across a couple are now going to go to the 3-d cursor where
are we 3D Curson just set it plus one on the z axis.
So when I add a couple of more basic objects like a cone and Suzanne let's stop at Suzanne the monkey.
There we go.
And we rotate Suzanne around 90 so she's facing us although that is down the camera.
She was rightly added.
I want to set smooth shading on this cone so smooth shading there will get some odd effects around the
base here because well it's trying to smooth around a great of a 90 degree angle so that's going to
look interesting and I'm going to smooth Suzanne here now with Suzanne one of the things to bear in
mind is she's going to be quite jagged So I'm going to add in a couple of subsurface divisions just
to make her look that much smoother.
Okay let's go to the camera view and well let's move that camera around so we've got a much better view
case of all three of our objects.
Now finally to play with this I'm going to add in one final meche So I've got a surface to work with.
Going to move that down and scale it up.
So we've got a surface and I'm going to set all three of these objects to have the same material.
So let's go to the materials tab new and let's change the colour so we can see what's going on.
Ullman could apply that material to all these other ones as well.
Okay so we've got our material set up.
Lighting is not great at the moment so when I go to my lamp maybe it universal using the sunlamp and
use nodes.
Okay.
And I'm going to make the outputs of the strength about four so it's nice and bright when I get rid
of my propertys panel and my tool shelf and just zoom into the area we're looking at.
Now we've got this set up we can actually play with the material and I'm going to call this test material
so we know what's going on and we can actually change this to all different types so we can make it
glossy You can see this reflecting Incidentally you see this really jagged stuff happening around here.
That's simply because there's there's not enough polygons to interpolate between them all so you end
up with a very jagged surface.
If we wanted to improve that again we'd have to add some subsurface divisions but of course with that
comes a few problems in itself because that cone no longer looks like a cone but kind of cool it now
looks like a teardrop which I didn't know that would happen.
First time I've tried that.
There we go.
How cool is that.
If I'm going to move that across on the y axis so it's a little.
I've moved the wrong thing move across on the y axis it's a little closer to our models.
Okay I'll leave it like that just because I can and because I quite like it.
Okay Somehow I've got these three objects that we can play with.
We can play with the materials and I'll get to that in a few moments after I've just explained a couple
of items here.
So I want to explain that why volume absorption and volume scattering will come out black and anything
else to do with volume.
And the reason for that is because we're changing the volume properties and not the surface properties.
So we see the word surface here and volume here so we can swap these round or essentially click on the
little darton remove and then go to volume and add it in to volume absorption for instance.
And if I make this density something like 15 we'll be able to see what's going on there.
The thicker your object is the more light it's actually absorbs.
So we give this a colour let's make it a blue.
We can see that's we end up with a very dark blue or essentially black if all the light is absorbed
by the time it reaches the middle of a thick object.
And these is a quite thin so it lets a lot of light through.
Now volume scatter is very similar but it's kind of opposite in a way.
So you're telling it which colours are being absorbed.
So in this case the blue you can see opposite is the yellow surface absorbing a lot of blue and the
output is mainly yellow.
If I tell it to absorb all the green and of course don't go all the way because otherwise you'd get
a complete zero on something and which is something we don't want.
If we go let's say to here we can see that the pink light is being scattered etc etc etc. says the opposite
side of that colour wheel.
Now when we look at the nodes set up we get something.
Well it really highlights what's going on in the background here.
So if we're playing with the volume scatter it needs to be plugged into the material outputs in these
to be plugged into the volume inputs of that material outputs otherwise it won't work and it actually
says here volume and we've got a green shader outputs.
So it's looking for a shader input that's also a volume.
If we plug it into a surface it doesn't work because it's not set up to do that.
The other thing to show you guys is the anisotropic filter.
Where is that anisotropic in this tropic.
I'm being complete we go.
So anisotropic basically means it changes depending on the direction at which the camera and slash lighting
is hitting the object.
So in this case an anisotropic is used as a control here and a stroppy amateur tropica I don't know
how mispronouncing that amateur trophy up anyway.
It depends on the handler which the light is.
And we end up with a very good looking saucepan lid.
If we get the settings quite right there.
Perhaps not on a cube but we get the effect there if you look on the bottom of a metallic saucepan of
what's going on.
So it's very very good for metallic objects it's basically directional reflections in that case rotation.
Well that kind of skews that and makes it look a bit odd in places.
But it will have its its time and place depending on the model that you're working on.
So that's only a couple of these shaders gone over.
And of course it's time for a challenge.
I would like to go and play with shaders so set up a series of basic objects just use primitives to
get the hang of this and obviously watch for facets as well so if you are going to use anything that's
basically smooth you want it to be as smooth as possible in the first place.
So bear in mind if you're making a sphere or you're making a cone etc. just to make sure you don't have
artefacts when your rendering apply the same shader to each one of these objects you can see how it
affects different objects at the same time.
Remember you can use a render board has to speed up rendering so you have to render the entire scene
you can draw that render border around your work so you don't have to wait for your computer if you've
not got a particularly quick one to render the scene.
Remember you can lower your samples as well just in case you've turned them up at some point in the
past.
I wouldn't recommend any more than 10 wash to do in this testing.
Try out all of the shaders one by one to see their effect on those primitives on those objects and you'll
get an idea and a feeling about how they're going to work.
When you start using them on other objects as well remember volume shaders need to be plugged in to
the volume input of the material output node.
They're designed to work on the volume of the shape not just its surface.
So a video now and give that a go.
Okay guys.
Welcome back.
Let's go play with some shaders.
Okay so we're back over in blender and I'm going to go and open up a file.
I was working on earlier just a few extra primitives in it.
And here we go.
We've got smooth shading applied to four of the objects here and the others are flat.
So let's hop into rended mode so we can see what's going on.
And I have got the man lights a peachy creamy colour at the moment.
So with diffuse we know what that looks like we'll play with that.
Lots hair does look very odd.
Did you notice that when you played with hair he heads up faceted all over the place.
Of course this shader is in fact designed for hair not thick objects.
But there we go.
If that's a pattern you're looking for and something.
Well it's there and ready for you if you want to use it.
So let's see what else we got here.
Volume absorption.
Of course we can't use that on the surface we need to use that on volume.
That was great fun to play with glossy.
I always love glossy I like shiny things.
Call me a magpie.
I can make things reflective and we've already played with making this roughness just a little bit more
sensitive before I quite like the tune shade whereas it bit the further downtown.
Now I thought this is quite cool.
Give us a more cartoony appearance to your models.
And there were two options here.
Diffusive glossy glossy had a much harsher reflection to non reflective area I suppose that's right
with it being glossy size I quite liked having that quite high up because it gave more of that comic
book type feel to its core smoothing just made those those boundaries a little less harsh.
Although when he wakes up a size so high it didn't really make sense raising the smoothness because
it made it quite bland by quite like the the output that this gives a very cartoony very.
That's basically what it is it's a toon shader it's supposed to look more cartoony velvet's now.
It was an interesting one for me that kind of looked more like.
Well obviously it's supposed to be velvet so why.
Let's make it a luscious deep red or gorgeous.
But it reminded me more of the diffuse shader with the black splodge facing the camera than about you.
But that's how I felt about it when I first saw it.
Now I do know that it's useful for doing surfaces that have a house slightly hairy like fine the hair
on a face or something along those lines.
So it can be used much more subtly than this extreme example translucent that's always fun to have.
Of course these are designed to.
Some of these are designed to be used with other shaders so translucent as the main sounds is just letting
light through our model which is great but of course it would be better if it was mixed with something
else to make it semi transparent glass is a good one to play with.
Now there are shader itself has got some spec clarity to it so it's glossy and refraction down in the
bottom is basically the glass shader without reform without the gloss added to it.
So very similar but this is more of a I suppose a plastic sort of feel to it rather than a glass.
Now the one that will get most people is hold out because you're very unlikely to use it unless you
are trying to separate something out later on in the compositor.
Essentially hold out adds a value of zero for any object that actually has that material applied to
it.
And when that happens it means that later on you can fill it in in a render in the compositor.
But we're not going to use that in this particular section at all.
So lots of different ones to play with.
Did you have any particular favourites.
Say I quite liked to know that was one of my favourites because it had that high contrast to it.
Did you end up mixing or adding any of the shaders together.
Did you get some effects that you really liked.
I quite like mixing emission with certain shaders because it makes the objects glow as I said I like
shiny things.
Anyway if you've come up with some great shader combinations I'd love to see them in the discussions
and I will see you guys in the next lecture.