2 * blenlib/DNA_texture_types.h (mar-2001 nzc)
6 * ***** BEGIN GPL LICENSE BLOCK *****
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL LICENSE BLOCK *****
31 #ifndef DNA_TEXTURE_TYPES_H
32 #define DNA_TEXTURE_TYPES_H
35 #include "DNA_image_types.h"
50 short texco, mapto, maptoneg, blendtype;
51 struct Object *object;
55 char projx, projy, projz, mapping;
56 float ofs[3], size[3], rot;
58 short texflag, colormodel, pmapto, pmaptoneg;
59 short normapspace, which_output;
60 char brush_map_mode, pad[7];
68 float norfac, dispfac, warpfac;
69 float colspecfac, mirrfac, alphafac;
70 float difffac, specfac, emitfac, hardfac;
71 float raymirrfac, translfac, ambfac;
72 float colemitfac, colreflfac, coltransfac;
73 float densfac, scatterfac, reflfac;
76 float timefac, lengthfac, clumpfac;
77 float kinkfac, roughfac, padensfac;
78 float lifefac, sizefac, ivelfac, pvelfac;
84 float zenupfac, zendownfac, blendfac;
87 #ifndef DNA_USHORT_FIX
88 #define DNA_USHORT_FIX
90 * @deprecated This typedef serves to avoid badly typed functions when
91 * @deprecated compiling while delivering a proper dna.c. Do not use
92 * @deprecated it in any case.
94 typedef unsigned short dna_ushort_fix;
97 typedef struct PluginTex {
113 void (*instance_init)(void *);
115 /* should be void (*)(unsigned short)... patched */
116 void (*callback)(dna_ushort_fix);
121 typedef struct CBData {
122 float r, g, b, a, pos;
126 /* 32 = MAXCOLORBAND */
127 /* note that this has to remain a single struct, for UserDef */
128 typedef struct ColorBand {
129 short flag, tot, cur, ipotype;
134 typedef struct EnvMap {
135 struct Object *object;
136 struct Image *ima; /* type ENV_LOAD */
137 struct ImBuf *cube[6]; /* these images are dynamic, not part of the main struct */
141 float clipsta, clipend;
142 float viewscale; /* viewscale is for planar envmaps to zoom in or out */
144 short cuberes, depth;
146 short recalc, lastsize;
149 typedef struct PointDensity {
153 float falloff_softness;
161 struct Object *object; /* for 'Object' or 'Particle system' type - source object */
162 struct ParticleSystem *psys;
163 short psys_cache_space; /* cache points in worldspace, object space, ... ? */
164 short ob_cache_space; /* cache points in worldspace, object space, ... ? */
168 void *point_tree; /* the acceleration tree containing points */
169 float *point_data; /* dynamically allocated extra for extra information, like particle age */
173 short noise_influence;
179 struct ColorBand *coba; /* for time -> color */
183 typedef struct VoxelData {
191 struct Object *object; /* for rendering smoke sims */
192 float int_multiplier;
194 char source_path[240];
201 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
203 float noisesize, turbul;
204 float bright, contrast, rfac, gfac, bfac;
207 /* newnoise: musgrave parameters */
208 float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
210 /* newnoise: distorted noise amount, musgrave & voronoi ouput scale */
211 float dist_amount, ns_outscale;
213 /* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */
219 short vn_distm, vn_coltype;
221 short noisedepth, noisetype;
223 /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
224 short noisebasis, noisebasis2;
229 float cropxmin, cropymin, cropxmax, cropymax;
231 int afmax; // anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes
232 short xrepeat, yrepeat;
235 /* variables disabled, moved to struct iuser */
238 int frames, offset, sfra;
240 float checkerdist, nabla;
243 struct ImageUser iuser;
245 struct bNodeTree *nodetree;
246 struct Ipo *ipo; // XXX depreceated... old animation system
248 struct PluginTex *plugin;
249 struct ColorBand *coba;
251 struct PreviewImage * preview;
252 struct PointDensity *pd;
253 struct VoxelData *vd;
260 /* used for mapping node. note: rot is in degrees */
262 typedef struct TexMapping {
263 float loc[3], rot[3], size[3];
267 float min[3], max[3];
273 #define TEXMAP_CLIP_MIN 1
274 #define TEXMAP_CLIP_MAX 2
277 /* **************** TEX ********************* */
289 #define TEX_ENVMAP 10
290 #define TEX_MUSGRAVE 11
291 #define TEX_VORONOI 12
292 #define TEX_DISTNOISE 13
293 #define TEX_POINTDENSITY 14
294 #define TEX_VOXELDATA 15
297 #define TEX_MFRACTAL 0
298 #define TEX_RIDGEDMF 1
299 #define TEX_HYBRIDMF 2
301 #define TEX_HTERRAIN 4
303 /* newnoise: noisebasis 1 & 2 */
304 #define TEX_BLENDER 0
305 #define TEX_STDPERLIN 1
306 #define TEX_NEWPERLIN 2
307 #define TEX_VORONOI_F1 3
308 #define TEX_VORONOI_F2 4
309 #define TEX_VORONOI_F3 5
310 #define TEX_VORONOI_F4 6
311 #define TEX_VORONOI_F2F1 7
312 #define TEX_VORONOI_CRACKLE 8
313 #define TEX_CELLNOISE 14
315 /* newnoise: Voronoi distance metrics, vn_distm */
316 #define TEX_DISTANCE 0
317 #define TEX_DISTANCE_SQUARED 1
318 #define TEX_MANHATTAN 2
319 #define TEX_CHEBYCHEV 3
320 #define TEX_MINKOVSKY_HALF 4
321 #define TEX_MINKOVSKY_FOUR 5
322 #define TEX_MINKOVSKY 6
325 #define TEX_INTERPOL 1
326 #define TEX_USEALPHA 2
328 #define TEX_IMAROT 16
329 #define TEX_CALCALPHA 32
330 #define TEX_NORMALMAP 2048
331 #define TEX_GAUSS_MIP 4096
332 #define TEX_FILTER_MIN 8192
335 // TXF_BOX -> blender's old texture filtering method
340 // TXF_SAT only available when mipmaps disabled
343 /* imaflag unused, only for version check */
344 #define TEX_FIELDS_ 8
345 #define TEX_ANIMCYCLIC_ 64
346 #define TEX_ANIM5_ 128
347 #define TEX_ANTIALI_ 256
348 #define TEX_ANTISCALE_ 512
349 #define TEX_STD_FIELD_ 1024
352 #define TEX_COLORBAND 1
353 #define TEX_FLIPBLEND 2
354 #define TEX_NEGALPHA 4
355 #define TEX_CHECKER_ODD 8
356 #define TEX_CHECKER_EVEN 16
357 #define TEX_PRV_ALPHA 32
358 #define TEX_PRV_NOR 64
359 #define TEX_REPEAT_XMIR 128
360 #define TEX_REPEAT_YMIR 256
361 #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 )
363 /* extend (starts with 1 because of backward comp.) */
367 #define TEX_CLIPCUBE 4
368 #define TEX_CHECKER 5
371 #define TEX_NOISESOFT 0
372 #define TEX_NOISEPERL 1
374 /* tex->noisebasis2 in texture.c - wood waveforms */
379 /* tex->stype in texture.c - wood types */
382 #define TEX_BANDNOISE 2
383 #define TEX_RINGNOISE 3
385 /* tex->stype in texture.c - cloud types */
386 #define TEX_DEFAULT 0
389 /* tex->stype in texture.c - marble types */
392 #define TEX_SHARPER 2
394 /* tex->stype in texture.c - blend types */
403 /* tex->stype in texture.c - stucci types */
404 #define TEX_PLASTIC 0
406 #define TEX_WALLOUT 2
408 /* tex->stype in texture.c - voronoi types */
409 #define TEX_INTENSITY 0
414 /* mtex->normapspace */
415 #define MTEX_NSPACE_CAMERA 0
416 #define MTEX_NSPACE_WORLD 1
417 #define MTEX_NSPACE_OBJECT 2
418 #define MTEX_NSPACE_TANGENT 3
424 #define MTEX_SPHERE 3
431 /* pr_texture in material, world, lamp, */
432 #define TEX_PR_TEXTURE 0
433 #define TEX_PR_OTHER 1
434 #define TEX_PR_BOTH 2
436 /* **************** MTEX ********************* */
445 #define MTEX_RGBTOINT 1
446 #define MTEX_STENCIL 2
447 #define MTEX_NEGATIVE 4
448 #define MTEX_ALPHAMIX 8
449 #define MTEX_VIEWSPACE 16
450 #define MTEX_DUPLI_MAPTO 32
451 #define MTEX_OB_DUPLI_ORIG 64
452 #define MTEX_NEW_BUMP 128
463 #define MTEX_SCREEN 8
464 #define MTEX_OVERLAY 9
465 #define MTEX_BLEND_HUE 10
466 #define MTEX_BLEND_SAT 11
467 #define MTEX_BLEND_VAL 12
468 #define MTEX_BLEND_COLOR 13
469 #define MTEX_NUM_BLENDTYPES 14
470 #define MTEX_SOFT_LIGHT 15
471 #define MTEX_LIN_LIGHT 16
474 #define MTEX_MAP_MODE_FIXED 0
475 #define MTEX_MAP_MODE_TILED 1
476 #define MTEX_MAP_MODE_3D 2
478 /* **************** EnvMap ********************* */
494 /* **************** PointDensity ********************* */
497 #define TEX_PD_PSYS 0
498 #define TEX_PD_OBJECT 1
499 #define TEX_PD_FILE 2
502 #define TEX_PD_FALLOFF_STD 0
503 #define TEX_PD_FALLOFF_SMOOTH 1
504 #define TEX_PD_FALLOFF_SOFT 2
505 #define TEX_PD_FALLOFF_CONSTANT 3
506 #define TEX_PD_FALLOFF_ROOT 4
508 /* psys_cache_space */
509 #define TEX_PD_OBJECTLOC 0
510 #define TEX_PD_OBJECTSPACE 1
511 #define TEX_PD_WORLDSPACE 2
514 #define TEX_PD_TURBULENCE 1
517 /* noise_influence */
518 #define TEX_PD_NOISE_STATIC 0
519 #define TEX_PD_NOISE_VEL 1
520 #define TEX_PD_NOISE_AGE 2
521 #define TEX_PD_NOISE_TIME 3
524 #define TEX_PD_COLOR_CONSTANT 0
525 #define TEX_PD_COLOR_PARTAGE 1
526 #define TEX_PD_COLOR_PARTSPEED 2
527 #define TEX_PD_COLOR_PARTVEL 3
529 #define POINT_DATA_VEL 1
530 #define POINT_DATA_LIFE 2
532 /******************** Voxel Data *****************************/
534 #define TEX_VD_STILL 1
537 #define TEX_VD_NEARESTNEIGHBOR 0
538 #define TEX_VD_LINEAR 1
539 #define TEX_VD_QUADRATIC 2
540 #define TEX_VD_TRICUBIC_CATROM 3
541 #define TEX_VD_TRICUBIC_BSPLINE 4
542 #define TEX_VD_TRICUBIC_SLOW 5
545 #define TEX_VD_BLENDERVOXEL 0
546 #define TEX_VD_RAW_8BIT 1
547 #define TEX_VD_RAW_16BIT 2
548 #define TEX_VD_IMAGE_SEQUENCE 3
549 #define TEX_VD_SMOKE 4