Fix #114780: Cycles: Principled Chiang Hair importance sampling correction #115241
|
@ -395,7 +395,7 @@ ccl_device int bsdf_hair_chiang_sample(KernelGlobals kg,
|
|||
rand.z = max(rand.z, 1e-5f);
|
||||
const float fac = 1.0f + v * logf(rand.z + (1.0f - rand.z) * expf(-2.0f / v));
|
||||
float sin_theta_i = -fac * sintheta_temp_o +
|
||||
cos_from_sin(fac) * cosf(M_2PI_F * rand.y) * costheta_temp_o;
|
||||
sin_from_cos(fac) * cosf(M_2PI_F * rand.y) * costheta_temp_o;
|
||||
HamilcarR marked this conversation as resolved
Outdated
|
||||
float cos_theta_i = cos_from_sin(sin_theta_i);
|
||||
|
||||
float phi;
|
||||
|
@ -407,8 +407,6 @@ ccl_device int bsdf_hair_chiang_sample(KernelGlobals kg,
|
|||
}
|
||||
const float phi_i = phi_o + phi;
|
||||
|
||||
hair_alpha_angles(sin_theta_o, cos_theta_o, bsdf->alpha, angles);
|
||||
|
||||
Spectrum F = zero_spectrum();
|
||||
float F_energy = 0.0f;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
I do not like this naming, because this variable has a concrete meaning and is therefore not temp, and it does not following the naming convention of the nearby code.
I suggest
sin_theta_o_tilted
agreed , this was poorly named.