|
Blender
V2.93
|
#include <math.h>#include <stdio.h>#include <stdlib.h>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_kdopbvh.h"#include "BLI_math.h"#include "BLI_noise.h"#include "BLI_task.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "DNA_particle_types.h"#include "DNA_texture_types.h"#include "BKE_colorband.h"#include "BKE_colortools.h"#include "BKE_customdata.h"#include "BKE_deform.h"#include "BKE_lattice.h"#include "BKE_object.h"#include "BKE_particle.h"#include "BKE_scene.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_query.h"#include "render_types.h"#include "texture_common.h"#include "RE_texture.h"Go to the source code of this file.
Classes | |
| struct | PointDensityRangeData |
| struct | SampleCallbackData |
Typedefs | |
| typedef struct PointDensityRangeData | PointDensityRangeData |
| typedef struct SampleCallbackData | SampleCallbackData |
Variables | |
| static ThreadMutex | sample_mutex = PTHREAD_MUTEX_INITIALIZER |
| typedef struct PointDensityRangeData PointDensityRangeData |
| typedef struct SampleCallbackData SampleCallbackData |
|
static |
Definition at line 567 of file texture_pointdensity.c.
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 141 of file texture_pointdensity.c.
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 452 of file texture_pointdensity.c.
References BLI_bvhtree_free(), BLI_findlink(), depsgraph, NULL, OB_MESH, PointDensity::object, Object::particlesystem, PointDensity::point_tree, pointdensity_cache_object(), pointdensity_cache_psys(), PointDensity::psys, scene, PointDensity::source, TEX_PD_OBJECT, TEX_PD_PSYS, and Object::type.
Referenced by RE_point_density_cache().
|
static |
Definition at line 520 of file texture_pointdensity.c.
References BKE_curvemapping_evaluateF(), BKE_curvemapping_init(), PointDensityRangeData::density_curve, PointDensityRangeData::falloff_type, len_v3(), MIN2, PointDensityRangeData::point_data_life, PointDensityRangeData::point_data_velocity, KDL::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 486 of file texture_pointdensity.c.
References BLI_bvhtree_free(), MEM_freeN, NULL, PointDensity::point_data, PointDensity::point_tree, and PointDensity::totpoints.
Referenced by RE_point_density_free(), and RE_point_density_sample().
|
static |
Definition at line 591 of file texture_pointdensity.c.
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 776 of file texture_pointdensity.c.
References add_v3_v3v3(), BKE_lattice_deform_data_destroy(), BKE_scene_frame_get(), ParticleSimulationData::depsgraph, depsgraph, INIT_MINMAX, invert_m4_m4(), ParticleSystem::lattice_deform_data, max, min, minmax_v3v3_v3(), mul_v3_m4v3(), NULL, ParticleSimulationData::ob, Object::obmat, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_create_lattice_deform_data(), psys_get_modifier(), psys_get_particle_state(), ParticleSimulationData::scene, 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 91 of file texture_pointdensity.c.
References data, NULL, 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 64 of file texture_pointdensity.c.
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 896 of file texture_pointdensity.c.
References col, copy_v3_v3(), data, float(), min, PointDensity::point_tree, pointdensity(), pointdensity_color(), TexResult::tin, TexResult::tr, x, y, and z.
Referenced by RE_point_density_sample().
|
static |
Definition at line 614 of file texture_pointdensity.c.
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, NULL, 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 386 of file texture_pointdensity.c.
References alloc_point_data(), BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), CD_MASK_BAREMESH, CD_MASK_MCOL, CD_MASK_MDEFORMVERT, CD_MASK_MLOOPCOL, CD_MASK_MTFACE, copy_v3_v3(), Object::data, Object::loc, mask(), mesh, mul_m4_v3(), Mesh::mvert, NULL, PointDensity::ob_cache_space, PointDensity::ob_color_source, Object::obmat, 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::totvert.
Referenced by cache_pointdensity().
|
static |
Definition at line 165 of file texture_pointdensity.c.
References alloc_point_data(), BKE_lattice_deform_data_destroy(), BKE_scene_frame_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(), ParticleSimulationData::depsgraph, depsgraph, ParticleSettings::draw, Object::imat, invert_m4_m4(), ParticleSystem::lattice_deform_data, ParticleData::lifetime, Object::loc, mul_m4_v3(), NULL, ParticleSimulationData::ob, Object::obmat, 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_create_lattice_deform_data(), psys_get_child_time(), psys_get_modifier(), psys_get_particle_state(), 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 282 of file texture_pointdensity.c.
References add_v3_v3(), BLI_assert, CD_MLOOPCOL, col, CustomData_get_layer_named(), CustomData_has_layer(), CustomData_validate_layer_name(), Mesh::ldata, MAX_CUSTOMDATA_LAYER_NAME, MEM_callocN, MEM_freeN, mesh, Mesh::mloop, mul_v3_fl(), r, rgb_uchar_to_float(), Mesh::totloop, PointDensity::totpoints, v, MLoop::v, and PointDensity::vertex_attribute_name.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 371 of file texture_pointdensity.c.
References BLI_assert, mesh, Mesh::mvert, normal_short_to_float_v3(), and PointDensity::totpoints.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 334 of file texture_pointdensity.c.
References Object::actdef, BKE_object_defgroup_name_index(), BLI_assert, CD_MDEFORMVERT, copy_v3_fl(), CustomData_get_layer(), MDeformWeight::def_nr, MDeformVert::dw, mesh, Mesh::totvert, PointDensity::vertex_attribute_name, and MDeformWeight::weight.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 697 of file texture_pointdensity.c.
References BKE_colorband_evaluate(), PointDensity::coba, col, PointDensity::color_source, copy_v3_v3(), len_v3(), mul_v3_v3fl(), PointDensity::ob_color_source, PointDensity::source, PointDensity::speed_scale, TexResult::ta, TexResult::talpha, TexResult::tb, 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::tg, TexResult::tin, and TexResult::tr.
Referenced by point_density_sample_func().
| void RE_point_density_cache | ( | struct Depsgraph * | depsgraph, |
| PointDensity * | pd | ||
| ) |
Definition at line 831 of file texture_pointdensity.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), cache_pointdensity(), DEG_get_evaluated_scene(), depsgraph, sample_mutex, and scene.
| void RE_point_density_fix_linking | ( | void | ) |
Definition at line 982 of file texture_pointdensity.c.
Referenced by RE_InitState().
| void RE_point_density_free | ( | struct PointDensity * | pd | ) |
Definition at line 977 of file texture_pointdensity.c.
References free_pointdensity().
Referenced by node_shader_free_tex_pointdensity().
| void RE_point_density_minmax | ( | struct Depsgraph * | depsgraph, |
| struct PointDensity * | pd, | ||
| float | r_min[3], | ||
| float | r_max[3] | ||
| ) |
Definition at line 841 of file texture_pointdensity.c.
References add_v3_v3(), BKE_object_boundbox_get(), BLI_assert, BLI_findlink(), BOUNDBOX_DIRTY, copy_v3_v3(), DEG_get_evaluated_scene(), depsgraph, BoundBox::flag, NULL, PointDensity::object, particle_system_minmax(), Object::particlesystem, PointDensity::psys, PointDensity::radius, scene, PointDensity::source, sub_v3_v3(), TEX_PD_PSYS, BoundBox::vec, and zero_v3().
Referenced by RE_point_density_sample().
| void RE_point_density_sample | ( | Depsgraph * | depsgraph, |
| PointDensity * | pd, | ||
| const int | resolution, | ||
| float * | values | ||
| ) |
Definition at line 937 of file texture_pointdensity.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, depsgraph, free_pointdensity(), max, min, NULL, 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 771 of file texture_pointdensity.c.
Referenced by RE_point_density_sample().
|
static |
Definition at line 62 of file texture_pointdensity.c.
Referenced by RE_point_density_cache(), and RE_point_density_sample().