Getting An Anime Effect in Blender 3D (2.5)
Getting An Anime Effect in Blender 3D (2.5)
Getting An Anime Effect in Blender 3D (2.5)
5)
In this tutorial, you will learn to get a type of ‘cell-shading’ texture on your character along with
learning multiple methods to add an edge to the character to get that anime/manga look to it. For
this tutorial, I’m going to be using a sphere to show how to get the texture and what it will look
like, but I will also be including characters that I’ve made to show end results.
Now lets head over to the material panel (1) and add a new material
(2). Then under the diffuse options, check the box that says
‘Ramp’ (3). Now a ramp is basically a gradient that you are adding
to the overall effect of the material. So in essence, you could have a
transparent material, but have a ramp where there is color on one
part of the mesh that fades into transparency. Although we will not
be covering that in this tutorial. So, now that you added a ramp, we
need to change the effect of the ramp. So, next to the word ‘Input’
there’s a little selection box and we are going to change the input
type from ‘Shader’ to ‘Result’, saying that we want our material to
be the result of the gradient.
This next part will vary depending on your character and the type of shading that you are trying
to achieve. First, I like to choose the diffuse color that I want, for this I’m going to pick a light
blue (5) (RGB: .357, .635, 1.000). Once you have your color chosen, you are going to have to
select the ‘cursor’ #1 in the gradient and change it to your diffuse color (6). Once that is done, we
need to create the cell shading shadow. So, select the ‘cursor’ #0, and change the color to a
darker shade of your diffuse color. I prefer to simply subtract .200 from each of my RGB values
to keep it within the same shade and family color. So, for my example, my darker end will be
(RBG: .157, .463, .800). Now if you’ll notice, the image of
the gradient did not change when you changed the color. That
is because the alpha value is currently 0.000, making the
material, no matter what the color, transparent. So, simply
change the alpha value to 1.000, making the transparent end
of the gradient opaque.
Now if you’re style of anime/cartoon texturing involves more than just a normal color and a dark
color, add 2 ‘cursor’ with the ‘Add’ button under the diffuse option pane, set them close together,
but note that one of the cursors has to have the same color as one of the other colors you’ve used,
otherwise you might end up with a subtle gradient happening in your material. Here is an
example of a tri-tone.
Sample of just material on character:
Within Blender there is the default edge setting, most commonly seen
when toon rendering. By far this is the worst method of creating an edge if
you plan to be animating. The reason being is there is very little control
over the edge options, leaving the user at the fate of Blender of what to
place edges on.
Here is what I end up with when rendering with Blender’s default edge setting, alright but
lacking a line in areas.:
Now two boxes should have popped up in your node window connected to each other. The larger
one is where all the information from your current material comes from and the smaller one
shows you what the end product will look like. To keep the next part simple, I’m going to say
what node you have to add at a time, what changes in that node you have to do and then show the
overall node setup at the end.
Material Node (large one they gave us): click the button that looked like the Material Nodes
button you had to click to activate the nodes for materials, from there it should pop up with a list
of all the materials in the file, select which one you want to apply this node to.
Camera Data Node (Add -> Input -> Camera Data): Leave this be for the time being.
Vector Math Node (Add -> Convertor-> Vector Math): Change ‘Add’ to ‘Dot Product’. Then
connect the Normal of the Material Node to the first vector of the Vector Math Node. Have the
View Vector of the Camera Data Node hooked up to the second vector of the Vector Math Node.
Color Ramp Node (Add -> Convertor -> ColorRamp): Now, this should have its Fac (Factor)
input connected to the output Value from the Vector Math Node. The Color Ramp itself you have
to change to the amount of shadow you want, the bigger the black, the bigger the shadow. Just
remember that it needs to be a sudden shift and not a subtle gradient.
Mix Node (Add -> Color -> Mix): Change Mix to Multiply. Change the Fac (Factor) from .500
to 1.000. Have the color output from the ColorRamp Node attach to the color2 input for the Mix
Node and have the color output from the Material Node attach to the color 1 input for the Mix
node. Attach the color output from the Mix Node to the color input for the Output Node (small
box the initially gave us).
At this point in the Output Node, you should see a black edge around our material. The thickness
of that line depends on the changes you make in the Color Ramp Node.
Simply render and you get the following results:
Edge with Freestyle:
The last method and possibly the best method is to render using Freestyle which is currently
being integrated in Blender. Certain versions are still a little buggy, but it’s being worked on and
it’s well worth it to put up with a little bugs since the results are great. First, you will need to
download the newest build of freestyle at graphicall.org. Once downloaded, you can either use
pre-made scripts or make your own. First though you need to enable your render for Freestyle, so
in the Render panel, simply click the two boxes labeled Freestyle. One is located at the bottom of
the Post Processing section of the Render panel and the other is located under the Layers section
of the Render panel.
Towards the bottom of the Layers section of the Render Panel, you will see a little section
labeled freestyle. There will be a button named ‘Add Style Module’, click it and it will bring you
to a list of pre loaded style modules (post processing effects), so just pick one and then render.
Be careful though since not all of them are working yet, so if you notice that nothing is
happening to your render, you may want to try another.
import freestyle_init
from logical_operators import *
from PredicatesU1D import *
from shaders import *
Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D
(QuantitativeInvisibilityUP1D(0)))
shaders_list = [
SamplingShader(5.0),
ConstantColorShader(0, 0, 0, 1.0),
ConstantThicknessShader(1)]
Operators.create(TrueUP1D(), shaders_list)
To use my script, simply go to the text editor in blender; copy and paste the code into the text
editor and save it as a .py. Just make sure you save it in a location where you can find it when
you want to select it as a style module. Finally, these are the results I got when using freestyle
and the first version of the code:
I believe that’s all I have to say, if you have any comments or questions please post them.