diff options
author | Matt Ebb <matt@mke3.net> | 2008-11-09 04:16:12 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2008-11-09 04:16:12 +0300 |
commit | a972107b03a3b8b00e1548d99e790612dc9f0ccc (patch) | |
tree | 93f8277505c327eb2ae125a177edb5d94807b071 /source/blender/makesdna/DNA_texture_types.h | |
parent | f5f0c8fb37eaac8be9efc44b2802fb87fcf85727 (diff) |
Point Density texture: colouring
This introduces a few new ways of modifying the intensity and colour output
generated by the Point Density texture. Previously, the texture only output
intensity information, but now you can map it to colours along a gradient
ramp, based on information coming out of a particle system.
This lets you do things like colour a particle system based on the individual
particles' age - the main reason I need it is to fade particles out over time.
The colorband influences both the colour and intensity (using the colorband's
alpha value), which makes it easy to map a single point density texture to
both intensity values in the Map To panel (such as density or emit) and colour
values (such as absorb col or emit col). This is how the below examples are
set up, an example .blend file is available here:
http://mke3.net/blender/devel/rendering/volumetrics/pd_test4.blend
The different modes:
* Constant
No modifications to intensity or colour (pure white)
* Particle Age
Maps the color ramp along the particles' lifetimes:
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_partage.mov
* Particle Speed
Maps the color ramp to the particles' absolute speed per frame (in Blender
units). There's an additional scale parameter that you can use to bring this
speed into a 0.0 - 1.0 range, if your particles are travelling too faster or
slower than 0-1.
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_speed.mov
* Velocity -> RGB
Outputs the particle XYZ velocity vector as RGB colours. This may be useful
for comp work, or maybe in the future things like displacement. Again, there's
a scale parameter to control it.
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_velrgb.mov
Diffstat (limited to 'source/blender/makesdna/DNA_texture_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_texture_types.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index c51311bb621..b057efb4a55 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -134,7 +134,10 @@ typedef struct PointDensity { float falloff_softness; float radius; short source; - short pdpad; + short color_source; + int totpoints; + + int pdpad; struct Object *object; /* for 'Object' or 'Particle system' type - source object */ short psys_cache_space; /* cache points in worldspace, object space, ... ? */ @@ -151,7 +154,9 @@ typedef struct PointDensity { short noise_depth; short noise_influence; float noise_fac; - float pdpad4; + + float speed_scale; + struct ColorBand *coba; /* for time -> color */ } PointDensity; @@ -442,7 +447,17 @@ typedef struct TexMapping { /* noise_influence */ #define TEX_PD_NOISE_STATIC 0 #define TEX_PD_NOISE_VEL 1 -#define TEX_PD_NOISE_TIME 2 +#define TEX_PD_NOISE_AGE 2 +#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 + +#define POINT_DATA_VEL 1 +#define POINT_DATA_LIFE 2 #endif |