Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesdna/DNA_material_types.h')
-rw-r--r--source/blender/makesdna/DNA_material_types.h450
1 files changed, 141 insertions, 309 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index f024a3a3e9c..2de63f5d59f 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -40,198 +40,134 @@
#define MAX_MTEX 18
#endif
-struct MTex;
struct Image;
-struct ColorBand;
-struct Group;
struct bNodeTree;
struct AnimData;
struct Ipo;
/* WATCH IT: change type? also make changes in ipo.h */
-typedef struct VolumeSettings {
- float density;
- float emission;
- float scattering;
- float reflection;
-
- float emission_col[3];
- float transmission_col[3];
- float reflection_col[3];
-
- float density_scale;
- float depth_cutoff;
- float asymmetry;
-
- short stepsize_type;
- short shadeflag;
- short shade_type;
- short precache_resolution;
-
- float stepsize;
- float ms_diff;
- float ms_intensity;
- float ms_spread;
-} VolumeSettings;
-
-/* Game Engine Options (old Texface mode, transp and flag) */
-typedef struct GameSettings {
- int flag;
- int alpha_blend;
- int face_orientation;
- int pad1;
-} GameSettings;
-
typedef struct TexPaintSlot {
struct Image *ima; /* image to be painted on */
char *uvname; /* customdata index for uv layer, MAX_NAME*/
- int index; /* index for mtex slot in material for blender internal */
+ int valid; /* do we have a valid image and UV map */
int pad;
} TexPaintSlot;
+typedef struct MaterialGPencilStyle {
+ struct Image *sima; /* Texture image for strokes */
+ struct Image *ima; /* Texture image for filling */
+ float stroke_rgba[4]; /* color for paint and strokes (alpha included) */
+ float fill_rgba[4]; /* color that should be used for drawing "fills" for strokes (alpha included) */
+ float mix_rgba[4]; /* secondary color used for gradients and other stuff */
+ short flag; /* settings */
+ short index; /* custom index for passes */
+ short stroke_style; /* style for drawing strokes (used to select shader type) */
+ short fill_style; /* style for filling areas (used to select shader type) */
+ float mix_factor; /* factor used to define shader behavior (several uses) */
+ float gradient_angle; /* angle used for gradients orientation */
+ float gradient_radius; /* radius for radial gradients */
+ float pattern_gridsize; /* cheesboard size */
+ float gradient_scale[2]; /* uv coordinates scale */
+ float gradient_shift[2]; /* factor to shift filling in 2d space */
+ float texture_angle; /* angle used for texture orientation */
+ float texture_scale[2]; /* texture scale (separated of uv scale) */
+ float texture_offset[2]; /* factor to shift texture in 2d space */
+ float texture_opacity; /* texture opacity */
+ float texture_pixsize; /* pixel size for uv along the stroke */
+ int mode; /* drawing mode (line or dots) */
+
+ int gradient_type; /* type of gradient */
+ char pad[4];
+} MaterialGPencilStyle;
+
+/* MaterialGPencilStyle->flag */
+typedef enum eMaterialGPencilStyle_Flag {
+ /* Fill Texture is a pattern */
+ GP_STYLE_FILL_PATTERN = (1 << 0),
+ /* don't display color */
+ GP_STYLE_COLOR_HIDE = (1 << 1),
+ /* protected from further editing */
+ GP_STYLE_COLOR_LOCKED = (1 << 2),
+ /* do onion skinning */
+ GP_STYLE_COLOR_ONIONSKIN = (1 << 3),
+ /* clamp texture */
+ GP_STYLE_COLOR_TEX_CLAMP = (1 << 4),
+ /* mix texture */
+ GP_STYLE_COLOR_TEX_MIX = (1 << 5),
+ /* Flip fill colors */
+ GP_STYLE_COLOR_FLIP_FILL = (1 << 6),
+ /* Stroke Texture is a pattern */
+ GP_STYLE_STROKE_PATTERN = (1 << 7),
+ /* Stroke show main switch */
+ GP_STYLE_STROKE_SHOW = (1 << 8),
+ /* Fill show main switch */
+ GP_STYLE_FILL_SHOW = (1 << 9)
+} eMaterialGPencilStyle_Flag;
+
+typedef enum eMaterialGPencilStyle_Mode {
+ GP_STYLE_MODE_LINE = 0, /* line */
+ GP_STYLE_MODE_DOTS = 1, /* dots */
+ GP_STYLE_MODE_BOX = 2, /* rectangles */
+} eMaterialGPencilStyle_Mode;
+
typedef struct Material {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
- short material_type, flag;
- /* note, keep this below synced with render_types.h */
+ short flag, pad1[7];
+
+ /* Colors from Blender Internal that we are still using. */
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 */
-
- struct VolumeSettings vol;
- struct GameSettings game;
-
- float fresnel_mir, fresnel_mir_i;
- float fresnel_tra, fresnel_tra_i;
- float filter; /* filter added, for raytrace transparency and transmissivity */
- float tx_limit, tx_falloff;
- short ray_depth, ray_depth_tra;
- short har;
- char seed1, seed2;
-
- float gloss_mir, gloss_tra;
- short samp_gloss_mir, samp_gloss_tra;
- float adapt_thresh_mir, adapt_thresh_tra;
- float aniso_gloss_mir;
- float dist_mir;
- short fadeto_mir;
- short shade_flag; /* like Cubic interpolation */
-
- int mode, mode_l; /* mode_l is the or-ed result of all layer modes */
- int mode2, mode2_l; /* additional mode flags */
- short flarec, starc, linec, ringc;
- float hasize, flaresize, subsize, flareboost;
- float strand_sta, strand_end, strand_ease, strand_surfnor;
- float strand_min, strand_widthfade;
- char strand_uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
-
- float sbias; /* shadow bias to prevent terminator prob */
- float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
- float shad_alpha; /* in use for irregular shadowbuffer */
- int septex;
-
- /* for buttons and render*/
- char rgbsel, texact, pr_type, use_nodes;
- short pr_lamp, pr_texture, ml_flag; /* ml_flag is for disable base material */
-
- /* mapping */
- char mapflag, pad;
-
- /* shaders */
- short diff_shader, spec_shader;
- float roughness, refrac;
- /* XXX param[4] needs review and improvement (shader system as whole anyway)
- * This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
- float param[4]; /* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
- float rms;
- float darkness;
-
- /* runtime - OR'd from 'mtex' */
- short texco, mapto;
-
- /* ramp colors */
- struct ColorBand *ramp_col;
- struct ColorBand *ramp_spec;
- char rampin_col, rampin_spec;
- char rampblend_col, rampblend_spec;
- short ramp_show, pad3;
- float rampfac_col, rampfac_spec;
-
- struct MTex *mtex[18]; /* MAX_MTEX */
- struct bNodeTree *nodetree;
- struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
- struct Group *group; /* light group */
- struct PreviewImage *preview;
+ float alpha DNA_DEPRECATED;
+ float ray_mirror DNA_DEPRECATED;
+ float spec;
+ float gloss_mir DNA_DEPRECATED; /* renamed and inversed to roughness */
+ float roughness;
+ float metallic;
+ float pad4[2];
- /* dynamic properties */
- float friction, fh, reflect;
- float fhdist, xyfrict;
- short dynamode, pad2;
+ /* Ror buttons and render. */
+ char pr_type, use_nodes;
+ short pr_lamp, pr_texture;
- /* subsurface scattering */
- float sss_radius[3], sss_col[3];
- float sss_error, sss_scale, sss_ior;
- float sss_colfac, sss_texfac;
- float sss_front, sss_back;
- short sss_flag, sss_preset;
+ /* Index for render passes. */
+ short index;
- int mapto_textured; /* render-time cache to optimize texture lookups */
- short shadowonly_flag; /* "shadowsonly" type */
- short index; /* custom index for render passes */
+ struct bNodeTree *nodetree;
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
+ struct PreviewImage *preview;
- /* Freestyle line settings */
+ /* Freestyle line settings. */
float line_col[4];
short line_priority;
short vcol_alpha;
- /* texture painting */
+ /* Texture painting slots. */
short paint_active_slot;
short paint_clone_slot;
short tot_slots;
- short pad4[3];
+ short pad2[3];
- /* multiple tangent (Normal Map node) */
- char nmap_tangent_names[9][64]; /* [MAX_MTFACE+1][MAX_NAME]; +1 for empty name */
- int nmap_tangent_names_count, pad5;
-
- struct TexPaintSlot *texpaintslot; /* cached slot for painting. Make sure to recalculate before use
- * with refresh_texpaint_image_cache */
- ListBase gpumaterial; /* runtime */
-} Material;
+ /* Transparency. */
+ float alpha_threshold;
+ float refract_depth;
+ char blend_method;
+ char blend_shadow;
+ char blend_flag;
+ char pad3[5];
+ /* Cached slots for texture painting, must be refreshed in
+ * refresh_texpaint_image_cache before using. */
+ struct TexPaintSlot *texpaintslot;
-/* **************** GAME PROPERTIES ********************* */
-// Blend Transparency Options - alpha_blend /* match GPU_material::GPUBlendMode */
-#define GEMAT_SOLID 0 /* GPU_BLEND_SOLID */
-#define GEMAT_ADD (1 << 0) /* GPU_BLEND_ADD */
-#define GEMAT_ALPHA (1 << 1) /* GPU_BLEND_ALPHA */
-#define GEMAT_CLIP (1 << 2) /* GPU_BLEND_CLIP */
-#define GEMAT_ALPHA_SORT (1 << 3) /* GPU_BLEND_ALPHA_SORT */
-#define GEMAT_ALPHA_TO_COVERAGE (1 << 4) /* GPU_BLEND_ALPHA_TO_COVERAGE */
-
-// Game Options - flag
-#define GEMAT_BACKCULL (1 << 4) /* KX_BACKCULL */
-#define GEMAT_SHADED (1 << 5) /* KX_LIGHT */
-#define GEMAT_TEXT (1 << 6) /* RAS_RENDER_3DPOLYGON_TEXT */
-#define GEMAT_NOPHYSICS (1 << 7)
-#define GEMAT_INVISIBLE (1 << 8)
-
-// Face Orientation Options - face_orientation
-#define GEMAT_NORMAL 0
-#define GEMAT_HALO (1 << 9) /* BILLBOARD_SCREENALIGNED */
-#define GEMAT_BILLBOARD (1 << 10) /* BILLBOARD_AXISALIGNED */
-#define GEMAT_SHADOW (1 << 11) /* SHADOW */
-
-// Use Textures - not defined directly in the UI
-#define GEMAT_TEX 4096 /* KX_TEX */
+ /* Runtime cache for GLSL materials. */
+ ListBase gpumaterial;
+ /* grease pencil color */
+ struct MaterialGPencilStyle *gp_style;
+} Material;
/* **************** MATERIAL ********************* */
@@ -241,12 +177,6 @@ typedef struct Material {
* -1 because for active material we store the index + 1 */
#define MAXMAT (32767-1)
-/* material_type */
-#define MA_TYPE_SURFACE 0
-#define MA_TYPE_HALO 1
-#define MA_TYPE_VOLUME 2
-#define MA_TYPE_WIRE 3
-
/* flag */
/* for render */
#define MA_IS_USED (1 << 0)
@@ -258,101 +188,7 @@ typedef struct Material {
*/
#define MA_DS_SHOW_TEXS (1 << 2)
-/* mode (is int) */
-#define MA_TRACEBLE (1 << 0)
-#define MA_SHADOW (1 << 1)
-#define MA_SHLESS (1 << 2)
-#define MA_WIRE (1 << 3) /* deprecated */
-#define MA_VERTEXCOL (1 << 4)
-#define MA_HALO_SOFT (1 << 4)
-#define MA_HALO (1 << 5) /* deprecated */
-#define MA_ZTRANSP (1 << 6)
-#define MA_VERTEXCOLP (1 << 7)
-#define MA_ZINV (1 << 8)
-#define MA_HALO_RINGS (1 << 8)
-#define MA_ENV (1 << 9)
-#define MA_HALO_LINES (1 << 9)
-#define MA_ONLYSHADOW (1 << 10)
-#define MA_HALO_XALPHA (1 << 10)
-#define MA_STAR (1 << 11)
-#define MA_FACETEXTURE (1 << 11)
-#define MA_HALOTEX (1 << 12)
-#define MA_HALOPUNO (1 << 13)
-#define MA_ONLYCAST (1 << 13)
-#define MA_NOMIST (1 << 14)
-#define MA_HALO_SHADE (1 << 14)
-#define MA_HALO_FLARE (1 << 15)
-#define MA_TRANSP (1 << 16)
-#define MA_RAYTRANSP (1 << 17)
-#define MA_RAYMIRROR (1 << 18)
-#define MA_SHADOW_TRA (1 << 19)
-#define MA_RAMP_COL (1 << 20)
-#define MA_RAMP_SPEC (1 << 21)
-#define MA_RAYBIAS (1 << 22)
-#define MA_FULL_OSA (1 << 23)
-#define MA_TANGENT_STR (1 << 24)
-#define MA_SHADBUF (1 << 25)
- /* note; we drop MA_TANGENT_STR later to become tangent_u */
-#define MA_TANGENT_V (1 << 26)
-/* qdn: a bit clumsy this, tangents needed for normal maps separated from shading */
-#define MA_NORMAP_TANG (1 << 27)
-#define MA_GROUP_NOLAY (1 << 28)
-#define MA_FACETEXTURE_ALPHA (1 << 29)
-#define MA_STR_B_UNITS (1 << 30)
-#define MA_STR_SURFDIFF (1 << 31u)
-
-#define MA_MODE_MASK (((1 << 31u) - 1) & ~(1 << 28u)) /* all valid mode bits */
-#define MA_MODE_PIPELINE (MA_TRANSP | MA_ZTRANSP | MA_RAYTRANSP \
- | MA_TRACEBLE | MA_FULL_OSA | MA_ENV | MA_ZINV \
- | MA_ONLYCAST | MA_SHADBUF)
-
-/* mode2 (is int) */
-#define MA_CASTSHADOW (1 << 0)
-#define MA_MODE2_PIPELINE (MA_CASTSHADOW)
-#define MA_TANGENT_CONCRETE (1 << 1)
-
-/* mapflag */
-#define MA_MAPFLAG_UVPROJECT (1 << 0)
-
-/* ray mirror fadeout */
-#define MA_RAYMIR_FADETOSKY 0
-#define MA_RAYMIR_FADETOMAT 1
-
-/* shadowonly_flag */
-#define MA_SO_OLD 0
-#define MA_SO_SHADOW 1
-#define MA_SO_SHADED 2
-
-/* shade_flag */
-#define MA_CUBIC 1
-#define MA_OBCOLOR 2
-#define MA_APPROX_OCCLUSION 4
-#define MA_GROUP_LOCAL 8
-
-/* diff_shader */
-#define MA_DIFF_LAMBERT 0
-#define MA_DIFF_ORENNAYAR 1
-#define MA_DIFF_TOON 2
-#define MA_DIFF_MINNAERT 3
-#define MA_DIFF_FRESNEL 4
-
-/* spec_shader */
-#define MA_SPEC_COOKTORR 0
-#define MA_SPEC_PHONG 1
-#define MA_SPEC_BLINN 2
-#define MA_SPEC_TOON 3
-#define MA_SPEC_WARDISO 4
-
-/* dynamode */
-// #define MA_DRAW_DYNABUTS 1 /* deprecated */
-#define MA_FH_NOR 2
-
/* ramps */
-#define MA_RAMP_IN_SHADER 0
-#define MA_RAMP_IN_ENERGY 1
-#define MA_RAMP_IN_NOR 2
-#define MA_RAMP_IN_RESULT 3
-
#define MA_RAMP_BLEND 0
#define MA_RAMP_ADD 1
#define MA_RAMP_MULT 2
@@ -393,39 +229,8 @@ typedef struct Material {
#define TEXCO_SPEED (1 << 15)
/* mapto */
-#define MAP_COL (1 << 0)
-#define MAP_NORM (1 << 1)
-#define MAP_COLSPEC (1 << 2)
-#define MAP_COLMIR (1 << 3)
-#define MAP_VARS (((1 << 16) - 1) & ~((1 << 4) - 1))
-#define MAP_REF (1 << 4)
-#define MAP_SPEC (1 << 5)
-#define MAP_EMIT (1 << 6)
-#define MAP_ALPHA (1 << 7)
-#define MAP_HAR (1 << 8)
-#define MAP_RAYMIRR (1 << 9)
-#define MAP_TRANSLU (1 << 10)
-#define MAP_AMB (1 << 11)
-#define MAP_DISPLACE (1 << 12)
-#define MAP_WARP (1 << 13)
-// #define MAP_LAYER (1 << 14) /* unused */
-
-/* volume mapto - reuse definitions for now - a bit naughty! */
-#define MAP_DENSITY (1 << 7)
-#define MAP_EMISSION (1 << 6)
-#define MAP_EMISSION_COL (1 << 0)
-#define MAP_SCATTERING (1 << 4)
-#define MAP_TRANSMISSION_COL (1 << 3)
-#define MAP_REFLECTION_COL (1 << 2)
-#define MAP_REFLECTION (1 << 5)
-
-
-/* mapto for halo */
-//#define MAP_HA_COL (1 << 0)
-//#define MAP_HA_ALPHA (1 << 7)
-//#define MAP_HA_HAR (1 << 8)
-//#define MAP_HA_SIZE (1 << 1)
-//#define MAP_HA_ADD (1 << 6)
+#define MAP_COL (1 << 0)
+#define MAP_ALPHA (1 << 7)
/* pmapto */
/* init */
@@ -457,23 +262,50 @@ typedef struct Material {
#define MA_HAIR 10
#define MA_ATMOS 11
-/* sss_flag */
-#define MA_DIFF_SSS 1
-
-/* vol_stepsize_type */
-#define MA_VOL_STEP_RANDOMIZED 0
-#define MA_VOL_STEP_CONSTANT 1
-#define MA_VOL_STEP_ADAPTIVE 2
-
-/* vol_shadeflag */
-#define MA_VOL_RECV_EXT_SHADOW 1
-#define MA_VOL_PRECACHESHADING 8
-
-/* vol_shading_type */
-#define MA_VOL_SHADE_SHADELESS 0
-#define MA_VOL_SHADE_SHADOWED 2
-#define MA_VOL_SHADE_SHADED 1
-#define MA_VOL_SHADE_MULTIPLE 3
-#define MA_VOL_SHADE_SHADEDPLUSMULTIPLE 4
+/* blend_method */
+enum {
+ MA_BM_SOLID,
+ MA_BM_ADD,
+ MA_BM_MULTIPLY,
+ MA_BM_CLIP,
+ MA_BM_HASHED,
+ MA_BM_BLEND,
+};
+
+/* blend_flag */
+enum {
+ MA_BL_HIDE_BACKSIDE = (1 << 0),
+ MA_BL_SS_REFRACTION = (1 << 1),
+ MA_BL_SS_SUBSURFACE = (1 << 2), /* DEPRECATED */
+ MA_BL_TRANSLUCENCY = (1 << 3),
+};
+
+/* blend_shadow */
+enum {
+ MA_BS_NONE = 0,
+ MA_BS_SOLID,
+ MA_BS_CLIP,
+ MA_BS_HASHED,
+};
+
+/* Grease Pencil Stroke styles */
+enum {
+ GP_STYLE_STROKE_STYLE_SOLID = 0,
+ GP_STYLE_STROKE_STYLE_TEXTURE
+};
+
+/* Grease Pencil Fill styles */
+enum {
+ GP_STYLE_FILL_STYLE_SOLID = 0,
+ GP_STYLE_FILL_STYLE_GRADIENT,
+ GP_STYLE_FILL_STYLE_CHESSBOARD,
+ GP_STYLE_FILL_STYLE_TEXTURE
+};
+
+/* Grease Pencil Gradient Types */
+enum {
+ GP_STYLE_GRADIENT_LINEAR = 0,
+ GP_STYLE_GRADIENT_RADIAL
+};
#endif