Blender
V3.3
|
PointCloud API for render engines. More...
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "BKE_customdata.h"
#include "BKE_pointcloud.h"
#include "GPU_batch.h"
#include "draw_cache_impl.h"
Go to the source code of this file.
Classes | |
struct | PointCloudBatchCache |
Typedefs | |
typedef struct PointCloudBatchCache | PointCloudBatchCache |
Functions | |
static void | pointcloud_batch_cache_clear (PointCloud *pointcloud) |
static bool | pointcloud_batch_cache_valid (PointCloud *pointcloud) |
static void | pointcloud_batch_cache_init (PointCloud *pointcloud) |
void | DRW_pointcloud_batch_cache_validate (PointCloud *pointcloud) |
static PointCloudBatchCache * | pointcloud_batch_cache_get (PointCloud *pointcloud) |
void | DRW_pointcloud_batch_cache_dirty_tag (PointCloud *pointcloud, int mode) |
void | DRW_pointcloud_batch_cache_free (PointCloud *pointcloud) |
static void | pointcloud_batch_cache_ensure_pos (Object *ob, PointCloudBatchCache *cache) |
static void | pointcloud_batch_cache_ensure_geom (Object *UNUSED(ob), PointCloudBatchCache *cache) |
GPUBatch * | DRW_pointcloud_batch_cache_get_dots (Object *ob) |
GPUBatch * | DRW_pointcloud_batch_cache_get_surface (Object *ob) |
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) |
Variables | |
static const float | half_octahedron_normals [5][3] |
static const uint | half_octahedron_tris [4][3] |
PointCloud API for render engines.
Definition in file draw_cache_impl_pointcloud.c.
typedef struct PointCloudBatchCache PointCloudBatchCache |
GPUBatch** DRW_cache_pointcloud_surface_shaded_get | ( | Object * | ob, |
struct GPUMaterial ** | UNUSEDgpumat_array, | ||
uint | gpumat_array_len | ||
) |
Definition at line 257 of file draw_cache_impl_pointcloud.c.
References BLI_assert, Object::data, PointCloudBatchCache::geom, PointCloudBatchCache::geom_indices, GPU_batch_create, GPU_batch_instbuf_add_ex(), GPU_PRIM_TRIS, PointCloudBatchCache::mat_len, NULL, pointcloud_batch_cache_ensure_geom(), pointcloud_batch_cache_ensure_pos(), pointcloud_batch_cache_get(), PointCloudBatchCache::pos, PointCloudBatchCache::surface_per_mat, and UNUSED_VARS.
void DRW_pointcloud_batch_cache_dirty_tag | ( | PointCloud * | pointcloud, |
int | mode | ||
) |
Definition at line 94 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache, BKE_POINTCLOUD_BATCH_DIRTY_ALL, BLI_assert, PointCloudBatchCache::is_dirty, and NULL.
Referenced by DRW_engines_register().
void DRW_pointcloud_batch_cache_free | ( | PointCloud * | pointcloud | ) |
Definition at line 130 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache, MEM_SAFE_FREE, and pointcloud_batch_cache_clear().
Referenced by DRW_engines_register().
Definition at line 228 of file draw_cache_impl_pointcloud.c.
References Object::data, PointCloudBatchCache::dots, GPU_batch_create, GPU_PRIM_POINTS, NULL, pointcloud_batch_cache_ensure_pos(), pointcloud_batch_cache_get(), and PointCloudBatchCache::pos.
Referenced by DRW_cache_object_face_wireframe_get(), and DRW_cache_pointcloud_get_dots().
Definition at line 241 of file draw_cache_impl_pointcloud.c.
References Object::data, PointCloudBatchCache::geom, PointCloudBatchCache::geom_indices, GPU_batch_create, GPU_batch_instbuf_add_ex(), GPU_PRIM_TRIS, NULL, pointcloud_batch_cache_ensure_geom(), pointcloud_batch_cache_ensure_pos(), pointcloud_batch_cache_get(), PointCloudBatchCache::pos, and PointCloudBatchCache::surface.
Referenced by DRW_cache_pointcloud_surface_get().
void DRW_pointcloud_batch_cache_validate | ( | PointCloud * | pointcloud | ) |
Definition at line 81 of file draw_cache_impl_pointcloud.c.
References pointcloud_batch_cache_clear(), pointcloud_batch_cache_init(), and pointcloud_batch_cache_valid().
Referenced by drw_batch_cache_validate().
int DRW_pointcloud_material_count_get | ( | PointCloud * | pointcloud | ) |
Definition at line 277 of file draw_cache_impl_pointcloud.c.
References max_ii(), and PointCloud::totcol.
Referenced by DRW_cache_object_material_count_get(), pointcloud_batch_cache_init(), and pointcloud_batch_cache_valid().
|
static |
Definition at line 109 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache, PointCloudBatchCache::dots, PointCloudBatchCache::geom, PointCloudBatchCache::geom_indices, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, PointCloudBatchCache::mat_len, MEM_SAFE_FREE, PointCloudBatchCache::pos, PointCloudBatchCache::surface, and PointCloudBatchCache::surface_per_mat.
Referenced by DRW_pointcloud_batch_cache_free(), and DRW_pointcloud_batch_cache_validate().
|
static |
Definition at line 196 of file draw_cache_impl_pointcloud.c.
References ARRAY_SIZE, PointCloudBatchCache::geom, PointCloudBatchCache::geom_indices, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_indexbuf_add_tri_verts(), GPU_indexbuf_build(), GPU_indexbuf_init(), GPU_PRIM_TRIS, GPU_vertbuf_attr_fill(), GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertformat_alias_add(), GPU_vertformat_attr_add(), half_octahedron_normals, half_octahedron_tris, NULL, pos, and UNPACK3.
Referenced by DRW_cache_pointcloud_surface_shaded_get(), and DRW_pointcloud_batch_cache_get_surface().
|
static |
Definition at line 136 of file draw_cache_impl_pointcloud.c.
References CD_PROP_FLOAT, CD_PROP_FLOAT3, copy_v3_v3(), CustomData_get_layer_named(), Object::data, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_vertbuf_attr_fill(), GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertbuf_get_data(), GPU_vertformat_attr_add(), NULL, PointCloud::pdata, PointCloudBatchCache::pos, pos, positions, radii, and PointCloud::totpoint.
Referenced by DRW_cache_pointcloud_surface_shaded_get(), DRW_pointcloud_batch_cache_get_dots(), and DRW_pointcloud_batch_cache_get_surface().
|
static |
Definition at line 89 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache.
Referenced by DRW_cache_pointcloud_surface_shaded_get(), DRW_pointcloud_batch_cache_get_dots(), and DRW_pointcloud_batch_cache_get_surface().
|
static |
Definition at line 63 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache, DRW_pointcloud_material_count_get(), GPUBatch, PointCloudBatchCache::is_dirty, PointCloudBatchCache::mat_len, MEM_callocN, and PointCloudBatchCache::surface_per_mat.
Referenced by DRW_pointcloud_batch_cache_validate().
|
static |
Definition at line 50 of file draw_cache_impl_pointcloud.c.
References PointCloud::batch_cache, DRW_pointcloud_material_count_get(), PointCloudBatchCache::is_dirty, PointCloudBatchCache::mat_len, and NULL.
Referenced by DRW_pointcloud_batch_cache_validate().
|
static |
Definition at line 181 of file draw_cache_impl_pointcloud.c.
Referenced by pointcloud_batch_cache_ensure_geom().
|
static |
Definition at line 189 of file draw_cache_impl_pointcloud.c.
Referenced by pointcloud_batch_cache_ensure_geom().