Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
781df86
split out new quaternion hlsl stuff over from hlsl path tracer example
keptsecret Dec 2, 2025
506c8a5
Merge branch 'master' into new_quaternion_hlsl
keptsecret Dec 11, 2025
c2fa565
Merge branch 'master' into new_quaternion_hlsl
keptsecret Dec 11, 2025
1bf0616
removed redundant constructors, some reorganize quaternions
keptsecret Dec 11, 2025
8745a33
added some checks to create from rot mat
keptsecret Dec 11, 2025
2a8451d
moved normalize, static_cast to helper specializations, norm and unno…
keptsecret Dec 12, 2025
a93fa26
fix some quaternion bugs
keptsecret Dec 12, 2025
f900b78
rng dim adaptor should not store its own copy of rng
keptsecret Dec 17, 2025
6cbd841
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Dec 22, 2025
35993ae
removed obsolete function
keptsecret Dec 23, 2025
da67082
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Dec 23, 2025
01337d6
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Dec 24, 2025
6924883
implements incomplete gamma function (RLGamma from bxdf chi2 test)
keptsecret Dec 29, 2025
688391d
added draft version of adaptive simpson, only tested on cpp and shoul…
keptsecret Dec 29, 2025
5964da0
adds turbo colormap
keptsecret Dec 30, 2025
e9a325a
fixes 1d adaptive simpson to use compile-time depth
keptsecret Dec 30, 2025
3354e6a
converted adaptive simpson 2d into templated structs
keptsecret Dec 30, 2025
80c842c
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 5, 2026
bedeb61
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 5, 2026
35e78b9
merge master, fix conflicts
keptsecret Jan 5, 2026
2f33aa0
some fixes to quaternions
keptsecret Jan 6, 2026
a22d46a
implement quaternion slerp (might need optimizing?)
keptsecret Jan 7, 2026
f71cca1
minor optimization to slerp
keptsecret Jan 7, 2026
c39c78a
fix create from rotation matrix
keptsecret Jan 7, 2026
0b180c8
force constructor type with requires to avoid dxc implicit conversions
keptsecret Jan 7, 2026
de1b0d1
fixes to transformVector and other minor fixes
keptsecret Jan 7, 2026
96ef95d
added matrix runtime traits for checking orthogonality, uniform scale
keptsecret Jan 8, 2026
4fb6184
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 13, 2026
ca322c8
Merge branch 'master' into new_quaternion_hlsl
keptsecret Jan 13, 2026
a0acd35
matrix runtime traits stores uniform scale squared, changed calculati…
keptsecret Jan 13, 2026
d1c4a89
added more static_casts and new partial spec for flipIfRHSNegative
keptsecret Jan 13, 2026
e8a6488
account for no scale in transform vector
keptsecret Jan 13, 2026
c07365f
more comment info for pitch yaw roll, removed normalize truncated quat
keptsecret Jan 14, 2026
2aa275e
create from matrix restore scale correctly
keptsecret Jan 14, 2026
3869cb1
minor bug fixes to quaternions
keptsecret Jan 15, 2026
6853ca3
Merge branch 'master' into new_quaternion_hlsl
keptsecret Jan 15, 2026
a602fba
add some operators to hlsl::matrix in C++
Jan 15, 2026
4aa2368
factor out uniform scale from mat before convert
keptsecret Jan 15, 2026
78c3ee9
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 15, 2026
5f02325
new vector comparison by orientation
keptsecret Jan 15, 2026
11f7f2e
return nan quaternion if uniform scale is 0
keptsecret Jan 15, 2026
266cd71
account for negative orientation, added check for 0 length vectors
keptsecret Jan 16, 2026
61f9ca3
added concept requires to adaptive simpson function, changed func sig
keptsecret Jan 16, 2026
762b826
minor fixes to turbo vis struct
keptsecret Jan 16, 2026
2599856
made ndf and bxdf methods const
keptsecret Jan 16, 2026
9a3918a
adaptive simpson should take const function
keptsecret Jan 16, 2026
ce371c7
fixes create from matrix by using correct row-column indexing
keptsecret Jan 16, 2026
c8df31a
fix glm not liking unary - on swizzle
keptsecret Jan 16, 2026
f4b0b43
do quaternion inverse not as member function
keptsecret Jan 16, 2026
044fdbc
Merge branch 'new_quaternion_hlsl' into minor_adjustments_to_bxdf_and…
keptsecret Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions include/nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct quant_query_helper<N, F, true>
using quant_query_type = typename N::quant_query_type;

