71 memset(cache, 0,
sizeof(*cache));
76 "pointcloud suface_per_mat");
123 for (
int i = 0; i < cache->
mat_len; i++) {
152 if (
format.attr_len == 0) {
169 for (
int i = 0; i < pointcloud->
totpoint; i++) {
173 vbo_data[i][3] =
radii[i] * 100.0f;
204 if (
format.attr_len == 0) {
259 uint gpumat_array_len)
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
General operations for point clouds.
@ BKE_POINTCLOUD_BATCH_DIRTY_ALL
MINLINE int max_ii(int a, int b)
MINLINE void copy_v3_v3(float r[3], const float a[3])
Object is a sort of wrapper for general info.
#define GPU_batch_create(prim, verts, elem)
#define GPU_BATCH_DISCARD_SAFE(batch)
int GPU_batch_instbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo)
struct GPUIndexBuf GPUIndexBuf
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
GPUIndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_tri_verts(GPUIndexBufBuilder *, uint v1, uint v2, uint v3)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void * GPU_vertbuf_get_data(const GPUVertBuf *verts)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_attr_fill(GPUVertBuf *, uint a_idx, const void *data)
Read Guarded memory(de)allocation.
static void pointcloud_batch_cache_ensure_geom(Object *UNUSED(ob), PointCloudBatchCache *cache)
static const uint half_octahedron_tris[4][3]
static void pointcloud_batch_cache_init(PointCloud *pointcloud)
static void pointcloud_batch_cache_ensure_pos(Object *ob, PointCloudBatchCache *cache)
struct PointCloudBatchCache PointCloudBatchCache
GPUBatch ** DRW_cache_pointcloud_surface_shaded_get(Object *ob, struct GPUMaterial **UNUSED(gpumat_array), uint gpumat_array_len)
int DRW_pointcloud_material_count_get(PointCloud *pointcloud)
GPUBatch * DRW_pointcloud_batch_cache_get_surface(Object *ob)
GPUBatch * DRW_pointcloud_batch_cache_get_dots(Object *ob)
void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
static void pointcloud_batch_cache_clear(PointCloud *pointcloud)
static bool pointcloud_batch_cache_valid(PointCloud *pointcloud)
static const float half_octahedron_normals[5][3]
void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud)
void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud)
static PointCloudBatchCache * pointcloud_batch_cache_get(PointCloud *pointcloud)
void *(* MEM_callocN)(size_t len, const char *str)
MutableSpan< float3 > positions
MutableSpan< float > radii
GPUIndexBuf * geom_indices
GPUBatch ** surface_per_mat