Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
abs
all
any
cos
ddx
ddy
dot
dst
exp
fma
lit
log
mad
max
min
mul
pow
rcp
sin
tan
Expand Minimize

refract

Returns a refraction vector using an entering ray, a surface normal, and a refraction index.

ret refract(i, n, η)

 

Parameters

ItemDescription

i

[in] A floating-point, ray direction vector.

n

[in] A floating-point, surface normal vector.

η

[in] A floating-point, refraction index scalar.

 

Return Value

A floating-point, refraction vector. If the angle between the entering ray i and the surface normal n is too great for a given refraction index η, the return value is (0,0,0).

Type Description

Name Template Type Component Type Size
ivector float any
nvector float same dimension(s) as input i
ηscalar float 1
refraction vectorvector float same dimension(s) as input i

 

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 2 (DirectX HLSL) and higher shader modelsyes
Shader Model 1 (DirectX HLSL) yes (vs_1_1 only)

 

See also

Intrinsic Functions (DirectX HLSL)

 

 

Community Additions

ADD
Show:
© 2015 Microsoft