diff options
author | Ton Roosendaal <ton@blender.org> | 2005-12-04 17:32:21 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-12-04 17:32:21 +0300 |
commit | aa939b859904fcfad5c6782e14621da74bbf8118 (patch) | |
tree | ccf58f615f767fea93ddcfc01988244efdc0c643 /source/blender/makesdna/DNA_material_types.h | |
parent | c2cff1cbcf71634de3aca184c70cc4bd23fe35a8 (diff) |
Orange branch feature; Material Layering
(WIP, don't bugs for this in tracker yet please!)
- New Panel "Layers" in Material buttons, allows to add unlimited amount
of materials on top of each other.
- Every Layer is actually just another Material, which gets rendered/shaded
(including texture), and then added on top of previous layer with an
operation like Mix, Add, Mult, etc.
- Layers render fully independent, so bumpmaps are not passed on to next
layers.
- Per Layer you can set if it influences Diffuse, Specular or Alpha
- If a Material returns alpha (like from texture), the alpha value is
used for adding the layers too.
- New texture "Map To" channel allows to have a texture work on a Layer
- Each layer, including basis Material, can be turned on/off individually
Notes:
- at this moment, the full shading pass happens for each layer, including
shadow, AO and raytraced mirror or transparency...
- I had to remove old hacks from preview render, which corrected reflected
normals for preview texturing.
- still needs loadsa testing!
Diffstat (limited to 'source/blender/makesdna/DNA_material_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_material_types.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 5ef327502e1..395c438c6e3 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -34,10 +34,9 @@ #ifndef DNA_MATERIAL_TYPES_H #define DNA_MATERIAL_TYPES_H -/* #include "BLI_listBase.h" */ - #include "DNA_ID.h" #include "DNA_scriptlink_types.h" +#include "DNA_listBase.h" #ifndef MAX_MTEX #define MAX_MTEX 10 @@ -48,20 +47,32 @@ struct Ipo; struct Material; struct ColorBand; +typedef struct MaterialLayer { + struct MaterialLayer *next, *prev; + + struct Material *mat; + float blendfac; + short flag, blendmethod, menunr, pad; + int pad2; + +} MaterialLayer; + /* WATCH IT: change type? also make changes in ipo.h */ typedef struct Material { ID id; short colormodel, lay; /* lay: for dynamics (old engine, until 2.04) */ + /* note, keep this below synced with render_types.h */ float r, g, b; float specr, specg, specb; float mirr, mirg, mirb; float ambr, ambb, ambg; - float amb, emit, ang, spectra, ray_mirror; float alpha, ref, spec, zoffs, add; float translucency; + /* end synced with render_types.h */ + float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; float filter; /* filter added, for raytrace transparency */ @@ -69,16 +80,15 @@ typedef struct Material { short har; char seed1, seed2; - int mode; - int mode2; /* even more material settings :) */ + int mode, mode_l; /* mode_l is the or-ed result of all layer modes */ short flarec, starc, linec, ringc; float hasize, flaresize, subsize, flareboost; float strand_sta, strand_end, strand_ease; + float pad1; /* for buttons and render*/ char rgbsel, texact, pr_type, pad; - short pr_back, pr_lamp, septex, pad4; - int pad5; + short pr_back, pr_lamp, septex, ml_flag; /* ml_flag is for disable base material */ /* shaders */ short diff_shader, spec_shader; @@ -97,6 +107,7 @@ typedef struct Material { float rampfac_col, rampfac_spec; struct MTex *mtex[10]; + ListBase layers; struct Ipo *ipo; /* dynamic properties */ @@ -107,7 +118,7 @@ typedef struct Material { /* yafray: absorption color, dispersion parameters and material preset menu */ float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr; int YF_dsmp, YF_preset, YF_djit; - + ScriptLink scriptlink; } Material; @@ -161,7 +172,7 @@ typedef struct Material { #define MA_DIFF_LAMBERT 0 #define MA_DIFF_ORENNAYAR 1 #define MA_DIFF_TOON 2 -#define MA_DIFF_MINNAERT 3 +#define MA_DIFF_MINNAERT 3 /* spec_shader */ #define MA_SPEC_COOKTORR 0 @@ -224,6 +235,7 @@ typedef struct Material { #define MAP_AMB 2048 #define MAP_DISPLACE 4096 #define MAP_WARP 8192 +#define MAP_LAYER 16384 /* pr_type */ #define MA_FLAT 0 @@ -233,5 +245,13 @@ typedef struct Material { /* pr_back */ #define MA_DARK 1 +/* MaterialLayer flag */ +#define ML_ACTIVE 1 +#define ML_RENDER 2 +#define ML_NEG_NORMAL 4 +#define ML_DIFFUSE 8 +#define ML_SPECULAR 16 +#define ML_ALPHA 32 + #endif |