@@ -468,8 +468,10 @@ struct SLightSample
468
468
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
469
469
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
470
470
#define NBL_CONCEPT_PARAM_0 (cache, T)
471
- NBL_CONCEPT_BEGIN (1 )
471
+ #define NBL_CONCEPT_PARAM_1 (eta, fresnel::OrientedEtas<vector <typename T::scalar_type,1 > >)
472
+ NBL_CONCEPT_BEGIN (2 )
472
473
#define cache NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
474
+ #define eta NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
473
475
NBL_CONCEPT_END (
474
476
((NBL_CONCEPT_REQ_TYPE)(T::scalar_type))
475
477
((NBL_CONCEPT_REQ_TYPE)(T::vector3_type))
@@ -480,7 +482,9 @@ NBL_CONCEPT_END(
480
482
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((cache.getAbsNdotH ()), ::nbl::hlsl::is_same_v, typename T::scalar_type))
481
483
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((cache.getNdotH2 ()), ::nbl::hlsl::is_same_v, typename T::scalar_type))
482
484
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((cache.isTransmission ()), ::nbl::hlsl::is_same_v, bool ))
485
+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((cache.isValid (eta)), ::nbl::hlsl::is_same_v, bool ))
483
486
);
487
+ #undef eta
484
488
#undef cache
485
489
#include <nbl/builtin/hlsl/concepts/__end.hlsl>
486
490
@@ -637,6 +641,11 @@ struct SIsotropicMicrofacetCache
637
641
// similar with BSDF sampling, as fresnel can be high while reflection can be invalid, or low while refraction would be invalid too
638
642
bool isTransmission () NBL_CONST_MEMBER_FUNC { return getVdotHLdotH () < scalar_type (0.0 ); }
639
643
644
+ bool isValid (NBL_CONST_REF_ARG (fresnel::OrientedEtas<monochrome_type>) orientedEta) NBL_CONST_MEMBER_FUNC
645
+ {
646
+ return ComputeMicrofacetNormal<scalar_type>::isValidMicrofacet (isTransmission (), VdotL, absNdotH, orientedEta);
647
+ }
648
+
640
649
scalar_type getVdotL () NBL_CONST_MEMBER_FUNC { return VdotL; }
641
650
scalar_type getVdotH () NBL_CONST_MEMBER_FUNC { return VdotH; }
642
651
scalar_type getLdotH () NBL_CONST_MEMBER_FUNC { return LdotH; }
@@ -809,6 +818,11 @@ struct SAnisotropicMicrofacetCache
809
818
scalar_type getNdotH2 () NBL_CONST_MEMBER_FUNC { return iso_cache.getNdotH2 (); }
810
819
bool isTransmission () NBL_CONST_MEMBER_FUNC { return iso_cache.isTransmission (); }
811
820
821
+ bool isValid (NBL_CONST_REF_ARG (fresnel::OrientedEtas<monochrome_type>) orientedEta) NBL_CONST_MEMBER_FUNC
822
+ {
823
+ return iso_cache.isValid (orientedEta);
824
+ }
825
+
812
826
scalar_type getTdotH () NBL_CONST_MEMBER_FUNC { return TdotH; }
813
827
scalar_type getTdotH2 () NBL_CONST_MEMBER_FUNC { const scalar_type t = getTdotH (); return t*t; }
814
828
scalar_type getBdotH () NBL_CONST_MEMBER_FUNC { return BdotH; }
0 commit comments