Preface
One of the most commonly used effects in games is edge light, which can not only highlight objects, but also add luster to the character's skin surface. As shown below:
Implementation principle
The principle of edge light is the underlying logic of the Fresnel node.
Fresnel: The Fresnel effect is the effect of different reflectivities on surfaces depending on the viewing angle. When approaching the grazing angle, more light will be reflected. The Fresnel Effect node approximates this by calculating the angle between the surface normal and the view direction. The wider the angle, the larger the return value. This effect is often used to achieve rim lighting and is common in many art styles.
We can roughly know its principle through Fresnel's code.
Code:
void Unity_FresnelEffect_float(float3 Normal, float3 ViewDir, float Power, out