Clip editor: remove Z-key shortcut for curve view. It doesn't make many sense anymore.
[blender.git] / intern / cycles / kernel / svm / svm_types.h
1 /*
2  * Copyright 2011, Blender Foundation.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18
19 #ifndef __SVM_TYPES_H__
20 #define __SVM_TYPES_H__
21
22 CCL_NAMESPACE_BEGIN
23
24 /* Stack */
25
26 /* SVM stack has a fixed size */
27 #define SVM_STACK_SIZE 255
28 /* SVM stack offsets with this value indicate that it's not on the stack */
29 #define SVM_STACK_INVALID 255 
30
31 /* Nodes */
32
33 /* note that we do not simply use 0, 1, 2, .. as values for these. this works
34  * around an obscure CUDA bug that happens when compiling for fermi. why it
35  * happens i have no idea, but consecutive values are problematic, maybe it
36  * generates an incorrect jump table. */
37
38 typedef enum NodeType {
39         NODE_END = 0,
40         NODE_CLOSURE_BSDF = 100,
41         NODE_CLOSURE_EMISSION = 200,
42         NODE_CLOSURE_BACKGROUND = 300,
43         NODE_CLOSURE_SET_WEIGHT = 400,
44         NODE_CLOSURE_WEIGHT = 500,
45         NODE_MIX_CLOSURE = 600,
46         NODE_JUMP = 700,
47         NODE_TEX_IMAGE = 1000,
48         NODE_TEX_SKY = 1100,
49         NODE_GEOMETRY = 1200,
50         NODE_LIGHT_PATH = 1300,
51         NODE_VALUE_F = 1400,
52         NODE_VALUE_V = 1500,
53         NODE_MIX = 1600,
54         NODE_ATTR = 1700,
55         NODE_CONVERT = 1900,
56         NODE_FRESNEL = 2000,
57         NODE_EMISSION_WEIGHT = 2100,
58         NODE_TEX_GRADIENT = 2200,
59         NODE_TEX_VORONOI = 2300,
60         NODE_TEX_MUSGRAVE = 2400,
61         NODE_TEX_WAVE = 2500,
62         NODE_TEX_MAGIC = 2600,
63         NODE_TEX_NOISE = 3000,
64         NODE_SHADER_JUMP = 3100,
65         NODE_SET_DISPLACEMENT = 3200,
66         NODE_GEOMETRY_BUMP_DX = 3300,
67         NODE_GEOMETRY_BUMP_DY = 3400,
68         NODE_SET_BUMP = 3500,
69         NODE_MATH = 3600,
70         NODE_VECTOR_MATH = 3700,
71         NODE_MAPPING = 3800,
72         NODE_TEX_COORD = 3900,
73         NODE_TEX_COORD_BUMP_DX = 4000,
74         NODE_TEX_COORD_BUMP_DY = 4100,
75         NODE_ADD_CLOSURE = 4200,
76         NODE_EMISSION_SET_WEIGHT_TOTAL = 4300,
77         NODE_ATTR_BUMP_DX = 4400,
78         NODE_ATTR_BUMP_DY = 4500,
79         NODE_TEX_ENVIRONMENT = 4600,
80         NODE_CLOSURE_HOLDOUT = 4700,
81         NODE_LAYER_WEIGHT = 4800,
82         NODE_CLOSURE_VOLUME = 4900,
83         NODE_SEPARATE_RGB = 5000,
84         NODE_COMBINE_RGB = 5100,
85         NODE_HSV = 5200,
86         NODE_CAMERA = 5300,
87         NODE_INVERT = 5400,
88         NODE_NORMAL = 5500,
89         NODE_GAMMA = 5600,
90         NODE_TEX_CHECKER = 5700,
91         NODE_BRIGHTCONTRAST = 5800,
92         NODE_RGB_RAMP = 5900,
93         NODE_RGB_CURVES = 6000
94 } NodeType;
95
96 typedef enum NodeAttributeType {
97         NODE_ATTR_FLOAT = 0,
98         NODE_ATTR_FLOAT3
99 } NodeAttributeType;
100
101 typedef enum NodeGeometry {
102         NODE_GEOM_P = 0,
103         NODE_GEOM_N,
104         NODE_GEOM_T,
105         NODE_GEOM_I,
106         NODE_GEOM_Ng,
107         NODE_GEOM_uv
108 } NodeGeometry;
109
110 typedef enum NodeLightPath {
111         NODE_LP_camera = 0,
112         NODE_LP_shadow,
113         NODE_LP_diffuse,
114         NODE_LP_glossy,
115         NODE_LP_singular,
116         NODE_LP_reflection,
117         NODE_LP_transmission,
118         NODE_LP_backfacing
119 } NodeLightPath;
120
121 typedef enum NodeTexCoord {
122         NODE_TEXCO_NORMAL,
123         NODE_TEXCO_OBJECT,
124         NODE_TEXCO_CAMERA,
125         NODE_TEXCO_WINDOW,
126         NODE_TEXCO_REFLECTION
127 } NodeTexCoord;
128
129 typedef enum NodeMix {
130         NODE_MIX_BLEND = 0,
131         NODE_MIX_ADD,
132         NODE_MIX_MUL,
133         NODE_MIX_SUB,
134         NODE_MIX_SCREEN,
135         NODE_MIX_DIV,
136         NODE_MIX_DIFF,
137         NODE_MIX_DARK,
138         NODE_MIX_LIGHT,
139         NODE_MIX_OVERLAY,
140         NODE_MIX_DODGE,
141         NODE_MIX_BURN,
142         NODE_MIX_HUE,
143         NODE_MIX_SAT,
144         NODE_MIX_VAL,
145         NODE_MIX_COLOR,
146         NODE_MIX_SOFT,
147         NODE_MIX_LINEAR
148 } NodeMix;
149
150 typedef enum NodeMath {
151         NODE_MATH_ADD,
152         NODE_MATH_SUBTRACT,
153         NODE_MATH_MULTIPLY,
154         NODE_MATH_DIVIDE,
155         NODE_MATH_SINE,
156         NODE_MATH_COSINE,
157         NODE_MATH_TANGENT,
158         NODE_MATH_ARCSINE,
159         NODE_MATH_ARCCOSINE,
160         NODE_MATH_ARCTANGENT,
161         NODE_MATH_POWER,
162         NODE_MATH_LOGARITHM,
163         NODE_MATH_MINIMUM,
164         NODE_MATH_MAXIMUM,
165         NODE_MATH_ROUND,
166         NODE_MATH_LESS_THAN,
167         NODE_MATH_GREATER_THAN
168 } NodeMath;
169
170 typedef enum NodeVectorMath {
171         NODE_VECTOR_MATH_ADD,
172         NODE_VECTOR_MATH_SUBTRACT,
173         NODE_VECTOR_MATH_AVERAGE,
174         NODE_VECTOR_MATH_DOT_PRODUCT,
175         NODE_VECTOR_MATH_CROSS_PRODUCT,
176         NODE_VECTOR_MATH_NORMALIZE
177 } NodeVectorMath;
178
179 typedef enum NodeConvert {
180         NODE_CONVERT_FV,
181         NODE_CONVERT_CF,
182         NODE_CONVERT_VF
183 } NodeConvert;
184
185 typedef enum NodeDistanceMetric {
186         NODE_VORONOI_DISTANCE_SQUARED,
187         NODE_VORONOI_ACTUAL_DISTANCE,
188         NODE_VORONOI_MANHATTAN,
189         NODE_VORONOI_CHEBYCHEV,
190         NODE_VORONOI_MINKOVSKY_H,
191         NODE_VORONOI_MINKOVSKY_4,
192         NODE_VORONOI_MINKOVSKY
193 } NodeDistanceMetric;
194
195 typedef enum NodeNoiseBasis {
196         NODE_NOISE_PERLIN,
197         NODE_NOISE_VORONOI_F1,
198         NODE_NOISE_VORONOI_F2,
199         NODE_NOISE_VORONOI_F3,
200         NODE_NOISE_VORONOI_F4,
201         NODE_NOISE_VORONOI_F2_F1,
202         NODE_NOISE_VORONOI_CRACKLE,
203         NODE_NOISE_CELL_NOISE
204 } NodeNoiseBasis;
205
206 typedef enum NodeWaveType {
207         NODE_WAVE_SINE,
208         NODE_WAVE_SAW,
209         NODE_WAVE_TRI
210 } NodeWaveType;
211
212 typedef enum NodeMusgraveType {
213         NODE_MUSGRAVE_MULTIFRACTAL,
214         NODE_MUSGRAVE_FBM,
215         NODE_MUSGRAVE_HYBRID_MULTIFRACTAL,
216         NODE_MUSGRAVE_RIDGED_MULTIFRACTAL,
217         NODE_MUSGRAVE_HETERO_TERRAIN
218 } NodeMusgraveType;
219
220 typedef enum NodeWoodType {
221         NODE_WAVE_BANDS,
222         NODE_WAVE_RINGS
223 } NodeWoodType;
224
225 typedef enum NodeBlendType {
226         NODE_BLEND_LINEAR,
227         NODE_BLEND_QUADRATIC,
228         NODE_BLEND_EASING,
229         NODE_BLEND_DIAGONAL,
230         NODE_BLEND_RADIAL,
231         NODE_BLEND_QUADRATIC_SPHERE,
232         NODE_BLEND_SPHERICAL
233 } NodeBlendType;
234
235 typedef enum NodeBlendAxis {
236         NODE_BLEND_HORIZONTAL,
237         NODE_BLEND_VERTICAL
238 } NodeBlendAxis;
239
240 typedef enum NodeMarbleType {
241         NODE_MARBLE_SOFT,
242         NODE_MARBLE_SHARP,
243         NODE_MARBLE_SHARPER
244 } NodeMarbleType;
245
246 typedef enum NodeStucciType {
247         NODE_STUCCI_PLASTIC,
248         NODE_STUCCI_WALL_IN,
249         NODE_STUCCI_WALL_OUT
250 } NodeStucciType;
251
252 typedef enum NodeVoronoiColoring {
253         NODE_VORONOI_INTENSITY,
254         NODE_VORONOI_CELLS
255 } NodeVoronoiColoring;
256
257 typedef enum NodeBlendWeightType {
258         NODE_LAYER_WEIGHT_FRESNEL,
259         NODE_LAYER_WEIGHT_FACING
260 } NodeBlendWeightType;
261
262 typedef enum ShaderType {
263         SHADER_TYPE_SURFACE,
264         SHADER_TYPE_VOLUME,
265         SHADER_TYPE_DISPLACEMENT
266 } ShaderType;
267
268 /* Closure */
269
270 typedef enum ClosureType {
271         CLOSURE_BSDF_ID,
272
273         CLOSURE_BSDF_DIFFUSE_ID,
274         CLOSURE_BSDF_OREN_NAYAR_ID,
275
276         CLOSURE_BSDF_REFLECTION_ID,
277         CLOSURE_BSDF_MICROFACET_GGX_ID,
278         CLOSURE_BSDF_MICROFACET_BECKMANN_ID,
279         CLOSURE_BSDF_WARD_ID,
280         CLOSURE_BSDF_WESTIN_SHEEN_ID,
281
282         CLOSURE_BSDF_TRANSLUCENT_ID,
283         CLOSURE_BSDF_REFRACTION_ID,
284         CLOSURE_BSDF_WESTIN_BACKSCATTER_ID,
285         CLOSURE_BSDF_ASHIKHMIN_VELVET_ID,
286         CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID,
287         CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID,
288         CLOSURE_BSDF_GLASS_ID,
289
290         CLOSURE_BSDF_TRANSPARENT_ID,
291
292         CLOSURE_BSSRDF_CUBIC_ID,
293         CLOSURE_EMISSION_ID,
294         CLOSURE_DEBUG_ID,
295         CLOSURE_BACKGROUND_ID,
296         CLOSURE_HOLDOUT_ID,
297         CLOSURE_SUBSURFACE_ID,
298
299         CLOSURE_VOLUME_ID,
300         CLOSURE_VOLUME_TRANSPARENT_ID,
301         CLOSURE_VOLUME_ISOTROPIC_ID,
302
303         NBUILTIN_CLOSURES
304 } ClosureType;
305
306 /* watch this, being lazy with memory usage */
307 #define CLOSURE_IS_BSDF(type) (type <= CLOSURE_BSDF_TRANSPARENT_ID)
308 #define CLOSURE_IS_BSDF_DIFFUSE(type) (type >= CLOSURE_BSDF_DIFFUSE_ID && type <= CLOSURE_BSDF_OREN_NAYAR_ID)
309 #define CLOSURE_IS_BSDF_GLOSSY(type) (type >= CLOSURE_BSDF_REFLECTION_ID && type <= CLOSURE_BSDF_WESTIN_SHEEN_ID)
310 #define CLOSURE_IS_BSDF_TRANSMISSION(type) (type >= CLOSURE_BSDF_TRANSLUCENT_ID && type <= CLOSURE_BSDF_GLASS_ID)
311 #define CLOSURE_IS_VOLUME(type) (type >= CLOSURE_VOLUME_ID && type <= CLOSURE_VOLUME_ISOTROPIC_ID)
312 #define CLOSURE_IS_EMISSION(type) (type == CLOSURE_EMISSION_ID)
313 #define CLOSURE_IS_HOLDOUT(type) (type == CLOSURE_HOLDOUT_ID)
314 #define CLOSURE_IS_BACKGROUND(type) (type == CLOSURE_BACKGROUND_ID)
315
316 CCL_NAMESPACE_END
317
318 #endif /*  __SVM_TYPES_H__ */
319