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:
authorLukas Tönne <lukas.toenne@gmail.com>2016-03-24 13:41:44 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-03-24 14:07:03 +0300
commitbdae647670817f4c09d4c871314f237dde1bfaac (patch)
tree59907fb1b268a3023e43b3b4568798a5e4c3f7e2 /source/blender/makesdna/DNA_texture_types.h
parent8e9a55f1e51daaadf92cd4f8236e3214b8db7c85 (diff)
Color sources for point density textures based on mesh vertices
This patch adds support for coloring point density textures based on several mesh vertex attributes. * Vertex Color: Use a vertex color layer for coloring the point density texture * Vertex Weight: Use a weights from a vertex group as intensity values. (for Blender Render engine the additional color band is used) * Vertex Normals: Use object-space vertex normals as RGB values. The vertex color source enum is stored separately from the particle color source, to avoid invalid values when switching. Note that vertex colors are technically "corner colors" (MLoop), so each vertex can have as many colors as faces it is part of. For the purpose of point density the mloop colors are simply averaged, which is physically plausible because corners can be viewed as multiple points in the same location.
Diffstat (limited to 'source/blender/makesdna/DNA_texture_types.h')
-rw-r--r--source/blender/makesdna/DNA_texture_types.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 2843d010c9d..995d7645dc0 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -143,15 +143,18 @@ typedef struct PointDensity {
float falloff_softness;
float radius;
short source;
- short color_source;
- int totpoints;
+ short pad0;
+
+ short color_source; /* psys_color_source */
+ short ob_color_source;
- int pdpad;
+ int totpoints;
struct Object *object; /* for 'Object' or 'Particle system' type - source object */
int psys; /* index+1 in ob.particlesystem, non-ID pointer not allowed */
short psys_cache_space; /* cache points in worldspace, object space, ... ? */
short ob_cache_space; /* cache points in worldspace, object space, ... ? */
+ char vertex_attribute_name[64]; /* vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME */
void *point_tree; /* the acceleration tree containing points */
float *point_data; /* dynamically allocated extra for extra information, like particle age */
@@ -160,10 +163,10 @@ typedef struct PointDensity {
short noise_depth;
short noise_influence;
short noise_basis;
- short pdpad3[3];
+ short pad1[3];
float noise_fac;
- float speed_scale, falloff_speed_scale, pdpad2;
+ float speed_scale, falloff_speed_scale, pad2;
struct ColorBand *coba; /* for time -> color */
struct CurveMapping *falloff_curve; /* falloff density curve */
@@ -594,13 +597,21 @@ enum {
#define TEX_PD_NOISE_TIME 3
/* color_source */
-#define TEX_PD_COLOR_CONSTANT 0
-#define TEX_PD_COLOR_PARTAGE 1
-#define TEX_PD_COLOR_PARTSPEED 2
-#define TEX_PD_COLOR_PARTVEL 3
+enum {
+ TEX_PD_COLOR_CONSTANT = 0,
+ /* color_source: particles */
+ TEX_PD_COLOR_PARTAGE = 1,
+ TEX_PD_COLOR_PARTSPEED = 2,
+ TEX_PD_COLOR_PARTVEL = 3,
+ /* color_source: vertices */
+ TEX_PD_COLOR_VERTCOL = 1,
+ TEX_PD_COLOR_VERTWEIGHT = 2,
+ TEX_PD_COLOR_VERTNOR = 3,
+};
#define POINT_DATA_VEL 1
#define POINT_DATA_LIFE 2
+#define POINT_DATA_COLOR 4
/******************** Voxel Data *****************************/
/* flag */