refract - HLSL
Microsoft DirectX 9.0 SDK Update (October 2004)

refract - HLSL


Returns the refraction vector given the entering ray direction i, the surface normal n, and the refraction index ri. If the angle between i and n is too great for a given eta, refract returns (0,0,0).

Syntax

ret refract(i, n, ri)

Where:

NameIn/OutTemplate TypeComponent TypeSize
iinvectorfloatany
ninvectorfloatsame dimension(s) as input i
riinscalarfloat1
refraction vectoroutvectorfloatsame dimension(s) as input i

Minimum Shader Version

This intrinsic function is supported in the following (or above) shader versions:

Vertex ShaderPixel Shader
vs_1_1ps_2_0


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.