Illumination model
In 3D rendering, the illumination of an object's surface is calculated as:
I = Ambient Light (iambient) + Diffuse Reflection light (idiffuse) + specular highlight (ispecular);
Where the ambient light (ambient) is calculated as:
iambient = aintensity * ACOLOR; (aintensity indicates ambient light intensity, acolor indicates ambient light color)
The diffuse light (diffuse) calculation formula is:
Idiffuse = DINTENSITY*DCOLOR*N.L; (Dintensity represents diffuse intensity, dcolor represents diffuse light color, n is the normal vector for that point, and L is the light vector)
Specular illumination (specular) is calculated as:
Ispecular = sintensity*scolor* (R.V) n; (Sintensity for specular light intensity, scolor for specular light, R for light, and V for Observer vectors)
The overall illumination formula is:
I = aintensity * acolor + DINTENSITY*DCOLOR*N.L + sintensity*scolor* (R.V) N;
Combining some values and using white as the light color, the above formula can be simplified to:
I = A + D*N.L + (R.V) N
Light Model formula