Blender  V3.3
DNA_texture_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 #include "DNA_defs.h"
12 #include "DNA_image_types.h" /* ImageUser */
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct AnimData;
19 struct ColorBand;
20 struct CurveMapping;
21 struct Image;
22 struct Ipo;
23 struct Object;
24 struct PreviewImage;
25 struct Tex;
26 
27 typedef struct MTex {
29 
31  struct Object *object;
32  struct Tex *tex;
34  char uvname[64];
35 
38  char _pad[2];
39  float ofs[3], size[3], rot, random_angle;
40 
41  char _pad0[2];
42  short colormodel;
44  float r, g, b, k;
45  float def_var;
46 
47  /* common */
48  float colfac, varfac;
49 
50  /* material */
57 
58  /* particles */
62  float twistfac;
63 
64  /* light */
65  float shadowfac;
66 
67  /* world */
69 } MTex;
70 
71 #ifndef DNA_USHORT_FIX
72 # define DNA_USHORT_FIX
78 typedef unsigned short dna_ushort_fix;
79 #endif
80 
81 typedef struct CBData {
82  float r, g, b, a, pos;
83  int cur;
85 
90 typedef struct ColorBand {
91  short tot, cur;
92  char ipotype, ipotype_hue;
93  char color_mode;
94  char _pad[1];
95 
96  CBData data[32];
98 
99 typedef struct PointDensity {
101 
102  short flag;
103 
104  short falloff_type;
105  float falloff_softness;
106  float radius;
107  short source;
108  char _pad0[2];
109 
111  short color_source;
112  short ob_color_source;
113 
114  int totpoints;
115 
117  struct Object *object;
119  int psys;
121  short psys_cache_space;
123  short ob_cache_space;
125  char vertex_attribute_name[64];
126 
128  void *point_tree;
130  float *point_data;
131 
132  float noise_size;
133  short noise_depth;
134  short noise_influence;
135  short noise_basis;
136  char _pad1[6];
137  float noise_fac;
138 
139  float speed_scale, falloff_speed_scale;
140  char _pad2[4];
142  struct ColorBand *coba;
143 
145  struct CurveMapping *falloff_curve;
147 
148 typedef struct Tex {
150 
151  ID id;
153  struct AnimData *adt;
154 
155  float noisesize, turbul;
156  float bright, contrast, saturation, rfac, gfac, bfac;
157  float filtersize;
158  char _pad2[4];
159 
160  /* newnoise: musgrave parameters */
161  float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
162 
163  /* newnoise: distorted noise amount, musgrave & voronoi output scale */
164  float dist_amount, ns_outscale;
165 
166  /* newnoise: voronoi nearest neighbor weights, minkovsky exponent,
167  * distance metric & color type */
168  float vn_w1;
169  float vn_w2;
170  float vn_w3;
171  float vn_w4;
172  float vn_mexp;
173  short vn_distm, vn_coltype;
174 
175  /* noisedepth MUST be <= 30 else we get floating point exceptions */
176  short noisedepth, noisetype;
177 
178  /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
179  short noisebasis, noisebasis2;
180 
181  short imaflag, flag;
182  short type, stype;
183 
184  float cropxmin, cropymin, cropxmax, cropymax;
185  int texfilter;
186  int afmax; /* anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes */
187  short xrepeat, yrepeat;
188  short extend;
189 
190  /* variables disabled, moved to struct iuser */
191  short _pad0;
192  int len;
193  int frames, offset, sfra;
194 
195  float checkerdist, nabla;
196  char _pad1[4];
197 
198  struct ImageUser iuser;
199 
200  struct bNodeTree *nodetree;
201  /* old animation system, deprecated for 2.5 */
202  struct Ipo *ipo DNA_DEPRECATED;
203  struct Image *ima;
204  struct ColorBand *coba;
206 
207  char use_nodes;
208  char _pad[7];
209 
210 } Tex;
211 
213 typedef struct TexMapping {
214  float loc[3];
216  float rot[3];
217  float size[3];
218  int flag;
220  int type;
221 
222  float mat[4][4];
223  float min[3], max[3];
224  struct Object *ob;
225 
227 
228 typedef struct ColorMapping {
229  struct ColorBand coba;
230 
231  float bright, contrast, saturation;
232  int flag;
233 
234  float blend_color[3];
237  char _pad[4];
239 
240 /* texmap->flag */
241 #define TEXMAP_CLIP_MIN 1
242 #define TEXMAP_CLIP_MAX 2
243 #define TEXMAP_UNIT_MATRIX 4
244 
245 /* texmap->type */
246 #define TEXMAP_TYPE_POINT 0
247 #define TEXMAP_TYPE_TEXTURE 1
248 #define TEXMAP_TYPE_VECTOR 2
249 #define TEXMAP_TYPE_NORMAL 3
250 
251 /* colormap->flag */
252 #define COLORMAP_USE_RAMP 1
253 
254 /* **************** TEX ********************* */
255 
256 /* type */
257 #define TEX_CLOUDS 1
258 #define TEX_WOOD 2
259 #define TEX_MARBLE 3
260 #define TEX_MAGIC 4
261 #define TEX_BLEND 5
262 #define TEX_STUCCI 6
263 #define TEX_NOISE 7
264 #define TEX_IMAGE 8
265 //#define TEX_PLUGIN 9 /* Deprecated */
266 //#define TEX_ENVMAP 10 /* Deprecated */
267 #define TEX_MUSGRAVE 11
268 #define TEX_VORONOI 12
269 #define TEX_DISTNOISE 13
270 //#define TEX_POINTDENSITY 14 /* Deprecated */
271 //#define TEX_VOXELDATA 15 /* Deprecated */
272 //#define TEX_OCEAN 16 /* Deprecated */
273 
274 /* musgrave stype */
275 #define TEX_MFRACTAL 0
276 #define TEX_RIDGEDMF 1
277 #define TEX_HYBRIDMF 2
278 #define TEX_FBM 3
279 #define TEX_HTERRAIN 4
280 
281 /* newnoise: noisebasis 1 & 2 */
282 #define TEX_BLENDER 0
283 #define TEX_STDPERLIN 1
284 #define TEX_NEWPERLIN 2
285 #define TEX_VORONOI_F1 3
286 #define TEX_VORONOI_F2 4
287 #define TEX_VORONOI_F3 5
288 #define TEX_VORONOI_F4 6
289 #define TEX_VORONOI_F2F1 7
290 #define TEX_VORONOI_CRACKLE 8
291 #define TEX_CELLNOISE 14
292 
293 /* newnoise: Voronoi distance metrics, vn_distm */
294 #define TEX_DISTANCE 0
295 #define TEX_DISTANCE_SQUARED 1
296 #define TEX_MANHATTAN 2
297 #define TEX_CHEBYCHEV 3
298 #define TEX_MINKOVSKY_HALF 4
299 #define TEX_MINKOVSKY_FOUR 5
300 #define TEX_MINKOVSKY 6
301 
302 /* imaflag */
303 #define TEX_INTERPOL (1 << 0)
304 #define TEX_USEALPHA (1 << 1)
305 #define TEX_MIPMAP (1 << 2)
306 #define TEX_IMAROT (1 << 4)
307 #define TEX_CALCALPHA (1 << 5)
308 #define TEX_NORMALMAP (1 << 11)
309 #define TEX_GAUSS_MIP (1 << 12)
310 #define TEX_FILTER_MIN (1 << 13)
311 #define TEX_DERIVATIVEMAP (1 << 14)
312 
313 /* texfilter */
314 #define TXF_BOX 0 /* Blender's old texture filtering method. */
315 #define TXF_EWA 1
316 #define TXF_FELINE 2
317 #define TXF_AREA 3
318 
319 /* flag */
320 #define TEX_COLORBAND (1 << 0)
321 #define TEX_FLIPBLEND (1 << 1)
322 #define TEX_NEGALPHA (1 << 2)
323 #define TEX_CHECKER_ODD (1 << 3)
324 #define TEX_CHECKER_EVEN (1 << 4)
325 #define TEX_PRV_ALPHA (1 << 5)
326 #define TEX_PRV_NOR (1 << 6)
327 #define TEX_REPEAT_XMIR (1 << 7)
328 #define TEX_REPEAT_YMIR (1 << 8)
329 #define TEX_FLAG_MASK \
330  (TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | \
331  TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR)
332 #define TEX_DS_EXPAND (1 << 9)
333 #define TEX_NO_CLAMP (1 << 10)
334 
335 /* extend (starts with 1 because of backward comp.) */
336 #define TEX_EXTEND 1
337 #define TEX_CLIP 2
338 #define TEX_REPEAT 3
339 #define TEX_CLIPCUBE 4
340 #define TEX_CHECKER 5
341 
342 /* noisetype */
343 #define TEX_NOISESOFT 0
344 #define TEX_NOISEPERL 1
345 
346 /* tex->noisebasis2 in texture.c - wood waveforms */
347 #define TEX_SIN 0
348 #define TEX_SAW 1
349 #define TEX_TRI 2
350 
351 /* tex->stype in texture.c - wood types */
352 #define TEX_BAND 0
353 #define TEX_RING 1
354 #define TEX_BANDNOISE 2
355 #define TEX_RINGNOISE 3
356 
357 /* tex->stype in texture.c - cloud types */
358 #define TEX_DEFAULT 0
359 #define TEX_COLOR 1
360 
361 /* tex->stype in texture.c - marble types */
362 #define TEX_SOFT 0
363 #define TEX_SHARP 1
364 #define TEX_SHARPER 2
365 
366 /* tex->stype in texture.c - blend types */
367 #define TEX_LIN 0
368 #define TEX_QUAD 1
369 #define TEX_EASE 2
370 #define TEX_DIAG 3
371 #define TEX_SPHERE 4
372 #define TEX_HALO 5
373 #define TEX_RAD 6
374 
375 /* tex->stype in texture.c - stucci types */
376 #define TEX_PLASTIC 0
377 #define TEX_WALLIN 1
378 #define TEX_WALLOUT 2
379 
380 /* tex->stype in texture.c - voronoi types */
381 #define TEX_INTENSITY 0
382 #define TEX_COL1 1
383 #define TEX_COL2 2
384 #define TEX_COL3 3
385 
386 /* mtex->normapspace */
387 #define MTEX_NSPACE_CAMERA 0
388 #define MTEX_NSPACE_WORLD 1
389 #define MTEX_NSPACE_OBJECT 2
390 #define MTEX_NSPACE_TANGENT 3
391 
392 /* wrap */
393 #define MTEX_FLAT 0
394 #define MTEX_CUBE 1
395 #define MTEX_TUBE 2
396 #define MTEX_SPHERE 3
397 
398 /* return value */
399 #define TEX_INT 0
400 #define TEX_RGB 1
401 
402 /* pr_texture in material, world, light. */
403 #define TEX_PR_TEXTURE 0
404 #define TEX_PR_OTHER 1
405 #define TEX_PR_BOTH 2
406 
407 /* **************** MTEX ********************* */
408 
409 /* proj */
410 #define PROJ_N 0
411 #define PROJ_X 1
412 #define PROJ_Y 2
413 #define PROJ_Z 3
414 
415 /* blendtype */
416 #define MTEX_BLEND 0
417 #define MTEX_MUL 1
418 #define MTEX_ADD 2
419 #define MTEX_SUB 3
420 #define MTEX_DIV 4
421 #define MTEX_DARK 5
422 #define MTEX_DIFF 6
423 #define MTEX_LIGHT 7
424 #define MTEX_SCREEN 8
425 #define MTEX_OVERLAY 9
426 #define MTEX_BLEND_HUE 10
427 #define MTEX_BLEND_SAT 11
428 #define MTEX_BLEND_VAL 12
429 #define MTEX_BLEND_COLOR 13
430 #define MTEX_SOFT_LIGHT 15
431 #define MTEX_LIN_LIGHT 16
432 
433 /* brush_map_mode */
434 #define MTEX_MAP_MODE_VIEW 0
435 #define MTEX_MAP_MODE_TILED 1
436 #define MTEX_MAP_MODE_3D 2
437 #define MTEX_MAP_MODE_AREA 3
438 #define MTEX_MAP_MODE_RANDOM 4
439 #define MTEX_MAP_MODE_STENCIL 5
440 
441 /* brush_angle_mode */
442 #define MTEX_ANGLE_RANDOM 1
443 #define MTEX_ANGLE_RAKE 2
444 
445 /* **************** ColorBand ********************* */
446 
448 enum {
452 };
453 
455 enum {
461 };
462 
464 enum {
469 };
470 
471 /* **************** PointDensity ********************* */
472 
473 /* source */
474 #define TEX_PD_PSYS 0
475 #define TEX_PD_OBJECT 1
476 #define TEX_PD_FILE 2
477 
478 /* falloff_type */
479 #define TEX_PD_FALLOFF_STD 0
480 #define TEX_PD_FALLOFF_SMOOTH 1
481 #define TEX_PD_FALLOFF_SOFT 2
482 #define TEX_PD_FALLOFF_CONSTANT 3
483 #define TEX_PD_FALLOFF_ROOT 4
484 #define TEX_PD_FALLOFF_PARTICLE_AGE 5
485 #define TEX_PD_FALLOFF_PARTICLE_VEL 6
486 
487 /* psys_cache_space */
488 #define TEX_PD_OBJECTLOC 0
489 #define TEX_PD_OBJECTSPACE 1
490 #define TEX_PD_WORLDSPACE 2
491 
492 /* flag */
493 #define TEX_PD_TURBULENCE 1
494 #define TEX_PD_FALLOFF_CURVE 2
495 
496 /* noise_influence */
497 #define TEX_PD_NOISE_STATIC 0
498 /* #define TEX_PD_NOISE_VEL 1 */ /* Deprecated */
499 /* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
500 /* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
501 
503 enum {
505  /* color_source: particles */
509  /* color_source: vertices */
513 };
514 
515 #define POINT_DATA_VEL 1
516 #define POINT_DATA_LIFE 2
517 #define POINT_DATA_COLOR 4
518 
519 #ifdef __cplusplus
520 }
521 #endif
ID and Library types, which are fundamental for sdna.
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition: DNA_defs.h:64
#define DNA_DEPRECATED
Definition: DNA_defs.h:21
@ COLBAND_BLEND_RGB
@ COLBAND_BLEND_HSL
@ COLBAND_BLEND_HSV
unsigned short dna_ushort_fix
@ COLBAND_HUE_FAR
@ COLBAND_HUE_CW
@ COLBAND_HUE_NEAR
@ COLBAND_HUE_CCW
@ COLBAND_INTERP_LINEAR
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_EASE
@ COLBAND_INTERP_CARDINAL
struct ColorBand ColorBand
struct TexMapping TexMapping
@ 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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its saturation
int len
Definition: draw_manager.c:108
uint pos
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static const pxr::TfToken preview("preview", pxr::TfToken::Immortal)
#define min(a, b)
Definition: sort.c:35
Definition: DNA_ID.h:368
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
float padensfac
char brush_map_mode
float translfac
short blendtype
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
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 emitfac
float shadowfac
char _pad[2]
float sizefac
struct Tex * tex
float colspecfac
float raymirrfac
float reflfac
float max