Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
8e7615d
fix spirv qualifiers for HitTriangleVertexPositionsKHR
keptsecret Mar 10, 2026
b9ec10e
fix transpose when matrix N!=M
keptsecret Mar 11, 2026
cb13a6b
fix pseudoInverse3x4, some bugs in linalg/basic.hlsl
keptsecret Mar 11, 2026
c545a59
fixes lookAt calculation for loading toWorld property in mitsuba scene
keptsecret Mar 12, 2026
1e907f4
remove obsolete comments
keptsecret Mar 12, 2026
70b31d4
Merge branch 'master' into rt_pipeline_debug_render_fixes
keptsecret Mar 13, 2026
1409481
latest example
keptsecret Mar 13, 2026
5def0b4
Fix checking valid jpeg file logic
Mar 14, 2026
f93f430
get opacity going!
devshgraphicsprogramming Mar 14, 2026
1a7bf02
really struggling with TWO_SIDED
devshgraphicsprogramming Mar 14, 2026
0dc31aa
add CFrontendIR node copying, stack reversal and individual BxDF expr…
devshgraphicsprogramming Mar 16, 2026
8aff0f7
Beer node needs a thickness unfortunately.
devshgraphicsprogramming Mar 16, 2026
1b0b6f3
quick hack around normalmaps and bumpmaps, sketch out the general ide…
devshgraphicsprogramming Mar 16, 2026
6a4e8df
Merge remote-tracking branch 'remotes/origin/hotfix_jpeg_loader' into…
devshgraphicsprogramming Mar 16, 2026
0c1e045
move UV transform to front of SParameterSet, keep variable length stu…
devshgraphicsprogramming Mar 16, 2026
850536c
implement BLEND_BSDF
devshgraphicsprogramming Mar 17, 2026
9574030
merge master, fix conflicts
keptsecret Mar 17, 2026
011e7f0
I forgot that for blends all layers need to be blended!
devshgraphicsprogramming Mar 17, 2026
2b34047
I don't want to admit how long it took me to debug this one
devshgraphicsprogramming Mar 17, 2026
2d3719f
fix the last thing in the material frontend
devshgraphicsprogramming Mar 18, 2026
ad0cf8d
fix TLAS export when Polygon Geometry can't be made into a BLAS
devshgraphicsprogramming Mar 18, 2026
5d2568b
merge master
devshgraphicsprogramming Mar 18, 2026
546ed90
Merge branch 'master' into rt_pipeline_debug_render_fixes
keptsecret Mar 19, 2026
c86f8e1
Fix Wave include paths and failure dumps
AnastaZIuk Mar 19, 2026
4871e24
Clean up preprocess failure plumbing
AnastaZIuk Mar 19, 2026
1f73d6a
Backport Wave pragma fix and remove workaround
AnastaZIuk Mar 19, 2026
e4df2b2
Merge pull request #1025 from Devsh-Graphics-Programming/preprocessUp…
AnastaZIuk Mar 19, 2026
66da590
Use upstream gh-pages action for badges
AnastaZIuk Mar 19, 2026
f830a47
Promote NSC channel 66da590b3f06b586f69bdb522bad2f2eebf11b6f
github-actions[bot] Mar 19, 2026
00017ad
Merge pull request #1026 from Devsh-Graphics-Programming/ci/nsc-promo…
AnastaZIuk Mar 19, 2026
83e30e4
Merge branch 'master' into ris_bxdfs
keptsecret Mar 20, 2026
067d107
change concepts for bxdf to *_and_weight methods, make changes for co…
keptsecret Mar 20, 2026
fc6deb8
pdf method renamed to denominator, don't expect to be used
keptsecret Mar 20, 2026
c292f41
Merge remote-tracking branch 'remotes/origin/master' into mitsuba_xml…
devshgraphicsprogramming Mar 21, 2026
1a3d26a
Merge pull request #1021 from Devsh-Graphics-Programming/mitsuba_xml_…
devshgraphicsprogramming Mar 21, 2026
0afd2fa
fix MIS in the path tracer, dont make every ray that didn't miss go i…
devshgraphicsprogramming Mar 21, 2026
f2e2265
camelcase method names, no need for denominator method (pdf is pdf an…
keptsecret Mar 23, 2026
0708859
refactor cook torrance to fit concept
keptsecret Mar 23, 2026
b609179
znowu w zyciu mi nie wyszlo
devshgraphicsprogramming Mar 23, 2026
63cd4df
changes to method names in pt concept, use *_weight instead of pdf an…
keptsecret Mar 23, 2026
59e090e
record my discoveries
devshgraphicsprogramming Mar 23, 2026
a877934
renamed pdf to forwardPdf
keptsecret Mar 23, 2026
64ce3ba
add tractable pdf trait to bxdfs
keptsecret Mar 23, 2026
2539522
Merge remote-tracking branch 'remotes/origin/master' into mitsuba_xml…
devshgraphicsprogramming Mar 23, 2026
148b9bd
bxdf input random to generate has variable dimensions (brdf>=2; bsdf>…
keptsecret Mar 23, 2026
95a3862
merge master, fix conflicts
keptsecret Mar 24, 2026
946c9c7
pass ray to nee generate instead, store depth in ray
keptsecret Mar 24, 2026
4f4421d
nee deferredPdf is deferredWeight
keptsecret Mar 24, 2026
a70f420
all bxdfs have a cache type from generate to quotient_weight, microfa…
keptsecret Mar 24, 2026
dab4a18
eval should have its own cache type in concepts
keptsecret Mar 24, 2026
fb878a6
minor typo bug fixes
keptsecret Mar 25, 2026
4171059
eval returns a value_and_weight type, fixed some bugs in bxdf concept
keptsecret Mar 25, 2026
0e16279
made value_and_pdf compose from value_and_weight
keptsecret Mar 25, 2026
345865f
reuse quant query and other stuff from forwardPdf in quotient and eva…
keptsecret Mar 25, 2026
a98cd45
reuse reflectance from forwardpdf in eval
keptsecret Mar 25, 2026
d0ed7d3
renamed quotient_pdf type to quotient_weight type
keptsecret Mar 26, 2026
110547a
minor fixes to cook torrance, removed redundant functions
keptsecret Mar 26, 2026
ef9156e
only microfacet bxdfs need eval cache type, allow for overload with e…
keptsecret Mar 26, 2026
05124c2
latest example
keptsecret Mar 26, 2026
258836a
latest example
keptsecret Mar 26, 2026
01ee867
fixes in HLSL, SPIR-V intrinsics and Mitsuba parsing merged
devshgraphicsprogramming Mar 26, 2026
e11b118
update submodule pointer after merge
devshgraphicsprogramming Mar 26, 2026
efa17ca
latest example
keptsecret Mar 27, 2026
bea4780
minor changes to concepts, microfacet bxdfs have eval that autogenera…
keptsecret Mar 27, 2026
7d27081
added additional checks for a=0 to get pdf=inf
keptsecret Mar 27, 2026
d8271b9
regular bxdfs also have eval that don't need cache as input param
keptsecret Mar 27, 2026
e4a8319
regular bxdfs don't take cache for eval
keptsecret Mar 27, 2026
920c44a
latest example
keptsecret Mar 27, 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 .github/workflows/build-nabla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ jobs:
$imageBadge | Set-Content -Path "$imagePath/image-badge.json" -Encoding utf8

- name: Deploy Badges
uses: Devsh-Graphics-Programming/actions-gh-pages@v4.0.0-devsh.1
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: badges
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/boost/superproject
Submodule superproject updated 1 files
+1 −1 libs/wave
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 30 files
+27 −43 13_MaterialCompilerTest/main.cpp
+42 −17 22_CppCompat/CIntrinsicsTester.h
+51 −32 22_CppCompat/CTgmathTester.h
+6 −0 22_CppCompat/app_resources/common.hlsl
+6 −1 31_HLSLPathTracer/app_resources/hlsl/example_common.hlsl
+21 −16 31_HLSLPathTracer/app_resources/hlsl/material_system.hlsl
+41 −31 31_HLSLPathTracer/app_resources/hlsl/next_event_estimator.hlsl
+1 −1 31_HLSLPathTracer/app_resources/hlsl/render.comp.hlsl
+16 −92 31_HLSLPathTracer/main.cpp
+14 −14 37_HLSLSamplingTests/main.cpp
+5 −0 40_PathTracer/app_resources/pathtrace/beauty.hlsl
+97 −5 40_PathTracer/app_resources/pathtrace/debug.hlsl
+5 −0 40_PathTracer/app_resources/pathtrace/previs.hlsl
+7 −2 40_PathTracer/include/renderer/CRenderer.h
+2 −1 40_PathTracer/include/renderer/CSession.h
+11 −4 40_PathTracer/include/renderer/shaders/pathtrace/push_constants.hlsl
+45 −0 40_PathTracer/include/renderer/shaders/pathtrace/rand_gen.hlsl
+5 −1 40_PathTracer/include/renderer/shaders/session.hlsl
+17 −4 40_PathTracer/main.cpp
+11 −10 40_PathTracer/src/io/CSceneLoader.cpp
+127 −3 40_PathTracer/src/renderer/CRenderer.cpp
+3 −1 40_PathTracer/src/renderer/CScene.cpp
+33 −5 40_PathTracer/src/renderer/CSession.cpp
+14 −10 66_HLSLBxDFTests/app_resources/test_compile.comp.hlsl
+4 −2 66_HLSLBxDFTests/app_resources/test_components.hlsl
+39 −34 66_HLSLBxDFTests/app_resources/tests.hlsl
+3 −1 66_HLSLBxDFTests/app_resources/tests_common.hlsl
+20 −11 66_HLSLBxDFTests/tests.h
+45 −33 common/include/nbl/examples/Tester/ITester.h
+130 −0 common/include/nbl/examples/common/ScrambleSequence.hpp
2 changes: 1 addition & 1 deletion include/nbl/asset/ICPUScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class ICPUScene final : public IAsset, public IScene
instances.emplace_back().instance = std::move(inst);
}
// TODO: adjust BLAS geometry flags according to materials set opaqueness and NO_DUPLICATE_ANY_HIT_INVOCATION_BIT
SResult retval = {.instances=core::make_refctd_dynamic_array<decltype(SResult::instances)>(instanceCount),.allInstancesValid=allInstancesValid};
SResult retval = {.instances=core::make_refctd_dynamic_array<decltype(SResult::instances)>(instances.size()),.allInstancesValid=allInstancesValid};
std::move(instances.begin(),instances.end(),retval.instances->begin());
return retval;
}
Expand Down
265 changes: 221 additions & 44 deletions include/nbl/asset/material_compiler3/CFrontendIR.h

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions include/nbl/asset/utils/IShaderCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "nbl/builtin/hlsl/enums.hlsl"

