Geometry.FresnelTerm Method |
Language: |
Calculates the Fresnel term.
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;
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.
System.Single
Fresnel term for unpolarized light.
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/2Then, 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)
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center