-
Notifications
You must be signed in to change notification settings - Fork 71
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
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
08a83fd
925023e
4fdfb15
4c0da88
9b3891b
e3a57df
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 |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ struct array_set | |
| arr[index] = val; | ||
| } | ||
| }; | ||
|
|
||
| } | ||
| } | ||
|
|
||
| #endif | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,8 @@ struct add_pointer | |
|
|
||
| #endif | ||
|
|
||
|
|
||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| // 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" | ||
| #include "nbl/builtin/hlsl/cpp_compat/basic.h" | ||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
| { | ||
| namespace ies | ||
| { | ||
|
|
||
| struct ProfileProperties | ||
| { | ||
| NBL_CONSTEXPR_STATIC_INLINE float32_t MaxVAngleDegrees = 180.f; | ||
| NBL_CONSTEXPR_STATIC_INLINE float32_t MaxHAngleDegrees = 360.f; | ||
|
|
||
| // TODO: could change to uint8_t once we get implemented | ||
| // https://github.com/microsoft/hlsl-specs/pull/538 | ||
| using packed_flags_t = uint32_t; | ||
|
|
||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t VersionBits = 2u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t TypeBits = 2u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t SymmetryBits = 3u; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t VersionMask = (packed_flags_t(1u) << VersionBits) - packed_flags_t(1u); | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t TypeMask = (packed_flags_t(1u) << TypeBits) - packed_flags_t(1u); | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t SymmetryMask = (packed_flags_t(1u) << SymmetryBits) - packed_flags_t(1u); | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t TypeShift = VersionBits; | ||
| NBL_CONSTEXPR_STATIC_INLINE packed_flags_t SymmetryShift = VersionBits + TypeBits; | ||
|
|
||
| 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 & VersionMask); | ||
| } | ||
|
|
||
| PhotometricType getType() NBL_CONST_MEMBER_FUNC | ||
| { | ||
| return (PhotometricType)((packed >> TypeShift) & TypeMask); | ||
| } | ||
|
|
||
| LuminairePlanesSymmetry getSymmetry() NBL_CONST_MEMBER_FUNC | ||
| { | ||
| return (LuminairePlanesSymmetry)((packed >> SymmetryShift) & SymmetryMask); | ||
| } | ||
|
|
||
| void setVersion(Version v) | ||
| { | ||
| packed_flags_t vBits = (packed_flags_t)(v) & VersionMask; | ||
| packed = (packed & ~VersionMask) | vBits; | ||
| } | ||
|
|
||
| void setType(PhotometricType t) | ||
| { | ||
| packed_flags_t tBits = ((packed_flags_t)(t) & TypeMask) << TypeShift; | ||
| packed = (packed & ~(TypeMask << TypeShift)) | tBits; | ||
| } | ||
|
|
||
| void setSymmetry(LuminairePlanesSymmetry s) | ||
| { | ||
| packed_flags_t sBits = ((packed_flags_t)(s) & SymmetryMask) << SymmetryShift; | ||
| packed = (packed & ~(SymmetryMask << SymmetryShift)) | 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?
Member
Author
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. resolved
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. how is it resolved ?
Member
Author
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.
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. I meant a regular HLSL supports this (although maybe not with
Member
Author
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. ahh right, ok that could be improved |
||
| }; | ||
|
|
||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
| #endif // _NBL_BUILTIN_HLSL_IES_PROFILE_INCLUDED_ | ||
Uh oh!
There was an error while loading. Please reload this page.