55#define _NBL_BUILTIN_HLSL_PATH_TRACING_CONCEPTS_INCLUDED_
66
77#include <nbl/builtin/hlsl/concepts.hlsl>
8- #include <nbl/builtin/hlsl/bxdf/common.hlsl>
98
109namespace nbl
1110{
@@ -15,6 +14,17 @@ namespace path_tracing
1514{
1615namespace concepts
1716{
17+ namespace impl
18+ {
19+ template<typename Vector3>
20+ struct DummyRayInteraction
21+ {
22+ using vector3_type = Vector3;
23+
24+ vector3_type getN () NBL_CONST_MEMBER_FUNC;
25+ bool isMaterialBSDF () NBL_CONST_MEMBER_FUNC;
26+ };
27+ }
1828
1929#define NBL_CONCEPT_NAME RandGenerator
2030#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
@@ -38,7 +48,7 @@ NBL_CONCEPT_END(
3848#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
3949#define NBL_CONCEPT_PARAM_0 (ray, T)
4050#define NBL_CONCEPT_PARAM_1 (v, typename T::vector3_type)
41- #define NBL_CONCEPT_PARAM_2 (interaction, bxdf::surface_interactions::SIsotropic<bxdf::ray_dir_info::SBasic< float >, typename T::spectral_type >)
51+ #define NBL_CONCEPT_PARAM_2 (interaction, impl::DummyRayInteraction< typename T::vector3_type >)
4252#define NBL_CONCEPT_PARAM_3 (scalar, typename T::scalar_type)
4353#define NBL_CONCEPT_PARAM_4 (color, typename T::spectral_type)
4454NBL_CONCEPT_BEGIN (5 )
@@ -52,7 +62,7 @@ NBL_CONCEPT_END(
5262 ((NBL_CONCEPT_REQ_TYPE)(T::vector3_type))
5363 ((NBL_CONCEPT_REQ_TYPE)(T::spectral_type))
5464 ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.init (v/*origin*/ , v/*direction*/ )), ::nbl::hlsl::is_same_v, void ))
55- ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.template setInteraction<bxdf::surface_interactions::SIsotropic<bxdf::ray_dir_info::SBasic< float >, typename T::spectral_type> > (interaction)), ::nbl::hlsl::is_same_v, void ))
65+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setInteraction (interaction)), ::nbl::hlsl::is_same_v, void ))
5666 ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.initPayload ()), ::nbl::hlsl::is_same_v, void ))
5767 ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.shouldDoMIS ()), ::nbl::hlsl::is_same_v, bool ))
5868 ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.foundEmissiveMIS (scalar)), ::nbl::hlsl::is_same_v, typename T::scalar_type))
@@ -70,6 +80,21 @@ NBL_CONCEPT_END(
7080#undef ray
7181#include <nbl/builtin/hlsl/concepts/__end.hlsl>
7282
83+ #define NBL_CONCEPT_NAME RaySetInteraction
84+ #define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename)
85+ #define NBL_CONCEPT_TPLT_PRM_NAMES (RayT)(Interaction)
86+ #define NBL_CONCEPT_PARAM_0 (ray, RayT)
87+ #define NBL_CONCEPT_PARAM_1 (interaction, Interaction)
88+ NBL_CONCEPT_BEGIN (2 )
89+ #define ray NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
90+ #define interaction NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
91+ NBL_CONCEPT_END (
92+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setInteraction (interaction)), ::nbl::hlsl::is_same_v, void ))
93+ );
94+ #undef interaction
95+ #undef ray
96+ #include <nbl/builtin/hlsl/concepts/__end.hlsl>
97+
7398#define NBL_CONCEPT_NAME RayGenerator
7499#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
75100#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
@@ -124,6 +149,7 @@ NBL_CONCEPT_END(
124149 ((NBL_CONCEPT_REQ_TYPE)(T::scene_type))
125150 ((NBL_CONCEPT_REQ_TYPE)(T::ray_type))
126151 ((NBL_CONCEPT_REQ_TYPE)(T::object_handle_type))
152+ ((NBL_CONCEPT_REQ_TYPE)(T::anisotropic_interaction_type))
127153 ((NBL_CONCEPT_REQ_TYPE)(T::closest_hit_type))
128154 ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(IntersectorClosestHit, typename T::closest_hit_type))
129155 ((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(Ray, typename T::ray_type))
@@ -136,6 +162,26 @@ NBL_CONCEPT_END(
136162#undef intersect
137163#include <nbl/builtin/hlsl/concepts/__end.hlsl>
138164
165+ #define NBL_CONCEPT_NAME UnidirectionalInteractionContract
166+ #define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename)(typename)
167+ #define NBL_CONCEPT_TPLT_PRM_NAMES (RayT)(IntersectorT)(MaterialSystemT)
168+ #define NBL_CONCEPT_PARAM_0 (ray, RayT)
169+ #define NBL_CONCEPT_PARAM_1 (hit, typename IntersectorT::closest_hit_type)
170+ #define NBL_CONCEPT_PARAM_2 (interaction, typename MaterialSystemT::anisotropic_interaction_type)
171+ NBL_CONCEPT_BEGIN (3 )
172+ #define ray NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
173+ #define hit NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
174+ #define interaction NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_2
175+ NBL_CONCEPT_END (
176+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((hit.getInteraction ()), ::nbl::hlsl::is_same_v, typename IntersectorT::anisotropic_interaction_type))
177+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((hit.getInteraction ()), ::nbl::hlsl::is_same_v, typename MaterialSystemT::anisotropic_interaction_type))
178+ ((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setInteraction (interaction)), ::nbl::hlsl::is_same_v, void ))
179+ );
180+ #undef interaction
181+ #undef hit
182+ #undef ray
183+ #include <nbl/builtin/hlsl/concepts/__end.hlsl>
184+
139185#define NBL_CONCEPT_NAME BxdfNode
140186#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
141187#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
0 commit comments