-
Notifications
You must be signed in to change notification settings - Fork 67
Final BxDF changes, drafts of Spherical Shape Sampling, RWMC and PAth Tracing #966
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
Merged
devshgraphicsprogramming
merged 121 commits into
master
from
hlsl_path_tracer_example_no_quat
Dec 16, 2025
Merged
Changes from 4 commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
02d6d0f
initial example
keptsecret 129b50e
use bxdf creation params struct
keptsecret 74261dc
triangle and rectangle shapes
keptsecret ab3ae20
more sampling methods
keptsecret 355cfec
spherical rectangle
keptsecret ebf8fca
merge pcg fix from upstream
keptsecret 11180f4
fix aniso cache bug
keptsecret 4516051
init func to modify bxdf params directly
keptsecret d9a00c9
bug fixes
keptsecret ffe9029
fix sampling bugs #2
keptsecret cee192e
update to master
keptsecret b207312
fix rank type trait for matrix/vector
keptsecret 673f788
merge hlsl bxdfs, resolve conflict
keptsecret 69a257d
temporary fix for dxc bug issue 7154
keptsecret 866e6d7
some bug fixes again
keptsecret 85e955f
fix wrong template usage
keptsecret 3b167ab
merge changes from hlsl_bxdf
keptsecret 19e3a35
merge master/bxdf fixes, resolve conflicts
keptsecret 6b5bf06
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 7b574da
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 1c773d9
fix typo
keptsecret 326c885
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 6132a4e
Merge branch 'revert-some-device-limits' into hlsl_path_tracer_example
keptsecret 0bd26c7
Merge branch 'master' into hlsl_path_tracer_example
keptsecret ebb1b15
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 7cb977d
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 67c525e
Merge branch 'master' into hlsl_path_tracer_example
keptsecret a8f209e
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret e8d2ed8
fixed some func usage to nbl ver
keptsecret c47f446
specify template args
keptsecret 642e46d
fix merge conflicts
keptsecret 1137b6b
update to latest example
keptsecret 5cd4e6c
merge math, fix conflict
keptsecret 7e8dd81
latest example
keptsecret f86dd0c
Merge remote-tracking branch 'origin/intrinsics_adjustments' into hls…
keptsecret b154638
fix use of static const in func
keptsecret 7892563
added more morton order stuff
keptsecret b21b789
latest example
keptsecret 1f461ff
merge master, fix conflicts
keptsecret df2321a
merge hlsl_bxdfs, fix conflicts
keptsecret 26adf95
latest example
keptsecret 0d80626
Merge branch 'hlsl_bxdfs' into hlsl_path_tracer_example
keptsecret 36910c6
latest example fixes
keptsecret afc3485
merge bxdf, fix conflicts
keptsecret 19ba15d
Updated examples
Przemog1 7ec3f39
Created RWMC files
Przemog1 4dcf56a
Updated examples
Przemog1 dbbb30a
merge master, fix conflicts
keptsecret 3ae69fa
updated example
keptsecret 1f9bf16
merge iridescent_bxdf, fix conflicts (hope it's merged to master soon)
keptsecret 4cfed1b
use new angle adder
keptsecret 8ecfecf
Merge branch 'master' into hlsl_path_tracer_example
keptsecret dc8b5bc
initialize invalid ndf return to inf, not 0
keptsecret 434234c
derive trait from cook torrance base
keptsecret ffeb633
fix angle adder
keptsecret d75246d
optimizations to iridescent fresnel
keptsecret 494c625
avoid repeat fresnel calc
keptsecret ab25c17
mix reflectance w/ transmission in getScaledReflectance
keptsecret 2a7db14
Refactored resolve.hlsl
Przemog1 1acf7d6
some minor fixes to fresnel orientedEta usage
keptsecret 72429cb
refactor usage of angle adding
keptsecret 381bb50
temp? fix for mix_helper on floats
keptsecret 482ef2e
merge rwmc, fix conflicts
keptsecret a40a025
added missing typename qualifier
keptsecret b3f6d55
Fixed `ResolveAccessor` concept
Przemog1 cf6760e
minor fixes to spherical rect, latest example
keptsecret 4a283ba
quaternion struct, renamed spherical tri/rect shapes
keptsecret 0305948
make PartitionRandVar in struct and templated
keptsecret 3134254
precompute values in linear, bilinear sampling; make box muller a struct
keptsecret 8d744a9
precompute cos_sides, csc_sides in shape spherical_tri
keptsecret 2a22cb6
merge new rwmc fix
keptsecret 8292707
fix spherical tri precompute
keptsecret 563e072
latest example
keptsecret 4abbacf
Merge branch 'master' into hlsl_path_tracer_example
keptsecret 229929d
update examples
Erfan-Ahmadi 495924c
Merge branch 'master' into hlsl_path_tracer_example
keptsecret 27fd427
make rwmc accumulator match concept
keptsecret 12cac68
took 1transformation_matrix_utils.hlsl` from Arek's `cameraz` branch
karimsayedre 438aeb5
Merge remote-tracking branch 'origin/hlsl_path_tracer_example' into i…
karimsayedre d125a0e
pack rwmc params to half 2x16
keptsecret 1ccc4c4
Merge branch 'master' into hlsl_path_tracer_example
keptsecret aa716ee
merge imguizmo-lights, fix conflicts
keptsecret 8a6939f
latest example
keptsecret fbfde73
change quaternion struct name to match what it will be
keptsecret 856f828
merge master, fix conflicts
keptsecret 07918be
Merge branch 'master' into hlsl_path_tracer_example_no_quat
keptsecret 37d5c5a
removed temp fix for mix_helper require
keptsecret 6971906
fixes more nan problems + a few bugs in iridescent fresnel
keptsecret cb68928
fixes iridescent fresnel under transmission
keptsecret 76ed66c
fix wrong get refraction eta in iridescent transmission
keptsecret 4a8f4dc
quantized sequence packing data
keptsecret b8688be
templated quantized sequence
keptsecret 2146003
Merge branch 'master' into hlsl_path_tracer_example_no_quat
keptsecret 38bbf04
latest example
keptsecret fae7a80
quantized sequence decode
keptsecret e23538c
quantized sequence get/set values by index, simplify decode func spec…
keptsecret 6e9160e
quantized sequence encode should right shift input, changed scramble …
keptsecret 6f0d012
added decode variant for scramble before decode
keptsecret 3d53866
Merge branch 'master' into hlsl_path_tracer_example_no_quat
keptsecret c6462d1
some minor fixes to quantized sequence set, decode
keptsecret a30f083
fix quantized sequence mask being too small, assert conditions
keptsecret 073a9f3
merge master, fix conflicts
keptsecret 7d16cb2
fixed problems from merging master
keptsecret 965e028
fix decode scramble key, shifting discard bits in quantization
keptsecret cfd5500
fix z component storing too many bits in quantized sequence in vec2 d…
keptsecret 53ff444
mix_helper requirements include bool vectors
keptsecret 5055713
fix iridescent oriented eta bug
keptsecret 3f3b5c9
partitionRandVar stores leftProb, fix minor bugs
keptsecret db454c0
plain const for vector types
keptsecret c353ab3
fixes to iridescent fresnel, moved getOrientedEtaRcp to dielectric fr…
keptsecret 04f1c76
adjust mix_helper calling select requirements
keptsecret 94a778f
restore regular triangle stuff, refactor usage
keptsecret 9e4a16c
minor changes to rwmc usage
keptsecret 62c79b4
remove storing texture inside local var of ResolveAccessorAdaptor
keptsecret 5075c63
removed accessor, user should provide accessor that matches concept
keptsecret 90007e6
fix formatting, name
keptsecret 3d36c13
added more things to precompute
keptsecret 62f2c99
changes to splatting params precompute for the last time
keptsecret f3f60c6
check that eta type of dielectric fresnels should be monochrome
keptsecret b4d957d
Change `Compile flag error` to `Compile flag warning`
devshgraphicsprogramming dfcae2d
Merge remote-tracking branch 'remotes/origin/master' into hlsl_path_t…
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
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
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Copyright (C) 2018-2025 - DevSH Graphics Programming Sp. z O.O. | ||
| // This file is part of the "Nabla Engine". | ||
| // For conditions of distribution and use, see copyright notice in nabla.h | ||
|
|
||
| #ifndef _NBL_BUILTIN_HLSL_SHAPES_TRIANGLE_INCLUDED_ | ||
| #define _NBL_BUILTIN_HLSL_SHAPES_TRIANGLE_INCLUDED_ | ||
|
|
||
| #include <nbl/builtin/hlsl/cpp_compat.hlsl> | ||
| #include <nbl/builtin/hlsl/tgmath.hlsl> | ||
| #include <nbl/builtin/hlsl/numbers.hlsl> | ||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
| { | ||
| namespace shapes | ||
| { | ||
|
|
||
| namespace util | ||
| { | ||
| // Use this convetion e_i = v_{i+2}-v_{i+1}. vertex index is modulo by 3. | ||
| template <typename float_t> | ||
| vector<float_t, 3> anglesFromTriangleEdge(const vector<float_t, 3> e0, vector<float_t, 3> e1, const vector<float_t, 3> e2) | ||
devshgraphicsprogramming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| // Calculate this triangle's weight for each of its three m_vertices | ||
| // start by calculating the lengths of its sides | ||
| const float_t a = hlsl::dot(e0, e0); | ||
| const float_t asqrt = hlsl::sqrt(a); | ||
| const float_t b = hlsl::dot(e1, e1); | ||
| const float_t bsqrt = hlsl::sqrt(b); | ||
| const float_t c = hlsl::dot(e2, e2); | ||
| const float_t csqrt = hlsl::sqrt(c); | ||
|
|
||
| const float_t angle0 = hlsl::acos((b + c - a) / (2.f * bsqrt * csqrt)); | ||
| const float_t angle1 = hlsl::acos((-b + c + a) / (2.f * asqrt * csqrt)); | ||
| const float_t angle2 = hlsl::numbers::pi<float_t> - (angle0 + angle1); | ||
| // use them to find the angle at each vertex | ||
| return vector<float_t, 3>(angle0, angle1, angle2); | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif | ||
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
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.