Skip to content

Commit 7aa071b

Browse files
committed
moved ndf type defs and constexpr declaration into macro
1 parent dcc2464 commit 7aa071b

File tree

4 files changed

+67
-84
lines changed

4 files changed

+67
-84
lines changed

include/nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct SCookTorrance
132132
using fresnel_type = F;
133133

134134
NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = ndf_type::IsAnisotropic;
135-
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = ndf_type::NDFSurfaceType != ndf::MTT_REFLECT;
135+
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = ndf_type::SupportedPaths != ndf::MTT_REFLECT;
136136

137137
template<class Interaction, class MicrofacetCache>
138138
static bool __checkValid(NBL_CONST_REF_ARG(fresnel_type) f, NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)

include/nbl/builtin/hlsl/bxdf/ndf.hlsl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,29 @@ NBL_CONCEPT_END(
7676
#undef ndf
7777
#include <nbl/builtin/hlsl/concepts/__end.hlsl>
7878

79+
80+
#define NDF_CONSTEXPR_DECLS(ANISO,REFLECT_REFRACT) NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = ANISO;\
81+
NBL_CONSTEXPR_STATIC_INLINE MicrofacetTransformTypes SupportedPaths = REFLECT_REFRACT;\
82+
NBL_CONSTEXPR_STATIC_INLINE bool SupportsTransmission = REFLECT_REFRACT != MTT_REFLECT;\
83+
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = SupportsTransmission ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_NONE;\
84+
template<class Interaction>\
85+
NBL_CONSTEXPR_STATIC_INLINE bool RequiredInteraction = IsAnisotropic ? surface_interactions::Anisotropic<Interaction> : surface_interactions::Isotropic<Interaction>;\
86+
template<class MicrofacetCache>\
87+
NBL_CONSTEXPR_STATIC_INLINE bool RequiredMicrofacetCache = IsAnisotropic ? AnisotropicMicrofacetCache<MicrofacetCache> : ReadableIsotropicMicrofacetCache<MicrofacetCache>;\
88+
89+
// help avoid preprocessor splitting template declarations by comma
90+
#define SINGLE_ARG(...) __VA_ARGS__
91+
92+
#define NDF_TYPE_ALIASES(N,BASE,DG1_QUERY,G2_QUERY) using this_t = N;\
93+
using scalar_type = T;\
94+
using base_type = BASE;\
95+
using quant_type = SDualMeasureQuant<scalar_type>;\
96+
using vector2_type = vector<T, 2>;\
97+
using vector3_type = vector<T, 3>;\
98+
using dg1_query_type = DG1_QUERY<scalar_type>;\
99+
using g2g1_query_type = G2_QUERY<scalar_type>;\
100+
using quant_query_type = impl::NDFQuantQuery<scalar_type>;\
101+
79102
}
80103
}
81104
}

include/nbl/builtin/hlsl/bxdf/ndf/beckmann.hlsl

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,8 @@ struct BeckmannGenerateH
298298
template<typename T, bool _IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
299299
struct Beckmann
300300
{
301-
using this_t = Beckmann<T, _IsAnisotropic, reflect_refract>;
302-
using scalar_type = T;
303-
using base_type = impl::BeckmannCommon<T,_IsAnisotropic>;
304-
using quant_type = SDualMeasureQuant<scalar_type>;
305-
using vector2_type = vector<T, 2>;
306-
using vector3_type = vector<T, 3>;
307-
308-
using dg1_query_type = impl::SBeckmannDG1Query<scalar_type>;
309-
using g2g1_query_type = impl::SBeckmannG2overG1Query<scalar_type>;
310-
using quant_query_type = impl::NDFQuantQuery<scalar_type>;
311-
312-
NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = _IsAnisotropic;
313-
NBL_CONSTEXPR_STATIC_INLINE MicrofacetTransformTypes NDFSurfaceType = reflect_refract;
314-
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = reflect_refract != MTT_REFLECT;
315-
template<class Interaction>
316-
NBL_CONSTEXPR_STATIC_INLINE bool RequiredInteraction = IsAnisotropic ? surface_interactions::Anisotropic<Interaction> : surface_interactions::Isotropic<Interaction>;
317-
template<class MicrofacetCache>
318-
NBL_CONSTEXPR_STATIC_INLINE bool RequiredMicrofacetCache = IsAnisotropic ? AnisotropicMicrofacetCache<MicrofacetCache> : ReadableIsotropicMicrofacetCache<MicrofacetCache>;
301+
NDF_CONSTEXPR_DECLS(_IsAnisotropic,reflect_refract);
302+
NDF_TYPE_ALIASES(SINGLE_ARG(Beckmann<T,IsAnisotropic,SupportedPaths>), SINGLE_ARG(impl::BeckmannCommon<T,IsAnisotropic>), impl::SBeckmannDG1Query, impl::SBeckmannG2overG1Query);
319303

320304
template<typename C=bool_constant<!IsAnisotropic> >
321305
static enable_if_t<C::value && !IsAnisotropic, this_t> create(scalar_type A)
@@ -338,18 +322,15 @@ struct Beckmann
338322
return retval;
339323
}
340324

