|
Blender V4.5
|
#include <cmath>#include <cstdio>#include <cstdlib>#include "MEM_guardedalloc.h"#include "BLI_color.hh"#include "BLI_kdopbvh.hh"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_noise.h"#include "BLI_task.h"#include "BLI_utildefines.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "DNA_particle_types.h"#include "DNA_texture_types.h"#include "BKE_attribute.hh"#include "BKE_colorband.hh"#include "BKE_colortools.hh"#include "BKE_customdata.hh"#include "BKE_deform.hh"#include "BKE_mesh.hh"#include "BKE_object.hh"#include "BKE_particle.h"#include "BKE_scene.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "RE_texture.h"Go to the source code of this file.
Classes | |
| struct | PointDensityRangeData |
| struct | SampleCallbackData |
Enumerations | |
| enum | { POINT_DATA_VEL = 1 << 0 , POINT_DATA_LIFE = 1 << 1 , POINT_DATA_COLOR = 1 << 2 } |
Functions | |
| static int | point_data_used (PointDensity *pd) |
| static void | point_data_pointers (PointDensity *pd, float **r_data_velocity, float **r_data_life, float **r_data_color) |
| static void | alloc_point_data (PointDensity *pd) |
| static void | pointdensity_cache_psys (Depsgraph *depsgraph, Scene *scene, PointDensity *pd, Object *ob, ParticleSystem *psys) |
| static void | pointdensity_cache_vertex_color (PointDensity *pd, Object *, Mesh *mesh, float *data_color) |
| static void | pointdensity_cache_vertex_weight (PointDensity *pd, Object *ob, Mesh *mesh, float *data_color) |
| static void | pointdensity_cache_vertex_normal (Mesh *mesh, float *data_color) |
| static void | pointdensity_cache_object (PointDensity *pd, Object *ob) |
| static void | cache_pointdensity (Depsgraph *depsgraph, Scene *scene, PointDensity *pd) |
| static void | free_pointdensity (PointDensity *pd) |
| static float | density_falloff (PointDensityRangeData *pdr, int index, float squared_dist) |
| static void | accum_density (void *userdata, int index, const float co[3], float squared_dist) |
| static void | init_pointdensityrangedata (PointDensity *pd, PointDensityRangeData *pdr, float *density, float *vec, float *age, float *col, CurveMapping *density_curve, float velscale) |
| static int | pointdensity (PointDensity *pd, const float texvec[3], TexResult *texres, float r_vec[3], float *r_age, float r_col[3]) |
| static void | pointdensity_color (PointDensity *pd, TexResult *texres, float age, const float vec[3], const float col[3]) |
| static void | sample_dummy_point_density (int resolution, float *values) |
| static void | particle_system_minmax (Depsgraph *depsgraph, Scene *scene, Object *object, ParticleSystem *psys, float radius, float min[3], float max[3]) |
| void | RE_point_density_cache (Depsgraph *depsgraph, PointDensity *pd) |
| void | RE_point_density_minmax (Depsgraph *depsgraph, PointDensity *pd, float r_min[3], float r_max[3]) |
| static void | point_density_sample_func (void *__restrict data_v, const int iter, const TaskParallelTLS *__restrict) |
| void | RE_point_density_sample (Depsgraph *depsgraph, PointDensity *pd, const int resolution, float *values) |
| void | RE_point_density_free (PointDensity *pd) |
| void | RE_point_density_fix_linking () |
Variables | |
| static blender::Mutex | sample_mutex |
| anonymous enum |
| Enumerator | |
|---|---|
| POINT_DATA_VEL | |
| POINT_DATA_LIFE | |
| POINT_DATA_COLOR | |
Definition at line 47 of file texture_pointdensity.cc.
|
static |
Definition at line 546 of file texture_pointdensity.cc.
References add_v3_v3(), PointDensityRangeData::age, PointDensityRangeData::col, PointDensityRangeData::density, density_falloff(), PointDensityRangeData::point_data_color, PointDensityRangeData::point_data_life, PointDensityRangeData::point_data_velocity, UNUSED_VARS, and PointDensityRangeData::vec.
Referenced by pointdensity().
|
static |
Definition at line 132 of file texture_pointdensity.cc.
References MEM_calloc_arrayN(), PointDensity::point_data, POINT_DATA_COLOR, POINT_DATA_LIFE, point_data_used(), POINT_DATA_VEL, and PointDensity::totpoints.
Referenced by pointdensity_cache_object(), and pointdensity_cache_psys().
|
static |
Definition at line 434 of file texture_pointdensity.cc.
References BLI_bvhtree_free(), BLI_findlink(), depsgraph, OB_MESH, PointDensity::object, Object::particlesystem, PointDensity::point_tree, pointdensity_cache_object(), pointdensity_cache_psys(), PointDensity::psys, PointDensity::source, TEX_PD_OBJECT, TEX_PD_PSYS, and Object::type.
Referenced by RE_point_density_cache().
|
static |
Definition at line 499 of file texture_pointdensity.cc.
References BKE_curvemapping_evaluateF(), BKE_curvemapping_init(), PointDensityRangeData::density_curve, PointDensityRangeData::falloff_type, len_v3(), PointDensityRangeData::point_data_life, PointDensityRangeData::point_data_velocity, pow, PointDensityRangeData::softness, sqrtf, 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, and PointDensityRangeData::velscale.
Referenced by accum_density().
|
static |
Definition at line 468 of file texture_pointdensity.cc.
References BLI_bvhtree_free(), MEM_SAFE_FREE, PointDensity::point_data, PointDensity::point_tree, and PointDensity::totpoints.
Referenced by RE_point_density_free(), and RE_point_density_sample().
|
static |
Definition at line 570 of file texture_pointdensity.cc.
References PointDensityRangeData::age, col, PointDensityRangeData::col, PointDensityRangeData::density, PointDensityRangeData::density_curve, PointDensity::falloff_softness, PointDensity::falloff_type, PointDensityRangeData::falloff_type, PointDensity::noise_influence, PointDensityRangeData::noise_influence, PointDensityRangeData::point_data_color, PointDensityRangeData::point_data_life, point_data_pointers(), PointDensityRangeData::point_data_velocity, PointDensity::radius, PointDensityRangeData::softness, PointDensityRangeData::squared_radius, PointDensityRangeData::vec, and PointDensityRangeData::velscale.
Referenced by pointdensity().
|
static |
Definition at line 757 of file texture_pointdensity.cc.
References add_v3_v3v3(), BKE_scene_ctime_get(), depsgraph, ParticleSimulationData::depsgraph, i, INIT_MINMAX, invert_m4_m4(), max, min, minmax_v3v3_v3(), mul_v3_m4v3(), ParticleSimulationData::ob, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_get_modifier(), psys_get_particle_state(), psys_sim_data_free(), psys_sim_data_init(), ParticleSimulationData::scene, size(), state, sub_v3_v3v3(), ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, and unit_m4().
Referenced by RE_point_density_minmax().
|
static |
Definition at line 82 of file texture_pointdensity.cc.
References data, PointDensity::point_data, POINT_DATA_COLOR, POINT_DATA_LIFE, point_data_used(), POINT_DATA_VEL, and PointDensity::totpoints.
Referenced by init_pointdensityrangedata(), pointdensity_cache_object(), and pointdensity_cache_psys().
|
static |
Definition at line 53 of file texture_pointdensity.cc.
References PointDensity::color_source, ELEM, PointDensity::falloff_type, PointDensity::ob_color_source, POINT_DATA_COLOR, POINT_DATA_LIFE, POINT_DATA_VEL, PointDensity::source, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL, TEX_PD_COLOR_VERTCOL, TEX_PD_COLOR_VERTNOR, TEX_PD_COLOR_VERTWEIGHT, TEX_PD_FALLOFF_PARTICLE_AGE, TEX_PD_FALLOFF_PARTICLE_VEL, TEX_PD_OBJECT, and TEX_PD_PSYS.
Referenced by alloc_point_data(), point_data_pointers(), pointdensity(), and pointdensity_cache_psys().
|
static |
Definition at line 871 of file texture_pointdensity.cc.
References col, copy_v3_v3(), data, min, PointDensity::point_tree, pointdensity(), pointdensity_color(), TexResult::tin, TexResult::trgba, x, y, and z().
Referenced by RE_point_density_sample().
|
static |
Definition at line 593 of file texture_pointdensity.cc.
References accum_density(), BLI_bvhtree_range_query(), BLI_noise_generic_turbulence(), col, copy_v3_v3(), PointDensity::falloff_curve, PointDensity::falloff_speed_scale, PointDensity::flag, init_pointdensityrangedata(), mul_v3_fl(), PointDensity::noise_basis, PointDensity::noise_depth, PointDensity::noise_fac, PointDensity::noise_size, num, point_data_used(), PointDensity::point_tree, PointDensity::radius, TEX_INT, TEX_PD_FALLOFF_CURVE, TEX_PD_TURBULENCE, TexResult::tin, turb(), and zero_v3().
Referenced by point_density_sample_func().
|
static |
Definition at line 369 of file texture_pointdensity.cc.
References alloc_point_data(), BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), CD_MASK_BAREMESH, CD_MASK_MCOL, CD_MASK_MDEFORMVERT, CD_MASK_MTFACE, CD_MASK_PROP_BYTE_COLOR, copy_v3_v3(), Object::data, i, Object::loc, mask(), mul_m4_v3(), PointDensity::ob_cache_space, PointDensity::ob_color_source, point_data_pointers(), PointDensity::point_tree, pointdensity_cache_vertex_color(), pointdensity_cache_vertex_normal(), pointdensity_cache_vertex_weight(), sub_v3_v3(), TEX_PD_COLOR_VERTCOL, TEX_PD_COLOR_VERTNOR, TEX_PD_COLOR_VERTWEIGHT, TEX_PD_OBJECTLOC, TEX_PD_OBJECTSPACE, TEX_PD_WORLDSPACE, PointDensity::totpoints, and Mesh::verts_num.
Referenced by cache_pointdensity().
|
static |
Definition at line 157 of file texture_pointdensity.cc.
References alloc_point_data(), BKE_scene_ctime_get(), BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), ParticleSystem::child, ParticleSystem::childcache, ParticleCacheKey::co, copy_v3_v3(), DAG_EVAL_RENDER, DEG_get_mode(), depsgraph, ParticleSimulationData::depsgraph, ParticleSettings::draw, i, invert_m4_m4(), ParticleData::lifetime, Object::loc, mul_m4_v3(), ParticleSimulationData::ob, ParticleSystem::part, PART_DRAW_PARENT, PART_HAIR, ParticleSystem::particles, ParticleSystem::pathcache, POINT_DATA_LIFE, point_data_pointers(), point_data_used(), PointDensity::point_tree, ParticleSimulationData::psmd, ParticleSimulationData::psys, PointDensity::psys_cache_space, psys_check_enabled(), psys_get_child_time(), psys_get_modifier(), psys_get_particle_state(), psys_sim_data_free(), psys_sim_data_init(), Object::runtime, ParticleSimulationData::scene, ParticleCacheKey::segments, state, sub_v3_v3(), TEX_PD_OBJECTLOC, TEX_PD_OBJECTSPACE, ParticleData::time, ParticleSystem::totchild, ParticleSystem::totpart, PointDensity::totpoints, ParticleSettings::type, and zero_v3().
Referenced by cache_pointdensity().
|
static |
Definition at line 272 of file texture_pointdensity.cc.
References Mesh::active_color_attribute, add_v3_v3(), Geometry::attributes, BLI_assert, col, blender::bke::AttributeAccessor::contains(), blender::bke::Corner, Mesh::corners_num, i, blender::bke::AttributeAccessor::lookup(), MEM_calloc_arrayN(), MEM_freeN(), mul_v3_fl(), rgb_uchar_to_float(), PointDensity::totpoints, v, and PointDensity::vertex_attribute_name.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 362 of file texture_pointdensity.cc.
References BLI_assert, normals, and Mesh::verts_num.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 324 of file texture_pointdensity.cc.
References BKE_id_defgroup_name_index(), BKE_object_defgroup_active_index_get(), BLI_assert, CD_MDEFORMVERT, copy_v3_fl(), CustomData_get_layer(), MDeformWeight::def_nr, MDeformVert::dw, i, Mesh::id, Mesh::vert_data, PointDensity::vertex_attribute_name, Mesh::verts_num, and MDeformWeight::weight.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 678 of file texture_pointdensity.cc.
References BKE_colorband_evaluate(), PointDensity::coba, col, PointDensity::color_source, copy_v3_v3(), copy_v4_fl(), len_v3(), mul_v3_v3fl(), PointDensity::ob_color_source, PointDensity::source, PointDensity::speed_scale, TexResult::talpha, TEX_PD_COLOR_CONSTANT, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL, TEX_PD_COLOR_VERTCOL, TEX_PD_COLOR_VERTNOR, TEX_PD_COLOR_VERTWEIGHT, TEX_PD_PSYS, TexResult::tin, and TexResult::trgba.
Referenced by point_density_sample_func().
| void RE_point_density_cache | ( | Depsgraph * | depsgraph, |
| PointDensity * | pd ) |
Definition at line 809 of file texture_pointdensity.cc.
References cache_pointdensity(), DEG_get_evaluated_scene(), depsgraph, lock, and sample_mutex.
| void RE_point_density_fix_linking | ( | void | ) |
Definition at line 955 of file texture_pointdensity.cc.
Referenced by RE_InitState().
| void RE_point_density_free | ( | PointDensity * | pd | ) |
Definition at line 950 of file texture_pointdensity.cc.
References free_pointdensity().
Referenced by blender::nodes::node_shader_tex_pointdensity_cc::node_shader_free_tex_pointdensity().
| void RE_point_density_minmax | ( | Depsgraph * | depsgraph, |
| PointDensity * | pd, | ||
| float | r_min[3], | ||
| float | r_max[3] ) |
Definition at line 818 of file texture_pointdensity.cc.
References add_v3_v3(), BKE_object_boundbox_get(), BLI_findlink(), copy_v3_v3(), DEG_get_evaluated_scene(), depsgraph, PointDensity::object, particle_system_minmax(), Object::particlesystem, PointDensity::psys, PointDensity::radius, PointDensity::source, sub_v3_v3(), TEX_PD_PSYS, and zero_v3().
Referenced by RE_point_density_sample().
| void RE_point_density_sample | ( | struct Depsgraph * | depsgraph, |
| struct PointDensity * | pd, | ||
| int | resolution, | ||
| float * | values ) |
Definition at line 909 of file texture_pointdensity.cc.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, depsgraph, free_pointdensity(), lock, max, min, PointDensity::object, point_density_sample_func(), RE_point_density_minmax(), sample_dummy_point_density(), sample_mutex, sub_v3_v3v3(), and TaskParallelSettings::use_threading.
|
static |
Definition at line 752 of file texture_pointdensity.cc.
Referenced by RE_point_density_sample().
|
static |
Definition at line 45 of file texture_pointdensity.cc.
Referenced by RE_point_density_cache(), and RE_point_density_sample().