Cycles: support loading images from arbitrary OpenColorIO color space
[blender.git] / intern / cycles / kernel / svm / svm_types.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 #ifndef __SVM_TYPES_H__
18 #define __SVM_TYPES_H__
19
20 CCL_NAMESPACE_BEGIN
21
22 /* Stack */
23
24 /* SVM stack has a fixed size */
25 #define SVM_STACK_SIZE 255
26 /* SVM stack offsets with this value indicate that it's not on the stack */
27 #define SVM_STACK_INVALID 255
28
29 #define SVM_BUMP_EVAL_STATE_SIZE 9
30
31 /* Nodes */
32
33 /* Known frequencies of used nodes, used for selective nodes compilation
34  * in the kernel. Currently only affects split OpenCL kernel.
35  *
36  * Keep as defines so it's easy to check which nodes are to be compiled
37  * from preprocessor.
38  *
39  * Lower the number of group more often the node is used.
40  */
41 #define NODE_GROUP_LEVEL_0 0
42 #define NODE_GROUP_LEVEL_1 1
43 #define NODE_GROUP_LEVEL_2 2
44 #define NODE_GROUP_LEVEL_3 3
45 #define NODE_GROUP_LEVEL_MAX NODE_GROUP_LEVEL_3
46
47 #define NODE_FEATURE_VOLUME (1 << 0)
48 #define NODE_FEATURE_HAIR (1 << 1)
49 #define NODE_FEATURE_BUMP (1 << 2)
50 #define NODE_FEATURE_BUMP_STATE (1 << 3)
51 /* TODO(sergey): Consider using something like ((uint)(-1)).
52  * Need to check carefully operand types around usage of this
53  * define first.
54  */
55 #define NODE_FEATURE_ALL \
56   (NODE_FEATURE_VOLUME | NODE_FEATURE_HAIR | NODE_FEATURE_BUMP | NODE_FEATURE_BUMP_STATE)
57
58 typedef enum ShaderNodeType {
59   NODE_END = 0,
60   NODE_CLOSURE_BSDF,
61   NODE_CLOSURE_EMISSION,
62   NODE_CLOSURE_BACKGROUND,
63   NODE_CLOSURE_SET_WEIGHT,
64   NODE_CLOSURE_WEIGHT,
65   NODE_MIX_CLOSURE,
66   NODE_JUMP_IF_ZERO,
67   NODE_JUMP_IF_ONE,
68   NODE_TEX_IMAGE,
69   NODE_TEX_IMAGE_BOX,
70   NODE_TEX_SKY,
71   NODE_GEOMETRY,
72   NODE_GEOMETRY_DUPLI,
73   NODE_LIGHT_PATH,
74   NODE_VALUE_F,
75   NODE_VALUE_V,
76   NODE_MIX,
77   NODE_ATTR,
78   NODE_CONVERT,
79   NODE_FRESNEL,
80   NODE_WIREFRAME,
81   NODE_WAVELENGTH,
82   NODE_BLACKBODY,
83   NODE_EMISSION_WEIGHT,
84   NODE_TEX_GRADIENT,
85   NODE_TEX_VORONOI,
86   NODE_TEX_MUSGRAVE,
87   NODE_TEX_WAVE,
88   NODE_TEX_MAGIC,
89   NODE_TEX_NOISE,
90   NODE_SHADER_JUMP,
91   NODE_SET_DISPLACEMENT,
92   NODE_GEOMETRY_BUMP_DX,
93   NODE_GEOMETRY_BUMP_DY,
94   NODE_SET_BUMP,
95   NODE_MATH,
96   NODE_VECTOR_MATH,
97   NODE_VECTOR_TRANSFORM,
98   NODE_MAPPING,
99   NODE_TEX_COORD,
100   NODE_TEX_COORD_BUMP_DX,
101   NODE_TEX_COORD_BUMP_DY,
102   NODE_ATTR_BUMP_DX,
103   NODE_ATTR_BUMP_DY,
104   NODE_TEX_ENVIRONMENT,
105   NODE_CLOSURE_HOLDOUT,
106   NODE_LAYER_WEIGHT,
107   NODE_CLOSURE_VOLUME,
108   NODE_SEPARATE_VECTOR,
109   NODE_COMBINE_VECTOR,
110   NODE_SEPARATE_HSV,
111   NODE_COMBINE_HSV,
112   NODE_HSV,
113   NODE_CAMERA,
114   NODE_INVERT,
115   NODE_NORMAL,
116   NODE_GAMMA,
117   NODE_TEX_CHECKER,
118   NODE_BRIGHTCONTRAST,
119   NODE_RGB_RAMP,
120   NODE_RGB_CURVES,
121   NODE_VECTOR_CURVES,
122   NODE_MIN_MAX,
123   NODE_LIGHT_FALLOFF,
124   NODE_OBJECT_INFO,
125   NODE_PARTICLE_INFO,
126   NODE_TEX_BRICK,
127   NODE_CLOSURE_SET_NORMAL,
128   NODE_AMBIENT_OCCLUSION,
129   NODE_TANGENT,
130   NODE_NORMAL_MAP,
131   NODE_HAIR_INFO,
132   NODE_UVMAP,
133   NODE_TEX_VOXEL,
134   NODE_ENTER_BUMP_EVAL,
135   NODE_LEAVE_BUMP_EVAL,
136   NODE_BEVEL,
137   NODE_DISPLACEMENT,
138   NODE_VECTOR_DISPLACEMENT,
139   NODE_PRINCIPLED_VOLUME,
140   NODE_IES,
141 } ShaderNodeType;
142
143 typedef enum NodeAttributeType {
144   NODE_ATTR_FLOAT = 0,
145   NODE_ATTR_FLOAT2,
146   NODE_ATTR_FLOAT3,
147   NODE_ATTR_MATRIX
148 } NodeAttributeType;
149
150 typedef enum NodeGeometry {
151   NODE_GEOM_P = 0,
152   NODE_GEOM_N,
153   NODE_GEOM_T,
154   NODE_GEOM_I,
155   NODE_GEOM_Ng,
156   NODE_GEOM_uv
157 } NodeGeometry;
158
159 typedef enum NodeObjectInfo {
160   NODE_INFO_OB_LOCATION,
161   NODE_INFO_OB_INDEX,
162   NODE_INFO_MAT_INDEX,
163   NODE_INFO_OB_RANDOM
164 } NodeObjectInfo;
165
166 typedef enum NodeParticleInfo {
167   NODE_INFO_PAR_INDEX,
168   NODE_INFO_PAR_RANDOM,
169   NODE_INFO_PAR_AGE,
170   NODE_INFO_PAR_LIFETIME,
171   NODE_INFO_PAR_LOCATION,
172   NODE_INFO_PAR_ROTATION,
173   NODE_INFO_PAR_SIZE,
174   NODE_INFO_PAR_VELOCITY,
175   NODE_INFO_PAR_ANGULAR_VELOCITY
176 } NodeParticleInfo;
177
178 typedef enum NodeHairInfo {
179   NODE_INFO_CURVE_IS_STRAND,
180   NODE_INFO_CURVE_INTERCEPT,
181   NODE_INFO_CURVE_THICKNESS,
182   /*fade for minimum hair width transpency*/
183   /*NODE_INFO_CURVE_FADE,*/
184   NODE_INFO_CURVE_TANGENT_NORMAL,
185   NODE_INFO_CURVE_RANDOM,
186 } NodeHairInfo;
187
188 typedef enum NodeLightPath {
189   NODE_LP_camera = 0,
190   NODE_LP_shadow,
191   NODE_LP_diffuse,
192   NODE_LP_glossy,
193   NODE_LP_singular,
194   NODE_LP_reflection,
195   NODE_LP_transmission,
196   NODE_LP_volume_scatter,
197   NODE_LP_backfacing,
198   NODE_LP_ray_length,
199   NODE_LP_ray_depth,
200   NODE_LP_ray_diffuse,
201   NODE_LP_ray_glossy,
202   NODE_LP_ray_transparent,
203   NODE_LP_ray_transmission,
204 } NodeLightPath;
205
206 typedef enum NodeLightFalloff {
207   NODE_LIGHT_FALLOFF_QUADRATIC,
208   NODE_LIGHT_FALLOFF_LINEAR,
209   NODE_LIGHT_FALLOFF_CONSTANT
210 } NodeLightFalloff;
211
212 typedef enum NodeTexCoord {
213   NODE_TEXCO_NORMAL,
214   NODE_TEXCO_OBJECT,
215   NODE_TEXCO_CAMERA,
216   NODE_TEXCO_WINDOW,
217   NODE_TEXCO_REFLECTION,
218   NODE_TEXCO_DUPLI_GENERATED,
219   NODE_TEXCO_DUPLI_UV,
220   NODE_TEXCO_VOLUME_GENERATED
221 } NodeTexCoord;
222
223 typedef enum NodeMix {
224   NODE_MIX_BLEND = 0,
225   NODE_MIX_ADD,
226   NODE_MIX_MUL,
227   NODE_MIX_SUB,
228   NODE_MIX_SCREEN,
229   NODE_MIX_DIV,
230   NODE_MIX_DIFF,
231   NODE_MIX_DARK,
232   NODE_MIX_LIGHT,
233   NODE_MIX_OVERLAY,
234   NODE_MIX_DODGE,
235   NODE_MIX_BURN,
236   NODE_MIX_HUE,
237   NODE_MIX_SAT,
238   NODE_MIX_VAL,
239   NODE_MIX_COLOR,
240   NODE_MIX_SOFT,
241   NODE_MIX_LINEAR,
242   NODE_MIX_CLAMP /* used for the clamp UI option */
243 } NodeMix;
244
245 typedef enum NodeMath {
246   NODE_MATH_ADD,
247   NODE_MATH_SUBTRACT,
248   NODE_MATH_MULTIPLY,
249   NODE_MATH_DIVIDE,
250   NODE_MATH_SINE,
251   NODE_MATH_COSINE,
252   NODE_MATH_TANGENT,
253   NODE_MATH_ARCSINE,
254   NODE_MATH_ARCCOSINE,
255   NODE_MATH_ARCTANGENT,
256   NODE_MATH_POWER,
257   NODE_MATH_LOGARITHM,
258   NODE_MATH_MINIMUM,
259   NODE_MATH_MAXIMUM,
260   NODE_MATH_ROUND,
261   NODE_MATH_LESS_THAN,
262   NODE_MATH_GREATER_THAN,
263   NODE_MATH_MODULO,
264   NODE_MATH_ABSOLUTE,
265   NODE_MATH_ARCTAN2,
266   NODE_MATH_FLOOR,
267   NODE_MATH_CEIL,
268   NODE_MATH_FRACT,
269   NODE_MATH_SQRT,
270   NODE_MATH_CLAMP /* used for the clamp UI option */
271 } NodeMath;
272
273 typedef enum NodeVectorMath {
274   NODE_VECTOR_MATH_ADD,
275   NODE_VECTOR_MATH_SUBTRACT,
276   NODE_VECTOR_MATH_AVERAGE,
277   NODE_VECTOR_MATH_DOT_PRODUCT,
278   NODE_VECTOR_MATH_CROSS_PRODUCT,
279   NODE_VECTOR_MATH_NORMALIZE
280 } NodeVectorMath;
281
282 typedef enum NodeVectorTransformType {
283   NODE_VECTOR_TRANSFORM_TYPE_VECTOR,
284   NODE_VECTOR_TRANSFORM_TYPE_POINT,
285   NODE_VECTOR_TRANSFORM_TYPE_NORMAL
286 } NodeVectorTransformType;
287
288 typedef enum NodeVectorTransformConvertSpace {
289   NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD,
290   NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT,
291   NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA
292 } NodeVectorTransformConvertSpace;
293
294 typedef enum NodeConvert {
295   NODE_CONVERT_FV,
296   NODE_CONVERT_FI,
297   NODE_CONVERT_CF,
298   NODE_CONVERT_CI,
299   NODE_CONVERT_VF,
300   NODE_CONVERT_VI,
301   NODE_CONVERT_IF,
302   NODE_CONVERT_IV
303 } NodeConvert;
304
305 typedef enum NodeMusgraveType {
306   NODE_MUSGRAVE_MULTIFRACTAL,
307   NODE_MUSGRAVE_FBM,
308   NODE_MUSGRAVE_HYBRID_MULTIFRACTAL,
309   NODE_MUSGRAVE_RIDGED_MULTIFRACTAL,
310   NODE_MUSGRAVE_HETERO_TERRAIN
311 } NodeMusgraveType;
312
313 typedef enum NodeWaveType { NODE_WAVE_BANDS, NODE_WAVE_RINGS } NodeWaveType;
314
315 typedef enum NodeWaveProfiles {
316   NODE_WAVE_PROFILE_SIN,
317   NODE_WAVE_PROFILE_SAW,
318 } NodeWaveProfile;
319
320 typedef enum NodeSkyType { NODE_SKY_OLD, NODE_SKY_NEW } NodeSkyType;
321
322 typedef enum NodeGradientType {
323   NODE_BLEND_LINEAR,
324   NODE_BLEND_QUADRATIC,
325   NODE_BLEND_EASING,
326   NODE_BLEND_DIAGONAL,
327   NODE_BLEND_RADIAL,
328   NODE_BLEND_QUADRATIC_SPHERE,
329   NODE_BLEND_SPHERICAL
330 } NodeGradientType;
331
332 typedef enum NodeVoronoiColoring {
333   NODE_VORONOI_INTENSITY,
334   NODE_VORONOI_CELLS
335 } NodeVoronoiColoring;
336
337 typedef enum NodeVoronoiDistanceMetric {
338   NODE_VORONOI_DISTANCE,
339   NODE_VORONOI_MANHATTAN,
340   NODE_VORONOI_CHEBYCHEV,
341   NODE_VORONOI_MINKOWSKI
342 } NodeVoronoiDistanceMetric;
343
344 typedef enum NodeVoronoiFeature {
345   NODE_VORONOI_F1,
346   NODE_VORONOI_F2,
347   NODE_VORONOI_F3,
348   NODE_VORONOI_F4,
349   NODE_VORONOI_F2F1
350 } NodeVoronoiFeature;
351
352 typedef enum NodeBlendWeightType {
353   NODE_LAYER_WEIGHT_FRESNEL,
354   NODE_LAYER_WEIGHT_FACING
355 } NodeBlendWeightType;
356
357 typedef enum NodeTangentDirectionType {
358   NODE_TANGENT_RADIAL,
359   NODE_TANGENT_UVMAP
360 } NodeTangentDirectionType;
361
362 typedef enum NodeTangentAxis {
363   NODE_TANGENT_AXIS_X,
364   NODE_TANGENT_AXIS_Y,
365   NODE_TANGENT_AXIS_Z
366 } NodeTangentAxis;
367
368 typedef enum NodeNormalMapSpace {
369   NODE_NORMAL_MAP_TANGENT,
370   NODE_NORMAL_MAP_OBJECT,
371   NODE_NORMAL_MAP_WORLD,
372   NODE_NORMAL_MAP_BLENDER_OBJECT,
373   NODE_NORMAL_MAP_BLENDER_WORLD,
374 } NodeNormalMapSpace;
375
376 typedef enum NodeImageProjection {
377   NODE_IMAGE_PROJ_FLAT = 0,
378   NODE_IMAGE_PROJ_BOX = 1,
379   NODE_IMAGE_PROJ_SPHERE = 2,
380   NODE_IMAGE_PROJ_TUBE = 3,
381 } NodeImageProjection;
382
383 typedef enum NodeEnvironmentProjection {
384   NODE_ENVIRONMENT_EQUIRECTANGULAR = 0,
385   NODE_ENVIRONMENT_MIRROR_BALL = 1,
386 } NodeEnvironmentProjection;
387
388 typedef enum NodeBumpOffset {
389   NODE_BUMP_OFFSET_CENTER,
390   NODE_BUMP_OFFSET_DX,
391   NODE_BUMP_OFFSET_DY,
392 } NodeBumpOffset;
393
394 typedef enum NodeTexVoxelSpace {
395   NODE_TEX_VOXEL_SPACE_OBJECT = 0,
396   NODE_TEX_VOXEL_SPACE_WORLD = 1,
397 } NodeTexVoxelSpace;
398
399 typedef enum NodeAO {
400   NODE_AO_ONLY_LOCAL = (1 << 0),
401   NODE_AO_INSIDE = (1 << 1),
402   NODE_AO_GLOBAL_RADIUS = (1 << 2),
403 } NodeAO;
404
405 typedef enum ShaderType {
406   SHADER_TYPE_SURFACE,
407   SHADER_TYPE_VOLUME,
408   SHADER_TYPE_DISPLACEMENT,
409   SHADER_TYPE_BUMP,
410 } ShaderType;
411
412 typedef enum NodePrincipledHairParametrization {
413   NODE_PRINCIPLED_HAIR_REFLECTANCE = 0,
414   NODE_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION = 1,
415   NODE_PRINCIPLED_HAIR_DIRECT_ABSORPTION = 2,
416   NODE_PRINCIPLED_HAIR_NUM,
417 } NodePrincipledHairParametrization;
418
419 /* Closure */
420
421 typedef enum ClosureType {
422   /* Special type, flags generic node as a non-BSDF. */
423   CLOSURE_NONE_ID,
424
425   CLOSURE_BSDF_ID,
426
427   /* Diffuse */
428   CLOSURE_BSDF_DIFFUSE_ID,
429   CLOSURE_BSDF_OREN_NAYAR_ID,
430   CLOSURE_BSDF_DIFFUSE_RAMP_ID,
431   CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID,
432   CLOSURE_BSDF_PRINCIPLED_SHEEN_ID,
433   CLOSURE_BSDF_DIFFUSE_TOON_ID,
434
435   /* Glossy */
436   CLOSURE_BSDF_REFLECTION_ID,
437   CLOSURE_BSDF_MICROFACET_GGX_ID,
438   CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID,
439   CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID,
440   CLOSURE_BSDF_MICROFACET_BECKMANN_ID,
441   CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID,
442   CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID,
443   CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID,
444   CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID,
445   CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID,
446   CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID,
447   CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_FRESNEL_ID,
448   CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID,
449   CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID,
450   CLOSURE_BSDF_ASHIKHMIN_VELVET_ID,
451   CLOSURE_BSDF_PHONG_RAMP_ID,
452   CLOSURE_BSDF_GLOSSY_TOON_ID,
453   CLOSURE_BSDF_HAIR_REFLECTION_ID,
454
455   /* Transmission */
456   CLOSURE_BSDF_TRANSLUCENT_ID,
457   CLOSURE_BSDF_REFRACTION_ID,
458   CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID,
459   CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID,
460   CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID,
461   CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID,
462   CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID,
463   CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID,
464   CLOSURE_BSDF_SHARP_GLASS_ID,
465   CLOSURE_BSDF_HAIR_PRINCIPLED_ID,
466   CLOSURE_BSDF_HAIR_TRANSMISSION_ID,
467
468   /* Special cases */
469   CLOSURE_BSDF_BSSRDF_ID,
470   CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID,
471   CLOSURE_BSDF_TRANSPARENT_ID,
472
473   /* BSSRDF */
474   CLOSURE_BSSRDF_CUBIC_ID,
475   CLOSURE_BSSRDF_GAUSSIAN_ID,
476   CLOSURE_BSSRDF_PRINCIPLED_ID,
477   CLOSURE_BSSRDF_BURLEY_ID,
478   CLOSURE_BSSRDF_RANDOM_WALK_ID,
479   CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID,
480
481   /* Other */
482   CLOSURE_HOLDOUT_ID,
483
484   /* Volume */
485   CLOSURE_VOLUME_ID,
486   CLOSURE_VOLUME_ABSORPTION_ID,
487   CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID,
488
489   CLOSURE_BSDF_PRINCIPLED_ID,
490
491   NBUILTIN_CLOSURES
492 } ClosureType;
493
494 /* watch this, being lazy with memory usage */
495 #define CLOSURE_IS_BSDF(type) (type <= CLOSURE_BSDF_TRANSPARENT_ID)
496 #define CLOSURE_IS_BSDF_DIFFUSE(type) \
497   (type >= CLOSURE_BSDF_DIFFUSE_ID && type <= CLOSURE_BSDF_DIFFUSE_TOON_ID)
498 #define CLOSURE_IS_BSDF_GLOSSY(type) \
499   ((type >= CLOSURE_BSDF_REFLECTION_ID && type <= CLOSURE_BSDF_HAIR_REFLECTION_ID) || \
500    (type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID))
501 #define CLOSURE_IS_BSDF_TRANSMISSION(type) \
502   (type >= CLOSURE_BSDF_TRANSLUCENT_ID && type <= CLOSURE_BSDF_HAIR_TRANSMISSION_ID)
503 #define CLOSURE_IS_BSDF_BSSRDF(type) \
504   (type == CLOSURE_BSDF_BSSRDF_ID || type == CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID)
505 #define CLOSURE_IS_BSDF_SINGULAR(type) \
506   (type == CLOSURE_BSDF_REFLECTION_ID || type == CLOSURE_BSDF_REFRACTION_ID || \
507    type == CLOSURE_BSDF_TRANSPARENT_ID)
508 #define CLOSURE_IS_BSDF_TRANSPARENT(type) (type == CLOSURE_BSDF_TRANSPARENT_ID)
509 #define CLOSURE_IS_BSDF_MULTISCATTER(type) \
510   (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID || \
511    type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID || \
512    type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID)
513 #define CLOSURE_IS_BSDF_MICROFACET(type) \
514   ((type >= CLOSURE_BSDF_MICROFACET_GGX_ID && type <= CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID) || \
515    (type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && \
516     type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) || \
517    (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID))
518 #define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
519 #define CLOSURE_IS_BSSRDF(type) \
520   (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
521 #define CLOSURE_IS_DISK_BSSRDF(type) \
522   (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_BURLEY_ID)
523 #define CLOSURE_IS_VOLUME(type) \
524   (type >= CLOSURE_VOLUME_ID && type <= CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID)
525 #define CLOSURE_IS_VOLUME_SCATTER(type) (type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID)
526 #define CLOSURE_IS_VOLUME_ABSORPTION(type) (type == CLOSURE_VOLUME_ABSORPTION_ID)
527 #define CLOSURE_IS_HOLDOUT(type) (type == CLOSURE_HOLDOUT_ID)
528 #define CLOSURE_IS_PHASE(type) (type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID)
529 #define CLOSURE_IS_GLASS(type) \
530   (type >= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID && type <= CLOSURE_BSDF_SHARP_GLASS_ID)
531 #define CLOSURE_IS_PRINCIPLED(type) (type == CLOSURE_BSDF_PRINCIPLED_ID)
532
533 #define CLOSURE_WEIGHT_CUTOFF 1e-5f
534
535 CCL_NAMESPACE_END
536
537 #endif /*  __SVM_TYPES_H__ */