O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shader programming – Diffuse and Bump (normal) maps

In this first step, we will import Chapter3.unitypackage (which is already included in the FBX model and textures) and create a shader program, which will include all the properties that we can edit from the Material Inspector. We will start by assigning the Diffuse and Bump (normal) maps. Then, we will use the built-in lighting models, Lambert and BlinnPhong, which are located in the Lighting.cginc file inside the Unity application, to see our result.

Note

Lambert or diffuse reflection will cause all closed polygons to reflect light equally in all directions when rendered. This algorithm is named after Johann Heinrich Lambert, who invented it.

Blinn-Phong or Blinn-Phong reflection is a shading ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required