Skip to content

Commit e810f47

Browse files
committed
fixes to smooth dielectric, default create method with rec709 luma coeffs
1 parent bf413ce commit e810f47

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/nbl/builtin/hlsl/bxdf/transmission/smooth_dielectric.hlsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,7 @@ struct SSmoothDielectric
8888

8989
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
9090
{
91-
const bool transmitted = ComputeMicrofacetNormal<scalar_type>::isTransmissionPath(interaction.getNdotV(), _sample.getNdotL());
92-
93-
fresnel::OrientedEtaRcps<monochrome_type> rcpOrientedEtas = fresnel::OrientedEtaRcps<monochrome_type>::create(interaction.getNdotV(_clamp), hlsl::promote<monochrome_type>(eta));
94-
95-
const scalar_type _pdf = bit_cast<scalar_type, uint32_t>(numeric_limits<scalar_type>::infinity);
96-
scalar_type quo = hlsl::mix<scalar_type, bool>(1.0, rcpOrientedEtas.value[0], transmitted);
97-
return quotient_pdf_type::create(quo, _pdf);
91+
return quotient_pdf_type::create(1.0, bit_cast<scalar_type, uint32_t>(numeric_limits<scalar_type>::infinity));
9892
}
9993
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
10094
{
@@ -135,6 +129,12 @@ struct SSmoothThinDielectric
135129
retval.luminosityContributionHint = luminosityContributionHint;
136130
return retval;
137131
}
132+
static this_t create(NBL_CONST_REF_ARG(spectral_type) eta2)
133+
{
134+
static_assert(vector_traits<spectral_type>::Dimension == 3);
135+
const spectral_type rec709 = spectral_type(0.2126, 0.7152, 0.0722);
136+
return create(eta2, rec709);
137+
}
138138
static this_t create(NBL_CONST_REF_ARG(creation_type) params)
139139
{
140140
return create(params.eta2, params.luminosityContributionHint);

0 commit comments

Comments
 (0)