Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
4fb6184
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 13, 2026
78c3ee9
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 15, 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
044fdbc
Merge branch 'new_quaternion_hlsl' into minor_adjustments_to_bxdf_and…
keptsecret Jan 16, 2026
a37f289
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing…
keptsecret Jan 19, 2026
c26719a
merge master, fix conflicts
keptsecret Jan 20, 2026
3ce0d89
removed obsolete matrix transforms
keptsecret Jan 20, 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
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 29 files
+40 −0 31_HLSLPathTracer/CMakeLists.txt
+837 −0 31_HLSLPathTracer/app_resources/glsl/common.glsl
+182 −0 31_HLSLPathTracer/app_resources/glsl/litByRectangle.comp
+60 −0 31_HLSLPathTracer/app_resources/glsl/litBySphere.comp
+105 −0 31_HLSLPathTracer/app_resources/glsl/litByTriangle.comp
+36 −0 31_HLSLPathTracer/app_resources/hlsl/accumulator.hlsl
+50 −0 31_HLSLPathTracer/app_resources/hlsl/common.hlsl
+204 −0 31_HLSLPathTracer/app_resources/hlsl/concepts.hlsl
+390 −0 31_HLSLPathTracer/app_resources/hlsl/example_common.hlsl
+74 −0 31_HLSLPathTracer/app_resources/hlsl/intersector.hlsl
+242 −0 31_HLSLPathTracer/app_resources/hlsl/material_system.hlsl
+382 −0 31_HLSLPathTracer/app_resources/hlsl/next_event_estimator.hlsl
+266 −0 31_HLSLPathTracer/app_resources/hlsl/pathtracer.hlsl
+19 −0 31_HLSLPathTracer/app_resources/hlsl/present.frag.hlsl
+51 −0 31_HLSLPathTracer/app_resources/hlsl/rand_gen.hlsl
+75 −0 31_HLSLPathTracer/app_resources/hlsl/ray_gen.hlsl
+263 −0 31_HLSLPathTracer/app_resources/hlsl/render.comp.hlsl
+30 −0 31_HLSLPathTracer/app_resources/hlsl/render_common.hlsl
+17 −0 31_HLSLPathTracer/app_resources/hlsl/render_rwmc_common.hlsl
+66 −0 31_HLSLPathTracer/app_resources/hlsl/resolve.comp.hlsl
+15 −0 31_HLSLPathTracer/app_resources/hlsl/resolve_common.hlsl
+7 −0 31_HLSLPathTracer/app_resources/hlsl/rwmc_global_settings_common.hlsl
+197 −0 31_HLSLPathTracer/app_resources/hlsl/scene.hlsl
+28 −0 31_HLSLPathTracer/config.json.template
+17 −0 31_HLSLPathTracer/include/nbl/this_example/common.hpp
+167 −0 31_HLSLPathTracer/include/nbl/this_example/transform.hpp
+1,698 −0 31_HLSLPathTracer/main.cpp
+50 −0 31_HLSLPathTracer/pipeline.groovy
+1 −0 CMakeLists.txt
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