template<class I, class C>
static quant_query_type __call(NBL_REF_ARG(N) ndf, NBL_CONST_REF_ARG(F) fresnel, NBL_CONST_REF_ARG(I) interaction, NBL_CONST_REF_ARG(C) cache)
static quant_query_type __call(NBL_CONST_REF_ARG(N) ndf, NBL_CONST_REF_ARG(F) fresnel, NBL_CONST_REF_ARG(I) interaction, NBL_CONST_REF_ARG(C) cache)
{
return ndf.template createQuantQuery<I,C>(interaction, cache, fresnel.getRefractionOrientedEta());
}
Expand All @@ -62,7 +62,7 @@ struct quant_query_helper<N, F, false>
using quant_query_type = typename N::quant_query_type;

template<class I, class C>
static quant_query_type __call(NBL_REF_ARG(N) ndf, NBL_CONST_REF_ARG(F) fresnel, NBL_CONST_REF_ARG(I) interaction, NBL_CONST_REF_ARG(C) cache)
static quant_query_type __call(NBL_CONST_REF_ARG(N) ndf, NBL_CONST_REF_ARG(F) fresnel, NBL_CONST_REF_ARG(I) interaction, NBL_CONST_REF_ARG(C) cache)
{
typename N::scalar_type dummy;
return ndf.template createQuantQuery<I,C>(interaction, cache, dummy);
Expand Down Expand Up @@ -146,7 +146,7 @@ struct SCookTorrance
return hlsl::mix(reflectance, scalar_type(1.0)-reflectance, transmitted);
}

bool __dotIsValue(const vector3_type a, const vector3_type b, const scalar_type value)
bool __dotIsValue(const vector3_type a, const vector3_type b, const scalar_type value) NBL_CONST_MEMBER_FUNC
{
const scalar_type ab = hlsl::dot(a, b);
return hlsl::max(ab, value / ab) <= scalar_type(value + 1e-3);
Expand All @@ -156,7 +156,7 @@ struct SCookTorrance
template<class Interaction=conditional_t<IsAnisotropic,anisotropic_interaction_type,isotropic_interaction_type>,
class MicrofacetCache=conditional_t<IsAnisotropic,anisocache_type,isocache_type>
NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache) NBL_CONST_MEMBER_FUNC
{
fresnel_type _f = __getOrientedFresnel(fresnel, interaction.getNdotV());
if (!__checkValid<Interaction, MicrofacetCache>(_f, _sample, interaction, cache))
Expand Down Expand Up @@ -197,7 +197,7 @@ struct SCookTorrance
sample_type __generate_common(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type localH,
const scalar_type NdotV, const scalar_type VdotH, const scalar_type LdotH, bool transmitted,
NBL_CONST_REF_ARG(fresnel::OrientedEtaRcps<monochrome_type>) rcpEta,
NBL_REF_ARG(bool) valid)
NBL_REF_ARG(bool) valid) NBL_CONST_MEMBER_FUNC
{
// fail if samples have invalid paths
const scalar_type NdotL = hlsl::mix(scalar_type(2.0) * VdotH * localH.z - NdotV,
Expand Down Expand Up @@ -244,7 +244,7 @@ struct SCookTorrance
return sample_type::create(L, T, B, NdotL);
}
template<typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(C::value && !IsBSDF)
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u, NBL_REF_ARG(anisocache_type) cache)
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u, NBL_REF_ARG(anisocache_type) cache) NBL_CONST_MEMBER_FUNC
{
const scalar_type NdotV = interaction.getNdotV();
if (NdotV < numeric_limits<scalar_type>::min)
Expand Down Expand Up @@ -274,7 +274,7 @@ struct SCookTorrance
return s;
}
template<typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(C::value && IsBSDF)
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u, NBL_REF_ARG(anisocache_type) cache)
sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u, NBL_REF_ARG(anisocache_type) cache) NBL_CONST_MEMBER_FUNC
{
const vector3_type localV = interaction.getTangentSpaceV();
const scalar_type NdotV = localV.z;
Expand Down Expand Up @@ -322,7 +322,7 @@ struct SCookTorrance
return s;
}
template<typename C=bool_constant<!IsAnisotropic> NBL_FUNC_REQUIRES(C::value && !IsAnisotropic)
sample_type generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const conditional_t<IsBSDF, vector3_type, vector2_type> u, NBL_REF_ARG(isocache_type) cache)
sample_type generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const conditional_t<IsBSDF, vector3_type, vector2_type> u, NBL_REF_ARG(isocache_type) cache) NBL_CONST_MEMBER_FUNC
{
anisocache_type aniso_cache;
sample_type s = generate(anisotropic_interaction_type::create(interaction), u, aniso_cache);
Expand All @@ -331,7 +331,7 @@ struct SCookTorrance
}

