Fix Cycles CUDA performance on CUDA 8.0.
[blender-staging.git] / intern / cycles / kernel / closure / bsdf.h
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "../closure/bsdf_ashikhmin_velvet.h"
18 #include "../closure/bsdf_diffuse.h"
19 #include "../closure/bsdf_oren_nayar.h"
20 #include "../closure/bsdf_phong_ramp.h"
21 #include "../closure/bsdf_diffuse_ramp.h"
22 #include "../closure/bsdf_microfacet.h"
23 #include "../closure/bsdf_microfacet_multi.h"
24 #include "../closure/bsdf_reflection.h"
25 #include "../closure/bsdf_refraction.h"
26 #include "../closure/bsdf_transparent.h"
27 #include "../closure/bsdf_ashikhmin_shirley.h"
28 #include "../closure/bsdf_toon.h"
29 #include "../closure/bsdf_hair.h"
30 #ifdef __SUBSURFACE__
31 #  include "../closure/bssrdf.h"
32 #endif
33 #ifdef __VOLUME__
34 #  include "../closure/volume.h"
35 #endif
36
37 CCL_NAMESPACE_BEGIN
38
39 ccl_device_forceinline int bsdf_sample(KernelGlobals *kg,
40                                   ShaderData *sd,
41                                   const ShaderClosure *sc,
42                                   float randu,
43                                   float randv,
44                                   float3 *eval,
45                                   float3 *omega_in,
46                                   differential3 *domega_in,
47                                   float *pdf)
48 {
49         int label;
50
51         switch(sc->type) {
52                 case CLOSURE_BSDF_DIFFUSE_ID:
53                 case CLOSURE_BSDF_BSSRDF_ID:
54                         label = bsdf_diffuse_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
55                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
56                         break;
57 #ifdef __SVM__
58                 case CLOSURE_BSDF_OREN_NAYAR_ID:
59                         label = bsdf_oren_nayar_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
60                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
61                         break;
62 #ifdef __OSL__
63                 case CLOSURE_BSDF_PHONG_RAMP_ID:
64                         label = bsdf_phong_ramp_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
65                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
66                         break;
67                 case CLOSURE_BSDF_DIFFUSE_RAMP_ID:
68                         label = bsdf_diffuse_ramp_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
69                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
70                         break;
71 #endif
72                 case CLOSURE_BSDF_TRANSLUCENT_ID:
73                         label = bsdf_translucent_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
74                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
75                         break;
76                 case CLOSURE_BSDF_REFLECTION_ID:
77                         label = bsdf_reflection_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
78                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
79                         break;
80                 case CLOSURE_BSDF_REFRACTION_ID:
81                         label = bsdf_refraction_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
82                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
83                         break;
84                 case CLOSURE_BSDF_TRANSPARENT_ID:
85                         label = bsdf_transparent_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
86                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
87                         break;
88                 case CLOSURE_BSDF_MICROFACET_GGX_ID:
89                 case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
90                 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
91                         label = bsdf_microfacet_ggx_sample(kg, sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
92                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
93                         break;
94                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
95                         label = bsdf_microfacet_multi_ggx_sample(kg, sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
96                                 eval, omega_in,  &domega_in->dx, &domega_in->dy, pdf, &ccl_fetch(sd, lcg_state));
97                         break;
98                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
99                         label = bsdf_microfacet_multi_ggx_glass_sample(kg, sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
100                                 eval, omega_in,  &domega_in->dx, &domega_in->dy, pdf, &ccl_fetch(sd, lcg_state));
101                         break;
102                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
103                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
104                 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
105                         label = bsdf_microfacet_beckmann_sample(kg, sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
106                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
107                         break;
108                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
109                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
110                         label = bsdf_ashikhmin_shirley_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
111                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
112                         break;
113                 case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
114                         label = bsdf_ashikhmin_velvet_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
115                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
116                         break;
117                 case CLOSURE_BSDF_DIFFUSE_TOON_ID:
118                         label = bsdf_diffuse_toon_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
119                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
120                         break;
121                 case CLOSURE_BSDF_GLOSSY_TOON_ID:
122                         label = bsdf_glossy_toon_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
123                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
124                         break;
125                 case CLOSURE_BSDF_HAIR_REFLECTION_ID:
126                         label = bsdf_hair_reflection_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
127                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
128                         break;
129                 case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
130                         label = bsdf_hair_transmission_sample(sc, ccl_fetch(sd, Ng), ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv,
131                                 eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
132                         break;
133 #endif
134 #ifdef __VOLUME__
135                 case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID:
136                         label = volume_henyey_greenstein_sample(sc, ccl_fetch(sd, I), ccl_fetch(sd, dI).dx, ccl_fetch(sd, dI).dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
137                         break;
138 #endif
139                 default:
140                         label = LABEL_NONE;
141                         break;
142         }
143
144         return label;
145 }
146
147 #ifndef __KERNEL_CUDA__
148 ccl_device
149 #else
150 ccl_device_forceinline
151 #endif
152 float3 bsdf_eval(KernelGlobals *kg,
153                  ShaderData *sd,
154                  const ShaderClosure *sc,
155                  const float3 omega_in,
156                  float *pdf)
157 {
158         float3 eval;
159
160         if(dot(ccl_fetch(sd, Ng), omega_in) >= 0.0f) {
161                 switch(sc->type) {
162                         case CLOSURE_BSDF_DIFFUSE_ID:
163                         case CLOSURE_BSDF_BSSRDF_ID:
164                                 eval = bsdf_diffuse_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
165                                 break;
166 #ifdef __SVM__
167                         case CLOSURE_BSDF_OREN_NAYAR_ID:
168                                 eval = bsdf_oren_nayar_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
169                                 break;
170 #ifdef __OSL__
171                         case CLOSURE_BSDF_PHONG_RAMP_ID:
172                                 eval = bsdf_phong_ramp_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
173                                 break;
174                         case CLOSURE_BSDF_DIFFUSE_RAMP_ID:
175                                 eval = bsdf_diffuse_ramp_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
176                                 break;
177 #endif
178                         case CLOSURE_BSDF_TRANSLUCENT_ID:
179                                 eval = bsdf_translucent_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
180                                 break;
181                         case CLOSURE_BSDF_REFLECTION_ID:
182                                 eval = bsdf_reflection_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
183                                 break;
184                         case CLOSURE_BSDF_REFRACTION_ID:
185                                 eval = bsdf_refraction_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
186                                 break;
187                         case CLOSURE_BSDF_TRANSPARENT_ID:
188                                 eval = bsdf_transparent_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
189                                 break;
190                         case CLOSURE_BSDF_MICROFACET_GGX_ID:
191                         case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
192                         case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
193                                 eval = bsdf_microfacet_ggx_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
194                                 break;
195                         case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
196                                 eval = bsdf_microfacet_multi_ggx_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf, &ccl_fetch(sd, lcg_state));
197                                 break;
198                         case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
199                                 eval = bsdf_microfacet_multi_ggx_glass_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf, &ccl_fetch(sd, lcg_state));
200                                 break;
201                         case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
202                         case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
203                         case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
204                                 eval = bsdf_microfacet_beckmann_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
205                                 break;
206                         case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
207                         case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
208                                 eval = bsdf_ashikhmin_shirley_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
209                                 break;
210                         case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
211                                 eval = bsdf_ashikhmin_velvet_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
212                                 break;
213                         case CLOSURE_BSDF_DIFFUSE_TOON_ID:
214                                 eval = bsdf_diffuse_toon_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
215                                 break;
216                         case CLOSURE_BSDF_GLOSSY_TOON_ID:
217                                 eval = bsdf_glossy_toon_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
218                                 break;
219                         case CLOSURE_BSDF_HAIR_REFLECTION_ID:
220                                 eval = bsdf_hair_reflection_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
221                                 break;
222                         case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
223                                 eval = bsdf_hair_transmission_eval_reflect(sc, ccl_fetch(sd, I), omega_in, pdf);
224                                 break;
225 #endif
226 #ifdef __VOLUME__
227                         case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID:
228                                 eval = volume_henyey_greenstein_eval_phase(sc, ccl_fetch(sd, I), omega_in, pdf);
229                                 break;
230 #endif
231                         default:
232                                 eval = make_float3(0.0f, 0.0f, 0.0f);
233                                 break;
234                 }
235         }
236         else {
237                 switch(sc->type) {
238                         case CLOSURE_BSDF_DIFFUSE_ID:
239                         case CLOSURE_BSDF_BSSRDF_ID:
240                                 eval = bsdf_diffuse_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
241                                 break;
242 #ifdef __SVM__
243                         case CLOSURE_BSDF_OREN_NAYAR_ID:
244                                 eval = bsdf_oren_nayar_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
245                                 break;
246                         case CLOSURE_BSDF_TRANSLUCENT_ID:
247                                 eval = bsdf_translucent_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
248                                 break;
249                         case CLOSURE_BSDF_REFLECTION_ID:
250                                 eval = bsdf_reflection_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
251                                 break;
252                         case CLOSURE_BSDF_REFRACTION_ID:
253                                 eval = bsdf_refraction_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
254                                 break;
255                         case CLOSURE_BSDF_TRANSPARENT_ID:
256                                 eval = bsdf_transparent_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
257                                 break;
258                         case CLOSURE_BSDF_MICROFACET_GGX_ID:
259                         case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
260                         case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
261                                 eval = bsdf_microfacet_ggx_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
262                                 break;
263                         case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
264                                 eval = bsdf_microfacet_multi_ggx_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf, &ccl_fetch(sd, lcg_state));
265                                 break;
266                         case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
267                                 eval = bsdf_microfacet_multi_ggx_glass_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf, &ccl_fetch(sd, lcg_state));
268                                 break;
269                         case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
270                         case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
271                         case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
272                                 eval = bsdf_microfacet_beckmann_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
273                                 break;
274                         case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
275                         case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
276                                 eval = bsdf_ashikhmin_shirley_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
277                                 break;
278                         case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
279                                 eval = bsdf_ashikhmin_velvet_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
280                                 break;
281                         case CLOSURE_BSDF_DIFFUSE_TOON_ID:
282                                 eval = bsdf_diffuse_toon_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
283                                 break;
284                         case CLOSURE_BSDF_GLOSSY_TOON_ID:
285                                 eval = bsdf_glossy_toon_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
286                                 break;
287                         case CLOSURE_BSDF_HAIR_REFLECTION_ID:
288                                 eval = bsdf_hair_reflection_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
289                                 break;
290                         case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
291                                 eval = bsdf_hair_transmission_eval_transmit(sc, ccl_fetch(sd, I), omega_in, pdf);
292                                 break;
293 #endif
294 #ifdef __VOLUME__
295                         case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID:
296                                 eval = volume_henyey_greenstein_eval_phase(sc, ccl_fetch(sd, I), omega_in, pdf);
297                                 break;
298 #endif
299                         default:
300                                 eval = make_float3(0.0f, 0.0f, 0.0f);
301                                 break;
302                 }
303         }
304
305         return eval;
306 }
307
308 ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
309 {
310         /* ToDo: do we want to blur volume closures? */
311 #ifdef __SVM__
312         switch(sc->type) {
313                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
314                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
315                         bsdf_microfacet_multi_ggx_blur(sc, roughness);
316                         break;
317                 case CLOSURE_BSDF_MICROFACET_GGX_ID:
318                 case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
319                 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
320                         bsdf_microfacet_ggx_blur(sc, roughness);
321                         break;
322                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
323                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
324                 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
325                         bsdf_microfacet_beckmann_blur(sc, roughness);
326                         break;
327                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
328                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
329                         bsdf_ashikhmin_shirley_blur(sc, roughness);
330                         break;
331                 default:
332                         break;
333         }
334 #endif
335 }
336
337 ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b)
338 {
339 #ifdef __SVM__
340         switch(a->type) {
341                 case CLOSURE_BSDF_TRANSPARENT_ID:
342                         return true;
343                 case CLOSURE_BSDF_DIFFUSE_ID:
344                 case CLOSURE_BSDF_BSSRDF_ID:
345                 case CLOSURE_BSDF_TRANSLUCENT_ID:
346                         return bsdf_diffuse_merge(a, b);
347                 case CLOSURE_BSDF_OREN_NAYAR_ID:
348                         return bsdf_oren_nayar_merge(a, b);
349                 case CLOSURE_BSDF_REFLECTION_ID:
350                 case CLOSURE_BSDF_REFRACTION_ID:
351                 case CLOSURE_BSDF_MICROFACET_GGX_ID:
352                 case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
353                 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
354                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
355                 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
356                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
357                 case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
358                 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
359                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
360                 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
361                         return bsdf_microfacet_merge(a, b);
362                 case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
363                         return bsdf_ashikhmin_velvet_merge(a, b);
364                 case CLOSURE_BSDF_DIFFUSE_TOON_ID:
365                 case CLOSURE_BSDF_GLOSSY_TOON_ID:
366                         return bsdf_toon_merge(a, b);
367                 case CLOSURE_BSDF_HAIR_REFLECTION_ID:
368                 case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
369                         return bsdf_hair_merge(a, b);
370 #ifdef __VOLUME__
371                 case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID:
372                         return volume_henyey_greenstein_merge(a, b);
373 #endif
374                 default:
375                         return false;
376         }
377 #else
378         return false;
379 #endif
380 }
381
382 CCL_NAMESPACE_END
383