Tutorial: Procedural hatching and manga shaders for EEVEE Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Saved this post for later, this looks absolutely awesome man, what practical uses do you see this having?

!remindme 2 hours

👍︎︎ 2 👤︎︎ u/fwuppy 📅︎︎ Dec 04 2020 🗫︎ replies

I had a more primitive render only version of this in 2006 in Softimage, brilliant work!

👍︎︎ 1 👤︎︎ u/quasimechanical 📅︎︎ Dec 04 2020 🗫︎ replies

This is great! You should submit this to the bnpr wiki!

👍︎︎ 1 👤︎︎ u/nixtxt 📅︎︎ Dec 04 2020 🗫︎ replies
Captions
hi i'm kristoff and today we'll be looking at procedural cross hatching line and screen tone shaders i'm going to explain how to make each one of these but if you just want to use these shaders and test them out on your models you can download them using the link below in the description first we'll be making a shader for little hash marks next we'll make a couple of cross hatching shaders then we'll make a line and a screen tone shader and finally we'll be making some gray underpaint to combine with these so let's have a look at some examples and then we can get started but before we do that i want to give credit and a shout out to sam bowman's procedural note series one of his wonderful tutorials gave me the base for the cross-hatching shader and i've really enjoyed his research into the world of procedural textures his channel is really worth the visit and i'll link it in the description below the first example i want to show you is this lovely link model from this stuff on sketchfab yes that's another kristoff and it uses a combination of little hatches with the patch hatching shader and combined with the great underpaint this is really my favorite shader because it really has that hand-hatched feel and i think it looks great to map these hatches onto the model i use uv mapping i think some will say that it's not ideal but so far i could get great results just by using the basic uv mappings like a smart cube and spherical projection the shader is really dependent on the light sources so it really works well to play around with them but also you can go into the shader itself and there's a gamma and a contrast setting that will further help you enhance the light if need be next up i want to show you this screen tone shader in a manga style and i'm using rookie's otoro shidare model if you haven't seen her blender models and insanely talented work yet please go check her out on twitter she was generous enough to share a demo model with the bnpr community and you can download it and that's what i'm using to test the screen tone shader with for this one i've combined my gray underpaint and my screen tone shader and i combine it using a multiply and this gives some control over how dark i want the shading to look and then i also use this in combination with the different gamma settings i just use a different instance of the shader on different parts of the body and then i just tweak them until i'm happy with the results i'm getting of course there's also a control for the size of the diamonds and you can get some vastly different results with these one thing i want to point out is that this uses the window texture coordinate node and this is dependent on the ratio of your window so when you want to go and render it's best to get into your camera view and as you can see it distorts this diamond scale and you have to set the ratio for the diamond scale the same as your camera so for instance we're rendering at 1080 pixels by 1920 pixels and that is actually a ratio of three to four so we're going to leave this at 3 and we're going to set the y at four and as you can see this gives us a correct shape for our diamonds when we render having to adjust the ratio is a bit annoying if you know a workaround please let me know in the comment section and then i can share it with other people but once you get the shader dialed in i hope you agree you can get some great results so without further ado let's dive into blender and let's start building some shaders let's start a new blend file we're going to delete everything in the scene let's add a plane and we are also going to add a uv sphere and we're going to set it to shade smooth let's dive into the shader editor and we are going to add animation shader we're going to call it base hatching and we're also going to apply it to our sphere the first thing we are going to do is add a wave texture let's plug it in let's set it to 10 and this is going to provide us with the hatching and we're going to add a color ramp set to a constant and this will allow us to control the width of our hatching and gives us a nice sharp and clean edge also there are distortion controls so you can get a little bit of variety by using this but we're going to keep it to a minimum for now the next thing we want to do is to rotate clusters of these hatches and we're going to do this with a voronoi texture so let's add two voronoi textures the one below we're gonna keep as this and the one up we're gonna set to distance to edge let's add a mapping to our wave texture node and we're going to set texture coordinate to uv next up we're going to add a vector matte node set to multiply and we're going to plug the color of the voronoi into the vector we want it to be grayscale so we're going to add a color ramp which is a lazy way of making a grayscale and then we're going to plug the multiply into the rotation of our wave texture and if we now manipulate the z vector we can rotate our hatches and it will cluster into this voronoi pattern let's set it to 2.6 and then we're also going to mix in this second voronoi texture let's add a mix rgb node and let's plug in our voronoi texture let's add a color ramp and let's turn this color ramp around and so this gives us a total control over the edges we're gonna leave it like this and we're gonna set this mix to screen and last but not least to control this base hatching we're gonna add a mapping and texture coordinate node to put our voronoi textures and we are going to add an input value and connect to our scale we can call this cluster size and label it and if we set it to something like 7 and then we can do the same by adding a input value and adding our wave texture let's set it to 50 or 20 for instance and we can also give it a name and this will be the base for three of our shaders so let's select this set it aside and let's copy paste it let's click on our new shader and let's call it little marks and what we're going to do is we're going to add a mask to mask out little dots of these hatches and we're going to add them before this screen to do this we're going to add a noise texture going to add a mix rgb we're going to set the color to white let's use the noise texture into the fac to use as a mask and then we're going to add a color ramp and so this color ramp now controls our noise let's set our noise to 10 or something like 20. and now by playing around with the color ramp you can get different masking effects and this gives us our little marks or little hatching shader we can go back to our controls and we can also get different results by uh playing around with the scale of the hatches also if you want bigger hatches we can go to our color ramp and we can always play around with that one as well to get more of a dramatic hatching effect that's our first shader called little marks next up we're going to select our base hatching let's copy paste it again and this time we're gonna call this texture patch hatching and we're gonna select everything up to the screen and let's just copy paste it in let's mix it in using a mix rgb node set to multiply and we can do this a second time let's also set the mix to multiply and set it to a max value so this gives us three instances of our base hatching we're going to go to our second uh cluster to the location of our foronoid textures and for location we're going to set it to 5 and this is going to mix the different hatches with each other and for the third one we're going to set it to 10. we can also mix the cluster size so i'm going to set one to six another one i'm going to set to five you can even vary the hatching scale if you want to this looks good let's have a look on our uv sphere i'm going to edit my uv sphere and set it to a cube projection i often use smart uv project or cube or spherical projection and you can get some basic uv protect projections that work well even with more complex models and now we're going to turn this shader into an actual shader with lights so let's add a sun and we're going to add after our multiply and before our color ramp we're going to add a diffuse shader let's add a shader to rgb node plug it into a color ramp let's mix it in and we're going to use linear light let's set our linear light to a high value and now if we play around with our color wrap we get this shaded effect if you think the edges are too clean we can always go in and let's add a mix node and let's add a noise texture and this noise texture will break up the edges let's set it to soft light and as you can see this breaks up the edge but the scale is a bit too big so let's set it to something like 30 or 40. yeah that seems about right and this gives us a better control over our edges now we can get a vastly different result i play around with our color ramp but this is the basis for our patch hatching shader and that's it let's move on to our next shader we're going to copy paste our base hatching again and this one we are going to call interlocking cross hatching what we're going to do is we're going to copy paste all of the nodes up to the screen like last time and we're going to copy paste them again mix them in gonna use a multiply and we are going to set first of all we're going to set our multiply to a max value and then for the z rotation of our first cluster we're going to set it to 2. and then our second rotation we're going to set to 4. i don't want these channels in between so we're going to set the screen to a lower size a lower value maybe just a little bit and as you can see the hatches are really blending into each other and to get more control over this we can add a color ramp after our wave texture and we can bring it down and this gives us more of a control over this same thing for our other wave texture all right and just like last time we're gonna turn this into a shader with lights so let's add a diffuse shader to rgb a color ramp and a mix rgb node let's set it to linear light let's plug these into each other and this gives us our interlocking cross hatch shader which is a bit sharper and less chaotic than our patch hatching shader next up let's make a dotted line shader so i'm going to copy paste our base hatching let's call this one dot line shader and i'm going to delete everything except the emission shader let's add a wave texture and let's plug in a color ramp i'm going to set the wave texture to a scale of 50 and let's also add a mapping and a texture coordinate node let's set it to uv we're going to set the z rotation to 30 and then we are going to add a noise texture into a color ramp and we're also going to mix it in i'm going to set the scale to 60 and detail to zero and then we're also going to add a color ramp with a constant after the mix to see our sharp lines and let's set the mix to screen let's set the screen to max lower the color ramp on the wave texture and let's set up our color ramp and this gives some broken up lines and now we're also going to turn this into a shader with lighting so let's add a diffuse shader shade it to rgb color ramp and let's mix it in using a linear light let's set the linear light to max and let's adjust the color ramp of the diffuse and that's it that's our basic dotted line shader you can play around with the size of the wave texture and also the size of the noise texture to get this is too much to get some different sizes and effects next up we're going to make a classic cross hatching shader so i just copy pasted another plain and uv sphere let's call this one cross hatch shader and i'm gonna delete everything except an emission shader we're to start this off by using a wave texture into a color ramp and we're going to set the scale to 30 and the distortion to 3. and this gives us these distorted lines let's add a mapping and texture coordinate and set it to uv and now i want to break this up and to do this i'm going to use another wave texture so let's copy paste the texture mapping wave and color ramp and let's mix it in and we're gonna mix it in using a screen set it to max and now we're going to set the scale to something like 6 and distortion to something like 20. and we adjust a color ramp so it gives us these these breaks in our lights one more thing i'm going to set this x value in the upper wave texture to a diagonal next up we're gonna select everything up to the screen and we're gonna copy paste it and we're gonna mix it in let's add a mix rgb node let's mix this in using a multiply set it to max value and our third mapping node for the wave texture we're going to set the rotation to 90 degrees and we want a different distortion so we're going to set it to something like maybe a crazy value something like 75 and then scale to 14 and this is really going to break it up that's maybe a bit too much especially on the scale you can play around with it until you think it looks good and then to make these very sharp lines i'm gonna adjust the scale just a little bit five is better and we're going to add one more color ramp with a constant to get some sharp edges on this one and this creates a crosshatch shader that is a bit more irregular or a bit more distorted if we turn off the distortion it just creates this very boring pattern that doesn't look hand sketched at all so that's why i use this second wave texture to create something that looks totally irregular and i think it works really well so let's have a look on our sphere yep that looks right and now we're also going to turn this into a shader that has some shading with light so add a diffuse add a shader to rgb add a color ramp and again let's add it in using a mix node and set it to linear light you can adjust the color ramp and that's it that's our basic cross hatching shader let's move over to our next shader next up we're going to create a manga screen tone shader so again i'm going to start from a plane and from a sphere i'm going to call this one manga screen tone and again i'm going to delete everything except for the emission shader so for this one we're going to start off with a voronoi texture and we're going to set the randomness to zero and we're going to set it to 2d we're going to add a color ramp set it to a constant and this will control the size of our screen tone let's add a mapping and a texture coordinate node let's set let's put the z rotation to 45 degrees and now depending on whether you want dots or diamonds you can set the euclidean to chebychev and this will create a diamond shape next up we want these diamonds to always look at our camera and to do this we're gonna set it to window but this will also stretch our diamonds so we're gonna have to rescale uh our diamonds and for this i'm gonna set it like four to one ratio x to y and then i'm also gonna set the scale of my voronoi to 30. a constant is seems to be a bit too hard uh when we use our window mapping it creates these pixelated edges so i'm gonna set it to linear and let's just adjust it that way and this gives a bit of a smoother transition for the edges you can further set the scale to what we want maybe something like 70. yeah it's starting to look nice now to turn this into a shaded that reacts with the light we will do the same as before by adding a mix rgb node let's add a diffuse let's add a shader to rgb and a color ramp plug it in and we're going to set it to linear light i'm going to scale the screen tone and this is sort of the effect i'm going for i think this looks nice and let's try it out with the dots yep that looks nice as well one more tip when you're rendering it's best to set the x to y scale to the same ratio as your x to y resolution and then when you render just play with the settings until you're happy with them this shader is going to work well together with an underpaint shader that we're going to make next for this one i'm just going to use a uv sphere set it to shades mood let's start off by deleting the principal psdf let's add a diffuse let's add a shader to rgb and let's plug it into a color ramp and so what we're going to do is we're going to catch the light and then we're going to use this to make sort of a gray shader to do this we're going to use a gray and a white color code and then we're gonna set a gray in between we're gonna drag it all the way up to the white to get this sort of effect it's almost like you're using some hard lines as a constant but um it creates these tree tones but it's softer and i'm gonna call this one underpaint and when you use this one in combination with all of the other shaders it looks very very nice we can also add a gamma and then we can control the light a bit more by just using a slider and that's it we've now created all of the different shaders in this tutorial i will link to the tutorial files in the description below i hope you enjoyed this tutorial let me know in the comment section please like and subscribe and i hope to see you next time
Info
Channel: Kristof Dedene
Views: 78,183
Rating: undefined out of 5
Keywords: Anime, ghibli, blender, B3D, Shaders, hatching, dedenne, procedural, ink, paint, 2D, 3D, toon, BNPR, crosshatching, line, line shader, hatching shader
Id: 2ZR5XIjBmho
Channel Id: undefined
Length: 35min 46sec (2146 seconds)
Published: Thu Dec 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.