The simplest illumination is to calculate the illumination based on the illumination model and normal in vertex shader. This method cannot realize the surface details of an object well. Later, we produced the Per-pixle lighting, which postponed the computing of illumination to each pixel. The familiar bump mapping is a PPL technology. However, although PPL is good, an additional concave-convex ing graph is required, and the model itself also needs to calculate the binormal or tangent vector. Previously, when we read 3ds, we found that we didn't even have normal. We only calculated it by ourselves (see how to export the 3ds model and then calculate the normal ). It's so tiring to compute another vector. However, we can calculate the tangent directly in pixel shader according to the christian schuler method. The method is good. The following is a Demo of the effect:
Refer:
[1] Christian schted, Normal Mapping Without Precomputed Tangents.
[2] Tomas Akenine-moller, Eric Haines, Naty Hoffman, Real-Time Rendering 3rd.
[3] Jim Blinn, Simulation of Wrinkled Surfaces.
[4] Philip Taylor, Per-Pixel Lighting.