Loading...
Searching...
No Matches
maskingshadowing.h
Go to the documentation of this file.
1#ifndef _BBM_MASKINGSHADOWING_CONCEPT_H_
2#define _BBM_MASKINGSHADOWING_CONCEPT_H_
3
4#include "concepts/ndf.h"
5#include "concepts/util.h"
6
7/************************************************************************/
8/*! \file maskingshadowing.h
9
10 \brief Joint Masking-Shadowing Functor concept
11*************************************************************************/
12
13namespace bbm {
14 namespace concepts {
15
16 /********************************************************************/
17 /*! \brief maskingshadowing concept
18
19 Each Masking-Shadowing requires:
20 + concepts::has_config
21 + static Value/Spectrum eval(const NDF&, const Vec3d&, const Vec3d& in, const Vec3d& out, const Vec3d& m, Mask mask=true)
22 *********************************************************************/
23 template<typename MS>
24 concept maskingshadowing = requires
25 {
27
28 /******************************************************************/
29 /*! \brief Evaluate the masking-shaodinw function for a given ndf, and in/out/NDF normal vector.
30
31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
32 template<typename NDF> requires concepts::matching_config<NDF, MS>
33 Value/Spectrum eval(const NDF& ndf, const Vec3d& in, const Vec3d& out, const Vec3d& m, Mask mask=true) const
34 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
36 \param ndf = NDF to compute masking-shadowing for
37 \param in = incident direction of transport
38 \param out = exitant direction of transport
39 \param m = microfacet normal
40 \param mask = enable/disable lanes
41 \returns shadowing and masking ratio.
42 *******************************************************************/
43 { std::decay_t<MS>::eval(std::declval<archetype::ndf<get_config<MS>>>(), std::declval<Vec3d_t<MS>>(), std::declval<Vec3d_t<MS>>(), std::declval<Vec3d_t<MS>>(), std::declval<Mask_t<MS>>()) } -> concepts::same_as_any<Value_t<MS>, Spectrum_t<MS>>;
44
45 //! \brief mask has default value
46 { std::decay_t<MS>::eval(std::declval<archetype::ndf<get_config<MS>>>(), std::declval<Vec3d_t<MS>>(), std::declval<Vec3d_t<MS>>(), std::declval<Vec3d_t<MS>>()) } -> concepts::same_as_any<Value_t<MS>, Spectrum_t<MS>>;
47 };
48
49 /********************************************************************/
50 /*! \brief maskingshadowing archetype for concept checking
51
52 \tparam CONF = config to check for. Default: archetype::config
53 \tparam RET = return type (spectrum or value)
54 *********************************************************************/
55 namespace archetype {
56 template<typename CONF=config, typename RET=Value_t<CONF>> requires concepts::config<CONF>
58 {
59 using Config = CONF;
60 static RET eval(ndf<Config>, Vec3d_t<Config>, Vec3d_t<Config>, Vec3d_t<Config>, Mask_t<Config> = true);
61 };
62 } // end archetype namespace
63
65
66 } // end concepts namespace
67} // end bbm namespace
68
69#endif /* _BBM_MASKINGSHADOWING_CONCEPT_H_ */
config concept
Definition: config.h:31
has_config
Definition: config.h:53
maskingshadowing concept
Definition: maskingshadowing.h:24
ndf concept
Definition: ndf.h:29
true if type is the same as any of the listed types
Definition: util.h:31
Microfacet Normal Distribution contract.
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
Definition: aggregatebsdf.h:29
Definition: maskingshadowing.h:58
static RET eval(ndf< Config >, Vec3d_t< Config >, Vec3d_t< Config >, Vec3d_t< Config >, Mask_t< Config >=true)
CONF Config
Definition: maskingshadowing.h:59
Additional basic helper concepts.