96 static uint pos_id, color_id;
97 if (edit_point_format.
attr_len == 0) {
104 *r_color_id = color_id;
105 return &edit_point_format;
133 memset(cache, 0,
sizeof(*cache));
245 const int num_path_cache_keys,
248 for (
int i = 0; i < num_path_cache_keys; i++) {
296 const int num_uv_layers,
297 const int parent_index,
317 for (
int j = 0; j < num_uv_layers; j++) {
325 const int num_col_layers,
326 const int parent_index,
346 for (
int j = 0; j < num_col_layers; j++) {
356 const int num_uv_layers,
357 const int child_index,
369 int num = particle->
num;
372 for (
int j = 0; j < num_uv_layers; j++) {
380 const int num_col_layers,
381 const int child_index,
393 int num = particle->
num;
396 for (
int j = 0; j < num_col_layers; j++) {
405 const bool is_simple,
406 const int num_uv_layers,
407 const int parent_index,
408 const int child_index,
410 float (**r_parent_uvs)[2],
417 if (r_parent_uvs[parent_index] !=
NULL) {
418 *r_uv = r_parent_uvs[parent_index];
421 *r_uv =
MEM_callocN(
sizeof(**r_uv) * num_uv_layers,
"Particle UVs");
425 *r_uv =
MEM_callocN(
sizeof(**r_uv) * num_uv_layers,
"Particle UVs");
427 if (child_index == -1) {
430 r_parent_uvs[parent_index] = *r_uv;
439 else if (!r_parent_uvs[psys->
child[child_index].
parent]) {
440 r_parent_uvs[psys->
child[child_index].
parent] = *r_uv;
448 const bool is_simple,
449 const int num_col_layers,
450 const int parent_index,
451 const int child_index,
453 MCol **r_parent_mcol,
460 if (r_parent_mcol[parent_index] !=
NULL) {
461 *r_mcol = r_parent_mcol[parent_index];
464 *r_mcol =
MEM_callocN(
sizeof(**r_mcol) * num_col_layers,
"Particle MCol");
468 *r_mcol =
MEM_callocN(
sizeof(**r_mcol) * num_col_layers,
"Particle MCol");
470 if (child_index == -1) {
473 r_parent_mcol[parent_index] = *r_mcol;
482 else if (!r_parent_mcol[psys->
child[child_index].
parent]) {
483 r_parent_mcol[psys->
child[child_index].
parent] = *r_mcol;
498 const int global_offset,
499 const int start_index,
500 const int num_path_keys,
501 const int num_uv_layers,
502 const int num_col_layers,
507 float (***r_parent_uvs)[2],
508 MCol ***r_parent_mcol,
515 if (is_simple && *r_parent_uvs ==
NULL) {
517 *r_parent_uvs =
MEM_callocN(
sizeof(*r_parent_uvs) * psys->
totpart,
"Parent particle UVs");
519 if (is_simple && *r_parent_mcol ==
NULL) {
520 *r_parent_mcol =
MEM_callocN(
sizeof(*r_parent_mcol) * psys->
totpart,
"Parent particle MCol");
522 int curr_point = start_index;
523 for (
int i = 0; i < num_path_keys; i++) {
549 for (
int j = 0; j < path->
segments; j++) {
554 sub_v3_v3v3(tangent, path[j + 1].co, path[j - 1].co);
560 for (
int k = 0; k < num_uv_layers; k++) {
567 for (
int k = 0; k < num_col_layers; k++) {
581 int global_index = i + global_offset;
587 for (
int k = 0; k < num_uv_layers; k++) {
594 for (
int k = 0; k < num_col_layers; k++) {
616 const int num_path_keys,
620 for (
int i = 0; i < num_path_keys; i++) {
625 float total_len = 0.0f;
626 float *co_prev =
NULL, *seg_data_first;
627 for (
int j = 0; j <= path->
segments; j++) {
631 total_len +=
len_v3v3(co_prev, path[j].co);
634 seg_data_first = seg_data;
636 seg_data[3] = total_len;
637 co_prev = path[j].
co;
641 if (total_len > 0.0f) {
643 for (
int j = 0; j <= path->
segments; j++, seg_data_first += 4) {
644 seg_data_first[3] /= total_len;
654 float edit_key_seg_t = 1.0f / (part->
totkey - 1);
659 float interp =
t / edit_key_seg_t;
662 float s1 = hkeys[index].
weight;
663 float s2 = hkeys[index + 1].
weight;
664 return s1 +
interp * (s2 - s1);
671 const int start_index,
672 const int num_path_keys,
676 int curr_point = start_index;
677 for (
int i = 0; i < num_path_keys; i++) {
682 for (
int j = 0; j <= path->
segments; j++) {
689 seg_data->
color = (weight < 1.0f) ? weight : 1.0f;
705 const int start_index,
706 const int num_path_keys,
710 int curr_point = start_index;
711 for (
int i = 0; i < num_path_keys; i++) {
716 for (
int k = 0; k < res; k++) {
728 const int start_index,
729 const int num_path_keys,
732 float (***r_parent_uvs)[2],
736 MCol ***r_parent_mcol,
743 if (is_simple && *r_parent_uvs ==
NULL) {
745 *r_parent_uvs =
MEM_callocN(
sizeof(*r_parent_uvs) * psys->
totpart,
"Parent particle UVs");
747 if (is_simple && *r_parent_mcol ==
NULL) {
748 *r_parent_mcol =
MEM_callocN(
sizeof(*r_parent_mcol) * psys->
totpart,
"Parent particle MCol");
750 int curr_point = start_index;
751 for (
int i = 0; i < num_path_keys; i++) {
785 for (
int k = 0; k < num_uv_layers; k++) {
789 for (
int k = 0; k < num_col_layers; k++) {
897 if (i == active_uv) {
900 if (i == render_uv) {
927 if (i == active_col) {
930 if (i == render_col) {
1010 if (parent_uvs !=
NULL) {
1012 for (
int i = 0; i < psys->
totpart; i++) {
1017 if (parent_mcol !=
NULL) {
1018 for (
int i = 0; i < psys->
totpart; i++) {
1056 int element_count = (verts_per_hair + 1) * cache->
strands_len;
1085 psys->
childcache, curr_point, child_count, verts_per_hair, &elb);
1133 psys->
childcache, child_count, &pos_step, &length_step);
1174 int num_uv_layers = 0;
1175 int num_col_layers = 0;
1202 uv_id =
MEM_mallocN(
sizeof(*uv_id) * num_uv_layers,
"UV attr format");
1203 col_id =
MEM_mallocN(
sizeof(*col_id) * num_col_layers,
"Col attr format");
1205 for (
int i = 0; i < num_uv_layers; i++) {
1211 BLI_snprintf(uuid,
sizeof(uuid),
"a%s", attr_safe_name);
1214 if (i == active_uv) {
1219 for (
int i = 0; i < num_col_layers; i++) {
1225 BLI_snprintf(uuid,
sizeof(uuid),
"a%s", attr_safe_name);
1228 if (i == active_col) {
1240 if (num_uv_layers || num_col_layers) {
1242 if (num_uv_layers) {
1243 mtfaces =
MEM_mallocN(
sizeof(*mtfaces) * num_uv_layers,
"Faces UV layers");
1244 for (
int i = 0; i < num_uv_layers; i++) {
1249 if (num_col_layers) {
1250 mcols =
MEM_mallocN(
sizeof(*mcols) * num_col_layers,
"Color layers");
1251 for (
int i = 0; i < num_col_layers; i++) {
1322 if (parent_uvs !=
NULL) {
1324 for (
int i = 0; i < psys->
totpart; i++) {
1329 if (parent_mcol !=
NULL) {
1330 for (
int i = 0; i < psys->
totpart; i++) {
1335 if (num_uv_layers) {
1338 if (num_col_layers) {
1351 if (point_cache->
pos !=
NULL) {
1356 static uint pos_id, rot_id, val_id;
1372 if (
format.attr_len == 0) {
1382 for (curr_point = 0, i = 0, pa = psys->
particles; i < psys->totpart; i++, pa++) {
1411 if (curr_point != psys->
totpart) {
1474 r_draw_source->
object = object;
1475 r_draw_source->
psys = psys;
1476 r_draw_source->
md = md;
1477 r_draw_source->
edit = edit;
1530 uint pos_id, color_id;
1594 uint pos_id, color_id;
1600 int global_key_index = 0;
1606 for (
int key_index = 0; key_index <
point->totkey - 1; key_index++) {
1652 uint pos_id, color_id;
1658 int global_point_index = 0;
1669 global_point_index++;
1696 bool need_ft_update =
false;
1705 *r_hair_cache = &cache->
hair;
1710 if ((*r_hair_cache)->proc_point_buf ==
NULL ||
1711 (gpu_material && (*r_hair_cache)->length_tex ==
NULL)) {
1715 need_ft_update =
true;
1719 if ((*r_hair_cache)->strand_tex ==
NULL) {
1725 if ((*r_hair_cache)->final[subdiv].proc_buf ==
NULL) {
1727 need_ft_update =
true;
1729 if ((*r_hair_cache)->final[subdiv].proc_hairs[thickness_res - 1] ==
NULL) {
1731 source.
edit, source.
psys, &cache->
hair, thickness_res, subdiv);
1734 return need_ft_update;
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
const char * CustomData_get_layer_name(const struct CustomData *data, int type, int n)
int CustomData_number_of_layers(const struct CustomData *data, int type)
bool CustomData_has_layer(const struct CustomData *data, int type)
int CustomData_get_active_layer(const struct CustomData *data, int type)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
int CustomData_get_render_layer(const struct CustomData *data, int type)
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
void psys_cache_edit_paths(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, bool use_render_params)
struct ParticleSystem * psys_orig_get(struct ParticleSystem *psys)
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2])
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
void psys_sim_data_free(struct ParticleSimulationData *sim)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc)
void psys_sim_data_init(struct ParticleSimulationData *sim)
bool psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, bool always)
#define BLI_array_alloca(arr, realsize)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
struct Depsgraph Depsgraph
float DEG_get_ctime(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
struct Object * DEG_get_original_object(struct Object *object)
struct ID * DEG_get_original_id(struct ID *id)
#define PART_CHILD_PARTICLES
#define PART_DRAW_COL_ACC
#define PART_DRAW_COL_VEL
#define PSYS_HAIR_UPDATED
#define DRW_TEXTURE_FREE_SAFE(tex)
struct PTCacheEdit * PE_create_current(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
void PE_update_object(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, int useflag)
#define GPU_batch_create(prim, verts, elem)
#define GPU_BATCH_DISCARD_SAFE(batch)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
void GPU_indexbuf_add_primitive_restart(GPUIndexBufBuilder *)
GPUIndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_generic_vert(GPUIndexBufBuilder *, uint v)
void GPU_indexbuf_init_ex(GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
ListBase GPU_material_attributes(GPUMaterial *material)
GPUTexture * GPU_texture_create_from_vertbuf(const char *name, struct GPUVertBuf *vert)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_use(GPUVertBuf *)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *, uint a_idx, GPUVertBufRaw *access)
void GPU_vertbuf_attr_set(GPUVertBuf *, uint a_idx, uint v_idx, const void *data)
void GPU_vertbuf_data_resize(GPUVertBuf *, uint v_len)
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
const Depsgraph * depsgraph
static void particle_batch_cache_ensure_procedural_indices(PTCacheEdit *edit, ParticleSystem *psys, ParticleHairCache *cache, int thickness_res, int subdiv)
static void particle_calculate_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const bool is_simple, const int num_col_layers, const int parent_index, const int child_index, const MCol **mcols, MCol **r_parent_mcol, MCol **r_mcol)
static void particle_batch_cache_ensure_pos(Object *object, ParticleSystem *psys, ParticlePointCache *point_cache)
static int particle_batch_cache_fill_segments(ParticleSystem *psys, ParticleSystemModifierData *psmd, ParticleCacheKey **path_cache, const ParticleSource particle_source, const int global_offset, const int start_index, const int num_path_keys, const int num_uv_layers, const int num_col_layers, const MTFace **mtfaces, const MCol **mcols, uint *uv_id, uint *col_id, float(***r_parent_uvs)[2], MCol ***r_parent_mcol, GPUIndexBufBuilder *elb, HairAttributeID *attr_id, ParticleHairCache *hair_cache)
static void particle_batch_cache_clear(ParticleSystem *psys)
struct EditStrandData EditStrandData
static void count_cache_segment_keys(ParticleCacheKey **pathcache, const int num_path_cache_keys, ParticleHairCache *hair_cache)
static void particle_pack_mcol(MCol *mcol, ushort r_scol[3])
static int particle_batch_cache_fill_segments_edit(const PTCacheEdit *UNUSED(edit), const ParticleData *particle, ParticleCacheKey **path_cache, const int start_index, const int num_path_keys, GPUIndexBufBuilder *elb, GPUVertBufRaw *attr_step)
static void particle_batch_cache_ensure_edit_tip_pos(PTCacheEdit *edit, ParticleBatchCache *cache)
GPUBatch * DRW_particles_batch_cache_get_edit_strands(Object *object, ParticleSystem *psys, PTCacheEdit *edit, bool use_weight)
static void particle_batch_cache_init(ParticleSystem *psys)
static void particle_batch_cache_clear_point(ParticlePointCache *point_cache)
struct ParticleDrawSource ParticleDrawSource
GPUBatch * DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys)
static float particle_key_weight(const ParticleData *particle, int strand, float t)
static ParticleBatchCache * particle_batch_cache_get(ParticleSystem *psys)
static void particle_batch_cache_ensure_procedural_pos(PTCacheEdit *edit, ParticleSystem *psys, ParticleHairCache *cache, GPUMaterial *gpu_material)
static void ensure_edit_tip_points_count(const PTCacheEdit *edit, ParticleBatchCache *cache)
GPUBatch * DRW_particles_batch_cache_get_edit_inner_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
GPUBatch * DRW_particles_batch_cache_get_edit_tip_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
static void ensure_edit_inner_points_count(const PTCacheEdit *edit, ParticleBatchCache *cache)
struct HairAttributeID HairAttributeID
static void drw_particle_get_hair_source(Object *object, ParticleSystem *psys, ModifierData *md, PTCacheEdit *edit, ParticleDrawSource *r_draw_source)
static void particle_batch_cache_fill_segments_proc_pos(ParticleCacheKey **path_cache, const int num_path_keys, GPUVertBufRaw *attr_step, GPUVertBufRaw *length_step)
static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit, ParticleSystem *psys, ModifierData *md, ParticleHairCache *hair_cache)
static GPUVertFormat * edit_points_vert_format_get(uint *r_pos_id, uint *r_color_id)
GPUBatch * DRW_particles_batch_cache_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
void DRW_particle_batch_cache_free(ParticleSystem *psys)
static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit, ParticleSystem *psys, ModifierData *md, ParticleHairCache *cache)
static void drw_particle_update_ptcache(Object *object_eval, ParticleSystem *psys)
static void particle_interpolate_children_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_col_layers, const int child_index, const MCol **mcols, MCol *r_mcol)
static int particle_batch_cache_fill_segments_indices(ParticleCacheKey **path_cache, const int start_index, const int num_path_keys, const int res, GPUIndexBufBuilder *elb)
static void particle_batch_cache_ensure_procedural_final_points(ParticleHairCache *cache, int subdiv)
static bool particle_batch_cache_valid(ParticleSystem *psys)
static void drw_particle_update_ptcache_edit(Object *object_eval, ParticleSystem *psys, PTCacheEdit *edit)
static void particle_batch_cache_ensure_edit_pos_and_seg(PTCacheEdit *edit, ParticleSystem *psys, ModifierData *UNUSED(md), ParticleHairCache *hair_cache, bool use_weight)
static void particle_batch_cache_free_hair(ParticleHairCache *hair)
static void particle_calculate_uvs(ParticleSystem *psys, ParticleSystemModifierData *psmd, const bool is_simple, const int num_uv_layers, const int parent_index, const int child_index, const MTFace **mtfaces, float(**r_parent_uvs)[2], float(**r_uv)[2])
static void particle_calculate_parent_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_col_layers, const int parent_index, const MCol **mcols, MCol *r_mcol)
bool particles_ensure_procedural_data(Object *object, ParticleSystem *psys, ModifierData *md, ParticleHairCache **r_hair_cache, GPUMaterial *gpu_material, int subdiv, int thickness_res)
static void particle_calculate_parent_uvs(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_uv_layers, const int parent_index, const MTFace **mtfaces, float(*r_uv)[2])
static int particle_batch_cache_fill_strands_data(ParticleSystem *psys, ParticleSystemModifierData *psmd, ParticleCacheKey **path_cache, const ParticleSource particle_source, const int start_index, const int num_path_keys, GPUVertBufRaw *data_step, GPUVertBufRaw *seg_step, float(***r_parent_uvs)[2], GPUVertBufRaw *uv_step, const MTFace **mtfaces, int num_uv_layers, MCol ***r_parent_mcol, GPUVertBufRaw *col_step, const MCol **mcols, int num_col_layers)
static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache)
static void ensure_seg_pt_count(PTCacheEdit *edit, ParticleSystem *psys, ParticleHairCache *hair_cache)
static void particle_interpolate_children_uvs(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_uv_layers, const int child_index, const MTFace **mtfaces, float(*r_uv)[2])
struct ParticlePointCache ParticlePointCache
struct ParticleBatchCache ParticleBatchCache
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
@ PARTICLE_SOURCE_CHILDREN
static void particle_batch_cache_ensure_edit_inner_pos(PTCacheEdit *edit, ParticleBatchCache *cache)
#define MAX_LAYER_NAME_LEN
const DRWContextState * DRW_context_state_get(void)
struct @653::@656 attr_id
void(* MEM_freeN)(void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
MINLINE unsigned short unit_float_to_ushort_clamp(float val)
float BLI_color_from_srgb_table[256]
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
static bool is_child(const Object *ob, const Object *parent)
struct Depsgraph * depsgraph
struct ParticleCacheKey ** pathcache
PTCacheEditPoint * points
struct ParticleSystem * psys
GPUVertBuf * edit_inner_pos
GPUBatch * edit_tip_points
ParticleHairCache edit_hair
GPUVertBuf * edit_tip_pos
GPUBatch * edit_inner_points
GPUVertBuf * proc_point_buf
GPUTexture * uv_tex[MAX_MTFACE]
GPUVertBuf * proc_strand_buf
GPUVertBuf ** proc_col_buf
char uv_layer_names[MAX_MTFACE][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUVertBuf * proc_length_buf
GPUTexture * strand_seg_tex
GPUVertBuf * proc_strand_seg_buf
GPUVertBuf * proc_uv_buf[MAX_MTFACE]
ParticleHairFinalCache final[MAX_HAIR_SUBDIV]
char(* col_layer_names)[MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUBatch * proc_hairs[MAX_THICKRES]
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct ParticleSystem * psys
struct ParticleCacheKey ** childcache
struct ParticleCacheKey ** pathcache