@@ -16,6 +16,7 @@ namespace bxdf
1616// TODO should just check `is_base_of` (but not possible right now cause of DXC limitations)
1717namespace config_concepts
1818{
19+ // TODO: need to require either anisotropic_interaction_type or isotropic_interaction_type
1920#define NBL_CONCEPT_NAME BasicConfiguration
2021#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
2122#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
@@ -26,10 +27,14 @@ NBL_CONCEPT_END(
2627 ((NBL_CONCEPT_REQ_TYPE)(T::anisotropic_interaction_type))
2728 ((NBL_CONCEPT_REQ_TYPE)(T::sample_type))
2829 ((NBL_CONCEPT_REQ_TYPE)(T::spectral_type))
30+ ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(surface_interactions::Isotropic, typename T::anisotropic_interaction_type))
31+ ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(LightSample, typename T::sample_type))
32+ ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(concepts::FloatingPointLikeVectorial, typename T::spectral_type))
2933);
3034#undef conf
3135#include <nbl/builtin/hlsl/concepts/__end.hlsl>
3236
37+ // TODO: need to require either anisocache_type or isocache_type, but require anisocache_type if anisotropic_interaction_type was provided
3338#define NBL_CONCEPT_NAME MicrofacetConfiguration
3439#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
3540#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
@@ -39,6 +44,7 @@ NBL_CONCEPT_BEGIN(1)
3944NBL_CONCEPT_END (
4045 ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(BasicConfiguration, T))
4146 ((NBL_CONCEPT_REQ_TYPE)(T::anisocache_type))
47+ ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(ReadableIsotropicMicrofacetCache, typename T::anisocache_type))
4248);
4349#undef conf
4450#include <nbl/builtin/hlsl/concepts/__end.hlsl>
@@ -49,8 +55,8 @@ struct SConfiguration;
4955
5056#define CONF_ISO LightSample<LS> && surface_interactions::Isotropic<Interaction> && !surface_interactions::Anisotropic <Interaction> && concepts::FloatingPointLikeVectorial<Spectrum>
5157
52- template< class LS, class Interaction, class Spectrum>
53- NBL_PARTIAL_REQ_TOP (CONF_ISO)
58+ // TODO: remove the `IsAnisotropic` and deduce it from whether `anisotropic_interaction_type` was provided
59+ template< class LS, class Interaction, class Spectrum> NBL_PARTIAL_REQ_TOP (CONF_ISO)
5460struct SConfiguration<LS,Interaction,Spectrum NBL_PARTIAL_REQ_BOT (CONF_ISO) >
5561#undef CONF_ISO
5662{
@@ -63,8 +69,7 @@ struct SConfiguration<LS,Interaction,Spectrum NBL_PARTIAL_REQ_BOT(CONF_ISO) >
6369
6470#define CONF_ANISO LightSample<LS> && surface_interactions::Anisotropic <Interaction> && concepts::FloatingPointLikeVectorial<Spectrum>
6571
66- template<class LS, class Interaction, class Spectrum>
67- NBL_PARTIAL_REQ_TOP (CONF_ANISO)
72+ template<class LS, class Interaction, class Spectrum> NBL_PARTIAL_REQ_TOP (CONF_ANISO)
6873struct SConfiguration<LS,Interaction,Spectrum NBL_PARTIAL_REQ_BOT (CONF_ANISO) >
6974#undef CONF_ANISO
7075{
@@ -81,8 +86,7 @@ struct SMicrofacetConfiguration;
8186
8287#define MICROFACET_CONF_ISO LightSample<LS> && surface_interactions::Isotropic<Interaction> && !surface_interactions::Anisotropic <Interaction> && CreatableIsotropicMicrofacetCache<MicrofacetCache> && !AnisotropicMicrofacetCache<MicrofacetCache> && concepts::FloatingPointLikeVectorial<Spectrum>
8388
84- template<class LS, class Interaction, class MicrofacetCache, class Spectrum>
85- NBL_PARTIAL_REQ_TOP (MICROFACET_CONF_ISO)
89+ template<class LS, class Interaction, class MicrofacetCache, class Spectrum> NBL_PARTIAL_REQ_TOP (MICROFACET_CONF_ISO)
8690struct SMicrofacetConfiguration<LS,Interaction,MicrofacetCache,Spectrum NBL_PARTIAL_REQ_BOT (MICROFACET_CONF_ISO) > : SConfiguration<LS, Interaction, Spectrum>
8791#undef MICROFACET_CONF_ISO
8892{
@@ -95,8 +99,7 @@ struct SMicrofacetConfiguration<LS,Interaction,MicrofacetCache,Spectrum NBL_PART
9599
96100#define MICROFACET_CONF_ANISO LightSample<LS> && surface_interactions::Anisotropic <Interaction> && AnisotropicMicrofacetCache<MicrofacetCache> && concepts::FloatingPointLikeVectorial<Spectrum>
97101
98- template<class LS, class Interaction, class MicrofacetCache, class Spectrum>
99- NBL_PARTIAL_REQ_TOP (MICROFACET_CONF_ANISO)
102+ template<class LS, class Interaction, class MicrofacetCache, class Spectrum> NBL_PARTIAL_REQ_TOP (MICROFACET_CONF_ANISO)
100103struct SMicrofacetConfiguration<LS,Interaction,MicrofacetCache,Spectrum NBL_PARTIAL_REQ_BOT (MICROFACET_CONF_ANISO) > : SConfiguration<LS, Interaction, Spectrum>
101104#undef MICROFACET_CONF_ANISO
102105{
@@ -109,7 +112,7 @@ struct SMicrofacetConfiguration<LS,Interaction,MicrofacetCache,Spectrum NBL_PART
109112
110113#define NBL_BXDF_CONFIG_ALIAS (TYPE,CONFIG) using TYPE = typename CONFIG::TYPE
111114
112-
115+ // TODO: make the `monochrome_type` take `scalar_type` of spectral_type
113116#define BXDF_CONFIG_TYPE_ALIASES (Config) NBL_BXDF_CONFIG_ALIAS (sample_type, Config);\
114117using scalar_type = typename sample_type::scalar_type;\
115118using vector2_type = vector <scalar_type,2 >;\
0 commit comments