template<class Interaction, class MicrofacetCache>
scalar_type __pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache, NBL_REF_ARG(bool) isInfinity)
scalar_type __pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache, NBL_REF_ARG(bool) isInfinity) NBL_CONST_MEMBER_FUNC
{
using quant_query_type = typename ndf_type::quant_query_type;
using dg1_query_type = typename ndf_type::dg1_query_type;
Expand All @@ -356,7 +356,7 @@ struct SCookTorrance
template<class Interaction=conditional_t<IsAnisotropic,anisotropic_interaction_type,isotropic_interaction_type>,
class MicrofacetCache=conditional_t<IsAnisotropic,anisocache_type,isocache_type>
NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache) NBL_CONST_MEMBER_FUNC
{
fresnel_type _f = __getOrientedFresnel(fresnel, interaction.getNdotV());
if (!__checkValid<Interaction, MicrofacetCache>(_f, _sample, interaction, cache))
Expand All @@ -370,7 +370,7 @@ struct SCookTorrance
template<class Interaction=conditional_t<IsAnisotropic,anisotropic_interaction_type,isotropic_interaction_type>,
class MicrofacetCache=conditional_t<IsAnisotropic,anisocache_type,isocache_type>
NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache) NBL_CONST_MEMBER_FUNC
{
if (!_sample.isValid())
return quotient_pdf_type::create(scalar_type(0.0), scalar_type(0.0)); // set pdf=0 when quo=0 because we don't want to give high weight to sampling strategy that yields 0 contribution
Expand Down
20 changes: 10 additions & 10 deletions include/nbl/builtin/hlsl/bxdf/base/lambertian.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,54 @@ struct SLambertianBase

NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = conditional_value<IsBSDF, BxDFClampMode, BxDFClampMode::BCM_ABS, BxDFClampMode::BCM_MAX>::value;

spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return hlsl::promote<spectral_type>(_sample.getNdotL(_clamp) * numbers::inv_pi<scalar_type> * hlsl::mix(1.0, 0.5, IsBSDF));
}
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return eval(_sample, interaction.isotropic);
}

template<typename C=bool_constant<!IsBSDF> >
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u)
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u) NBL_CONST_MEMBER_FUNC
{
ray_dir_info_type L;
L.setDirection(sampling::ProjectedHemisphere<scalar_type>::generate(u));
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}
template<typename C=bool_constant<IsBSDF> >
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u)
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u) NBL_CONST_MEMBER_FUNC
{
vector3_type _u = u;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedSphere<scalar_type>::generate(_u));
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}
template<typename C=bool_constant<!IsBSDF> >
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector2_type u)
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector2_type u) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
}
template<typename C=bool_constant<IsBSDF> >
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector3_type u)
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector3_type u) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
}

scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
NBL_IF_CONSTEXPR (IsBSDF)
return sampling::ProjectedSphere<scalar_type>::pdf(_sample.getNdotL(_clamp));
else
return sampling::ProjectedHemisphere<scalar_type>::pdf(_sample.getNdotL(_clamp));
}
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return pdf(_sample, interaction.isotropic);
}

quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
sampling::quotient_and_pdf<monochrome_type, scalar_type> qp;
NBL_IF_CONSTEXPR (IsBSDF)
Expand All @@ -81,7 +81,7 @@ struct SLambertianBase
qp = sampling::ProjectedHemisphere<scalar_type>::template quotient_and_pdf(_sample.getNdotL(_clamp));
return quotient_pdf_type::create(qp.quotient[0], qp.pdf);
}
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return quotient_and_pdf(_sample, interaction.isotropic);
}
Expand Down
26 changes: 13 additions & 13 deletions include/nbl/builtin/hlsl/bxdf/base/oren_nayar.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,82 +45,82 @@ struct SOrenNayarBase
return retval;
}