341-
template<class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
342-
enable_if_t<C::value && !IsBSDF, quant_query_type> createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
325+
template<class MicrofacetCache NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
326+
quant_query_type createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
343327
{
344-
quant_query_type dummy; // brdfs don't make use of this
345-
return dummy;
346-
}
347-
template<class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
348-
enable_if_t<C::value && IsBSDF, quant_query_type> createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
349-
{
350-
quant_query_type quant_query;
351-
quant_query.VdotHLdotH = cache.getVdotHLdotH();
352-
quant_query.VdotH_etaLdotH = cache.getVdotH() + orientedEta * cache.getLdotH();
328+
quant_query_type quant_query; // only has members for refraction
329+
if (SupportsTransmission)
330+
{
331+
quant_query.VdotHLdotH = cache.getVdotHLdotH();
332+
quant_query.VdotH_etaLdotH = cache.getVdotH() + orientedEta * cache.getLdotH();
333+
}
353334
return quant_query;
354335
}
355336
template<class Interaction, class MicrofacetCache, typename C=bool_constant<!IsAnisotropic> NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
@@ -390,27 +371,27 @@ struct Beckmann
390371
return __generate_base.__call(localV, u);
391372
}
392373

393-
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
394-
enable_if_t<C::value && !IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
374+
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
375+
enable_if_t<C::value && !SupportsTransmission, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
395376
{
396377
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
397378
return createDualMeasureQuantity<T>(d, interaction.getNdotV(BxDFClampMode::BCM_MAX), _sample.getNdotL(BxDFClampMode::BCM_MAX));
398379
}
399-
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
400-
enable_if_t<C::value && IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
380+
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
381+
enable_if_t<C::value && SupportsTransmission, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
401382
{
402383
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
403384
return createDualMeasureQuantity<T, reflect_refract>(d, interaction.getNdotV(BxDFClampMode::BCM_ABS), _sample.getNdotL(BxDFClampMode::BCM_ABS), quant_query.getVdotHLdotH(), quant_query.getVdotH_etaLdotH());
404385
}
405386

406-
template<class LS, class Interaction, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
407-
enable_if_t<C::value && !IsBSDF, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
387+
template<class LS, class Interaction, typename C=bool_constant<!SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
388+
enable_if_t<C::value && !SupportsTransmission, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
408389
{
409390
scalar_type dg1 = base_type::template DG1<dg1_query_type>(query);
410391
return createDualMeasureQuantity<T>(dg1, interaction.getNdotV(BxDFClampMode::BCM_MAX), _sample.getNdotL(BxDFClampMode::BCM_MAX));
411392
}
412-
template<class LS, class Interaction, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
413-
enable_if_t<C::value && IsBSDF, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
393+
template<class LS, class Interaction, typename C=bool_constant<SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
394+
enable_if_t<C::value && SupportsTransmission, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
414395
{
415396
scalar_type dg1 = base_type::template DG1<dg1_query_type>(query);
416397
return createDualMeasureQuantity<T, reflect_refract>(dg1, interaction.getNdotV(BxDFClampMode::BCM_ABS), _sample.getNdotL(BxDFClampMode::BCM_ABS), quant_query.getVdotHLdotH(), quant_query.getVdotH_etaLdotH());

include/nbl/builtin/hlsl/bxdf/ndf/ggx.hlsl

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ struct SGGXG2XQuery
7575
scalar_type devsh_l;
7676
};
7777

