How to Make a Toon Shader in 2 Minutes | Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm going to quickly show you how to make a tune Shader with an unalert Shader graph so right click and create a urp unalert Shader graph and then double click to open it the first thing we want to do is change the brightness based on the direction of the light so add a normal Vector node and add a main light Direction node also the Light Direction node doesn't exist in older versions of unity so you may need to create a custom node if you're using an older version then plug both these nodes into a DOT product node which essentially tells us the direction difference between these two vectors by returning a value between -1 and 1 then add a remap node to normalize this value and now we can see some shading on the shapes now to make it tune we essentially just need to round the values so first let's divide the value by the shading size we want I want to have just over two shades so I put 0.49 which you can visualize like this then we just need to round this value using the floor node and now we have tun shading at the moment the output is between 0 and and 2.04 so let's remap this value to go between 0.3 and 1 and now the shades are closer together now let's add some more input and customization options to the Shader so let's add the variables add a texture 2D variable add a color variable add a float for shade size with a default value of 0.49 add a float for Min brightness with a default value of 0.3 and a float for Max brightness with a default value of one now we just need to plug these variables in so dragon drop the texture variable and plug it into a sample 2D texture node and then multiply it by the current output value and then same again with the color variable just multiply it by the current output then add the Minimax float variables to the remap node by adding them to a vector 2 node first and then lastly we need to change the static 2.04 value to be the result of one divided by Shades so add a divide node and plug it into a vector 2 node and then plug the output into the VAP in value and that's we're done let me know in the comments if you want to see more videos like these thanks for watching don't forget to like And subscribe
Info
Channel: Dom Evans
Views: 5,251
Rating: undefined out of 5
Keywords: howto, unity, celshading, toon, urp, shadergraph, anime, gamedev
Id: MXZ578OXOog
Channel Id: undefined
Length: 2min 7sec (127 seconds)
Published: Wed Oct 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.