Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DNA_texture_types.h « makesdna « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a43e5c7ae1335ff9ee174f4db5d9a4a17691e5e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
/**
 * blenlib/DNA_texture_types.h (mar-2001 nzc)
 *
 * $Id$ 
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL LICENSE BLOCK *****
 */
#ifndef DNA_TEXTURE_TYPES_H
#define DNA_TEXTURE_TYPES_H

#include "DNA_ID.h"
#include "DNA_image_types.h"

struct AnimData;
struct Ipo;
struct PluginTex;
struct ColorBand;
struct EnvMap;
struct Object;
struct Tex;
struct Image;
struct PreviewImage;
struct ImBuf;

typedef struct MTex {

	short texco, mapto, maptoneg, blendtype;
	struct Object *object;
	struct Tex *tex;
	char uvname[32];
	
	char projx, projy, projz, mapping;
	float ofs[3], size[3], rot;
	
	short texflag, colormodel, pmapto, pmaptoneg;
	short normapspace, which_output;
	char brush_map_mode, pad[7];
	float r, g, b, k;
	float def_var, rt;
	
	/* common */
	float colfac, varfac;
	
	/* material */
	float norfac, dispfac, warpfac;
	float colspecfac, mirrfac, alphafac;
	float difffac, specfac, emitfac, hardfac;
	float raymirrfac, translfac, ambfac;
	float colemitfac, colreflfac, coltransfac;
	float densfac, scatterfac, reflfac;

	/* particles */
	float timefac, lengthfac, clumpfac;
	float kinkfac, roughfac, padensfac;
	float lifefac, sizefac, ivelfac, pvelfac;

	/* lamp */
	float shadowfac;

	/* world */
	float zenupfac, zendownfac, blendfac;
} MTex;

#ifndef DNA_USHORT_FIX
#define DNA_USHORT_FIX
/**
 * @deprecated This typedef serves to avoid badly typed functions when
 * @deprecated compiling while delivering a proper dna.c. Do not use
 * @deprecated it in any case.
 */
typedef unsigned short dna_ushort_fix;
#endif

typedef struct PluginTex {
	char name[160];
	void *handle;
	
	char *pname;
	char *stnames;

	int stypes;
	int vars;
	void *varstr;
	float *result;
	float *cfra;
	
	float data[32];

	int (*doit)(void);
	void (*instance_init)(void *);

	/* should be void (*)(unsigned short)... patched */	
	void (*callback)(dna_ushort_fix);
	
	int version, pad;
} PluginTex;

typedef struct CBData {
	float r, g, b, a, pos;
	int cur;
} CBData;

/* 32 = MAXCOLORBAND */
/* note that this has to remain a single struct, for UserDef */
typedef struct ColorBand {
	short flag, tot, cur, ipotype;
	CBData data[32];
	
} ColorBand;

typedef struct EnvMap {
	struct Object *object;
	struct Image *ima;		/* type ENV_LOAD */
	struct ImBuf *cube[6];		/* these images are dynamic, not part of the main struct */
	float imat[4][4];
	float obimat[3][3];
	short type, stype;
	float clipsta, clipend;
	float viewscale;	/* viewscale is for planar envmaps to zoom in or out */
	unsigned int notlay;
	short cuberes, depth;
	int ok, lastframe;
	short recalc, lastsize;
} EnvMap;

typedef struct PointDensity {
	short flag;

	short falloff_type;
	float falloff_softness;
	float radius;
	short source;
	short color_source;
	int totpoints;
	
	int pdpad;

	struct Object *object;	/* for 'Object' or 'Particle system' type - source object */
	struct ParticleSystem *psys;
	short psys_cache_space;		/* cache points in worldspace, object space, ... ? */
	short ob_cache_space;		/* cache points in worldspace, object space, ... ? */
	
	short pdpad2[2];
	
	void *point_tree;		/* the acceleration tree containing points */
	float *point_data;		/* dynamically allocated extra for extra information, like particle age */
	
	float noise_size;
	short noise_depth;
	short noise_influence;
	short noise_basis;
    short pdpad3[3];
	float noise_fac;
	
	float speed_scale;
	struct ColorBand *coba;	/* for time -> color */
	
} PointDensity;

