Toon Shader Tutorial - Part 1 - How to Have Multiple Light Sources (Blender 2.8/EEVEE)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Saving to watch later. I'm a big fan of toon shaders and this one looks really nice.

👍︎︎ 2 👤︎︎ u/Discotheque7 📅︎︎ Jan 31 2020 🗫︎ replies
Captions
hey everyone my name is David from minding my studio and today's tutorial will be the first in a series on how to make your own custom real-time to chatter inside of blender 2.8 and it will be in two parts first I want to show you a sneak peak of one of the characters that we made for a project Dino Mansour's which will be a great way to demonstrate the kind of cool features that you can make inside the shader editor especially as far as non-photorealistic rendering goes and then I open up a new scene and we'll start making that shader from scratch focusing on just one feature for now which will be making a toon shader that supports a three point lighting setup and we'll do that using a cool little trick with the RGB channels so there's a lot of things to cover hope you guys are ready and let's get started okay so welcome back I've opened on my scene with one of her characters that's called ballista and he's badass it fights with a big cannonball and I'll use them to demonstrate some of the features that we've built in this custom shader so if I go to the material tab you have this belly stone metal ball and as you can see there's a metallic effect here that they can toggle on and off that makes it more like a standard diffuse versus a metallic effect and I can control the color of the light and portion and the darker portion here and it's using a math cap material which I've painted in Photoshop so you can make it look anything you want it's it renders super quickly so all the pieces here are a different material so the skin has a different material and I can control how the light falls on this piece of skin so let's say I want the edge of the skin here to be a bit smoother I conduct a key light color and change the edge and it will become super soft I can make it even softer if I want you so it's very very soft and I can even control the size of the light here so I can exaggerate how much the light influences my piece so there's multiple lights in the scene right now there's my key light which affects the main direction of the light and there's a fill light which you can use to add a secondary light direction but in my case I'm using it here to add a separate drip cast shadow so I can decide on what direction my light has for my character and having my second light here that controls where the shadow falls on the ground which can be super useful and I have a third light that controls a 2d rim light as you can see here that looks a bit like afrinolly effect in the sense that it's there's some some sort of a fixed-width to it that looks more 2d but it's being limited by what kind of shadows a real light with casts so it looks more natural and you can control obviously the size of this light so if I go to my skin material 2d room light I can control the size of it I can even control the I can cheat the direction so it comes a bit more from the top or from side so it's all pretty neat what else so there's an occlusion feature which lets me control occlusion separately from material to material so let's say I want to increase the occlusion on my skin here I can increase the size of the occlusion I can make it darker or I could even make it more red if I want to like increase the subsurface scattering effect maybe that's too much and I can also make it sharper or softer depending on what I want so it's sorry it will sort of increase the contrast of the occlusion to look more stylized so that's all pretty cool I have an outline feature lets me increase the size of my outline on my character and I mean there's so many things you can do you can paint the textures directly inside blender and there's even a feature that we've made that lets you paint shadows so what you see here this little dark line underneath the belt is actually painted shadow that we've painted inside blender and it blends seamlessly with the shadow from my light so you don't see the senior it doesn't it's not darker right underneath the the belt here it just blends with the shadow but it's actually painted and that lets you create a very specific tube you look exactly like wanted so that's really nice what we've really tried to do with the shader is make it super customizable so you can make any kind of style want as long as you're making something that sort of stylized non-photorealistic so I hope you've enjoyed this little preview and now I'm gonna close off the scene and open and freshen we all show you how to start making this shader from scratch okay so I'm inside a new scene of blender and we're ready to start making our shader from scratch we don't really need any fancy objects for this but I actually prefer using spheres than cube to see our lights to react to stuff so I'll just delete this here and press shift a and create a new UV sphere so I'll scale it up a bit make it smooth and make the viewport shading in rendered mode so now we're ready to start first thing we need to do is go to the material tab and create a new material here so we can rename this however we want are running this too and we now need to access the shader editor and to do that the way I like to do it is to go to the bottom here and drag the timeline upwards and then press shift F 3 to X as a shader editor you can actually also do it just by going to the left here and clicking on shader editor you can see the little shortcut shift F 3 but it's just I like using shortcuts so here we see the default shader that is being used on the sphere it uses a principle B as DF which is a bit too much for what we need it has a lot of features but for us we really only need for the sphere to be able to capture a diffuse light so I'll delete this and I'll create sorry I'll explain what I just did so anytime you want to create a new node inside the shader editor you can press shift a like anywhere else on bender and then there's a little search tab here where you can type in whatever you want so in my case I want to diffuse so our diffuse be SDF and I'll need two other things first I'll need a shader to RGB and I'll need a color wrap so Wyatt shear to RGB well the thing is the diffuse be SDF output something that's in like shader information you can see it in green here and what I need is color information in yellow so that I can plug it in my color ramp so by placing it into my shader to RGB first it transfer the information from the diffuse psdf in a way that makes me able to use it in the color ramp and once this is done I'll just plug the color ramp inside the material output and there you go now I can change the color ramp and as you can see right away I can create very sharp lighting effects on my sphere so this is the very basic way to do it on shader the problem like you can really change this to any color you want and there's ways to make this interesting as it is the problem is once you want to start adding multiple lights there really isn't any way to control the color of each of those lights and how much it affects the the sphere so we'll do it a bit differently I'll start by just switching this back to black and white and I will group this into a node group so by selecting the tree nodes here I'll press ctrl G and it will all turn green which means I'm inside a node group you can toggle back and forth between the two by pressing tab so you can see here this is the new node group and the what node groups are for is basically it's a way for you to reuse shaders across multiple materials so that if you decide to make any changes to this one shader even if you have like 50 materials using them you'll need to change it once and it will update everywhere and the only other cool thing about node groups is that you can create parameters for your material that can be accessed on the right side of the screen here and the material tab which is pretty useful because you need to go in the shader editor all the time so I'll jump into my node group by pressing tab and will start creating some first parameter for our foreign material so first thing we want is a way to control let me just delete those lights here awkward so okay so I just need one alright so I want a base color that will appear in the lighted section of my sphere so I will start by pressing shift 8 and I will create a mix RGB node so now switch this to multiply and make sure to pump the factor to one here so now I can plug my color from my color ramp in the first input here from my multiply and I'll take this node here this new node that has appeared since we've made the node group it's called group input and you see there's a circle here and whenever you drag the circle inside something it will create a new parameter for your material so in this case you see it's created something that's called color too and I can change that color from the material tab here on the right so this will be our base color and I want to change the name to base color so I'll go here in this little tab called node and you see color - I can click on it and I'll call this base color so now it doesn't change anything because I haven't plugged my multiply node into my group output so I'll do that just right now and there you go now we're multiplying this color ramp which is black and white with our base color so everything that's black will equal zero so we'll stay black and everything that's white will equal one so it will show us the color that we've chosen so now we need a new parameter to control what's in the black area of our sphere here so in order to do that we'll use a new mix RGB node I'll placate using shift shifty and I'll change the mode to lighten because I want to lighten the dark section here but not touched a white section so I'll just move this to the right and I'll place the light and note here in between the color ramp and the multiply and I'll create a new parameter just that like just like we did by clicking the little circle here from the group input and plug it into color too so it's created a new parameter here you can see it here I'll rename it shadow color and so now I can control my shadow color so as you can see by default it's going to be black but if I make it white there's going to be no shadow at all because it's going to lighten the black of my color ramp before it's being multiplied onto my base color so I'll leave this maybe not black but sort of a darker gray so this is pretty cool we have two parameters the problem is that we still have the same issue as before where if i duplicate my lights I can't control the color of each of those lights so we'll need to do things a bit differently so the tricks that we'll be using is to use the RGB channels so we'll have three lights will have our cue light that's going to use a red Channel and the other lights will use the green and the blue channels and the reason we'll be doing it this way is because there's really no way that I know of for a shader to target a specific light and tell it use information or light information from this light in particular but there's a way to separate the channels and tell it just use a red color in the blue color so it's sort of a cheat that we'll be using that lets us use three lights which in the case of toon shader is plenty enough because most times we want to light things using a key light a backlight doesn't feel like so I actually don't want to use a point like here because as you can see as you move it closer to your model and further away it sort of changes how it looks so I'll delete this and I'll create a new light which is going to be a sunlight and what's nice about sunlight is whatever I do with the position of it it's never going to change the only thing that's going to affect this is the rotation of my light so that's great I'll rename this key light R for red and I'll change it to red I'll go in the RGB tab here make it one for red I'll duplicate this rotate it and this one I'll call it feel like G for green and I'll duplicate this one again and I'll call it backlight B for blue blue all right so right now I'll need to tell my shader to first only use the red channel for my key light so I'll create a new node I'll press shift a for AB click on search and I'm going to write separate RGB so separate RGB node what it does is it takes color information and you can sort of just use the specific channel that you want which is exactly what we need right now so I will plug in plug it in between the shader to RGB and color ramp and all you just use the our channel and make sure - I did something here so if you drop it in between the two sometimes it won't update automatically I don't know why but you need to sort of disconnect this and reconnect the R and as you can see now it will only take the red color into account so that's pretty nice we have other lights but it's not using them right now so that's great what we want to start doing is having a new parameter for each of those lights that will help us control the color of that light so we'll make a new node which is going to be a mix RGB and we'll make it in the multiply mode bump the factor to one and we'll go just in between the counter ampere and enlightened mode and we'll place the multiply here and I will duplicate the group input and so just so you know it grew up inputs you can have as many as you want in this shader editor space and it really doesn't change anything it's really just to organize things better sometimes you don't want to have just one group input with lines that go all over the place because it becomes unreadable so I like to duplicate my group inputs in places that make sense so that I can read the lines that connects my notes so I will take this new group input here and I will drag this little circle here at the bottom to my color to from my new multiply node and this time I'll call it key light color so now I can change the color of my light here and so you might wonder what the differences at the moment between base color and key light color and I admit right now there isn't really a big difference but once we start adding textures to our model we want to plug it into base color and that way we can have a different color for the key light which will be super useful so already you can see that there's a lot of nodes and it's already starting to be a bit hard to remember where things are so I'll show you a nice trick to keep things organized and it's by using the layout frame here so a frame is just a way to group things together so I just took all my notes I dragged and drop them into this frame here and I rename this frame key light so now I know that everything that's in there concerns might key light and I want to make a group for my fill light and when I want to make a group for a backlight so I'll make a new frame I'll call it feel like I'll duplicate it and call it backlight okay and now when I be doing is duplicating these three notes that I've I've created here I'll press shift D and they'll sort of be stuck into this frame so what I want to do is press alt p to unparent them and I'll drag them into my fill light here and afterwards I'll do the same and put them into my backlight so click on all free shift thee unclick out P and I put them into my back light here and so I have my three lights and now I need to tell this Phil like to use the green Channel and I need to tell my backlight to do use the blue Channel great so there's really only one thing left here is to composite these this fell light and this backlight back onto my shader so what we'll be doing is pretty simple we'll make a new mix RGB that's going to be an add mode and I'll put it in between the multiply in the group output here make the factor 1 and afterwards we'll take the multiply node the output of the multiply node air from our fill light and we'll plug it in color to our add node so as you can see right away there's this new light that's being comped over an additive mode and we'll be able to control its light color by connecting so this is something I haven't done yet I need to connect my group input to this card to create a new parameter same thing for my backlight so now I have my new parameters here for each of those lights I'll rename them Phil white color and backlight color so now if I want to control the color of this Phil right here I can make it a nice blue like this and I can make this and nice gradient so it's really more of a fill light or subtle light while this one could be a bit sharper and if I want to add my last light I'll just duplicate this ad here and click here and I'll connect this multiply node to color too and why is it not working oh it's because I haven't connected my blue channel to my color ramp I thought I did that already so there you go and I have my nice little backlight here and something you can do if you don't want to have it's super sharp is that some kind of glue using a new handle here so I'll press this little plus button and make this a very dark gray switch this to b-spline and then you can have show you so you can okay okay so you can have some kind of a gradient here like a very sharp edge with a gradient and if I want to make this pop a little bit I can even pump the value to more than one so if I click on the backlight color I can make this value like five or maybe not five maybe one point five all right so there's a bit of glow here and there you go you have three lights you can control their sharpness the direction and the color and this will be the starting point for a shader where we'll be adding more features over time in the next videos so I hope you've enjoyed this tutorial let me know if you have any questions in the comments please hit the like button if you liked it and subscribe to our Channel and I'll see you next time you
Info
Channel: Lightning Boy Studio
Views: 274,859
Rating: undefined out of 5
Keywords: toon shading, blender 2.8, toon shader, blender 2.8 toon shader, Dinomancers, Lightning Boy Studio, npr, npr blender, blender npr tutorial, npr blender 2.8, npr shader, non photo realistic shader, david forest, dinomancer tutorial, npr free tutorial, best blender tutorials, best blender tutorials npr, best blender shader, david forest lightning boy studio, official lightning boy studio, 3d tutorial, 3d tutorial npr, 3d best tutorial
Id: TpWI2rU8iF0
Channel Id: undefined
Length: 23min 7sec (1387 seconds)
Published: Tue Jan 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.