refract

fun refract(i: Float2, n: Float2, eta: Float): Float2

Returns the refraction of incident vector i through a surface with normal n and ratio eta.

Returns zero if total internal reflection occurs.

Return

the refracted vector, or zero on total internal reflection

Parameters

i

the incident direction (need not be normalized)

n

the surface normal (assumed normalized)

eta

the ratio of refraction indices (n1 / n2)


fun refract(i: Float3, n: Float3, eta: Float): Float3
fun refract(i: Half3, n: Half3, eta: Half): Half3

Returns the refraction of incident vector i through a surface with normal n and ratio eta.

Returns zero if total internal reflection occurs.

Return

the refracted vector, or zero on total internal reflection

Parameters

i

the incident direction

n

the surface normal (assumed normalized)

eta

the ratio of refraction indices (n1 / n2)