Conversation
There was a problem hiding this comment.
things like lastWarpmapPixel go into members, basically you want to store everything that is "constant"/common in members were you to "draw" multiple samples from the same hierarhical image but with different xi
There was a problem hiding this comment.
still in the wrong path and folder
There was a problem hiding this comment.
or actually, make LuminancereadAccessor follow the template signature of loadable_image from here (added component count template parameter)
https://github.com/Devsh-Graphics-Programming/Nabla/pull/989/changes
and call it GatherableImage
| // declare concept | ||
| #define NBL_CONCEPT_NAME HierarchicalSampler | ||
| #define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename) | ||
| #define NBL_CONCEPT_TPLT_PRM_NAMES (HierarchicalSamplerT)(ScalarT) | ||
| // not the greatest syntax but works | ||
| #define NBL_CONCEPT_PARAM_0 (sampler,HierarchicalSamplerT) | ||
| #define NBL_CONCEPT_PARAM_1 (coord,vector<ScalarT, 2>) | ||
| // start concept | ||
| NBL_CONCEPT_BEGIN(2) | ||
| // need to be defined AFTER the concept begins | ||
| #define sampler NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0 | ||
| #define coord NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1 | ||
| NBL_CONCEPT_END( | ||
| ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((sampler.template sampleUvs(coord)) , ::nbl::hlsl::is_same_v, matrix<ScalarT, 4, 2>)) | ||
| ); | ||
| #undef sampler | ||
| #undef coord | ||
| #include <nbl/builtin/hlsl/concepts/__end.hlsl> |
There was a problem hiding this comment.
should be in hlsl/sampling/warp or hlsl/hierarchical_image
thats this and why does it return a 4x2 matrix given a xi sample?
Needs docs in comments
There was a problem hiding this comment.
pay attention to the literals you use, make sure they're floating point, dxc is a very bad compiler and may do some conversions without warning you
There was a problem hiding this comment.
make the density type templated as well, but default template param of float32
There was a problem hiding this comment.
require a density_type, codomain_type
There was a problem hiding this comment.
why did you remove these from the concept and not substituted with same checks but with WarpResult<typename U::codomain_type,typename U::denisty_type> instead for the warp function?
There was a problem hiding this comment.
Also the previous warper.template XXXX(param) should have been warper.template XXXX<TYPE_OF_PARAM>(param)
| #ifndef _NBL_HLSL_EXT_ENVMAP_IMPORTANCE_SAMPLING_PARAMETERS_COMMON_INCLUDED_ | ||
| #define _NBL_HLSL_EXT_ENVMAP_IMPORTANCE_SAMPLING_PARAMETERS_COMMON_INCLUDED_ | ||
|
|
||
| #include "nbl/builtin/hlsl/cpp_compat.hlsl" | ||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
| { | ||
| namespace ext | ||
| { | ||
| namespace envmap_importance_sampling | ||
| { |
There was a problem hiding this comment.
really shouldn't be an ext anymore, you can move to builtin/sampling/envmap and make the namespace nbl::hlsl::sampling::envmap
There was a problem hiding this comment.
why are you using macros? Macros are banned !
There was a problem hiding this comment.
why are luminance scales 4D and not 3D / RGBA ?
Also clearer naming like lumaRGBCoefficients could work better
There was a problem hiding this comment.
you don't need to read the directionality of the envmap eanymore because w eon't be regularizing
Description
Rework environment map importance sampling to vulkan and hlsl
Testing
Rework example 0 to use vulkan and hlsl
TODO list: