-
Notifications
You must be signed in to change notification settings - Fork 67
Remainder from hlsl PT and stuff moved out of bxdf unit test #980
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?
Remainder from hlsl PT and stuff moved out of bxdf unit test #980
Conversation
…d change to compile time depth
| template<class F, typename float_t, uint32_t Depth=6> // F has function __call(x) | ||
| struct AdaptiveSimpson |
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.
Fshould be required to haveoperator()(x)not__call(this is one is meant for statics- make a concept for the above
float_tyou can default todecltype(declval<F>()(0))
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.
Also f should be NBL_ConST_REF_ARG and not NBL_REF_ARG (it doesn't make sense otherwise, you want there to be no inner mutable state because it can't be sensitive to order its getting called in)
| template<class F, typename float_t, uint32_t Depth=6> // F has function __call(x) | ||
| struct AdaptiveSimpson | ||
| { | ||
| static float_t __call(NBL_REF_ARG(F) f, float_t x0, float_t x1, float_t eps = 1e-6) |
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.
documentation, what's eps used for ?
| static const float32_t3 RGB_LUT[256]; | ||
|
|
||
| static float32_t3 map(float x) | ||
| { | ||
| x = hlsl::clamp(x, 0.f, 1.f); | ||
| int i = int(x * 255.f); | ||
| int j = hlsl::min(255, i+1); | ||
| float s = x * 255.f - float(i); | ||
| return RGB_LUT[i] + (RGB_LUT[j] - RGB_LUT[i]) * s; | ||
| } | ||
| }; | ||
|
|
||
| inline const float32_t3 Turbo::RGB_LUT[256] = { |
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.
use the correct NBL_ macros for out of line constexpr array declarations and definitions
| { | ||
| static const float32_t3 RGB_LUT[256]; | ||
|
|
||
| static float32_t3 map(float x) |
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.
__call
No description provided.