#include <functional>

namespace nbl::asset
{

Expand Down Expand Up @@ -136,6 +138,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
E_SPIRV_VERSION targetSpirvVersion = E_SPIRV_VERSION::ESV_1_6;
bool depfile = false;
system::path depfilePath = {};
std::function<void(std::string_view)> onPartialOutputOnFailure = {};
};

// https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#debugging
Expand Down
181 changes: 100 additions & 81 deletions include/nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions include/nbl/builtin/hlsl/bxdf/base/lambertian.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,69 +23,69 @@ struct SLambertianBase
using this_t = SLambertianBase<Config, IsBSDF>;
BXDF_CONFIG_TYPE_ALIASES(Config);

using random_type = conditional_t<IsBSDF, vector3_type, vector2_type>;
struct Cache {};
using isocache_type = Cache;
using anisocache_type = Cache;

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) NBL_CONST_MEMBER_FUNC
value_weight_type evalAndWeight(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));
const spectral_type quo = hlsl::promote<spectral_type>(_sample.getNdotL(_clamp) * numbers::inv_pi<scalar_type> * hlsl::mix(1.0, 0.5, IsBSDF));
return value_weight_type::create(quo, forwardPdf(_sample, interaction));
}
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
value_weight_type evalAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
return eval(_sample, interaction.isotropic);
return evalAndWeight(_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) NBL_CONST_MEMBER_FUNC
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const random_type u, NBL_CONST_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
typename sampling::ProjectedHemisphere<scalar_type>::cache_type cache;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedHemisphere<scalar_type>::generate(u, cache));
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) NBL_CONST_MEMBER_FUNC
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const random_type u, NBL_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
typename sampling::ProjectedSphere<scalar_type>::cache_type cache;
vector3_type _u = u;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedSphere<scalar_type>::generate(_u, cache));
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) 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) NBL_CONST_MEMBER_FUNC
sample_type generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const random_type u, NBL_REF_ARG(isocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
return generate(anisotropic_interaction_type::create(interaction), u, _cache);
}

scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
scalar_type forwardPdf(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) NBL_CONST_MEMBER_FUNC
scalar_type forwardPdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return pdf(_sample, interaction.isotropic);
return forwardPdf(_sample, interaction.isotropic);
}

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
quotient_weight_type quotientAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(isocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
sampling::quotient_and_pdf<monochrome_type, scalar_type> qp;
NBL_IF_CONSTEXPR (IsBSDF)
qp = sampling::ProjectedSphere<scalar_type>::template quotientAndPdf(_sample.getNdotL(_clamp));
else
qp = sampling::ProjectedHemisphere<scalar_type>::template quotientAndPdf(_sample.getNdotL(_clamp));
return quotient_pdf_type::create(qp.quotient()[0], qp.pdf());
return quotient_weight_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) NBL_CONST_MEMBER_FUNC
quotient_weight_type quotientAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
return quotient_and_pdf(_sample, interaction.isotropic);
return quotientAndWeight(_sample, interaction.isotropic, _cache);
}
};

Expand Down
47 changes: 23 additions & 24 deletions include/nbl/builtin/hlsl/bxdf/base/oren_nayar.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ struct SOrenNayarBase
using this_t = SOrenNayarBase<Config, IsBSDF>;
BXDF_CONFIG_TYPE_ALIASES(Config);

