Skip to content

Commit f3f60c6

Browse files
committed
check that eta type of dielectric fresnels should be monochrome
1 parent 62f2c99 commit f3f60c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/nbl/builtin/hlsl/bxdf/fresnel.hlsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ NBL_CONCEPT_END(
319319
#undef fresnel
320320
#include <nbl/builtin/hlsl/concepts/__end.hlsl>
321321

322+
namespace impl
323+
{
324+
template<typename T>
325+
NBL_BOOL_CONCEPT VectorIsMonochrome = vector_traits<T>::Dimension == 1;
326+
}
327+
322328
#define NBL_CONCEPT_NAME TwoSidedFresnel
323329
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
324330
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
@@ -333,6 +339,7 @@ NBL_CONCEPT_END(
333339
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((fresnel.getRefractionOrientedEta()), ::nbl::hlsl::is_same_v, typename T::scalar_type))
334340
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((fresnel.getRefractionOrientedEtaRcps()), ::nbl::hlsl::is_same_v, OrientedEtaRcps<typename T::eta_type>))
335341
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((fresnel.getReorientedFresnel(cosTheta)), ::nbl::hlsl::is_same_v, T))
342+
((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(impl::VectorIsMonochrome, typename T::eta_type))
336343
);
337344
#undef cosTheta
338345
#undef fresnel

0 commit comments

Comments
 (0)