Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdopbvh.h"
#include "BLI_utildefines.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_lattice.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
#include "BKE_colortools.h"
#include "DNA_meshdata_types.h"
#include "DNA_texture_types.h"
#include "DNA_particle_types.h"
#include "render_types.h"
#include "renderdatabase.h"
#include "texture.h"
#include "pointdensity.h"
Go to the source code of this file.
Classes | |
struct | PointDensityRangeData |
Typedefs | |
typedef struct PointDensityRangeData | PointDensityRangeData |
Functions | |
static int | point_data_used (PointDensity *pd) |
static void | alloc_point_data (PointDensity *pd, int total_particles, int point_data_used) |
static void | pointdensity_cache_psys (Render *re, PointDensity *pd, Object *ob, ParticleSystem *psys) |
static void | pointdensity_cache_object (Render *re, PointDensity *pd, Object *ob) |
void | cache_pointdensity (Render *re, Tex *tex) |
static void | free_pointdensity (Render *UNUSED(re), Tex *tex) |
void | make_pointdensities (Render *re) |
void | free_pointdensities (Render *re) |
static void | accum_density (void *userdata, int index, float squared_dist) |
static void | init_pointdensityrangedata (PointDensity *pd, PointDensityRangeData *pdr, float *density, float *vec, float *age, struct CurveMapping *density_curve, float velscale) |
int | pointdensitytex (Tex *tex, float *texvec, TexResult *texres) |
Variables | |
struct Render | R |
Definition in file pointdensity.c.
typedef struct PointDensityRangeData PointDensityRangeData |
static void accum_density | ( | void * | userdata, |
int | index, | ||
float | squared_dist | ||
) | [static] |
Definition at line 342 of file pointdensity.c.
References PointDensityRangeData::age, curvemapping_evaluateF(), PointDensityRangeData::density, PointDensityRangeData::density_curve, PointDensityRangeData::falloff_type, if(), len_v3(), MIN2, PointDensityRangeData::offset, PointDensityRangeData::point_data, POINT_DATA_LIFE, PointDensityRangeData::point_data_used, POINT_DATA_VEL, pow(), PointDensityRangeData::softness, sqrt(), PointDensityRangeData::squared_radius, TEX_PD_FALLOFF_CONSTANT, TEX_PD_FALLOFF_PARTICLE_AGE, TEX_PD_FALLOFF_PARTICLE_VEL, TEX_PD_FALLOFF_ROOT, TEX_PD_FALLOFF_SMOOTH, TEX_PD_FALLOFF_SOFT, TEX_PD_FALLOFF_STD, PointDensityRangeData::vec, and PointDensityRangeData::velscale.
Referenced by pointdensitytex().
static void alloc_point_data | ( | PointDensity * | pd, |
int | total_particles, | ||
int | point_data_used | ||
) | [static] |
Definition at line 86 of file pointdensity.c.
References MEM_mallocN(), PointDensity::point_data, POINT_DATA_LIFE, and POINT_DATA_VEL.
Referenced by pointdensity_cache_psys().
Definition at line 242 of file pointdensity.c.
References BLI_bvhtree_free(), BLI_findlink(), NULL, OB_MESH, PointDensity::object, Object::particlesystem, Tex::pd, PointDensity::point_tree, pointdensity_cache_object(), pointdensity_cache_psys(), PointDensity::psys, PointDensity::source, TEX_PD_OBJECT, TEX_PD_PSYS, and Object::type.
Referenced by make_pointdensities(), and RE_init_sample_material().
void free_pointdensities | ( | Render * | re | ) |
Definition at line 312 of file pointdensity.c.
References ListBase::first, free_pointdensity(), Tex::id, Render::main, ID::next, Scene::r, R_PREVIEWBUTS, RenderData::scemode, Render::scene, Main::tex, TEX_POINTDENSITY, Tex::type, and ID::us.
Referenced by RE_Database_Free().
Definition at line 272 of file pointdensity.c.
References BLI_bvhtree_free(), MEM_freeN(), NULL, Tex::pd, PointDensity::point_data, PointDensity::point_tree, and PointDensity::totpoints.
Referenced by free_pointdensities().
static void init_pointdensityrangedata | ( | PointDensity * | pd, |
PointDensityRangeData * | pdr, | ||
float * | density, | ||
float * | vec, | ||
float * | age, | ||
struct CurveMapping * | density_curve, | ||
float | velscale | ||
) | [static] |
Definition at line 388 of file pointdensity.c.
References PointDensityRangeData::age, PointDensityRangeData::density, PointDensityRangeData::density_curve, PointDensity::falloff_softness, PointDensityRangeData::falloff_type, PointDensity::falloff_type, PointDensity::noise_influence, PointDensityRangeData::noise_influence, PointDensityRangeData::offset, PointDensity::point_data, PointDensityRangeData::point_data, PointDensityRangeData::point_data_used, point_data_used(), POINT_DATA_VEL, PointDensity::radius, PointDensityRangeData::softness, PointDensityRangeData::squared_radius, PointDensity::totpoints, PointDensityRangeData::vec, and PointDensityRangeData::velscale.
Referenced by pointdensitytex().
void make_pointdensities | ( | Render * | re | ) |
Definition at line 292 of file pointdensity.c.
References cache_pointdensity(), ListBase::first, Render::i, Tex::id, RenderStats::infostr, Render::main, ID::next, NULL, Scene::r, R_PREVIEWBUTS, RenderData::scemode, Render::scene, Render::sdh, Render::stats_draw, Main::tex, TEX_POINTDENSITY, Tex::type, and ID::us.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
static int point_data_used | ( | PointDensity * | pd | ) | [static] |
Definition at line 68 of file pointdensity.c.
References PointDensity::color_source, PointDensity::falloff_type, PointDensity::noise_influence, POINT_DATA_LIFE, POINT_DATA_VEL, PointDensity::source, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL, TEX_PD_FALLOFF_PARTICLE_AGE, TEX_PD_FALLOFF_PARTICLE_VEL, TEX_PD_NOISE_AGE, TEX_PD_NOISE_VEL, and TEX_PD_PSYS.
Referenced by init_pointdensityrangedata(), pointdensity_cache_psys(), and pointdensitytex().
static void pointdensity_cache_object | ( | Render * | re, |
PointDensity * | pd, | ||
Object * | ob | ||
) | [static] |
Definition at line 203 of file pointdensity.c.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), CD_MASK_BAREMESH, CD_MASK_MCOL, CD_MASK_MTFACE, MVert::co, co, copy_v3_v3(), DerivedMesh::getNumVerts, DerivedMesh::getVertArray, i, Object::loc, mesh_create_derived_render(), mul_m4_v3(), NULL, PointDensity::ob_cache_space, Object::obmat, PointDensity::point_tree, DerivedMesh::release, Render::scene, sub_v3_v3(), TEX_PD_OBJECTLOC, TEX_PD_OBJECTSPACE, TEX_PD_WORLDSPACE, and PointDensity::totpoints.
Referenced by cache_pointdensity().
static void pointdensity_cache_psys | ( | Render * | re, |
PointDensity * | pd, | ||
Object * | ob, | ||
ParticleSystem * | psys | ||
) | [static] |
Definition at line 103 of file pointdensity.c.
References alloc_point_data(), BKE_curframe(), BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), CD_MASK_BAREMESH, CD_MASK_MCOL, CD_MASK_MTFACE, Render::cfra, ParticleSystem::child, ParticleKey::co, copy_v3_v3(), ParticleSettings::draw, end_latt_deform(), i, Object::imat, invert_m4_m4(), ParticleSystem::lattice, ParticleData::lifetime, Object::loc, mesh_create_derived_render(), mul_m4_v3(), mult_m4_m4m4(), NULL, ParticleSimulationData::ob, Object::obmat, ParticleSystem::part, PART_DRAW_PARENT, ParticleSystem::particles, PointDensity::point_data, POINT_DATA_LIFE, point_data_used(), POINT_DATA_VEL, PointDensity::point_tree, ParticleSimulationData::psys, PointDensity::psys_cache_space, psys_check_enabled(), psys_get_child_time(), psys_get_lattice(), psys_get_particle_state(), psys_render_restore(), psys_render_set(), DerivedMesh::release, ParticleSimulationData::scene, Render::scene, state, sub_v3_v3(), TEX_PD_OBJECTLOC, TEX_PD_OBJECTSPACE, ParticleData::time, ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, PointDensity::totpoints, ParticleKey::vel, Render::viewinv, Render::viewmat, Render::winmat, Render::winx, and Render::winy.
Referenced by cache_pointdensity().
Definition at line 406 of file pointdensity.c.
References accum_density(), BLI_bvhtree_range_query(), BLI_gTurbulence(), BRICONT, BRICONTRGB, co, PointDensity::coba, PointDensity::color_source, copy_v3_v3(), do_colorband(), PointDensity::falloff_curve, PointDensity::falloff_speed_scale, PointDensity::flag, init_pointdensityrangedata(), len_v3(), mul_v3_fl(), PointDensity::noise_basis, PointDensity::noise_depth, PointDensity::noise_fac, PointDensity::noise_influence, PointDensity::noise_size, NULL, Tex::pd, point_data_used(), PointDensity::point_tree, R, PointDensity::radius, PointDensity::speed_scale, TexResult::ta, TexResult::talpha, TexResult::tb, TEX_INT, TEX_PD_COLOR_CONSTANT, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL, TEX_PD_FALLOFF_CURVE, TEX_PD_NOISE_AGE, TEX_PD_NOISE_TIME, TEX_PD_TURBULENCE, TEX_RGB, TexResult::tg, TexResult::tin, TexResult::tr, and turb().
Referenced by multitex().
Definition at line 127 of file pipeline.c.