-
Notifications
You must be signed in to change notification settings - Fork 65
Hlsl bxdfs 3 #899
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
160
commits into
master
Choose a base branch
from
hlsl_bxdfs
base: master
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.
+4,795
−571
Open
Hlsl bxdfs 3 #899
Changes from all commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
34ee35c
some test bxdfs using concepts and templates
keptsecret f6752c6
some corrections
keptsecret 42fcb2a
anisotropic concept
keptsecret 81e56f4
concepts for existing stuff
keptsecret 1e73953
more templated stuff, new type trait dimensions
keptsecret 6253da8
template conditionalabs
keptsecret d13cad4
completed adapting functions?
keptsecret 7110c50
added bxdf concept
keptsecret 98a0be1
fresnel function templates
keptsecret eef66c6
lambertian, oren nayar brdf
keptsecret eec8486
removed dimensions, extended rank/extent to vectors/matrix
keptsecret fcadc22
impl geom_smith and ndf funcs
keptsecret 9742aa1
more bxdfs, fix concepts
keptsecret 8433133
restructure existing bxdfs
keptsecret bafe623
ggx brdf
keptsecret 3ad9f44
some bsdfs
keptsecret bc13d1f
beckmann bsdf, bug fixes
keptsecret f56476e
typedefs in concepts
keptsecret fe7c882
ndfs as structs()
keptsecret a12d8d1
redid microfacet_to_light_transform as all structs
keptsecret 328c7ea
fixed missing type
keptsecret aeafa07
changed geom smith to templated structs
keptsecret 91ca79e
adjusted BxDF concept, new impl BxDF structs
keptsecret 3401783
refactored brdfs
keptsecret 3115423
corrected concept macro usage
keptsecret b244c12
finished beckmann+ggx bsdfs, fixed typos
keptsecret e8d5aa3
changes for cpp compat
keptsecret 8158aea
Merge branch 'master' into hlsl_bxdfs
keptsecret d632b3a
moved math functions to tgmath
keptsecret 3df4851
Merge branch 'master' into hlsl_bxdfs
keptsecret ffaaf87
rsqrt not in stl
keptsecret aae9a58
update to pr801/803 #1
keptsecret c3c97e1
funcs use with c++
keptsecret b308bff
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 2c2b368
hlsl bxdf test example init
keptsecret 67993ad
fixed include
keptsecret 35cd97a
merge fixes from branch
keptsecret 4f230e8
use correct examples
keptsecret 029116f
fixed cpp compat types
keptsecret aa91c06
some bug fixes
keptsecret 362d8cd
more bug,typo fixes
keptsecret 7734550
fixed bsdf bugs
keptsecret 05ef0e8
merge math fixes and latest example
keptsecret 0abf434
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 2aa51eb
use bit_cast instead of reinterpret_cast
keptsecret b53c605
fix concepts
keptsecret 16209a8
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 5a3e7e6
fix aniso inter create
keptsecret cbdb9f6
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 785291d
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 1286459
fixed all? bugs
keptsecret 3616dcf
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 3b78a06
more bug fixes
keptsecret 5bfdf2f
lots more typo fixes
keptsecret ecdbbf7
final? bxdf concept, bug fixes
keptsecret ca8905e
update examples merge conflict
keptsecret 9d2a2f3
bug fixes
keptsecret b83fae6
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 2539b13
use simpler getcolumn method
keptsecret 796c65b
more brdf bug fixes and example update
keptsecret 9ad1be4
bug fixes, microfacet_transform needs rechecking
keptsecret 567875c
bug fixes #2 (I think)
keptsecret 2239a5e
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 6fc78a4
latest example
keptsecret a4012dc
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret ac23035
uniform sampling, update embed cmakelists
keptsecret ccaa0a5
fix cmake, include bugs
keptsecret cf6c5c2
changed ior, spectral_type usage in bxdf + concept
keptsecret 1d3f291
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret d79346b
pcg hash
keptsecret 2217e81
pcg hash in cmakelist
keptsecret a4fff1c
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret e413e78
fix aniso microfacet cache create bug
keptsecret 8052ada
bug fixes for ggx dielectric, clamp
keptsecret d176107
calculation fixes
keptsecret 1a1327f
use param structs for eval/quotient_and_pdf funcs
keptsecret 1cedf68
update to latest
keptsecret bde6e60
some bug fixes
keptsecret 3618e4c
more typo bug fixes
keptsecret 5a00f7d
fix some calculations, ray dir info type
keptsecret 35ded62
fix not reading variables to param struct
keptsecret 7d8e982
duplicate variable bug fix
keptsecret 6e5c569
latest example: chi2
keptsecret 2125aab
fix examples conflict?
keptsecret a0d356b
update example, conflict
keptsecret a1d18d3
fix extent/rank type trait definition order
keptsecret aceb799
fix c++ compile
keptsecret a0dddce
bxdf traits, bug fixes
keptsecret 772c9b6
latest unit tests
keptsecret c4de151
latest test #2
keptsecret d00533a
tack merge example
keptsecret 90e39d1
Merge branch 'new_tgmath' into hlsl_bxdfs_tgmath_premerge
keptsecret 4bf43e3
fixes to get smooth dielectric working
keptsecret ce0001f
fix merge conflict
keptsecret edca69a
pcg prng as structs
keptsecret 967ec9e
fix pcg bug
keptsecret 0b4e33a
Merge branch 'hlsl_bxdfs' into hlsl_bxdfs_tgmath_premerge
keptsecret 97a22af
update to master
keptsecret 0497410
Merge branch 'hlsl_bxdfs' into hlsl_bxdfs_tgmath_premerge
keptsecret 18e8437
fix type traits conflict
keptsecret 4c91597
update master, resolve conflicts
keptsecret de3e5f2
merge in fixes to complete bxdfs
keptsecret 1337646
quick fix for compiling params in dxc
keptsecret 2fe105d
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret d3b3c59
refactor changes to interaction, cache, new fresnel funcs
keptsecret 6ad2965
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 705c4e9
fixes to match new bxdf params
keptsecret 0d4e8ab
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 660b0fc
merge functions.hlsl fixes, resolve conflicts
keptsecret 6fcccfe
fix any/all bugs, typos
keptsecret d1a37bd
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret dc739aa
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 7953914
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret d31a92b
removed condNegate, use flipSign
keptsecret 721978e
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret 78fb433
Merge branch 'maths_for_bxdfs_hlsl' into hlsl_bxdfs
keptsecret dc9db3e
added concept macro for checking type alias
keptsecret cc031f6
Merge branch 'master' into hlsl_bxdfs
keptsecret 6ca571e
more bug fixes #6
keptsecret 39a8a9b
minor fixes, infinity use
keptsecret 656b069
Merge branch 'master' into hlsl_bxdfs
keptsecret b02f8e6
condAbsOrMax in param struct
keptsecret 6662daa
update examples
keptsecret 9712b8d
merge maths branch, fix conflict
keptsecret 8c65555
merge master, fix conflicts
keptsecret e0ccc9e
some style changes, refactor sampling funcs
keptsecret b2b7794
new equal func for vectors
keptsecret e8a9756
Merge branch 'master' into hlsl_bxdfs
keptsecret bc68c22
refactor fresnel funcs usage
keptsecret 2b8bbbb
getters for interaction, samples
keptsecret 2e368ab
getters for microfacet cache
keptsecret bd52332
added vector spec for flipSign
keptsecret bff0aa6
added rng wrapper for 2d/3d uints
keptsecret deda14a
added OpSelect intrinsic for mix, fix mix behavior with bool
keptsecret 576b814
changes to uniform rand wrapper
keptsecret 268b573
moved quotient_pdf to sampling namespace, split bxdf files
keptsecret 7162a29
fixes to mix, flipSign constraints
keptsecret 540919b
changes to oriented eta, reflect, refract
keptsecret ac70036
changes to reflectrefract, fresnel funcs
keptsecret 4c7dfa6
change VNDF usage to structs
keptsecret b982f2c
compute microfacet normals as structs
keptsecret a0334a0
renamed light sample concept
keptsecret 79ef0d7
changes to microfacet cache member funcs
keptsecret cc5fab5
added isotropic generate
keptsecret f99933b
fix surface interaction, microfacet cache concepts + default concepts
keptsecret f2f9210
minor bug fix
keptsecret 493bc49
minor changes
keptsecret 4b87a4a
renamed some typedefs
keptsecret 31f2af8
moved typedefs, template params dependencies into bxdfs
keptsecret 927ef68
make param struct per bxdf
keptsecret 1cc205d
minor fix to bxdf concepts
keptsecret 688b950
merge mesh_loaders, fix conflicts
keptsecret f0491a9
update example test
keptsecret 4ac25e5
merge mesh_loaders, fix conflict
keptsecret 5d74015
latest example
keptsecret d24ac0e
fixed a few typo bugs
keptsecret 6b5b24b
merge master, fix conflict
keptsecret 48816a0
update vulkan headers to match master, not sure why it wasn't
keptsecret f0e6aea
changes to usage in common.hlsl
keptsecret 64ec358
changes to OrientedEtas, reflect/refract usage
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
There are no files selected for viewing
Submodule examples_tests
updated
6 files
+14 −10 | 66_HLSLBxDFTests/CMakeLists.txt | |
+20 −0 | 66_HLSLBxDFTests/app_resources/config.json | |
+92 −0 | 66_HLSLBxDFTests/app_resources/test_compile.comp.hlsl | |
+1,034 −95 | 66_HLSLBxDFTests/app_resources/tests.hlsl | |
+236 −33 | 66_HLSLBxDFTests/main.cpp | |
+1 −1 | media |
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,107 @@ | ||
// 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_BXDF_TRAITS_INCLUDED_ | ||
#define _NBL_BUILTIN_HLSL_BXDF_TRAITS_INCLUDED_ | ||
|
||
#include "nbl/builtin/hlsl/bxdf/common.hlsl" | ||
#include "nbl/builtin/hlsl/bxdf/reflection.hlsl" | ||
#include "nbl/builtin/hlsl/bxdf/transmission.hlsl" | ||
|
||
namespace nbl | ||
{ | ||
namespace hlsl | ||
{ | ||
namespace bxdf | ||
{ | ||
|
||
enum BxDFType : uint16_t | ||
{ | ||
BT_BSDF = 0, | ||
BT_BRDF, | ||
BT_BTDF | ||
}; | ||
|
||
template<typename BxdfT> | ||
struct traits; | ||
|
||
template<typename L, typename I, typename A, typename S> | ||
struct traits<bxdf::reflection::SLambertianBxDF<L, I, A, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BRDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = false; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename S> | ||
struct traits<bxdf::reflection::SOrenNayarBxDF<L, I, A, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BRDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
// no blinn phong | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::reflection::SBeckmannBxDF<L, I, A, IC, AC, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BRDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::reflection::SGGXBxDF<L, I, A, IC, AC, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BRDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
|
||
template<typename L, typename I, typename A, typename S> | ||
struct traits<bxdf::transmission::SLambertianBxDF<L, I, A, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BSDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = false; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::transmission::SSmoothDielectricBxDF<L, I, A, IC, AC, S, false> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BSDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::transmission::SSmoothDielectricBxDF<L, I, A, IC, AC, S, true> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BSDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::transmission::SBeckmannDielectricBxDF<L, I, A, IC, AC, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BSDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
template<typename L, typename I, typename A, typename IC, typename AC, typename S> | ||
struct traits<bxdf::transmission::SGGXDielectricBxDF<L, I, A, IC, AC, S> > | ||
{ | ||
NBL_CONSTEXPR_STATIC_INLINE BxDFType type = BT_BSDF; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotV = true; | ||
NBL_CONSTEXPR_STATIC_INLINE bool clampNdotL = true; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
|
||
#endif |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the partial specializations of the traits should appear RIGHT after the definition of each struct (its easy to avoid template instantiation before specialization that way, and you don't have to go looking)