using random_type = conditional_t<IsBSDF, vector3_type, vector2_type>;
struct Cache {};
using isocache_type = Cache;
using anisocache_type = Cache;

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

struct SCreationParams
Expand Down Expand Up @@ -58,73 +63,67 @@ struct SOrenNayarBase
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) NBL_CONST_MEMBER_FUNC
value_weight_type evalAndWeight(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);
return value_weight_type::create(__eval<SQuery>(query, _sample, interaction), forwardPdf(_sample, interaction));
}
spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
value_weight_type evalAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return eval(_sample, interaction.isotropic);
return evalAndWeight(_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) NBL_CONST_MEMBER_FUNC
enable_if_t<C::value && !IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const random_type u, NBL_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
typename sampling::ProjectedHemisphere<scalar_type>::cache_type cache;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedHemisphere<scalar_type>::generate(u, cache));
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) NBL_CONST_MEMBER_FUNC
enable_if_t<C::value && IsBSDF, sample_type> generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const random_type u, NBL_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
typename sampling::ProjectedSphere<scalar_type>::cache_type cache;
vector3_type _u = u;
ray_dir_info_type L;
L.setDirection(sampling::ProjectedSphere<scalar_type>::generate(_u, cache));
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) 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) NBL_CONST_MEMBER_FUNC
sample_type generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const random_type u, NBL_REF_ARG(isocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
return generate(anisotropic_interaction_type::create(interaction), u);
return generate(anisotropic_interaction_type::create(interaction), u, _cache);
}

scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
scalar_type forwardPdf(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) NBL_CONST_MEMBER_FUNC
scalar_type forwardPdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction) NBL_CONST_MEMBER_FUNC
{
return pdf(_sample, interaction.isotropic);
return forwardPdf(_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) NBL_CONST_MEMBER_FUNC
quotient_weight_type __quotientAndWeight(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 _pdf = forwardPdf(_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);
return quotient_weight_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) NBL_CONST_MEMBER_FUNC
quotient_weight_type quotientAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(isocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
SQuery query;
query.VdotL = hlsl::dot(interaction.getV().getDirection(), _sample.getL().getDirection());
return __quotient_and_pdf<SQuery>(query, _sample, interaction);
return __quotientAndWeight<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) NBL_CONST_MEMBER_FUNC
quotient_weight_type quotientAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) _cache) NBL_CONST_MEMBER_FUNC
{
return quotient_and_pdf(_sample, interaction.isotropic);
return quotientAndWeight(_sample, interaction.isotropic, _cache);
}

scalar_type A2;
Expand Down
Loading
Loading