Game Development Reference
In-Depth Information
We will start creaing by adding the difuse texture and bump (normal) texture and using the
built-in lighing models, which are
Lambert
(difuse lighing) and
BlinnPhong
(specular
lighing) that are located in the
Lighting.cginc
ile inside the Unity applicaion. This way,
we can see the structure and algorithm of the shader programming, and it will be helpful
when we adapt it to our custom shader.
Lambert
, or difuse relecion, will cause all closed polygons to relect light
equally in all direcions when rendered. This algorithm is named ater
Johann
Heinrich Lambert
who invented it.
Blinn-Phong
, or Blinn-Phong relecion, is the shading model that is the
modiicaion of the
Phong
relecion model developed by
Jim Blinn
.
Phong
relecion model is the shading model that includes a model for the
relecion of light from surfaces. It also has a compaible method of esimaing
pixel colors using interpolaion surface normals across rasterized(or bitmap)
polygons developed by
Bui Tuong Phong
.
Reference:
http://en.wikipedia.org/wiki/Lambertian_reflectance
.
http://en.wikipedia.org/wiki/Phong_shading
.
http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_
shading_model
.
Next, we will add the ambient color and specular color, and create the custom lighing
model. In this step, we will learn how to create a custom lighing model in a surface shader.
Finally, we will add the rim light (back light) and the ramp texture to create the toon shader
style, and see a result similar to the previous figure.