78-
template<typename T, bool IsBSDF, bool IsAnisotropic=false NBL_STRUCT_CONSTRAINABLE>
78+
template<typename T, bool SupportsTransmission, bool IsAnisotropic=false NBL_STRUCT_CONSTRAINABLE>
7979
struct GGXCommon;
8080

81-
template<typename T, bool IsBSDF>
81+
template<typename T, bool SupportsTransmission>
8282
NBL_PARTIAL_REQ_TOP(concepts::FloatingPointScalar<T>)
83-
struct GGXCommon<T,IsBSDF,false NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
83+
struct GGXCommon<T,SupportsTransmission,false NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
8484
{
8585
using scalar_type = T;
8686

87-
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = IsBSDF ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_MAX;
87+
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = SupportsTransmission ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_MAX;
8888

8989
// trowbridge-reitz
9090
template<class MicrofacetCache NBL_FUNC_REQUIRES(ReadableIsotropicMicrofacetCache<MicrofacetCache>)
@@ -158,13 +158,13 @@ struct GGXCommon<T,IsBSDF,false NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScala
158158
scalar_type one_minus_a2;
159159
};
160160

161-
template<typename T, bool IsBSDF>
161+
template<typename T, bool SupportsTransmission>
162162
NBL_PARTIAL_REQ_TOP(concepts::FloatingPointScalar<T>)
163-
struct GGXCommon<T,IsBSDF,true NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
163+
struct GGXCommon<T,SupportsTransmission,true NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
164164
{
165165
using scalar_type = T;
166166

167-
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = IsBSDF ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_MAX;
167+
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = SupportsTransmission ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_MAX;
168168

169169
template<class MicrofacetCache NBL_FUNC_REQUIRES(AnisotropicMicrofacetCache<MicrofacetCache>)
170170
scalar_type D(NBL_CONST_REF_ARG(MicrofacetCache) cache)
@@ -278,26 +278,8 @@ struct GGXGenerateH
278278
template<typename T, bool _IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
279279
struct GGX
280280
{
281-
NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = _IsAnisotropic;
282-
NBL_CONSTEXPR_STATIC_INLINE MicrofacetTransformTypes NDFSurfaceType = reflect_refract;
283-
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = reflect_refract != MTT_REFLECT;
284-
285-
using this_t = GGX<T, _IsAnisotropic, reflect_refract>;
286-
using scalar_type = T;
287-
using base_type = impl::GGXCommon<T,IsBSDF,IsAnisotropic>;
288-
using quant_type = SDualMeasureQuant<scalar_type>;
289-
using vector2_type = vector<T, 2>;
290-
using vector3_type = vector<T, 3>;
291-
292-
using dg1_query_type = impl::SGGXDG1Query<scalar_type>;
293-
using g2g1_query_type = impl::SGGXG2XQuery<scalar_type>;
294-
using quant_query_type = impl::NDFQuantQuery<scalar_type>;
295-
296-
NBL_CONSTEXPR_STATIC_INLINE BxDFClampMode _clamp = IsBSDF ? BxDFClampMode::BCM_ABS : BxDFClampMode::BCM_NONE;
297-
template<class Interaction>
298-
NBL_CONSTEXPR_STATIC_INLINE bool RequiredInteraction = IsAnisotropic ? surface_interactions::Anisotropic<Interaction> : surface_interactions::Isotropic<Interaction>;
299-
template<class MicrofacetCache>
300-
NBL_CONSTEXPR_STATIC_INLINE bool RequiredMicrofacetCache = IsAnisotropic ? AnisotropicMicrofacetCache<MicrofacetCache> : ReadableIsotropicMicrofacetCache<MicrofacetCache>;
281+
NDF_CONSTEXPR_DECLS(_IsAnisotropic,reflect_refract);
282+
NDF_TYPE_ALIASES(SINGLE_ARG(GGX<T,IsAnisotropic,SupportedPaths>), SINGLE_ARG(impl::GGXCommon<T,SupportsTransmission,IsAnisotropic>), impl::SGGXDG1Query, impl::SGGXG2XQuery);
301283

302284
template<typename C=bool_constant<!IsAnisotropic> >
303285
static enable_if_t<C::value && !IsAnisotropic, this_t> create(scalar_type A)
@@ -321,18 +303,15 @@ struct GGX
321303
return retval;
322304
}
323305

324-
template<class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
325-
enable_if_t<C::value && !IsBSDF, quant_query_type> createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
326-
{
327-
quant_query_type dummy; // brdfs don't make use of this
328-
return dummy;
329-
}
330-
template<class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
331-
enable_if_t<C::value && IsBSDF, quant_query_type> createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
306+
template<class MicrofacetCache NBL_FUNC_REQUIRES(RequiredMicrofacetCache<MicrofacetCache>)
307+
quant_query_type createQuantQuery(NBL_CONST_REF_ARG(MicrofacetCache) cache, scalar_type orientedEta)
332308
{
333-
quant_query_type quant_query;
334-
quant_query.VdotHLdotH = cache.getVdotHLdotH();
335-
quant_query.VdotH_etaLdotH = cache.getVdotH() + orientedEta * cache.getLdotH();
309+
quant_query_type quant_query; // only has members for refraction
310+
if (SupportsTransmission)
311+
{
312+
quant_query.VdotHLdotH = cache.getVdotHLdotH();
313+
quant_query.VdotH_etaLdotH = cache.getVdotH() + orientedEta * cache.getLdotH();
314+
}
336315
return quant_query;
337316
}
338317
template<class Interaction, class MicrofacetCache, typename C=bool_constant<!IsAnisotropic> NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
@@ -375,17 +354,17 @@ struct GGX
375354
return __generate_base.__call(localV, u);
376355
}
377356

