2 * blenlib/DNA_material_types.h (mar-2001 nzc)
6 * ***** BEGIN GPL/BL DUAL 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. The Blender
12 * Foundation also sells licenses for use in proprietary software under
13 * the Blender License. See http://www.blender.org/BL/ for information
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
26 * All rights reserved.
28 * The Original Code is: all of this file.
30 * Contributor(s): none yet.
32 * ***** END GPL/BL DUAL LICENSE BLOCK *****
34 #ifndef DNA_MATERIAL_TYPES_H
35 #define DNA_MATERIAL_TYPES_H
38 #include "DNA_scriptlink_types.h"
39 #include "DNA_listBase.h"
52 /* WATCH IT: change type? also make changes in ipo.h */
54 typedef struct Material {
57 short colormodel, flag;
58 /* note, keep this below synced with render_types.h */
60 float specr, specg, specb;
61 float mirr, mirg, mirb;
62 float ambr, ambb, ambg;
63 float amb, emit, ang, spectra, ray_mirror;
64 float alpha, ref, spec, zoffs, add;
66 /* end synced with render_types.h */
68 float fresnel_mir, fresnel_mir_i;
69 float fresnel_tra, fresnel_tra_i;
70 float filter; /* filter added, for raytrace transparency and transmissivity */
71 float tx_limit, tx_falloff;
72 short ray_depth, ray_depth_tra;
76 float gloss_mir, gloss_tra;
77 short samp_gloss_mir, samp_gloss_tra;
78 float adapt_thresh_mir, adapt_thresh_tra;
79 float aniso_gloss_mir;
82 short shade_flag; /* like Cubic interpolation */
84 int mode, mode_l; /* mode_l is the or-ed result of all layer modes */
85 short flarec, starc, linec, ringc;
86 float hasize, flaresize, subsize, flareboost;
87 float strand_sta, strand_end, strand_ease, strand_surfnor;
88 float strand_min, strand_widthfade;
89 char strand_uvname[32];
91 float sbias; /* shadow bias to prevent terminator prob */
92 float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
93 float shad_alpha; /* in use for irregular shadowbuffer */
94 float padf; /* free padding, take me! */
96 /* for buttons and render*/
97 char rgbsel, texact, pr_type, use_nodes;
98 short pr_back, pr_lamp, septex, ml_flag; /* ml_flag is for disable base material */
101 short diff_shader, spec_shader;
102 float roughness, refrac;
103 float param[4]; /* size, smooth, size, smooth, for toonshader */
109 struct ColorBand *ramp_col;
110 struct ColorBand *ramp_spec;
111 char rampin_col, rampin_spec;
112 char rampblend_col, rampblend_spec;
113 short ramp_show, pad3;
114 float rampfac_col, rampfac_spec;
116 struct MTex *mtex[10];
117 struct bNodeTree *nodetree;
119 struct Group *group; /* light group */
120 struct PreviewImage * preview;
122 /* dynamic properties */
123 float friction, fh, reflect;
124 float fhdist, xyfrict;
125 short dynamode, pad2;
127 /* subsurface scattering */
128 float sss_radius[3], sss_col[3];
129 float sss_error, sss_scale, sss_ior;
130 float sss_colfac, sss_texfac;
131 float sss_front, sss_back;
132 short sss_flag, sss_preset;
134 /* yafray: absorption color, dispersion parameters and material preset menu */
135 float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr;
136 int YF_dsmp, YF_preset, YF_djit;
138 ScriptLink scriptlink;
141 /* **************** MATERIAL ********************* */
143 /* maximum number of materials per material array
144 * (on object, mesh, lamp, etc.)
159 #define MA_TRACEBLE 1
163 #define MA_VERTEXCOL 16
166 #define MA_VERTEXCOLP 128
168 #define MA_HALO_RINGS 256
170 #define MA_HALO_LINES 512
171 #define MA_ONLYSHADOW 1024
172 #define MA_HALO_XALPHA 1024
173 #define MA_STAR 0x800
174 #define MA_FACETEXTURE 0x800
175 #define MA_HALOTEX 0x1000
176 #define MA_HALOPUNO 0x2000
177 #define MA_ONLYCAST 0x2000
178 #define MA_NOMIST 0x4000
179 #define MA_HALO_SHADE 0x4000
180 #define MA_HALO_FLARE 0x8000
181 #define MA_RADIO 0x10000
182 #define MA_RAYTRANSP 0x20000
183 #define MA_RAYMIRROR 0x40000
184 #define MA_SHADOW_TRA 0x80000
185 #define MA_RAMP_COL 0x100000
186 #define MA_RAMP_SPEC 0x200000
187 #define MA_RAYBIAS 0x400000
188 #define MA_FULL_OSA 0x800000
189 #define MA_TANGENT_STR 0x1000000
190 #define MA_SHADBUF 0x2000000
191 /* note; we drop MA_TANGENT_STR later to become tangent_u */
192 #define MA_TANGENT_V 0x4000000
193 /* qdn: a bit clumsy this, tangents needed for normal maps separated from shading */
194 #define MA_NORMAP_TANG 0x8000000
195 #define MA_GROUP_NOLAY 0x10000000
196 #define MA_FACETEXTURE_ALPHA 0x20000000
197 #define MA_STR_B_UNITS 0x40000000
198 #define MA_STR_SURFDIFF 0x80000000
200 #define MA_MODE_MASK 0x6fffffff /* all valid mode bits */
202 /* ray mirror fadeout */
203 #define MA_RAYMIR_FADETOSKY 0
204 #define MA_RAYMIR_FADETOMAT 1
210 #define MA_DIFF_LAMBERT 0
211 #define MA_DIFF_ORENNAYAR 1
212 #define MA_DIFF_TOON 2
213 #define MA_DIFF_MINNAERT 3
214 #define MA_DIFF_FRESNEL 4
217 #define MA_SPEC_COOKTORR 0
218 #define MA_SPEC_PHONG 1
219 #define MA_SPEC_BLINN 2
220 #define MA_SPEC_TOON 3
221 #define MA_SPEC_WARDISO 4
224 #define MA_DRAW_DYNABUTS 1
228 #define MA_RAMP_IN_SHADER 0
229 #define MA_RAMP_IN_ENERGY 1
230 #define MA_RAMP_IN_NOR 2
231 #define MA_RAMP_IN_RESULT 3
233 #define MA_RAMP_BLEND 0
234 #define MA_RAMP_ADD 1
235 #define MA_RAMP_MULT 2
236 #define MA_RAMP_SUB 3
237 #define MA_RAMP_SCREEN 4
238 #define MA_RAMP_DIV 5
239 #define MA_RAMP_DIFF 6
240 #define MA_RAMP_DARK 7
241 #define MA_RAMP_LIGHT 8
242 #define MA_RAMP_OVERLAY 9
243 #define MA_RAMP_DODGE 10
244 #define MA_RAMP_BURN 11
245 #define MA_RAMP_HUE 12
246 #define MA_RAMP_SAT 13
247 #define MA_RAMP_VAL 14
248 #define MA_RAMP_COLOR 15
256 #define TEXCO_OBJECT 32
257 #define TEXCO_LAVECTOR 64
258 #define TEXCO_VIEW 128
259 #define TEXCO_STICKY 256
260 #define TEXCO_OSA 512
261 #define TEXCO_WINDOW 1024
263 #define TEXCO_TANGENT 4096
264 /* still stored in vertex->accum, 1 D */
265 #define TEXCO_STRAND 8192
266 #define TEXCO_STRESS 16384
267 #define TEXCO_SPEED 32768
272 #define MAP_COLSPEC 4
274 #define MAP_VARS (0xFFF0)
278 #define MAP_ALPHA 128
280 #define MAP_RAYMIRR 512
281 #define MAP_TRANSLU 1024
283 #define MAP_DISPLACE 4096
284 #define MAP_WARP 8192
285 #define MAP_LAYER 16384
288 //#define MAP_HA_COL 1
289 //#define MAP_HA_ALPHA 128
290 //#define MAP_HA_HAR 256
291 //#define MAP_HA_SIZE 2
292 //#define MAP_HA_ADD 64
296 #define MAP_PA_INIT 31
297 #define MAP_PA_TIME 1
298 #define MAP_PA_LIFE 2
299 #define MAP_PA_DENS 4
300 #define MAP_PA_SIZE 8
301 #define MAP_PA_LENGTH 16
303 #define MAP_PA_IVEL 32
305 #define MAP_PA_PVEL 64
307 #define MAP_PA_CACHE 912
308 #define MAP_PA_CLUMP 128
309 #define MAP_PA_KINK 256
310 #define MAP_PA_ROUGH 512
317 #define MA_SPHERE_A 4
327 #define MA_DIFF_SSS 1