2 * blenlib/DNA_material_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_MATERIAL_TYPES_H
32 #define DNA_MATERIAL_TYPES_H
35 #include "DNA_listBase.h"
48 /* WATCH IT: change type? also make changes in ipo.h */
50 typedef struct Material {
52 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
54 short material_type, flag;
55 /* note, keep this below synced with render_types.h */
57 float specr, specg, specb;
58 float mirr, mirg, mirb;
59 float ambr, ambb, ambg;
60 float amb, emit, ang, spectra, ray_mirror;
61 float alpha, ref, spec, zoffs, add;
63 /* end synced with render_types.h */
65 float fresnel_mir, fresnel_mir_i;
66 float fresnel_tra, fresnel_tra_i;
67 float filter; /* filter added, for raytrace transparency and transmissivity */
68 float tx_limit, tx_falloff;
69 short ray_depth, ray_depth_tra;
73 float gloss_mir, gloss_tra;
74 short samp_gloss_mir, samp_gloss_tra;
75 float adapt_thresh_mir, adapt_thresh_tra;
76 float aniso_gloss_mir;
79 short shade_flag; /* like Cubic interpolation */
81 int mode, mode_l; /* mode_l is the or-ed result of all layer modes */
82 short flarec, starc, linec, ringc;
83 float hasize, flaresize, subsize, flareboost;
84 float strand_sta, strand_end, strand_ease, strand_surfnor;
85 float strand_min, strand_widthfade;
86 char strand_uvname[32];
88 float sbias; /* shadow bias to prevent terminator prob */
89 float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
90 float shad_alpha; /* in use for irregular shadowbuffer */
93 /* for buttons and render*/
94 char rgbsel, texact, pr_type, use_nodes;
95 short pr_back, pr_lamp, pr_texture, ml_flag; /* ml_flag is for disable base material */
98 short diff_shader, spec_shader;
99 float roughness, refrac;
100 /* XXX param[4] needs review and improvement (shader system as whole anyway)
101 This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
102 float param[4]; /* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
108 struct ColorBand *ramp_col;
109 struct ColorBand *ramp_spec;
110 char rampin_col, rampin_spec;
111 char rampblend_col, rampblend_spec;
112 short ramp_show, pad3;
113 float rampfac_col, rampfac_spec;
115 struct MTex *mtex[18]; /* MAX_MTEX */
116 struct bNodeTree *nodetree;
117 struct Ipo *ipo; // XXX depreceated... old animation system
118 struct Group *group; /* light group */
119 struct PreviewImage * preview;
121 /* dynamic properties */
122 float friction, fh, reflect;
123 float fhdist, xyfrict;
124 short dynamode, pad2;
126 /* subsurface scattering */
127 float sss_radius[3], sss_col[3];
128 float sss_error, sss_scale, sss_ior;
129 float sss_colfac, sss_texfac;
130 float sss_front, sss_back;
131 short sss_flag, sss_preset;
133 /* yafray: absorption color, dispersion parameters and material preset menu */
134 float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr;
135 int YF_dsmp, YF_preset, YF_djit;
137 ListBase gpumaterial; /* runtime */
140 /* **************** MATERIAL ********************* */
142 /* maximum number of materials per material array.
143 * (on object, mesh, lamp, etc.). limited by
144 * short mat_nr in verts, faces. */
148 #define MA_TYPE_SURFACE 0
149 #define MA_TYPE_HALO 1
150 #define MA_TYPE_VOLUME 2
151 #define MA_TYPE_WIRE 3
157 #define MA_DS_EXPAND 2
160 #define MA_TRACEBLE 1
163 #define MA_WIRE 8 /* deprecated */
164 #define MA_VERTEXCOL 16
165 #define MA_HALO_SOFT 16
166 #define MA_HALO 32 /* deprecated */
168 #define MA_VERTEXCOLP 128
170 #define MA_HALO_RINGS 256
172 #define MA_HALO_LINES 512
173 #define MA_ONLYSHADOW 1024
174 #define MA_HALO_XALPHA 1024
175 #define MA_STAR 0x800
176 #define MA_FACETEXTURE 0x800
177 #define MA_HALOTEX 0x1000
178 #define MA_HALOPUNO 0x2000
179 #define MA_ONLYCAST 0x2000
180 #define MA_NOMIST 0x4000
181 #define MA_HALO_SHADE 0x4000
182 #define MA_HALO_FLARE 0x8000
183 #define MA_RADIO 0x10000
184 #define MA_RAYTRANSP 0x20000
185 #define MA_RAYMIRROR 0x40000
186 #define MA_SHADOW_TRA 0x80000
187 #define MA_RAMP_COL 0x100000
188 #define MA_RAMP_SPEC 0x200000
189 #define MA_RAYBIAS 0x400000
190 #define MA_FULL_OSA 0x800000
191 #define MA_TANGENT_STR 0x1000000
192 #define MA_SHADBUF 0x2000000
193 /* note; we drop MA_TANGENT_STR later to become tangent_u */
194 #define MA_TANGENT_V 0x4000000
195 /* qdn: a bit clumsy this, tangents needed for normal maps separated from shading */
196 #define MA_NORMAP_TANG 0x8000000
197 #define MA_GROUP_NOLAY 0x10000000
198 #define MA_FACETEXTURE_ALPHA 0x20000000
199 #define MA_STR_B_UNITS 0x40000000
200 #define MA_STR_SURFDIFF 0x80000000
202 #define MA_MODE_MASK 0x6fffffff /* all valid mode bits */
204 /* ray mirror fadeout */
205 #define MA_RAYMIR_FADETOSKY 0
206 #define MA_RAYMIR_FADETOMAT 1
213 #define MA_DIFF_LAMBERT 0
214 #define MA_DIFF_ORENNAYAR 1
215 #define MA_DIFF_TOON 2
216 #define MA_DIFF_MINNAERT 3
217 #define MA_DIFF_FRESNEL 4
220 #define MA_SPEC_COOKTORR 0
221 #define MA_SPEC_PHONG 1
222 #define MA_SPEC_BLINN 2
223 #define MA_SPEC_TOON 3
224 #define MA_SPEC_WARDISO 4
227 #define MA_DRAW_DYNABUTS 1
231 #define MA_RAMP_IN_SHADER 0
232 #define MA_RAMP_IN_ENERGY 1
233 #define MA_RAMP_IN_NOR 2
234 #define MA_RAMP_IN_RESULT 3
236 #define MA_RAMP_BLEND 0
237 #define MA_RAMP_ADD 1
238 #define MA_RAMP_MULT 2
239 #define MA_RAMP_SUB 3
240 #define MA_RAMP_SCREEN 4
241 #define MA_RAMP_DIV 5
242 #define MA_RAMP_DIFF 6
243 #define MA_RAMP_DARK 7
244 #define MA_RAMP_LIGHT 8
245 #define MA_RAMP_OVERLAY 9
246 #define MA_RAMP_DODGE 10
247 #define MA_RAMP_BURN 11
248 #define MA_RAMP_HUE 12
249 #define MA_RAMP_SAT 13
250 #define MA_RAMP_VAL 14
251 #define MA_RAMP_COLOR 15
259 #define TEXCO_OBJECT 32
260 #define TEXCO_LAVECTOR 64
261 #define TEXCO_VIEW 128
262 #define TEXCO_STICKY 256
263 #define TEXCO_OSA 512
264 #define TEXCO_WINDOW 1024
266 #define TEXCO_TANGENT 4096
267 /* still stored in vertex->accum, 1 D */
268 #define TEXCO_STRAND 8192
269 #define TEXCO_STRESS 16384
270 #define TEXCO_SPEED 32768
275 #define MAP_COLSPEC 4
277 #define MAP_VARS (0xFFF0)
281 #define MAP_ALPHA 128
283 #define MAP_RAYMIRR 512
284 #define MAP_TRANSLU 1024
286 #define MAP_DISPLACE 4096
287 #define MAP_WARP 8192
288 #define MAP_LAYER 16384
291 //#define MAP_HA_COL 1
292 //#define MAP_HA_ALPHA 128
293 //#define MAP_HA_HAR 256
294 //#define MAP_HA_SIZE 2
295 //#define MAP_HA_ADD 64
299 #define MAP_PA_INIT 31
300 #define MAP_PA_TIME 1
301 #define MAP_PA_LIFE 2
302 #define MAP_PA_DENS 4
303 #define MAP_PA_SIZE 8
304 #define MAP_PA_LENGTH 16
306 #define MAP_PA_IVEL 32
308 #define MAP_PA_PVEL 64
310 #define MAP_PA_CACHE 912
311 #define MAP_PA_CLUMP 128
312 #define MAP_PA_KINK 256
313 #define MAP_PA_ROUGH 512
320 #define MA_SPHERE_A 4
331 #define MA_DIFF_SSS 1