Removed all the old particle rendering code and options I had in there before, in order to make way for... A new procedural texture: 'Point Density' Point Density is a 3d texture that find the density of a group of 'points' in space and returns that in the texture as an intensity value. Right now, its at an early stage and it's only enabled for particles, but it would be cool to extend it later for things like object vertices, or point cache files from disk - i.e. to import point cloud data into Blender for rendering volumetrically. Currently there are just options for an Object and its particle system number, this is the particle system that will get cached before rendering, and then used for the texture's density estimation. It works totally consistent with as any other procedural texture, so previously where I've mapped a clouds texture to volume density to make some of those test renders, now I just map a point density texture to volume density. Here's a version of the same particle smoke test file from before, updated to use the point density texture instead: http://mke3.net/blender/devel/rendering/volumetrics/smoke_test02.blend There are a few cool things about implementing this as a texture: - The one texture (and cache) can be instanced across many different materials: http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_instanced.png This means you can calculate and bake one particle system, but render it multiple times across the scene, with different material settings, at no extra memory cost. Right now, the particles are cached in world space, so you have to map it globally, and if you want it offset, you have to do it in the material (as in the file above). I plan to add an option to bake in local space, so you can just map the texture to local and it just works. - It also works for solid surfaces too, it just gets the density at that particular point on the surface, eg: http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_solid.mov - You can map it to whatever you want, not only density but the various emissions and colours as well. I'd like to investigate using the other outputs in the texture too (like the RGB or normal outputs), perhaps with options to colour by particle age, generating normals for making particle 'dents' in a surface, whatever!
87 lines
2.6 KiB
C
87 lines
2.6 KiB
C
/**
|
|
* blenlib/BKE_texture.h (mar-2001 nzc)
|
|
*
|
|
* $Id$
|
|
*
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
* All rights reserved.
|
|
*
|
|
* The Original Code is: all of this file.
|
|
*
|
|
* Contributor(s): none yet.
|
|
*
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
*/
|
|
#ifndef BKE_TEXTURE_H
|
|
#define BKE_TEXTURE_H
|
|
|
|
struct Tex;
|
|
struct MTex;
|
|
struct PluginTex;
|
|
struct LampRen;
|
|
struct ColorBand;
|
|
struct HaloRen;
|
|
struct TexMapping;
|
|
struct EnvMap;
|
|
struct PointDensity;
|
|
|
|
/* in ColorBand struct */
|
|
#define MAXCOLORBAND 32
|
|
|
|
|
|
void free_texture(struct Tex *t);
|
|
int test_dlerr(const char *name, const char *symbol);
|
|
void open_plugin_tex(struct PluginTex *pit);
|
|
struct PluginTex *add_plugin_tex(char *str);
|
|
void free_plugin_tex(struct PluginTex *pit);
|
|
|
|
void init_colorband(struct ColorBand *coba, int rangetype);
|
|
struct ColorBand *add_colorband(int rangetype);
|
|
int do_colorband(struct ColorBand *coba, float in, float out[4]);
|
|
void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
|
|
|
|
void default_tex(struct Tex *tex);
|
|
struct Tex *add_texture(char *name);
|
|
void default_mtex(struct MTex *mtex);
|
|
struct MTex *add_mtex(void);
|
|
struct Tex *copy_texture(struct Tex *tex);
|
|
void make_local_texture(struct Tex *tex);
|
|
void autotexname(struct Tex *tex);
|
|
struct Tex *give_current_texture(struct Object *ob, int act);
|
|
struct Tex *give_current_world_texture(void);
|
|
|
|
struct TexMapping *add_mapping(void);
|
|
void init_mapping(struct TexMapping *texmap);
|
|
|
|
|
|
void BKE_free_envmapdata(struct EnvMap *env);
|
|
void BKE_free_envmap(struct EnvMap *env);
|
|
struct EnvMap *BKE_add_envmap(void);
|
|
struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
|
|
|
|
void BKE_free_pointdensitydata(struct PointDensity *pd);
|
|
void BKE_free_pointdensity(struct PointDensity *pd);
|
|
struct PointDensity *BKE_add_pointdensity(void);
|
|
struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
|
|
|
|
int BKE_texture_dependsOnTime(const struct Tex *texture);
|
|
|
|
#endif
|
|
|