4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
29 #ifndef DNA_TEXTURE_TYPES_H
30 #define DNA_TEXTURE_TYPES_H
32 /** \file DNA_texture_types.h
39 #include "DNA_image_types.h" /* ImageUser */
59 short texco, mapto, maptoneg, blendtype;
60 struct Object *object;
64 char projx, projy, projz, mapping;
65 float ofs[3], size[3], rot;
67 short texflag, colormodel, pmapto, pmaptoneg;
68 short normapspace, which_output;
69 char brush_map_mode, pad[7];
77 float norfac, dispfac, warpfac;
78 float colspecfac, mirrfac, alphafac;
79 float difffac, specfac, emitfac, hardfac;
80 float raymirrfac, translfac, ambfac;
81 float colemitfac, colreflfac, coltransfac;
82 float densfac, scatterfac, reflfac;
85 float timefac, lengthfac, clumpfac, dampfac;
86 float kinkfac, roughfac, padensfac, gravityfac;
87 float lifefac, sizefac, ivelfac, fieldfac;
93 float zenupfac, zendownfac, blendfac;
96 #ifndef DNA_USHORT_FIX
97 #define DNA_USHORT_FIX
99 * @deprecated This typedef serves to avoid badly typed functions when
100 * @deprecated compiling while delivering a proper dna.c. Do not use
101 * @deprecated it in any case.
103 typedef unsigned short dna_ushort_fix;
106 typedef struct PluginTex {
122 void (*instance_init)(void *);
124 /* should be void (*)(unsigned short)... patched */
125 void (*callback)(dna_ushort_fix);
130 typedef struct CBData {
131 float r, g, b, a, pos;
135 /* 32 = MAXCOLORBAND */
136 /* note that this has to remain a single struct, for UserDef */
137 typedef struct ColorBand {
138 short flag, tot, cur, ipotype;
143 typedef struct EnvMap {
144 struct Object *object;
145 struct Image *ima; /* type ENV_LOAD */
146 struct ImBuf *cube[6]; /* these images are dynamic, not part of the main struct */
150 float clipsta, clipend;
151 float viewscale; /* viewscale is for planar envmaps to zoom in or out */
153 short cuberes, depth;
155 short recalc, lastsize;
158 typedef struct PointDensity {
162 float falloff_softness;
170 struct Object *object; /* for 'Object' or 'Particle system' type - source object */
171 int psys; /* index+1 in ob.particlesystem, non-ID pointer not allowed */
172 short psys_cache_space; /* cache points in worldspace, object space, ... ? */
173 short ob_cache_space; /* cache points in worldspace, object space, ... ? */
175 void *point_tree; /* the acceleration tree containing points */
176 float *point_data; /* dynamically allocated extra for extra information, like particle age */
180 short noise_influence;
185 float speed_scale, falloff_speed_scale, pdpad2;
186 struct ColorBand *coba; /* for time -> color */
188 struct CurveMapping *falloff_curve; /* falloff density curve */
191 typedef struct VoxelData {
199 struct Object *object; /* for rendering smoke sims */
200 float int_multiplier;
202 char source_path[240];
213 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
215 float noisesize, turbul;
216 float bright, contrast, saturation, rfac, gfac, bfac;
217 float filtersize, pad2;
219 /* newnoise: musgrave parameters */
220 float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
222 /* newnoise: distorted noise amount, musgrave & voronoi ouput scale */
223 float dist_amount, ns_outscale;
225 /* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */
231 short vn_distm, vn_coltype;
233 short noisedepth, noisetype; /* noisedepth MUST be <= 30 else we get floating point exceptions */
235 /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
236 short noisebasis, noisebasis2;
241 float cropxmin, cropymin, cropxmax, cropymax;
243 int afmax; // anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes
244 short xrepeat, yrepeat;
247 /* variables disabled, moved to struct iuser */
250 int frames, offset, sfra;
252 float checkerdist, nabla;
255 struct ImageUser iuser;
257 struct bNodeTree *nodetree;
258 struct Ipo *ipo; // XXX depreceated... old animation system
260 struct PluginTex *plugin;
261 struct ColorBand *coba;
263 struct PreviewImage * preview;
264 struct PointDensity *pd;
265 struct VoxelData *vd;
272 /* used for mapping node. note: rot is in degrees */
274 typedef struct TexMapping {
275 float loc[3], rot[3], size[3];
279 float min[3], max[3];
285 #define TEXMAP_CLIP_MIN 1
286 #define TEXMAP_CLIP_MAX 2
289 /* **************** TEX ********************* */
301 #define TEX_ENVMAP 10
302 #define TEX_MUSGRAVE 11
303 #define TEX_VORONOI 12
304 #define TEX_DISTNOISE 13
305 #define TEX_POINTDENSITY 14
306 #define TEX_VOXELDATA 15
309 #define TEX_MFRACTAL 0
310 #define TEX_RIDGEDMF 1
311 #define TEX_HYBRIDMF 2
313 #define TEX_HTERRAIN 4
315 /* newnoise: noisebasis 1 & 2 */
316 #define TEX_BLENDER 0
317 #define TEX_STDPERLIN 1
318 #define TEX_NEWPERLIN 2
319 #define TEX_VORONOI_F1 3
320 #define TEX_VORONOI_F2 4
321 #define TEX_VORONOI_F3 5
322 #define TEX_VORONOI_F4 6
323 #define TEX_VORONOI_F2F1 7
324 #define TEX_VORONOI_CRACKLE 8
325 #define TEX_CELLNOISE 14
327 /* newnoise: Voronoi distance metrics, vn_distm */
328 #define TEX_DISTANCE 0
329 #define TEX_DISTANCE_SQUARED 1
330 #define TEX_MANHATTAN 2
331 #define TEX_CHEBYCHEV 3
332 #define TEX_MINKOVSKY_HALF 4
333 #define TEX_MINKOVSKY_FOUR 5
334 #define TEX_MINKOVSKY 6
337 #define TEX_INTERPOL 1
338 #define TEX_USEALPHA 2
340 #define TEX_IMAROT 16
341 #define TEX_CALCALPHA 32
342 #define TEX_NORMALMAP 2048
343 #define TEX_GAUSS_MIP 4096
344 #define TEX_FILTER_MIN 8192
347 // TXF_BOX -> blender's old texture filtering method
353 /* imaflag unused, only for version check */
354 #define TEX_FIELDS_ 8
355 #define TEX_ANIMCYCLIC_ 64
356 #define TEX_ANIM5_ 128
357 #define TEX_ANTIALI_ 256
358 #define TEX_ANTISCALE_ 512
359 #define TEX_STD_FIELD_ 1024
362 #define TEX_COLORBAND 1
363 #define TEX_FLIPBLEND 2
364 #define TEX_NEGALPHA 4
365 #define TEX_CHECKER_ODD 8
366 #define TEX_CHECKER_EVEN 16
367 #define TEX_PRV_ALPHA 32
368 #define TEX_PRV_NOR 64
369 #define TEX_REPEAT_XMIR 128
370 #define TEX_REPEAT_YMIR 256
371 #define TEX_FLAG_MASK ( TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR )
372 #define TEX_DS_EXPAND 512
374 /* extend (starts with 1 because of backward comp.) */
378 #define TEX_CLIPCUBE 4
379 #define TEX_CHECKER 5
382 #define TEX_NOISESOFT 0
383 #define TEX_NOISEPERL 1
385 /* tex->noisebasis2 in texture.c - wood waveforms */
390 /* tex->stype in texture.c - wood types */
393 #define TEX_BANDNOISE 2
394 #define TEX_RINGNOISE 3
396 /* tex->stype in texture.c - cloud types */
397 #define TEX_DEFAULT 0
400 /* tex->stype in texture.c - marble types */
403 #define TEX_SHARPER 2
405 /* tex->stype in texture.c - blend types */
414 /* tex->stype in texture.c - stucci types */
415 #define TEX_PLASTIC 0
417 #define TEX_WALLOUT 2
419 /* tex->stype in texture.c - voronoi types */
420 #define TEX_INTENSITY 0
425 /* mtex->normapspace */
426 #define MTEX_NSPACE_CAMERA 0
427 #define MTEX_NSPACE_WORLD 1
428 #define MTEX_NSPACE_OBJECT 2
429 #define MTEX_NSPACE_TANGENT 3
435 #define MTEX_SPHERE 3
442 /* pr_texture in material, world, lamp, */
443 #define TEX_PR_TEXTURE 0
444 #define TEX_PR_OTHER 1
445 #define TEX_PR_BOTH 2
447 /* **************** MTEX ********************* */
456 #define MTEX_RGBTOINT 1
457 #define MTEX_STENCIL 2
458 #define MTEX_NEGATIVE 4
459 #define MTEX_ALPHAMIX 8
460 #define MTEX_VIEWSPACE 16
461 #define MTEX_DUPLI_MAPTO 32
462 #define MTEX_OB_DUPLI_ORIG 64
463 #define MTEX_COMPAT_BUMP 128
464 #define MTEX_3TAP_BUMP 256
465 #define MTEX_5TAP_BUMP 512
466 #define MTEX_BUMP_OBJECTSPACE 1024
467 #define MTEX_BUMP_TEXTURESPACE 2048
478 #define MTEX_SCREEN 8
479 #define MTEX_OVERLAY 9
480 #define MTEX_BLEND_HUE 10
481 #define MTEX_BLEND_SAT 11
482 #define MTEX_BLEND_VAL 12
483 #define MTEX_BLEND_COLOR 13
484 #define MTEX_NUM_BLENDTYPES 14
485 #define MTEX_SOFT_LIGHT 15
486 #define MTEX_LIN_LIGHT 16
489 #define MTEX_MAP_MODE_FIXED 0
490 #define MTEX_MAP_MODE_TILED 1
491 #define MTEX_MAP_MODE_3D 2
493 /* **************** EnvMap ********************* */
509 /* **************** PointDensity ********************* */
512 #define TEX_PD_PSYS 0
513 #define TEX_PD_OBJECT 1
514 #define TEX_PD_FILE 2
517 #define TEX_PD_FALLOFF_STD 0
518 #define TEX_PD_FALLOFF_SMOOTH 1
519 #define TEX_PD_FALLOFF_SOFT 2
520 #define TEX_PD_FALLOFF_CONSTANT 3
521 #define TEX_PD_FALLOFF_ROOT 4
522 #define TEX_PD_FALLOFF_PARTICLE_AGE 5
523 #define TEX_PD_FALLOFF_PARTICLE_VEL 6
525 /* psys_cache_space */
526 #define TEX_PD_OBJECTLOC 0
527 #define TEX_PD_OBJECTSPACE 1
528 #define TEX_PD_WORLDSPACE 2
531 #define TEX_PD_TURBULENCE 1
532 #define TEX_PD_FALLOFF_CURVE 2
534 /* noise_influence */
535 #define TEX_PD_NOISE_STATIC 0
536 #define TEX_PD_NOISE_VEL 1
537 #define TEX_PD_NOISE_AGE 2
538 #define TEX_PD_NOISE_TIME 3
541 #define TEX_PD_COLOR_CONSTANT 0
542 #define TEX_PD_COLOR_PARTAGE 1
543 #define TEX_PD_COLOR_PARTSPEED 2
544 #define TEX_PD_COLOR_PARTVEL 3
546 #define POINT_DATA_VEL 1
547 #define POINT_DATA_LIFE 2
549 /******************** Voxel Data *****************************/
551 #define TEX_VD_STILL 1
554 #define TEX_VD_NEARESTNEIGHBOR 0
555 #define TEX_VD_LINEAR 1
556 #define TEX_VD_QUADRATIC 2
557 #define TEX_VD_TRICUBIC_CATROM 3
558 #define TEX_VD_TRICUBIC_BSPLINE 4
559 #define TEX_VD_TRICUBIC_SLOW 5
562 #define TEX_VD_BLENDERVOXEL 0
563 #define TEX_VD_RAW_8BIT 1
564 #define TEX_VD_RAW_16BIT 2
565 #define TEX_VD_IMAGE_SEQUENCE 3
566 #define TEX_VD_SMOKE 4
567 /* for voxels which use VoxelData->source_path */
568 #define TEX_VD_IS_SOURCE_PATH(_format) (ELEM3(_format, TEX_VD_BLENDERVOXEL, TEX_VD_RAW_8BIT, TEX_VD_RAW_16BIT))
570 /* smoke data types */
571 #define TEX_VD_SMOKEDENSITY 0
572 #define TEX_VD_SMOKEHEAT 1
573 #define TEX_VD_SMOKEVEL 2