@@ -19,139 +19,142 @@ namespace bxdf
1919namespace  reflection
2020{
2121
22- template<class  Config NBL_PRIMARY_REQUIRES (config_concepts::MicrofacetConfiguration<Config>)
23- struct  SBeckmannIsotropic
24- {
25-     using this_t = SBeckmannIsotropic<Config>;
26-     MICROFACET_BXDF_CONFIG_TYPE_ALIASES (Config);
27- 
28-     using ndf_type = ndf::Beckmann<scalar_type, false , ndf::MTT_REFLECT>;
29-     using fresnel_type = fresnel::Conductor<spectral_type>;
30- 
31-     struct  SCreationParams
32-     {
33-         scalar_type A;
34-         spectral_type eta;
35-         spectral_type etak;
36-     };
37-     using creation_type = SCreationParams;
38- 
39-     static  this_t create (scalar_type A, NBL_CONST_REF_ARG (spectral_type) eta, NBL_CONST_REF_ARG (spectral_type) etak)
40-     {
41-         this_t retval;
42-         retval.__base.ndf.__ndf_base.a2 = A*A;
43-         retval.__base.ndf.__generate_base.ax = A;
44-         retval.__base.ndf.__generate_base.ay = A;
45-         retval.__base.fresnel.eta = eta;
46-         retval.__base.fresnel.etak2 = etak * etak;
47-         retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;
48-         return  retval;
49-     }
50-     static  this_t create (NBL_CONST_REF_ARG (creation_type) params)
51-     {
52-         return  create (params.A, params.eta, params.etak);
53-     }
54- 
55-     spectral_type eval (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction, NBL_CONST_REF_ARG (isocache_type) cache)
56-     {
57-         return  __base.eval (_sample, interaction, cache);
58-     }
59-     spectral_type eval (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
60-     {
61-         return  __base.eval (_sample, interaction.isotropic, cache.iso_cache);
62-     }
63- 
64-     sample_type generate (NBL_CONST_REF_ARG (isotropic_interaction_type) interaction, const  vector2_type u, NBL_REF_ARG (isocache_type) cache)
65-     {
66-         anisocache_type aniso_cache;
67-         sample_type s = __base.template generate<vector2_type>(anisotropic_interaction_type::create (interaction), u, aniso_cache);
68-         cache = aniso_cache.iso_cache;
69-         return  s;
70-     }
71-     sample_type generate (NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, const  vector2_type u, NBL_REF_ARG (anisocache_type) cache)
72-     {
73-         return  __base.template generate<vector2_type>(interaction, u, cache);
74-     }
75- 
76-     scalar_type pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction, NBL_CONST_REF_ARG (isocache_type) cache)
77-     {
78-         return  __base.pdf (_sample, interaction, cache);
79-     }
80-     scalar_type pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
81-     {
82-         return  __base.pdf (_sample, interaction.isotropic, cache.iso_cache);
83-     }
84- 
85-     quotient_pdf_type quotient_and_pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (isotropic_interaction_type) interaction, NBL_CONST_REF_ARG (isocache_type) cache)
86-     {
87-         return  __base.quotient_and_pdf (_sample, interaction, cache);
88-     }
89-     quotient_pdf_type quotient_and_pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
90-     {
91-         return  __base.quotient_and_pdf (_sample, interaction.isotropic, cache.iso_cache);
92-     }
93- 
94-     SCookTorrance<Config, ndf_type, fresnel_type> __base;
95- };
96- 
97- template<class  Config NBL_PRIMARY_REQUIRES (config_concepts::MicrofacetConfiguration<Config>)
98- struct  SBeckmannAnisotropic
99- {
100-     using this_t = SBeckmannAnisotropic<Config>;
101-     MICROFACET_BXDF_CONFIG_TYPE_ALIASES (Config);
102- 
103-     using ndf_type = ndf::Beckmann<scalar_type, true , ndf::MTT_REFLECT>;
104-     using fresnel_type = fresnel::Conductor<spectral_type>;
105- 
106-     struct  SCreationParams
107-     {
108-         scalar_type ax;
109-         scalar_type ay;
110-         spectral_type eta;
111-         spectral_type etak;
112-     };
113-     using creation_type = SCreationParams;
114- 
115-     static  this_t create (scalar_type ax, scalar_type ay, NBL_CONST_REF_ARG (spectral_type) eta, NBL_CONST_REF_ARG (spectral_type) etak)
116-     {
117-         this_t retval;
118-         retval.__base.ndf.__ndf_base.ax2 = ax*ax;
119-         retval.__base.ndf.__ndf_base.ay2 = ay*ay;
120-         retval.__base.ndf.__ndf_base.a2 = ax*ay;
121-         retval.__base.ndf.__generate_base.ax = ax;
122-         retval.__base.ndf.__generate_base.ay = ay;
123-         retval.__base.fresnel.eta = eta;
124-         retval.__base.fresnel.etak2 = etak * etak;
125-         retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;
126-         return  retval;
127-     }
128-     static  this_t create (NBL_CONST_REF_ARG (creation_type) params)
129-     {
130-         return  create (params.ax, params.ay, params.eta, params.etak);
131-     }
132- 
133-     spectral_type eval (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
134-     {
135-         return  __base.eval (_sample, interaction, cache);
136-     }
137- 
138-     sample_type generate (NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, const  vector2_type u, NBL_REF_ARG (anisocache_type) cache)
139-     {
140-         return  __base.template generate<vector2_type>(interaction, u, cache);
141-     }
142- 
143-     scalar_type pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
144-     {
145-         return  __base.pdf (_sample, interaction, cache);
146-     }
147- 
148-     quotient_pdf_type quotient_and_pdf (NBL_CONST_REF_ARG (sample_type) _sample, NBL_CONST_REF_ARG (anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG (anisocache_type) cache)
149-     {
150-         return  __base.quotient_and_pdf (_sample, interaction, cache);
151-     }
152- 
153-     SCookTorrance<Config, ndf_type, fresnel_type> __base;
154- };
22+ template<class  Config>
23+ using SBeckmannIsotropic = SCookTorrance<Config, ndf::Beckmann<typename Config::scalar_type, false , ndf::MTT_REFLECT>, fresnel::Conductor<typename Config::spectral_type> >;
24+ 
25+ template<class  Config>
26+ using SBeckmannAnisotropic = SCookTorrance<Config, ndf::Beckmann<typename Config::scalar_type, true , ndf::MTT_REFLECT>, fresnel::Conductor<typename Config::spectral_type> >;
27+ 
28+ // template<class Config NBL_PRIMARY_REQUIRES(config_concepts::MicrofacetConfiguration<Config>) 
29+ // struct SBeckmannIsotropic 
30+ // { 
31+ //     using this_t = SBeckmannIsotropic<Config>; 
32+ //     MICROFACET_BXDF_CONFIG_TYPE_ALIASES(Config); 
33+ 
34+ //     using ndf_type = ndf::Beckmann<scalar_type, false, ndf::MTT_REFLECT>; 
35+ //     using fresnel_type = fresnel::Conductor<spectral_type>; 
36+ 
37+ //     struct SCreationParams 
38+ //     { 
39+ //         scalar_type A; 
40+ //         spectral_type eta; 
41+ //         spectral_type etak; 
42+ //     }; 
43+ //     using creation_type = SCreationParams; 
44+ 
45+ //     static this_t create(scalar_type A, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak) 
46+ //     { 
47+ //         this_t retval; 
48+ //         retval.__base.ndf.__ndf_base.a2 = A*A; 
49+ //         retval.__base.ndf.__generate_base.ax = A; 
50+ //         retval.__base.ndf.__generate_base.ay = A; 
51+ //         retval.__base.fresnel.eta = eta; 
52+ //         retval.__base.fresnel.etak2 = etak * etak; 
53+ //         retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2; 
54+ //         return retval; 
55+ //     } 
56+ //     static this_t create(NBL_CONST_REF_ARG(creation_type) params) 
57+ //     { 
58+ //         return create(params.A, params.eta, params.etak); 
59+ //     } 
60+ 
61+ //     spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(isocache_type) cache) 
62+ //     { 
63+ //         return __base.eval(_sample, interaction, cache); 
64+ //     } 
65+ //     spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
66+ //     { 
67+ //         return __base.eval(_sample, interaction.isotropic, cache.iso_cache); 
68+ //     } 
69+ 
70+ //     sample_type generate(NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, const vector2_type u, NBL_REF_ARG(isocache_type) cache) 
71+ //     { 
72+ //         return __base.generate(interaction, u, cache); 
73+ //     } 
74+ //     sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u, NBL_REF_ARG(anisocache_type) cache) 
75+ //     { 
76+ //         return __base.generate(interaction, u, cache); 
77+ //     } 
78+ 
79+ //     scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(isocache_type) cache) 
80+ //     { 
81+ //         return __base.pdf(_sample, interaction, cache); 
82+ //     } 
83+ //     scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
84+ //     { 
85+ //         return __base.pdf(_sample, interaction.isotropic, cache.iso_cache); 
86+ //     } 
87+ 
88+ //     quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(isotropic_interaction_type) interaction, NBL_CONST_REF_ARG(isocache_type) cache) 
89+ //     { 
90+ //         return __base.quotient_and_pdf(_sample, interaction, cache); 
91+ //     } 
92+ //     quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
93+ //     { 
94+ //         return __base.quotient_and_pdf(_sample, interaction.isotropic, cache.iso_cache); 
95+ //     } 
96+ 
97+ //     SCookTorrance<Config, ndf_type, fresnel_type> __base; 
98+ // }; 
99+ 
100+ // template<class Config NBL_PRIMARY_REQUIRES(config_concepts::MicrofacetConfiguration<Config>) 
101+ // struct SBeckmannAnisotropic 
102+ // { 
103+ //     using this_t = SBeckmannAnisotropic<Config>; 
104+ //     MICROFACET_BXDF_CONFIG_TYPE_ALIASES(Config); 
105+ 
106+ //     using ndf_type = ndf::Beckmann<scalar_type, true, ndf::MTT_REFLECT>; 
107+ //     using fresnel_type = fresnel::Conductor<spectral_type>; 
108+ 
109+ //     struct SCreationParams 
110+ //     { 
111+ //         scalar_type ax; 
112+ //         scalar_type ay; 
113+ //         spectral_type eta; 
114+ //         spectral_type etak; 
115+ //     }; 
116+ //     using creation_type = SCreationParams; 
117+ 
118+ //     static this_t create(scalar_type ax, scalar_type ay, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak) 
119+ //     { 
120+ //         this_t retval; 
121+ //         retval.__base.ndf.__ndf_base.ax2 = ax*ax; 
122+ //         retval.__base.ndf.__ndf_base.ay2 = ay*ay; 
123+ //         retval.__base.ndf.__ndf_base.a2 = ax*ay; 
124+ //         retval.__base.ndf.__generate_base.ax = ax; 
125+ //         retval.__base.ndf.__generate_base.ay = ay; 
126+ //         retval.__base.fresnel.eta = eta; 
127+ //         retval.__base.fresnel.etak2 = etak * etak; 
128+ //         retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2; 
129+ //         return retval; 
130+ //     } 
131+ //     static this_t create(NBL_CONST_REF_ARG(creation_type) params) 
132+ //     { 
133+ //         return create(params.ax, params.ay, params.eta, params.etak); 
134+ //     } 
135+ 
136+ //     spectral_type eval(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
137+ //     { 
138+ //         return __base.eval(_sample, interaction, cache); 
139+ //     } 
140+ 
141+ //     sample_type generate(NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, const vector2_type u, NBL_REF_ARG(anisocache_type) cache) 
142+ //     { 
143+ //         return __base.generate(interaction, u, cache); 
144+ //     } 
145+ 
146+ //     scalar_type pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
147+ //     { 
148+ //         return __base.pdf(_sample, interaction, cache); 
149+ //     } 
150+ 
151+ //     quotient_pdf_type quotient_and_pdf(NBL_CONST_REF_ARG(sample_type) _sample, NBL_CONST_REF_ARG(anisotropic_interaction_type) interaction, NBL_CONST_REF_ARG(anisocache_type) cache) 
152+ //     { 
153+ //         return __base.quotient_and_pdf(_sample, interaction, cache); 
154+ //     } 
155+ 
156+ //     SCookTorrance<Config, ndf_type, fresnel_type> __base; 
157+ // }; 
155158
156159}
157160
0 commit comments