refract
Returns a refraction vector using an entering ray, a surface normal, and a refraction index.
ret refract(i, n, ?) |
---|
Parameters
Item | Description |
---|---|
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 |
---|---|---|---|
i | vector | float | any |
n | vector | float | same dimension(s) as input i |
? | scalar | float | 1 |
refraction vector | vector | float | same dimension(s) as input i |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 2 (DirectX HLSL) and higher shader models | yes |
Shader Model 1 (DirectX HLSL) | yes (vs_1_1 only) |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for