typedef struct VoxelData {
	int resol[3];
	int interp_type;
	short file_format;
	short flag;
	short extend;
	short pad;
	
	struct Object *object; /* for rendering smoke sims */
	float int_multiplier;	
	int still_frame;
	char source_path[240];
	float *dataset;
 
} VoxelData;

typedef struct Tex {
	ID id;
	struct AnimData *adt;	/* animation data (must be immediately after id for utilities to use it) */ 
	
	float noisesize, turbul;
	float bright, contrast, rfac, gfac, bfac;
	float filtersize;

	/* newnoise: musgrave parameters */
	float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;

	/* newnoise: distorted noise amount, musgrave & voronoi ouput scale */
	float dist_amount, ns_outscale;

	/* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */
	float vn_w1;
	float vn_w2;
	float vn_w3;
	float vn_w4;
	float vn_mexp;
	short vn_distm, vn_coltype;

	short noisedepth, noisetype;

	/* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
	short noisebasis, noisebasis2;

	short imaflag, flag;
	short type, stype;
	
	float cropxmin, cropymin, cropxmax, cropymax;
	int texfilter;
	int afmax;	// anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes
	short xrepeat, yrepeat;
	short extend;

	/* variables disabled, moved to struct iuser */
	short fie_ima;
	int len;
	int frames, offset, sfra;
	
	float checkerdist, nabla;
	float norfac;
	
	struct ImageUser iuser;
	
	struct bNodeTree *nodetree;
	struct Ipo *ipo;				// XXX depreceated... old animation system
	struct Image *ima;
	struct PluginTex *plugin;
	struct ColorBand *coba;
	struct EnvMap *env;
	struct PreviewImage * preview;
	struct PointDensity *pd;
	struct VoxelData *vd;
	
	char use_nodes;
	char pad[7];
	
} Tex;

/* used for mapping node. note: rot is in degrees */

typedef struct TexMapping {
	float loc[3], rot[3], size[3];
	int flag;
	
	float mat[4][4];
	float min[3], max[3];
	struct Object *ob;

} TexMapping;

/* texmap->flag */
#define TEXMAP_CLIP_MIN	1
#define TEXMAP_CLIP_MAX	2


/* **************** TEX ********************* */

/* type */
#define TEX_CLOUDS		1
#define TEX_WOOD		2
#define TEX_MARBLE		3
#define TEX_MAGIC		4
#define TEX_BLEND		5
#define TEX_STUCCI		6
#define TEX_NOISE		7
#define TEX_IMAGE		8
#define TEX_PLUGIN		9
#define TEX_ENVMAP		10
#define TEX_MUSGRAVE	11
#define TEX_VORONOI		12
#define TEX_DISTNOISE	13
#define TEX_POINTDENSITY	14
#define TEX_VOXELDATA		15

/* musgrave stype */
#define TEX_MFRACTAL		0
#define TEX_RIDGEDMF		1
#define TEX_HYBRIDMF		2
#define TEX_FBM				3
#define TEX_HTERRAIN		4

/* newnoise: noisebasis 1 & 2 */
#define TEX_BLENDER			0
#define TEX_STDPERLIN		1
#define TEX_NEWPERLIN		2
#define TEX_VORONOI_F1		3
#define TEX_VORONOI_F2		4
#define TEX_VORONOI_F3		5
#define TEX_VORONOI_F4		6
#define TEX_VORONOI_F2F1	7
#define TEX_VORONOI_CRACKLE		8
#define TEX_CELLNOISE		14

