@@ -53,7 +53,7 @@ struct SOrenNayar
53
53
scalar_type NdotV = interaction.getNdotV (_clamp);
54
54
scalar_type C = 1.0 / max <scalar_type>(NdotL, NdotV);
55
55
56
- scalar_type cos_phi_sin_theta = max <scalar_type>(VdotL - NdotL * NdotV, 0.0 );
56
+ scalar_type cos_phi_sin_theta = max <scalar_type>(query. getVdotL () - NdotL * NdotV, 0.0 );
57
57
return hlsl::promote<spectral_type>(NdotL * numbers::inv_pi<scalar_type> * 0.5 * (AB.x + AB.y * cos_phi_sin_theta * C));
58
58
}
59
59
spectral_type eval (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction)
@@ -87,7 +87,13 @@ struct SOrenNayar
87
87
quotient_pdf_type __quotient_and_pdf (NBL_CONST_REF_ARG (Query) query, NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction)
88
88
{
89
89
scalar_type _pdf = pdf (_sample);
90
- scalar_type q = __rec_pi_factored_out_wo_clamps (query.getVdotL (), _sample.getNdotL (_clamp), interaction.getNdotV (_clamp));
90
+
91
+ scalar_type NdotL = _sample.getNdotL (_clamp);
92
+ scalar_type NdotV = interaction.getNdotV (_clamp);
93
+ scalar_type C = 1.0 / max <scalar_type>(NdotL, NdotV);
94
+
95
+ scalar_type cos_phi_sin_theta = max <scalar_type>(query.getVdotL () - NdotL * NdotV, 0.0 );
96
+ scalar_type q = AB.x + AB.y * cos_phi_sin_theta * C;
91
97
return quotient_pdf_type::create (q, _pdf);
92
98
}
93
99
quotient_pdf_type quotient_and_pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction)
0 commit comments