Cycles: Add thin film iridescence to Principled BSDF #118477
|
@ -276,6 +276,9 @@ ccl_device_forceinline void microfacet_fresnel(KernelGlobals kg,
|
||||||
kernel_assert(fresnel->f90 == one_spectrum());
|
kernel_assert(fresnel->f90 == one_spectrum());
|
||||||
F = fresnel_iridescence(
|
F = fresnel_iridescence(
|
||||||
kg, 1.0f, fresnel->thin_film.ior, bsdf->ior, cos_theta_i, fresnel->thin_film.thickness);
|
kg, 1.0f, fresnel->thin_film.ior, bsdf->ior, cos_theta_i, fresnel->thin_film.thickness);
|
||||||
|
if (r_cos_theta_t) {
|
||||||
|
*r_cos_theta_t = -safe_sqrtf(1.0f - sqr(1.0f / bsdf->ior) * (1.0f - sqr(cos_theta_i)));
|
||||||
|
}
|
||||||
/* Apply F0 scaling (here per-channel, since iridescence produces colored output).
|
/* Apply F0 scaling (here per-channel, since iridescence produces colored output).
|
||||||
* Note that the usual approach (as used below) cannot be used here, since F may be below
|
* Note that the usual approach (as used below) cannot be used here, since F may be below
|
||||||
* F0_real. Therefore, use a different approach: Scale the result by (F0 / F0_real), with
|
* F0_real. Therefore, use a different approach: Scale the result by (F0 / F0_real), with
|
||||||
|
|
Loading…
Reference in New Issue