/* newnoise: Voronoi distance metrics, vn_distm */
#define TEX_DISTANCE		0
#define TEX_DISTANCE_SQUARED		1
#define TEX_MANHATTAN		2
#define TEX_CHEBYCHEV		3
#define TEX_MINKOVSKY_HALF		4
#define TEX_MINKOVSKY_FOUR		5
#define TEX_MINKOVSKY		6

/* imaflag */
#define TEX_INTERPOL	1
#define TEX_USEALPHA	2
#define TEX_MIPMAP		4
#define TEX_IMAROT		16
#define TEX_CALCALPHA	32
#define TEX_NORMALMAP	2048
#define TEX_GAUSS_MIP	4096
#define TEX_FILTER_MIN	8192

/* texfilter */
// TXF_BOX -> blender's old texture filtering method
#define TXF_BOX			0
#define TXF_EWA			1
#define TXF_FELINE		2
#define TXF_AREA		3
// TXF_SAT only available when mipmaps disabled
#define TXF_SAT			4

/* imaflag unused, only for version check */
#define TEX_FIELDS_		8
#define TEX_ANIMCYCLIC_	64
#define TEX_ANIM5_		128
#define TEX_ANTIALI_	256
#define TEX_ANTISCALE_	512
#define TEX_STD_FIELD_	1024

/* flag */
#define TEX_COLORBAND		1
#define TEX_FLIPBLEND		2
#define TEX_NEGALPHA		4
#define TEX_CHECKER_ODD		8
#define TEX_CHECKER_EVEN	16
#define TEX_PRV_ALPHA		32
#define TEX_PRV_NOR			64
#define TEX_REPEAT_XMIR		128
#define TEX_REPEAT_YMIR		256
#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 ) 

/* extend (starts with 1 because of backward comp.) */
#define TEX_EXTEND		1
#define TEX_CLIP		2
#define TEX_REPEAT		3
#define TEX_CLIPCUBE	4
#define TEX_CHECKER		5

/* noisetype */
#define TEX_NOISESOFT	0
#define TEX_NOISEPERL	1

/* tex->noisebasis2 in texture.c - wood waveforms */
#define TEX_SIN			0
#define TEX_SAW			1
#define TEX_TRI			2

/* tex->stype in texture.c - wood types */
#define TEX_BAND		0
#define TEX_RING		1
#define TEX_BANDNOISE	2
#define TEX_RINGNOISE	3

/* tex->stype in texture.c - cloud types */
#define TEX_DEFAULT		0
#define TEX_COLOR		1

/* tex->stype in texture.c - marble types */
#define TEX_SOFT		0
#define TEX_SHARP		1
#define TEX_SHARPER		2

/* tex->stype in texture.c - blend types */
#define TEX_LIN			0
#define TEX_QUAD		1
#define TEX_EASE		2
#define TEX_DIAG		3
#define TEX_SPHERE		4
#define TEX_HALO		5
#define TEX_RAD			6

/* tex->stype in texture.c - stucci types */
#define TEX_PLASTIC		0
#define TEX_WALLIN		1
#define TEX_WALLOUT		2

/* tex->stype in texture.c - voronoi types */
#define TEX_INTENSITY	0
#define TEX_COL1		1
#define TEX_COL2		2
#define TEX_COL3		3

/* mtex->normapspace */
#define MTEX_NSPACE_CAMERA	0
#define MTEX_NSPACE_WORLD	1
#define MTEX_NSPACE_OBJECT	2
#define MTEX_NSPACE_TANGENT	3

/* wrap */
#define MTEX_FLAT		0
#define MTEX_CUBE		1
#define MTEX_TUBE		2
#define MTEX_SPHERE		3

/* return value */
#define TEX_INT		0
#define TEX_RGB		1
#define TEX_NOR		2

/* pr_texture in material, world, lamp, */
#define TEX_PR_TEXTURE	0
#define TEX_PR_OTHER	1
#define TEX_PR_BOTH		2

