Geometry.FresnelTerm(Single,Single) Method (Microsoft.DirectX.Direct3D)
Calculates the Fresnel term.
Definition
Visual Basic Public Shared Function FresnelTerm( _
ByVal cosTheta As Single, _
ByVal refractionIndex As Single _
) As SingleC# public static float FresnelTerm(
float cosTheta,
float refractionIndex
);C++ public:
static float FresnelTerm(
float cosTheta,
float refractionIndex
);JScript public static function FresnelTerm(
cosTheta : float,
refractionIndex : float
) : float;
Parameters
cosTheta System.Single
Cosine of the incident angle; must be between 0 and 1.refractionIndex System.Single
Refraction index of a material; must be greater than 1.
Return Value
System.Single
Fresnel term for unpolarized light.
Remarks
To find the Fresnel term, use the following equation.
If F is the Fresnel term, A is the angle of incidence, and B is the angle of refraction, then
F = 0.5 * [tan2(A - B) / tan2(A + B) + sin2(A - B) / sin2(A + B)] = 0.5 * sin2(A - B) / sin2(A + B) * [cos2(A + B) / cos2(A - B) + 1] Let r = sina(A) / sin(B) (the relative refractive index) Let c = cos(A) Let g = (r2 + c2 - 1)1/2
Then, expand using the trigonometric identities and simplifying to produce the following result.
F = 0.5 * (g + c)2 / (g - c)2 * ([c(g + c) - 1]2 / [c(g - c) + 1]2 + 1)