378-
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
379-
enable_if_t<C::value && !IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
357+
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
358+
enable_if_t<C::value && !SupportsTransmission, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
380359
{
381360
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
382361
quant_type dmq;
383362
dmq.microfacetMeasure = d;
384363
dmq.projectedLightMeasure = d * _sample.getNdotL(BxDFClampMode::BCM_MAX);
385364
return dmq;
386365
}
387-
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
388-
enable_if_t<C::value && IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
366+
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
367+
enable_if_t<C::value && SupportsTransmission, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
389368
{
390369
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
391370
quant_type dmq;
@@ -401,17 +380,17 @@ struct GGX
401380
return dmq;
402381
}
403382

404-
template<class LS, class Interaction, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
405-
enable_if_t<C::value && !IsBSDF, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
383+
template<class LS, class Interaction, typename C=bool_constant<!SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
384+
enable_if_t<C::value && !SupportsTransmission, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
406385
{
407386
scalar_type dg1 = base_type::template DG1<dg1_query_type>(query);
408387
quant_type dmq;
409388
dmq.microfacetMeasure = dg1;
410389
dmq.projectedLightMeasure = dg1;// TODO: figure this out * _sample.getNdotL(BxDFClampMode::BCM_MAX);
411390
return dmq;
412391
}
413-
template<class LS, class Interaction, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
414-
enable_if_t<C::value && IsBSDF, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
392+
template<class LS, class Interaction, typename C=bool_constant<SupportsTransmission> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
393+
enable_if_t<C::value && SupportsTransmission, quant_type> DG1(NBL_CONST_REF_ARG(dg1_query_type) query, NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
415394
{
416395
scalar_type dg1 = base_type::template DG1<dg1_query_type>(query);
417396
quant_type dmq;

0 commit comments

Comments
 (0)