/* **************** MTEX ********************* */

/* proj */
#define PROJ_N			0
#define PROJ_X			1
#define PROJ_Y			2
#define PROJ_Z			3

/* texflag */
#define MTEX_RGBTOINT		1
#define MTEX_STENCIL		2
#define MTEX_NEGATIVE		4
#define MTEX_ALPHAMIX		8
#define MTEX_VIEWSPACE		16
#define MTEX_DUPLI_MAPTO	32
#define MTEX_OB_DUPLI_ORIG	64
#define MTEX_NEW_BUMP		128

/* blendtype */
#define MTEX_BLEND		0
#define MTEX_MUL		1
#define MTEX_ADD		2
#define MTEX_SUB		3
#define MTEX_DIV		4
#define MTEX_DARK		5
#define MTEX_DIFF		6
#define MTEX_LIGHT		7
#define MTEX_SCREEN		8
#define MTEX_OVERLAY	9
#define MTEX_BLEND_HUE		10
#define MTEX_BLEND_SAT		11
#define MTEX_BLEND_VAL		12
#define MTEX_BLEND_COLOR	13
#define MTEX_NUM_BLENDTYPES	14
#define MTEX_SOFT_LIGHT     15 
#define MTEX_LIN_LIGHT      16

/* brush_map_mode */
#define MTEX_MAP_MODE_FIXED    0
#define MTEX_MAP_MODE_TILED    1
#define MTEX_MAP_MODE_3D       2

/* **************** EnvMap ********************* */

/* type */
#define ENV_CUBE	0
#define ENV_PLANE	1
#define ENV_SPHERE	2

/* stype */
#define ENV_STATIC	0
#define ENV_ANIM	1
#define ENV_LOAD	2

/* ok */
#define ENV_NORMAL	1
#define ENV_OSA		2

/* **************** PointDensity ********************* */

/* source */
#define TEX_PD_PSYS			0
#define TEX_PD_OBJECT		1
#define TEX_PD_FILE			2

/* falloff_type */
#define TEX_PD_FALLOFF_STD		0
#define TEX_PD_FALLOFF_SMOOTH	1
#define TEX_PD_FALLOFF_SOFT		2
#define TEX_PD_FALLOFF_CONSTANT	3
#define TEX_PD_FALLOFF_ROOT		4

/* psys_cache_space */
#define TEX_PD_OBJECTLOC	0
#define TEX_PD_OBJECTSPACE	1
#define TEX_PD_WORLDSPACE	2

/* flag */
#define TEX_PD_TURBULENCE	1


/* noise_influence */
#define TEX_PD_NOISE_STATIC		0
#define TEX_PD_NOISE_VEL		1
#define TEX_PD_NOISE_AGE		2
#define TEX_PD_NOISE_TIME		3

/* color_source */
#define TEX_PD_COLOR_CONSTANT	0
#define TEX_PD_COLOR_PARTAGE	1
#define TEX_PD_COLOR_PARTSPEED	2
#define TEX_PD_COLOR_PARTVEL	3

#define POINT_DATA_VEL		1
#define POINT_DATA_LIFE		2

/******************** Voxel Data *****************************/
/* flag */
#define TEX_VD_STILL			1

/* interpolation */
#define TEX_VD_NEARESTNEIGHBOR		0
#define TEX_VD_LINEAR				1
#define TEX_VD_QUADRATIC        2
#define TEX_VD_TRICUBIC_CATROM  3
#define TEX_VD_TRICUBIC_BSPLINE 4
#define TEX_VD_TRICUBIC_SLOW    5

/* file format */
#define TEX_VD_BLENDERVOXEL		0
#define TEX_VD_RAW_8BIT			1
#define TEX_VD_RAW_16BIT		2
#define TEX_VD_IMAGE_SEQUENCE	3
#define TEX_VD_SMOKE			4

#endif