109 static uint pos_id, color_id;
110 if (edit_point_format.
attr_len == 0) {
117 *r_color_id = color_id;
118 return &edit_point_format;
146 memset(cache, 0,
sizeof(*cache));
197 for (
int i = 0; i <
MAX_MCOL; i++) {
240 const int num_path_cache_keys,
243 for (
int i = 0; i < num_path_cache_keys; i++) {
291 const int num_uv_layers,
292 const int parent_index,
312 for (
int j = 0; j < num_uv_layers; j++) {
320 const int num_col_layers,
321 const int parent_index,
341 for (
int j = 0; j < num_col_layers; j++) {
351 const int num_uv_layers,
352 const int child_index,
364 int num = particle->
num;
367 for (
int j = 0; j < num_uv_layers; j++) {
375 const int num_col_layers,
376 const int child_index,
388 int num = particle->
num;
391 for (
int j = 0; j < num_col_layers; j++) {
400 const bool is_simple,
401 const int num_uv_layers,
402 const int parent_index,
403 const int child_index,
405 float (**r_parent_uvs)[2],
412 if (r_parent_uvs[parent_index] !=
NULL) {
413 *r_uv = r_parent_uvs[parent_index];
416 *r_uv =
MEM_callocN(
sizeof(**r_uv) * num_uv_layers,
"Particle UVs");
420 *r_uv =
MEM_callocN(
sizeof(**r_uv) * num_uv_layers,
"Particle UVs");
422 if (child_index == -1) {
425 r_parent_uvs[parent_index] = *r_uv;
434 else if (!r_parent_uvs[psys->
child[child_index].
parent]) {
435 r_parent_uvs[psys->
child[child_index].
parent] = *r_uv;
443 const bool is_simple,
444 const int num_col_layers,
445 const int parent_index,
446 const int child_index,
448 MCol **r_parent_mcol,
455 if (r_parent_mcol[parent_index] !=
NULL) {
456 *r_mcol = r_parent_mcol[parent_index];
459 *r_mcol =
MEM_callocN(
sizeof(**r_mcol) * num_col_layers,
"Particle MCol");
463 *r_mcol =
MEM_callocN(
sizeof(**r_mcol) * num_col_layers,
"Particle MCol");
465 if (child_index == -1) {
468 r_parent_mcol[parent_index] = *r_mcol;
477 else if (!r_parent_mcol[psys->
child[child_index].
parent]) {
478 r_parent_mcol[psys->
child[child_index].
parent] = *r_mcol;
493 const int global_offset,
494 const int start_index,
495 const int num_path_keys,
496 const int num_uv_layers,
497 const int num_col_layers,
502 float (***r_parent_uvs)[2],
503 MCol ***r_parent_mcol,
510 if (is_simple && *r_parent_uvs ==
NULL) {
512 *r_parent_uvs =
MEM_callocN(
sizeof(*r_parent_uvs) * psys->
totpart,
"Parent particle UVs");
514 if (is_simple && *r_parent_mcol ==
NULL) {
515 *r_parent_mcol =
MEM_callocN(
sizeof(*r_parent_mcol) * psys->
totpart,
"Parent particle MCol");
517 int curr_point = start_index;
518 for (
int i = 0; i < num_path_keys; i++) {
544 for (
int j = 0; j < path->
segments; j++) {
549 sub_v3_v3v3(tangent, path[j + 1].co, path[j - 1].co);
555 for (
int k = 0; k < num_uv_layers; k++) {
562 for (
int k = 0; k < num_col_layers; k++) {
576 int global_index = i + global_offset;
582 for (
int k = 0; k < num_uv_layers; k++) {
589 for (
int k = 0; k < num_col_layers; k++) {
611 const int num_path_keys,
614 for (
int i = 0; i < num_path_keys; i++) {
619 float total_len = 0.0f;
620 float *co_prev =
NULL, *seg_data_first;
621 for (
int j = 0; j <= path->
segments; j++) {
625 total_len +=
len_v3v3(co_prev, path[j].co);
628 seg_data_first = seg_data;
630 seg_data[3] = total_len;
631 co_prev = path[j].
co;
633 if (total_len > 0.0f) {
635 for (
int j = 0; j <= path->
segments; j++, seg_data_first += 4) {
636 seg_data_first[3] /= total_len;
646 float edit_key_seg_t = 1.0f / (part->
totkey - 1);
651 float interp =
t / edit_key_seg_t;
654 float s1 = hkeys[index].
weight;
655 float s2 = hkeys[index + 1].
weight;
656 return s1 +
interp * (s2 - s1);
663 const int start_index,
664 const int num_path_keys,
668 int curr_point = start_index;
669 for (
int i = 0; i < num_path_keys; i++) {
674 for (
int j = 0; j <= path->
segments; j++) {
681 seg_data->
color = (weight < 1.0f) ? weight : 1.0f;
697 const int start_index,
698 const int num_path_keys,
702 int curr_point = start_index;
703 for (
int i = 0; i < num_path_keys; i++) {
708 for (
int k = 0; k < res; k++) {
720 const int start_index,
721 const int num_path_keys,
724 float (***r_parent_uvs)[2],
728 MCol ***r_parent_mcol,
735 if (is_simple && *r_parent_uvs ==
NULL) {
737 *r_parent_uvs =
MEM_callocN(
sizeof(*r_parent_uvs) * psys->
totpart,
"Parent particle UVs");
739 if (is_simple && *r_parent_mcol ==
NULL) {
740 *r_parent_mcol =
MEM_callocN(
sizeof(*r_parent_mcol) * psys->
totpart,
"Parent particle MCol");
742 int curr_point = start_index;
743 for (
int i = 0; i < num_path_keys; i++) {
777 for (
int k = 0; k < num_uv_layers; k++) {
781 for (
int k = 0; k < num_col_layers; k++) {
890 if (i == active_uv) {
893 if (i == render_uv) {
915 if (i == active_col) {
918 if (i == render_col) {
997 if (parent_uvs !=
NULL) {
999 for (
int i = 0; i < psys->
totpart; i++) {
1004 if (parent_mcol !=
NULL) {
1005 for (
int i = 0; i < psys->
totpart; i++) {
1043 int element_count = (verts_per_hair + 1) * cache->
strands_len;
1072 psys->
childcache, curr_point, child_count, verts_per_hair, &elb);
1137 int num_uv_layers = 0;
1138 int num_col_layers = 0;
1165 uv_id =
MEM_mallocN(
sizeof(*uv_id) * num_uv_layers,
"UV attr format");
1166 col_id =
MEM_mallocN(
sizeof(*col_id) * num_col_layers,
"Col attr format");
1168 for (
int i = 0; i < num_uv_layers; i++) {
1174 BLI_snprintf(uuid,
sizeof(uuid),
"u%s", attr_safe_name);
1177 if (i == active_uv) {
1182 for (
int i = 0; i < num_col_layers; i++) {
1187 BLI_snprintf(uuid,
sizeof(uuid),
"c%s", attr_safe_name);
1190 if (i == active_col) {
1202 if (num_uv_layers || num_col_layers) {
1204 if (num_uv_layers) {
1205 mtfaces =
MEM_mallocN(
sizeof(*mtfaces) * num_uv_layers,
"Faces UV layers");
1206 for (
int i = 0; i < num_uv_layers; i++) {
1210 if (num_col_layers) {
1211 mcols =
MEM_mallocN(
sizeof(*mcols) * num_col_layers,
"Color layers");
1212 for (
int i = 0; i < num_col_layers; i++) {
1283 if (parent_uvs !=
NULL) {
1285 for (
int i = 0; i < psys->
totpart; i++) {
1290 if (parent_mcol !=
NULL) {
1291 for (
int i = 0; i < psys->
totpart; i++) {
1296 if (num_uv_layers) {
1299 if (num_col_layers) {
1312 if (point_cache->
pos !=
NULL) {
1317 static uint pos_id, rot_id, val_id;
1333 if (
format.attr_len == 0) {
1343 for (curr_point = 0, i = 0, pa = psys->
particles; i < psys->totpart; i++, pa++) {
1372 if (curr_point != psys->
totpart) {
1433 r_draw_source->
object = object;
1434 r_draw_source->
psys = psys;
1435 r_draw_source->
md = md;
1436 r_draw_source->
edit = edit;
1489 uint pos_id, color_id;
1536 for (
int point_index = 0; point_index < edit->
totpoint; point_index++) {
1553 uint pos_id, color_id;
1559 int global_key_index = 0;
1560 for (
int point_index = 0; point_index < edit->
totpoint; point_index++) {
1565 for (
int key_index = 0; key_index < point->
totkey - 1; key_index++) {
1596 for (
int point_index = 0; point_index < edit->
totpoint; point_index++) {
1611 uint pos_id, color_id;
1617 int global_point_index = 0;
1618 for (
int point_index = 0; point_index < edit->
totpoint; point_index++) {
1628 global_point_index++;
1655 bool need_ft_update =
false;
1664 *r_hair_cache = &cache->
hair;
1669 if ((*r_hair_cache)->proc_point_buf ==
NULL) {
1672 need_ft_update =
true;
1676 if ((*r_hair_cache)->strand_tex ==
NULL) {
1682 if ((*r_hair_cache)->final[subdiv].proc_buf ==
NULL) {
1684 need_ft_update =
true;
1686 if ((*r_hair_cache)->final[subdiv].proc_hairs[thickness_res - 1] ==
NULL) {
1688 source.
edit, source.
psys, &cache->
hair, thickness_res, subdiv);
1691 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_named_layer_index(const struct CustomData *data, int type, const char *name)
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, const bool use_render_params)
struct LatticeDeformData * psys_create_lattice_deform_data(struct ParticleSimulationData *sim)
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)
int psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, int always)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
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
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
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
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.
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_batch_cache_ensure_pos(Object *object, ParticleSystem *psys, ParticlePointCache *point_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])
void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache)
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_calculate_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const bool is_simple, const int num_col_layers, const int parent_index, const int child_index, MCol **mcols, MCol **r_parent_mcol, MCol **r_mcol)
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_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)
bool particles_ensure_procedural_data(Object *object, ParticleSystem *psys, ModifierData *md, ParticleHairCache **r_hair_cache, int subdiv, int thickness_res)
GPUBatch * DRW_particles_batch_cache_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
void DRW_particle_batch_cache_free(ParticleSystem *psys)
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, MTFace **mtfaces, float(**r_parent_uvs)[2], float(**r_uv)[2])
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_batch_cache_fill_segments_proc_pos(ParticleCacheKey **path_cache, const int num_path_keys, GPUVertBufRaw *attr_step)
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_calculate_parent_uvs(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_uv_layers, const int parent_index, MTFace **mtfaces, float(*r_uv)[2])
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 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, MTFace **mtfaces, 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_ensure_edit_pos_and_seg(PTCacheEdit *edit, ParticleSystem *psys, ModifierData *UNUSED(md), ParticleHairCache *hair_cache, bool use_weight)
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, MTFace **mtfaces, int num_uv_layers, MCol ***r_parent_mcol, GPUVertBufRaw *col_step, MCol **mcols, int num_col_layers)
static void particle_interpolate_children_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_col_layers, const int child_index, MCol **mcols, MCol *r_mcol)
static void particle_interpolate_children_uvs(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_uv_layers, const int child_index, MTFace **mtfaces, float(*r_uv)[2])
static void particle_batch_cache_ensure_procedural_pos(PTCacheEdit *edit, ParticleSystem *psys, ParticleHairCache *cache)
static void ensure_seg_pt_count(PTCacheEdit *edit, ParticleSystem *psys, ParticleHairCache *hair_cache)
struct ParticlePointCache ParticlePointCache
struct ParticleBatchCache ParticleBatchCache
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
@ PARTICLE_SOURCE_CHILDREN
static void particle_calculate_parent_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, const int num_col_layers, const int parent_index, MCol **mcols, MCol *r_mcol)
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 @612::@615 attr_id
void(* MEM_freeN)(void *vmemh)
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]
static bool is_child(const Object *ob, const Object *parent)
struct Depsgraph * depsgraph
struct CustomData pdata ldata
struct CustomData vdata edata fdata
struct PTCacheEditKey * keys
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[MAX_MCOL]
char uv_layer_names[MAX_MTFACE][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUTexture * strand_seg_tex
GPUVertBuf * proc_strand_seg_buf
char col_layer_names[MAX_MCOL][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUVertBuf * proc_uv_buf[MAX_MTFACE]
GPUTexture * col_tex[MAX_MCOL]
ParticleHairFinalCache final[MAX_HAIR_SUBDIV]
GPUBatch * proc_hairs[MAX_THICKRES]
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct ParticleSystem * psys
struct LatticeDeformData * lattice_deform_data
struct ParticleCacheKey ** childcache
struct ParticleCacheKey ** pathcache
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)