Blender  V2.93
DNA_texture_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_ID.h"
27 #include "DNA_defs.h"
28 #include "DNA_image_types.h" /* ImageUser */
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 struct AnimData;
35 struct ColorBand;
36 struct CurveMapping;
37 struct Image;
38 struct Ipo;
39 struct Object;
40 struct PreviewImage;
41 struct Tex;
42 
43 typedef struct MTex {
44 
46  struct Object *object;
47  struct Tex *tex;
49  char uvname[64];
50 
53  char _pad[2];
54  float ofs[3], size[3], rot, random_angle;
55 
56  char _pad0[2];
59  float r, g, b, k;
60  float def_var, rt;
61 
62  /* common */
63  float colfac, varfac;
64 
65  /* material */
72 
73  /* particles */
77  float twistfac;
78 
79  /* light */
80  float shadowfac;
81 
82  /* world */
84 } MTex;
85 
86 #ifndef DNA_USHORT_FIX
87 # define DNA_USHORT_FIX
93 typedef unsigned short dna_ushort_fix;
94 #endif
95 
96 typedef struct CBData {
97  float r, g, b, a, pos;
98  int cur;
100 
101 /* 32 = MAXCOLORBAND */
102 /* note that this has to remain a single struct, for UserDef */
103 typedef struct ColorBand {
104  short tot, cur;
107  char _pad[1];
108 
111 
112 typedef struct PointDensity {
113  short flag;
114 
117  float radius;
118  short source;
119  char _pad0[2];
120 
124 
126 
128  struct Object *object;
130  int psys;
137 
139  void *point_tree;
141  float *point_data;
142 
143  float noise_size;
144  short noise_depth;
146  short noise_basis;
147  char _pad1[6];
148  float noise_fac;
149 
151  char _pad2[4];
153  struct ColorBand *coba;
154 
158 
159 typedef struct Tex {
162  struct AnimData *adt;
163 
166  float filtersize;
167  char _pad2[4];
168 
169  /* newnoise: musgrave parameters */
171 
172  /* newnoise: distorted noise amount, musgrave & voronoi output scale */
174 
175  /* newnoise: voronoi nearest neighbor weights, minkovsky exponent,
176  * distance metric & color type */
177  float vn_w1;
178  float vn_w2;
179  float vn_w3;
180  float vn_w4;
181  float vn_mexp;
183 
184  /* noisedepth MUST be <= 30 else we get floating point exceptions */
186 
187  /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
189 
190  short imaflag, flag;
191  short type, stype;
192 
195  int afmax; /* anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes */
196  short xrepeat, yrepeat;
197  short extend;
198 
199  /* variables disabled, moved to struct iuser */
200  short _pad0;
201  int len;
203 
205  char _pad1[4];
206 
207  struct ImageUser iuser;
208 
210  /* old animation system, deprecated for 2.5 */
211  struct Ipo *ipo DNA_DEPRECATED;
212  struct Image *ima;
213  struct ColorBand *coba;
215 
216  char use_nodes;
217  char _pad[7];
218 
219 } Tex;
220 
221 /* used for mapping and texture nodes. note: rot is now in radians */
222 
223 typedef struct TexMapping {
224  float loc[3], rot[3], size[3];
225  int flag;
227  int type;
228 
229  float mat[4][4];
230  float min[3], max[3];
231  struct Object *ob;
232 
234 
235 typedef struct ColorMapping {
236  struct ColorBand coba;
237 
239  int flag;
240 
241  float blend_color[3];
244  char _pad[4];
246 
247 /* texmap->flag */
248 #define TEXMAP_CLIP_MIN 1
249 #define TEXMAP_CLIP_MAX 2
250 #define TEXMAP_UNIT_MATRIX 4
251 
252 /* texmap->type */
253 #define TEXMAP_TYPE_POINT 0
254 #define TEXMAP_TYPE_TEXTURE 1
255 #define TEXMAP_TYPE_VECTOR 2
256 #define TEXMAP_TYPE_NORMAL 3
257 
258 /* colormap->flag */
259 #define COLORMAP_USE_RAMP 1
260 
261 /* **************** TEX ********************* */
262 
263 /* type */
264 #define TEX_CLOUDS 1
265 #define TEX_WOOD 2
266 #define TEX_MARBLE 3
267 #define TEX_MAGIC 4
268 #define TEX_BLEND 5
269 #define TEX_STUCCI 6
270 #define TEX_NOISE 7
271 #define TEX_IMAGE 8
272 //#define TEX_PLUGIN 9 /* Deprecated */
273 //#define TEX_ENVMAP 10 /* Deprecated */
274 #define TEX_MUSGRAVE 11
275 #define TEX_VORONOI 12
276 #define TEX_DISTNOISE 13
277 //#define TEX_POINTDENSITY 14 /* Deprecated */
278 //#define TEX_VOXELDATA 15 /* Deprecated */
279 //#define TEX_OCEAN 16 /* Deprecated */
280 
281 /* musgrave stype */
282 #define TEX_MFRACTAL 0
283 #define TEX_RIDGEDMF 1
284 #define TEX_HYBRIDMF 2
285 #define TEX_FBM 3
286 #define TEX_HTERRAIN 4
287 
288 /* newnoise: noisebasis 1 & 2 */
289 #define TEX_BLENDER 0
290 #define TEX_STDPERLIN 1
291 #define TEX_NEWPERLIN 2
292 #define TEX_VORONOI_F1 3
293 #define TEX_VORONOI_F2 4
294 #define TEX_VORONOI_F3 5
295 #define TEX_VORONOI_F4 6
296 #define TEX_VORONOI_F2F1 7
297 #define TEX_VORONOI_CRACKLE 8
298 #define TEX_CELLNOISE 14
299 
300 /* newnoise: Voronoi distance metrics, vn_distm */
301 #define TEX_DISTANCE 0
302 #define TEX_DISTANCE_SQUARED 1
303 #define TEX_MANHATTAN 2
304 #define TEX_CHEBYCHEV 3
305 #define TEX_MINKOVSKY_HALF 4
306 #define TEX_MINKOVSKY_FOUR 5
307 #define TEX_MINKOVSKY 6
308 
309 /* imaflag */
310 #define TEX_INTERPOL (1 << 0)
311 #define TEX_USEALPHA (1 << 1)
312 #define TEX_MIPMAP (1 << 2)
313 #define TEX_IMAROT (1 << 4)
314 #define TEX_CALCALPHA (1 << 5)
315 #define TEX_NORMALMAP (1 << 11)
316 #define TEX_GAUSS_MIP (1 << 12)
317 #define TEX_FILTER_MIN (1 << 13)
318 #define TEX_DERIVATIVEMAP (1 << 14)
319 
320 /* texfilter */
321 #define TXF_BOX 0 /* Blender's old texture filtering method. */
322 #define TXF_EWA 1
323 #define TXF_FELINE 2
324 #define TXF_AREA 3
325 
326 /* flag */
327 #define TEX_COLORBAND (1 << 0)
328 #define TEX_FLIPBLEND (1 << 1)
329 #define TEX_NEGALPHA (1 << 2)
330 #define TEX_CHECKER_ODD (1 << 3)
331 #define TEX_CHECKER_EVEN (1 << 4)
332 #define TEX_PRV_ALPHA (1 << 5)
333 #define TEX_PRV_NOR (1 << 6)
334 #define TEX_REPEAT_XMIR (1 << 7)
335 #define TEX_REPEAT_YMIR (1 << 8)
336 #define TEX_FLAG_MASK \
337  (TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | \
338  TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR)
339 #define TEX_DS_EXPAND (1 << 9)
340 #define TEX_NO_CLAMP (1 << 10)
341 
342 /* extend (starts with 1 because of backward comp.) */
343 #define TEX_EXTEND 1
344 #define TEX_CLIP 2
345 #define TEX_REPEAT 3
346 #define TEX_CLIPCUBE 4
347 #define TEX_CHECKER 5
348 
349 /* noisetype */
350 #define TEX_NOISESOFT 0
351 #define TEX_NOISEPERL 1
352 
353 /* tex->noisebasis2 in texture.c - wood waveforms */
354 #define TEX_SIN 0
355 #define TEX_SAW 1
356 #define TEX_TRI 2
357 
358 /* tex->stype in texture.c - wood types */
359 #define TEX_BAND 0
360 #define TEX_RING 1
361 #define TEX_BANDNOISE 2
362 #define TEX_RINGNOISE 3
363 
364 /* tex->stype in texture.c - cloud types */
365 #define TEX_DEFAULT 0
366 #define TEX_COLOR 1
367 
368 /* tex->stype in texture.c - marble types */
369 #define TEX_SOFT 0
370 #define TEX_SHARP 1
371 #define TEX_SHARPER 2
372 
373 /* tex->stype in texture.c - blend types */
374 #define TEX_LIN 0
375 #define TEX_QUAD 1
376 #define TEX_EASE 2
377 #define TEX_DIAG 3
378 #define TEX_SPHERE 4
379 #define TEX_HALO 5
380 #define TEX_RAD 6
381 
382 /* tex->stype in texture.c - stucci types */
383 #define TEX_PLASTIC 0
384 #define TEX_WALLIN 1
385 #define TEX_WALLOUT 2
386 
387 /* tex->stype in texture.c - voronoi types */
388 #define TEX_INTENSITY 0
389 #define TEX_COL1 1
390 #define TEX_COL2 2
391 #define TEX_COL3 3
392 
393 /* mtex->normapspace */
394 #define MTEX_NSPACE_CAMERA 0
395 #define MTEX_NSPACE_WORLD 1
396 #define MTEX_NSPACE_OBJECT 2
397 #define MTEX_NSPACE_TANGENT 3
398 
399 /* wrap */
400 #define MTEX_FLAT 0
401 #define MTEX_CUBE 1
402 #define MTEX_TUBE 2
403 #define MTEX_SPHERE 3
404 
405 /* return value */
406 #define TEX_INT 0
407 #define TEX_RGB (1 << 0)
408 #define TEX_NOR (1 << 1)
409 
410 /* pr_texture in material, world, light. */
411 #define TEX_PR_TEXTURE 0
412 #define TEX_PR_OTHER 1
413 #define TEX_PR_BOTH 2
414 
415 /* **************** MTEX ********************* */
416 
417 /* proj */
418 #define PROJ_N 0
419 #define PROJ_X 1
420 #define PROJ_Y 2
421 #define PROJ_Z 3
422 
423 /* blendtype */
424 #define MTEX_BLEND 0
425 #define MTEX_MUL 1
426 #define MTEX_ADD 2
427 #define MTEX_SUB 3
428 #define MTEX_DIV 4
429 #define MTEX_DARK 5
430 #define MTEX_DIFF 6
431 #define MTEX_LIGHT 7
432 #define MTEX_SCREEN 8
433 #define MTEX_OVERLAY 9
434 #define MTEX_BLEND_HUE 10
435 #define MTEX_BLEND_SAT 11
436 #define MTEX_BLEND_VAL 12
437 #define MTEX_BLEND_COLOR 13
438 #define MTEX_SOFT_LIGHT 15
439 #define MTEX_LIN_LIGHT 16
440 
441 /* brush_map_mode */
442 #define MTEX_MAP_MODE_VIEW 0
443 #define MTEX_MAP_MODE_TILED 1
444 #define MTEX_MAP_MODE_3D 2
445 #define MTEX_MAP_MODE_AREA 3
446 #define MTEX_MAP_MODE_RANDOM 4
447 #define MTEX_MAP_MODE_STENCIL 5
448 
449 /* brush_angle_mode */
450 #define MTEX_ANGLE_RANDOM 1
451 #define MTEX_ANGLE_RAKE 2
452 
453 /* **************** ColorBand ********************* */
454 
455 /* colormode */
456 enum {
460 };
461 
462 /* interpolation */
463 enum {
469 };
470 
471 /* color interpolation */
472 enum {
477 };
478 
479 /* **************** PointDensity ********************* */
480 
481 /* source */
482 #define TEX_PD_PSYS 0
483 #define TEX_PD_OBJECT 1
484 #define TEX_PD_FILE 2
485 
486 /* falloff_type */
487 #define TEX_PD_FALLOFF_STD 0
488 #define TEX_PD_FALLOFF_SMOOTH 1
489 #define TEX_PD_FALLOFF_SOFT 2
490 #define TEX_PD_FALLOFF_CONSTANT 3
491 #define TEX_PD_FALLOFF_ROOT 4
492 #define TEX_PD_FALLOFF_PARTICLE_AGE 5
493 #define TEX_PD_FALLOFF_PARTICLE_VEL 6
494 
495 /* psys_cache_space */
496 #define TEX_PD_OBJECTLOC 0
497 #define TEX_PD_OBJECTSPACE 1
498 #define TEX_PD_WORLDSPACE 2
499 
500 /* flag */
501 #define TEX_PD_TURBULENCE 1
502 #define TEX_PD_FALLOFF_CURVE 2
503 
504 /* noise_influence */
505 #define TEX_PD_NOISE_STATIC 0
506 /* #define TEX_PD_NOISE_VEL 1 */ /* Deprecated */
507 /* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
508 /* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
509 
510 /* color_source */
511 enum {
513  /* color_source: particles */
517  /* color_source: vertices */
521 };
522 
523 #define POINT_DATA_VEL 1
524 #define POINT_DATA_LIFE 2
525 #define POINT_DATA_COLOR 4
526 
527 #ifdef __cplusplus
528 }
529 #endif
ID and Library types, which are fundamental for sdna.
unsigned short dna_ushort_fix
@ COLBAND_INTERP_LINEAR
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_EASE
@ COLBAND_INTERP_CARDINAL
@ COLBAND_BLEND_RGB
@ COLBAND_BLEND_HSL
@ COLBAND_BLEND_HSV
struct ColorBand ColorBand
struct TexMapping TexMapping
@ COLBAND_HUE_FAR
@ COLBAND_HUE_CW
@ COLBAND_HUE_NEAR
@ COLBAND_HUE_CCW
struct MTex MTex
@ TEX_PD_COLOR_VERTWEIGHT
@ TEX_PD_COLOR_VERTNOR
@ TEX_PD_COLOR_VERTCOL
@ TEX_PD_COLOR_PARTAGE
@ TEX_PD_COLOR_CONSTANT
@ TEX_PD_COLOR_PARTVEL
@ TEX_PD_COLOR_PARTSPEED
struct ColorMapping ColorMapping
struct CBData CBData
struct Tex Tex
struct PointDensity PointDensity
CBData data[32]
struct ColorBand coba
float blend_color[3]
Definition: DNA_ID.h:273
short texco
float norfac
float fieldfac
char brush_angle_mode
char _pad0[2]
short colormodel
char projy
float roughfac
float kinkampfac
float zenupfac
char projz
char mapping
float warpfac
float colfac
float lifefac
short pmapto
float padensfac
char brush_map_mode
float translfac
short blendtype
short pmaptoneg
float kinkfac
float specfac
char projx
float difffac
float colreflfac
float rot
float dampfac
float def_var
float clumpfac
float ivelfac
short which_output
float ofs[3]
float varfac
float scatterfac
short mapto
float mirrfac
short maptoneg
struct Object * object
float timefac
float alphafac
float blendfac
float coltransfac
float dispfac
float zendownfac
float lengthfac
float colemitfac
float densfac
float size[3]
char uvname[64]
float gravityfac
float ambfac
float random_angle
float twistfac
short normapspace
float hardfac
float rt
float emitfac
float shadowfac
char _pad[2]
float sizefac
struct Tex * tex
float colspecfac
float raymirrfac
float reflfac
char vertex_attribute_name[64]
struct CurveMapping * falloff_curve
struct Object * object
struct ColorBand * coba
float mat[4][4]
struct Object * ob
float cropymin
float dist_amount
struct AnimData * adt
float noisesize
short xrepeat
float vn_w4
short noisedepth
float ns_outscale
short noisetype
float vn_w2
short imaflag
float cropxmax
float checkerdist
float cropymax
struct PreviewImage * preview
short _pad0
char _pad2[4]
float mg_lacunarity
float mg_offset
float nabla
char use_nodes
float vn_mexp
float mg_gain
float saturation
short noisebasis2
short vn_coltype
float gfac
float contrast
short stype
float mg_octaves
struct ImageUser iuser
struct ColorBand * coba
int texfilter
float bright
short vn_distm
float cropxmin
short flag
float mg_H
short type
float vn_w3
char _pad[7]
struct bNodeTree * nodetree
char _pad1[4]
short noisebasis
float vn_w1
float bfac
struct Image * ima
float rfac
short extend
short yrepeat
float turbul
struct Ipo *ipo DNA_DEPRECATED
float filtersize