

The Diffuse part The importance of the surface normal GlEnableVertexAttribArray ( 2 ) glBindBuffer ( GL_ARRAY_BUFFER, normalbuffer ) glVertexAttribPointer ( 2, // attributeĪnd this is enough to get us started. It is easily computed by taking the cross product of two of its edges (the cross product of a and b produces a vector that is perpendicular to both a and b, remember ?), and normalized : its length is brought back to 1. The normal of a triangle is a vector of length 1 that is perpendicular to this triangle.


The normal of a plane is a vector of length 1 that is perpendicular to this plane. Any kind of Global Illumination whatsoever (it’s the name that regroups all previous ones)ĭuring the last few tutorials you’ve been dealing with normal without really knowing what they were.Color Bleeding (a red carpet will make a white ceiling a litte bit red).Ambient Occlusion (it’s darker in a cave).Physically based shading, which tries to mimic the reality closely.Anisotrophic materials (like brushed metal).Any sophisticated light-matter interaction like subsurface scattering (like wax).Mirror-like reflections (this includes water).This is a broad topic that deserves its own tutorial(s) Beeing darker when light is not directly towards the model (diffuse lighting).Having highlights when looking in the reflection of a light (specular lighting).Beeing more bright when closer to a light source.
#SHADE 3D BASIC HOW TO#
In this 8th tutorial, we will learn how to do some basic shading.
