-
Notifications
You must be signed in to change notification settings - Fork 67
IES updates #965
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
base: master
Are you sure you want to change the base?
IES updates #965
Changes from all commits
199b75a
36d9943
e312993
25c4bdc
3d18b58
27de67f
0110f98
9ed5aee
35931bd
a892678
5e236e6
7b27168
77e9e57
699e841
bd6cc4d
9381491
ae0b160
d45e3a7
5ecf50e
07feaff
e8ea119
1e9138e
be62e3a
0c03e2f
80de6aa
e05478d
8d0c237
dbd2805
054038f
f64a8f3
c941991
95246c4
8eba4c9
4bb2864
12d608f
2eadc3b
ff2558b
1d8aa31
a7287ca
7105b0c
811ced6
53766dc
80d4479
0ec69a7
1a25fc0
83da9c5
7c5b658
67518fe
1ed5d82
9814b88
cf12cee
e605969
d517cf1
53e4ab1
5b79bb4
0db984b
5ce6fa2
83a83a4
b855e1c
2c5974e
777e443
5331ebe
cab896a
6329e3a
80ed36a
e7a0ef4
3e5f8d0
f95f163
575136e
2f5de5d
c71762e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,4 +33,5 @@ SVertexAttributes main() | |
| SVertexAttributes retval; | ||
| retval.uv = tc[gl_VertexIndex()]; | ||
| return retval; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| // 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_IES_PROFILE_INCLUDED_ | ||
| #define _NBL_BUILTIN_HLSL_IES_PROFILE_INCLUDED_ | ||
|
|
||
| #include "nbl/builtin/hlsl/cpp_compat.hlsl" | ||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
| { | ||
| namespace ies | ||
| { | ||
|
|
||
| struct ProfileProperties | ||
| { | ||
| //! max 16K resolution | ||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_MAX_TEXTURE_WIDTH = 15360u; | ||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_MAX_TEXTURE_HEIGHT = 8640u; | ||
|
|
||
| // TODO: This constraint is hack because the mitsuba loader and its material compiler use Virtual Texturing, and there's some bug with IES not sampling sub 128x128 mip levels | ||
| // don't want to spend time to fix this since we'll be using descriptor indexing for the next iteration | ||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_MIN_TEXTURE_WIDTH = 128u; | ||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_MIN_TEXTURE_HEIGHT = 128u; | ||
|
Comment on lines
+23
to
+26
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can let it be 3 pixels now, |
||
|
|
||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_DEFAULT_TEXTURE_WIDTH = 1024u; | ||
| NBL_CONSTEXPR_STATIC_INLINE uint32_t CDC_DEFAULT_TEXTURE_HEIGHT = 1024u; | ||
|
Comment on lines
+28
to
+29
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you need it?
Comment on lines
+19
to
+29
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all the texture stuff should go to |
||
|
|
||
| NBL_CONSTEXPR_STATIC_INLINE float32_t MAX_VANGLE = 180.f; | ||
| NBL_CONSTEXPR_STATIC_INLINE float32_t MAX_HANGLE = 360.f; | ||
|
Comment on lines
+31
to
+32
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put Degrees in the name so units are clear |
||
|
|
||
| // TODO: could change to uint8_t once we get implemented | ||
| // https://github.com/microsoft/hlsl-specs/pull/538 | ||
| using packed_flags_t = uint16_t; | ||
|
|
||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t VERSION_BITS = 2u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t TYPE_BITS = 2u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t SYMM_BITS = 3u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t VERSION_MASK = (packed_flags_t(1u) << VERSION_BITS) - packed_flags_t(1u); | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t TYPE_MASK = (packed_flags_t(1u) << TYPE_BITS) - packed_flags_t(1u); | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t SYMM_MASK = (packed_flags_t(1u) << SYMM_BITS) - packed_flags_t(1u); | ||
|
Comment on lines
+20
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
|
|
||
| enum Version : packed_flags_t | ||
| { | ||
| V_1995, | ||
| V_2002, | ||
| V_SIZE | ||
| }; | ||
|
|
||
| enum PhotometricType : packed_flags_t | ||
| { | ||
| TYPE_NONE, | ||
| TYPE_C, | ||
| TYPE_B, | ||
| TYPE_A | ||
| }; | ||
|
|
||
| enum LuminairePlanesSymmetry : packed_flags_t | ||
| { | ||
| ISOTROPIC, //! Only one horizontal angle present and a luminaire is assumed to be laterally axial symmetric | ||
| QUAD_SYMETRIC, //! The luminaire is assumed to be symmetric in each quadrant | ||
| HALF_SYMETRIC, //! The luminaire is assumed to be symmetric about the 0 to 180 degree plane | ||
| OTHER_HALF_SYMMETRIC, //! HALF_SYMETRIC case for legacy V_1995 version where horizontal angles are in range [90, 270], in that case the parser patches horizontal angles to be HALF_SYMETRIC | ||
| NO_LATERAL_SYMMET //! The luminaire is assumed to exhibit no lateral symmet | ||
| }; | ||
|
|
||
| Version getVersion() NBL_CONST_MEMBER_FUNC | ||
| { | ||
| return (Version)( packed & VERSION_MASK ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| PhotometricType getType() NBL_CONST_MEMBER_FUNC | ||
| { | ||
| const packed_flags_t shift = VERSION_BITS; | ||
| return (PhotometricType)((packed >> shift) & TYPE_MASK); | ||
| } | ||
|
|
||
| LuminairePlanesSymmetry getSymmetry() NBL_CONST_MEMBER_FUNC | ||
| { | ||
| const packed_flags_t shift = VERSION_BITS + TYPE_BITS; | ||
| return (LuminairePlanesSymmetry)((packed >> shift) & SYMM_MASK); | ||
| } | ||
|
|
||
| void setVersion(Version v) | ||
| { | ||
| packed_flags_t vBits = (packed_flags_t)(v) & VERSION_MASK; | ||
| packed = (packed & ~VERSION_MASK) | vBits; | ||
| } | ||
|
|
||
| void setType(PhotometricType t) | ||
| { | ||
| const packed_flags_t shift = VERSION_BITS; | ||
| packed_flags_t tBits = ((packed_flags_t)(t) & TYPE_MASK) << shift; | ||
| packed = (packed & ~(TYPE_MASK << shift)) | tBits; | ||
| } | ||
|
|
||
| void setSymmetry(LuminairePlanesSymmetry s) | ||
| { | ||
| const packed_flags_t shift = VERSION_BITS + TYPE_BITS; | ||
| packed_flags_t sBits = ((packed_flags_t)(s) & SYMM_MASK) << shift; | ||
| packed = (packed & ~(SYMM_MASK << shift)) | sBits; | ||
| } | ||
|
|
||
| float32_t maxCandelaValue; //! Max candela sample value | ||
| float32_t totalEmissionIntegral; //! Total emitted intensity (integral over full angular domain) | ||
| float32_t fullDomainAvgEmission; //! Mean intensity over full angular domain (including I == 0) | ||
| float32_t avgEmmision; //! Mean intensity over emitting solid angle (I > 0) | ||
| packed_flags_t packed; //! Packed version, type and symmetry flags | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not use a bitfield over uint32_t to store them? |
||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif // _NBL_BUILTIN_HLSL_IES_PROFILE_INCLUDED_ | ||
Uh oh!
There was an error while loading. Please reload this page.