-
Notifications
You must be signed in to change notification settings - Fork 69
Resampled Importance Sampling bxdfs #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devshgraphicsprogramming
wants to merge
50
commits into
sampler-concepts
Choose a base branch
from
ris_bxdfs
base: sampler-concepts
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,587
−859
Open
Changes from 41 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
5def0b4
Fix checking valid jpeg file logic
f93f430
get opacity going!
devshgraphicsprogramming 1a7bf02
really struggling with TWO_SIDED
devshgraphicsprogramming 0dc31aa
add CFrontendIR node copying, stack reversal and individual BxDF expr…
devshgraphicsprogramming 8aff0f7
Beer node needs a thickness unfortunately.
devshgraphicsprogramming 1b0b6f3
quick hack around normalmaps and bumpmaps, sketch out the general ide…
devshgraphicsprogramming 6a4e8df
Merge remote-tracking branch 'remotes/origin/hotfix_jpeg_loader' into…
devshgraphicsprogramming 0c1e045
move UV transform to front of SParameterSet, keep variable length stu…
devshgraphicsprogramming 850536c
implement BLEND_BSDF
devshgraphicsprogramming 011e7f0
I forgot that for blends all layers need to be blended!
devshgraphicsprogramming 2b34047
I don't want to admit how long it took me to debug this one
devshgraphicsprogramming 2d3719f
fix the last thing in the material frontend
devshgraphicsprogramming ad0cf8d
fix TLAS export when Polygon Geometry can't be made into a BLAS
devshgraphicsprogramming 5d2568b
merge master
devshgraphicsprogramming c86f8e1
Fix Wave include paths and failure dumps
AnastaZIuk 4871e24
Clean up preprocess failure plumbing
AnastaZIuk 1f73d6a
Backport Wave pragma fix and remove workaround
AnastaZIuk e4df2b2
Merge pull request #1025 from Devsh-Graphics-Programming/preprocessUp…
AnastaZIuk 66da590
Use upstream gh-pages action for badges
AnastaZIuk f830a47
Promote NSC channel 66da590b3f06b586f69bdb522bad2f2eebf11b6f
github-actions[bot] 00017ad
Merge pull request #1026 from Devsh-Graphics-Programming/ci/nsc-promo…
AnastaZIuk 83e30e4
Merge branch 'master' into ris_bxdfs
keptsecret 067d107
change concepts for bxdf to *_and_weight methods, make changes for co…
keptsecret fc6deb8
pdf method renamed to denominator, don't expect to be used
keptsecret c292f41
Merge remote-tracking branch 'remotes/origin/master' into mitsuba_xml…
devshgraphicsprogramming 1a3d26a
Merge pull request #1021 from Devsh-Graphics-Programming/mitsuba_xml_…
devshgraphicsprogramming 0afd2fa
fix MIS in the path tracer, dont make every ray that didn't miss go i…
devshgraphicsprogramming f2e2265
camelcase method names, no need for denominator method (pdf is pdf an…
keptsecret 0708859
refactor cook torrance to fit concept
keptsecret b609179
znowu w zyciu mi nie wyszlo
devshgraphicsprogramming 63cd4df
changes to method names in pt concept, use *_weight instead of pdf an…
keptsecret 59e090e
record my discoveries
devshgraphicsprogramming a877934
renamed pdf to forwardPdf
keptsecret 64ce3ba
add tractable pdf trait to bxdfs
keptsecret 2539522
Merge remote-tracking branch 'remotes/origin/master' into mitsuba_xml…
devshgraphicsprogramming 148b9bd
bxdf input random to generate has variable dimensions (brdf>=2; bsdf>…
keptsecret 95a3862
merge master, fix conflicts
keptsecret 946c9c7
pass ray to nee generate instead, store depth in ray
keptsecret 4f4421d
nee deferredPdf is deferredWeight
keptsecret a70f420
all bxdfs have a cache type from generate to quotient_weight, microfa…
keptsecret dab4a18
eval should have its own cache type in concepts
keptsecret fb878a6
minor typo bug fixes
keptsecret 4171059
eval returns a value_and_weight type, fixed some bugs in bxdf concept
keptsecret 0e16279
made value_and_pdf compose from value_and_weight
keptsecret 345865f
reuse quant query and other stuff from forwardPdf in quotient and eva…
keptsecret a98cd45
reuse reflectance from forwardpdf in eval
keptsecret d0ed7d3
renamed quotient_pdf type to quotient_weight type
keptsecret 110547a
minor fixes to cook torrance, removed redundant functions
keptsecret ef9156e
only microfacet bxdfs need eval cache type, allow for overload with e…
keptsecret 05124c2
latest example
keptsecret File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule examples_tests
updated
7 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,69 +23,70 @@ 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; | ||
| using evalcache_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 | ||
| quotient_pdf_type evalAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(evalcache_type) _cache) 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 quotient_pdf_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 | ||
| quotient_pdf_type evalAndWeight(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(evalcache_type) _cache) NBL_CONST_MEMBER_FUNC | ||
| { | ||
| return eval(_sample, interaction.isotropic); | ||
| return evalAndWeight(_sample, interaction.isotropic, _cache); | ||
| } | ||
|
|
||
| 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_pdf_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_pdf_type::create(qp.quotient(), 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_pdf_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); | ||
| } | ||
| }; | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.