Blender
V3.3
|
#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_mesh.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 538 of file texture_pointdensity.c.
References add_v3_v3(), PointDensityRangeData::age, PointDensityRangeData::col, usdtokens::density(), 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 126 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 426 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 491 of file texture_pointdensity.c.
References BKE_curvemapping_evaluateF(), BKE_curvemapping_init(), usdtokens::density(), PointDensityRangeData::density_curve, PointDensityRangeData::falloff_type, len_v3(), MIN2, 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 460 of file texture_pointdensity.c.
References BLI_bvhtree_free(), MEM_SAFE_FREE, 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 562 of file texture_pointdensity.c.
References PointDensityRangeData::age, col, PointDensityRangeData::col, usdtokens::density(), 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 747 of file texture_pointdensity.c.
References add_v3_v3v3(), BKE_scene_ctime_get(), ParticleSimulationData::depsgraph, depsgraph, INIT_MINMAX, invert_m4_m4(), max, min, minmax_v3v3_v3(), mul_v3_m4v3(), NULL, ParticleSimulationData::ob, Object::obmat, 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, size(), state, sub_v3_v3v3(), ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, and unit_m4().
Referenced by RE_point_density_minmax().
|
static |
Definition at line 76 of file texture_pointdensity.c.
References data, NULL, offset, 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 49 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 864 of file texture_pointdensity.c.
References col, copy_v3_v3(), data, float(), 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 585 of file texture_pointdensity.c.
References accum_density(), BLI_bvhtree_range_query(), BLI_noise_generic_turbulence(), col, copy_v3_v3(), usdtokens::density(), 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 360 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_MTFACE, CD_MASK_PROP_BYTE_COLOR, 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 150 of file texture_pointdensity.c.
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(), ParticleSimulationData::depsgraph, depsgraph, ParticleSettings::draw, Object::imat, invert_m4_m4(), 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_get_child_time(), psys_get_modifier(), psys_get_particle_state(), psys_sim_data_free(), psys_sim_data_init(), 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 264 of file texture_pointdensity.c.
References add_v3_v3(), BLI_assert, CD_PROP_BYTE_COLOR, 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().
Definition at line 353 of file texture_pointdensity.c.
References BKE_mesh_vertex_normals_ensure(), BLI_assert, float(), mesh, and Mesh::totvert.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 316 of file texture_pointdensity.c.
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, Mesh::id, mesh, Mesh::totvert, Mesh::vdata, PointDensity::vertex_attribute_name, and MDeformWeight::weight.
Referenced by pointdensity_cache_object().
|
static |
Definition at line 668 of file texture_pointdensity.c.
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, usdtokens::rgba(), 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 | ( | struct Depsgraph * | depsgraph, |
PointDensity * | pd | ||
) |
Definition at line 799 of file texture_pointdensity.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), cache_pointdensity(), DEG_get_evaluated_scene(), depsgraph, sample_mutex, and scene.
Definition at line 947 of file texture_pointdensity.c.
Referenced by RE_InitState().
void RE_point_density_free | ( | struct PointDensity * | pd | ) |
Definition at line 942 of file texture_pointdensity.c.
References free_pointdensity().
Referenced by blender::nodes::node_shader_tex_pointdensity_cc::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 809 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 | ( | struct Depsgraph * | depsgraph, |
struct PointDensity * | pd, | ||
int | resolution, | ||
float * | values | ||
) |
Definition at line 902 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.
Definition at line 742 of file texture_pointdensity.c.
Referenced by RE_point_density_sample().
|
static |
Definition at line 47 of file texture_pointdensity.c.
Referenced by RE_point_density_cache(), and RE_point_density_sample().