refract
The direction i bent through a surface with unit normal n.
refract(i: Val, n: Val, eta: Val): Expr
Import math from shaders/std and use math.refract.
eta is the ratio of refractive indices, about 0.66 going from air into glass.
Parameters
| Name | Type | Notes |
|---|---|---|
i | Val | |
n | Val | |
eta | Val |
Example
const bent = refract(viewDir, normal, 0.66)
See also
reflect— The directionibounced off a surface with unit normaln.