|
Blender V4.3
|
#include <cmath>#include <cstdio>#include <cstdlib>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_kdopbvh.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_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 } |
Variables | |
| static ThreadMutex | sample_mutex = PTHREAD_MUTEX_INITIALIZER |
| anonymous enum |
| Enumerator | |
|---|---|
| POINT_DATA_VEL | |
| POINT_DATA_LIFE | |
| POINT_DATA_COLOR | |
Definition at line 45 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 130 of file texture_pointdensity.cc.
References MEM_callocN, 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, INIT_MINMAX, invert_m4_m4(), 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, scene, state, sub_v3_v3v3(), ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, and unit_m4().
Referenced by RE_point_density_minmax().
|
static |
Definition at line 80 of file texture_pointdensity.cc.
References 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 51 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 872 of file texture_pointdensity.cc.
References col, copy_v3_v3(), float, min, PointDensity::point_tree, pointdensity(), pointdensity_color(), SampleCallbackData::resolution, TexResult::tin, TexResult::trgba, x, 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, 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, CustomData_MeshMasks::fmask, Object::loc, 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, and PointDensity::totpoints.
Referenced by cache_pointdensity().
|
static |
Definition at line 155 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, 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, 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 270 of file texture_pointdensity.cc.
References add_v3_v3(), BLI_assert, CD_PROP_BYTE_COLOR, col, CustomData_get_layer_named(), CustomData_has_layer(), CustomData_validate_layer_name(), MAX_CUSTOMDATA_LAYER_NAME, MEM_callocN, MEM_freeN(), mul_v3_fl(), rgb_uchar_to_float(), PointDensity::totpoints, v, and PointDensity::vertex_attribute_name.
Referenced by pointdensity_cache_object().
Definition at line 362 of file texture_pointdensity.cc.
References BLI_assert.
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, MDeformVert::totweight, PointDensity::vertex_attribute_name, 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 BLI_mutex_lock(), BLI_mutex_unlock(), cache_pointdensity(), DEG_get_evaluated_scene(), depsgraph, 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 819 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(), 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 910 of file texture_pointdensity.cc.
References BLI_mutex_lock(), BLI_mutex_unlock(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, depsgraph, free_pointdensity(), min, PointDensity::object, SampleCallbackData::pd, point_density_sample_func(), RE_point_density_minmax(), sample_dummy_point_density(), sample_mutex, and sub_v3_v3v3().
Definition at line 752 of file texture_pointdensity.cc.
Referenced by RE_point_density_sample().
|
static |
Definition at line 43 of file texture_pointdensity.cc.
Referenced by RE_point_density_cache(), and RE_point_density_sample().