scalar_type __rec_pi_factored_out_wo_clamps(scalar_type VdotL, scalar_type clampedNdotL, scalar_type clampedNdotV)
scalar_type __rec_pi_factored_out_wo_clamps(scalar_type VdotL, scalar_type clampedNdotL, scalar_type clampedNdotV) NBL_CONST_MEMBER_FUNC
{
scalar_type C = 1.0 / max<scalar_type>(clampedNdotL, clampedNdotV);
scalar_type cos_phi_sin_theta = max<scalar_type>(VdotL - clampedNdotL * clampedNdotV, 0.0);
return (AB.x + AB.y * cos_phi_sin_theta * C);
}
template<typename Query>
spectral_type __eval(NBL_CONST_REF_ARG(Query) query, NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
spectral_type __eval(NBL_CONST_REF_ARG(Query) query, NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
scalar_type NdotL = _sample.getNdotL(_clamp);
return hlsl::promote<spectral_type>(NdotL * numbers::inv_pi<scalar_type> * hlsl::mix(1.0, 0.5, IsBSDF) * __rec_pi_factored_out_wo_clamps(query.getVdotL(), NdotL, interaction.getNdotV(_clamp)));
}

spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
SQuery query;
query.VdotL = hlsl::dot(interaction.getV().getDirection(), _sample.getL().getDirection());
return __eval<SQuery>(query, _sample, interaction);
}
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return eval(_sample, interaction.isotropic);
}

template<typename C=bool_constant<!IsBSDF> >
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u)
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u) NBL_CONST_MEMBER_FUNC
{
ray_dir_info_type L;
L.setDirection(sampling::ProjectedHemisphere<scalar_type>::generate(u));
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}
template<typename C=bool_constant<IsBSDF> >
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u)
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector3_type u) NBL_CONST_MEMBER_FUNC
{
vector3_type _u = u;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedSphere<scalar_type>::generate(_u));
return sample_type::createFromTangentSpace(L, interaction.getFromTangentSpace());
}
template<typename C=bool_constant<!IsBSDF> >
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector2_type u)
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector2_type u) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
}
template<typename C=bool_constant<IsBSDF> >
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector3_type u)
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector3_type u) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
}

scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
if (IsBSDF)
return sampling::ProjectedSphere<scalar_type>::pdf(_sample.getNdotL(_clamp));
else
return sampling::ProjectedHemisphere<scalar_type>::pdf(_sample.getNdotL(_clamp));
}
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return pdf(_sample, interaction.isotropic);
}

template<typename Query>
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)
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) NBL_CONST_MEMBER_FUNC
{
scalar_type _pdf = pdf(_sample, interaction);
scalar_type q = __rec_pi_factored_out_wo_clamps(query.getVdotL(), _sample.getNdotL(_clamp), interaction.getNdotV(_clamp));
return quotient_pdf_type::create(q, _pdf);
}
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
SQuery query;
query.VdotL = hlsl::dot(interaction.getV().getDirection(), _sample.getL().getDirection());
return __quotient_and_pdf<SQuery>(query, _sample, interaction);
}
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction)
quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return quotient_and_pdf(_sample, interaction.isotropic);
}
Expand Down
16 changes: 0 additions & 16 deletions include/nbl/builtin/hlsl/bxdf/fresnel.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,6 @@ struct Conductor
return (rs2 + rp2) * hlsl::promote<T>(0.5);
}

// OrientedEtaRcps<eta_type> getRefractionOrientedEtaRcps() NBL_CONST_MEMBER_FUNC
// {
// OrientedEtaRcps<eta_type> rcpEta;
// rcpEta.value = hlsl::promote<eta_type>(1.0) / eta;
// rcpEta.value2 = rcpEta.value * rcpEta.value;
// return rcpEta;
// }

T eta;
T etak2;
T etaLen2;
Expand Down Expand Up @@ -703,14 +695,6 @@ struct Iridescent<T, false, Colorspace NBL_PARTIAL_REQ_BOT(concepts::FloatingPoi
base_type::eta12, base_type::eta23, getEtak23(), clampedCosTheta);
}

// OrientedEtaRcps<eta_type> getRefractionOrientedEtaRcps() NBL_CONST_MEMBER_FUNC
// {
// OrientedEtaRcps<eta_type> rcpEta;
// rcpEta.value = hlsl::promote<eta_type>(1.0) / base_type::eta13;
// rcpEta.value2 = rcpEta.value * rcpEta.value;
// return rcpEta;
// }

vector_type getEtak23() NBL_CONST_MEMBER_FUNC
{
return etak23;
Expand Down
Loading
Loading