Skip to content

Latest commit

 

History

History
113 lines (68 loc) · 2.04 KB

d3d10-d3dxfresnelterm.md

File metadata and controls

113 lines (68 loc) · 2.04 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location
D3DXFresnelTerm function (D3DX10Math.h) - Calculate the Fresnel term.
eaa2e5ea-9b6f-4216-8b48-7be74501124d
D3DXFresnelTerm function (D3DX10Math.h)
reference
05/31/2018
APIRef
kbSyntax
D3DXFresnelTerm
LibDef
D3DX10.lib
D3DX10.dll

D3DXFresnelTerm function (D3DX10Math.h)

Note

The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.

Calculate the Fresnel term.

Syntax

FLOAT D3DXFresnelTerm(
  _In_ FLOAT CosTheta,
  _In_ FLOAT RefractionIndex
);

Parameters

CosTheta [in]

Type: FLOAT

The value must be between 0 and 1.

RefractionIndex [in]

Type: FLOAT

The refraction index of a material. The value must be greater than 1.

Return value

Type: FLOAT

This function returns the Fresnel term for unpolarized light. CosTheta is the cosine of the incident angle.

Remarks

To find the Fresnel term (F):

If A is 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, expanding using the trig identities and simplifying, you get:

F = 0.5 * (g + c)2 / (g - c)2 * ([c(g + c) - 1]2 / [c(g - c) + 1]2 + 1)

Requirements

Requirement Value
Header
D3DX10Math.h
Library
D3DX10.lib

See also

Math Functions