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;
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;
89 float sbias; /* shadow bias */
90 float shad_alpha, padf; /* in use for irregular shadowbuffer */
92 /* for buttons and render*/
93 char rgbsel, texact, pr_type, use_nodes;
94 short pr_back, pr_lamp, septex, ml_flag; /* ml_flag is for disable base material */
97 short diff_shader, spec_shader;
98 float roughness, refrac;
99 float param[4]; /* size, smooth, size, smooth, for toonshader */
105 struct ColorBand *ramp_col;
106 struct ColorBand *ramp_spec;
107 char rampin_col, rampin_spec;
108 char rampblend_col, rampblend_spec;
109 short ramp_show, pad3;
110 float rampfac_col, rampfac_spec;
112 struct MTex *mtex[10];
113 struct bNodeTree *nodetree;
115 struct Group *group; /* light group */
116 struct PreviewImage * preview;
118 /* dynamic properties */
119 float friction, fh, reflect;
120 float fhdist, xyfrict;
121 short dynamode, pad2;
123 float sss_radius[3], sss_col[3];
124 float sss_error, sss_scale, sss_ior;
125 float sss_colfac, sss_texfac;
126 float sss_front, sss_back;
127 short sss_flag, sss_preset;
129 /* yafray: absorption color, dispersion parameters and material preset menu */
130 float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr;
131 int YF_dsmp, YF_preset, YF_djit;
133 ScriptLink scriptlink;
136 /* **************** MATERIAL ********************* */
138 /* maximum number of materials per material array
139 * (on object, mesh, lamp, etc.)
154 #define MA_TRACEBLE 1
158 #define MA_VERTEXCOL 16
161 #define MA_VERTEXCOLP 128
163 #define MA_HALO_RINGS 256
165 #define MA_HALO_LINES 512
166 #define MA_ONLYSHADOW 1024
167 #define MA_HALO_XALPHA 1024
168 #define MA_STAR 0x800
169 #define MA_FACETEXTURE 0x800
170 #define MA_HALOTEX 0x1000
171 #define MA_HALOPUNO 0x2000
172 #define MA_ONLYCAST 0x2000
173 #define MA_NOMIST 0x4000
174 #define MA_HALO_SHADE 0x4000
175 #define MA_HALO_FLARE 0x8000
176 #define MA_RADIO 0x10000
177 #define MA_RAYTRANSP 0x20000
178 #define MA_RAYMIRROR 0x40000
179 #define MA_SHADOW_TRA 0x80000
180 #define MA_RAMP_COL 0x100000
181 #define MA_RAMP_SPEC 0x200000
182 #define MA_RAYBIAS 0x400000
183 #define MA_FULL_OSA 0x800000
184 #define MA_TANGENT_STR 0x1000000
185 #define MA_SHADBUF 0x2000000
186 /* note; we drop MA_TANGENT_STR later to become tangent_u */
187 #define MA_TANGENT_V 0x4000000
188 /* qdn: a bit clumsy this, tangents needed for normal maps separated from shading */
189 #define MA_NORMAP_TANG 0x8000000
190 #define MA_GROUP_NOLAY 0x10000000
192 #define MA_MODE_MASK 0x1fffffff /* all valid mode bits */
194 /* ray mirror fadeout */
195 #define MA_RAYMIR_FADETOSKY 0
196 #define MA_RAYMIR_FADETOMAT 1
199 #define MA_DIFF_LAMBERT 0
200 #define MA_DIFF_ORENNAYAR 1
201 #define MA_DIFF_TOON 2
202 #define MA_DIFF_MINNAERT 3
203 #define MA_DIFF_FRESNEL 4
206 #define MA_SPEC_COOKTORR 0
207 #define MA_SPEC_PHONG 1
208 #define MA_SPEC_BLINN 2
209 #define MA_SPEC_TOON 3
210 #define MA_SPEC_WARDISO 4
213 #define MA_DRAW_DYNABUTS 1
217 #define MA_RAMP_IN_SHADER 0
218 #define MA_RAMP_IN_ENERGY 1
219 #define MA_RAMP_IN_NOR 2
220 #define MA_RAMP_IN_RESULT 3
222 #define MA_RAMP_BLEND 0
223 #define MA_RAMP_ADD 1
224 #define MA_RAMP_MULT 2
225 #define MA_RAMP_SUB 3
226 #define MA_RAMP_SCREEN 4
227 #define MA_RAMP_DIV 5
228 #define MA_RAMP_DIFF 6
229 #define MA_RAMP_DARK 7
230 #define MA_RAMP_LIGHT 8
231 #define MA_RAMP_OVERLAY 9
232 #define MA_RAMP_DODGE 10
233 #define MA_RAMP_BURN 11
234 #define MA_RAMP_HUE 12
235 #define MA_RAMP_SAT 13
236 #define MA_RAMP_VAL 14
237 #define MA_RAMP_COLOR 15
245 #define TEXCO_OBJECT 32
246 #define TEXCO_LAVECTOR 64
247 #define TEXCO_VIEW 128
248 #define TEXCO_STICKY 256
249 #define TEXCO_OSA 512
250 #define TEXCO_WINDOW 1024
252 #define TEXCO_TANGENT 4096
253 /* still stored in vertex->accum, 1 D */
254 #define TEXCO_STRAND 8192
255 #define TEXCO_STRESS 16384
256 #define TEXCO_SPEED 32768
261 #define MAP_COLSPEC 4
263 #define MAP_VARS (0xFFF0)
267 #define MAP_ALPHA 128
269 #define MAP_RAYMIRR 512
270 #define MAP_TRANSLU 1024
272 #define MAP_DISPLACE 4096
273 #define MAP_WARP 8192
274 #define MAP_LAYER 16384
281 #define MA_SPHERE_A 4
291 #define MA_DIFF_SSS 1