Blender
V3.3
|
MetaBall API for render engines. More...
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "BLI_utildefines.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "BKE_curve.h"
#include "BKE_mball.h"
#include "GPU_batch.h"
#include "DRW_render.h"
#include "draw_cache_impl.h"
Go to the source code of this file.
Classes | |
struct | MetaBallBatchCache |
Functions | |
Public Object/MetaBall API | |
GPUBatch * | DRW_metaball_batch_cache_get_triangles_with_normals (Object *ob) |
GPUBatch ** | DRW_metaball_batch_cache_get_surface_shaded (Object *ob, MetaBall *mb, struct GPUMaterial **UNUSED(gpumat_array), uint gpumat_array_len) |
GPUBatch * | DRW_metaball_batch_cache_get_wireframes_face (Object *ob) |
struct GPUBatch * | DRW_metaball_batch_cache_get_edge_detection (struct Object *ob, bool *r_is_manifold) |
struct GPUVertBuf * | DRW_mball_batch_cache_pos_vertbuf_get (Object *ob) |
int | DRW_metaball_material_count_get (MetaBall *mb) |
MetaBall GPUBatch Cache | |
typedef struct MetaBallBatchCache | MetaBallBatchCache |
static void | metaball_batch_cache_clear (MetaBall *mb) |
static bool | metaball_batch_cache_valid (MetaBall *mb) |
static void | metaball_batch_cache_init (MetaBall *mb) |
void | DRW_mball_batch_cache_validate (MetaBall *mb) |
static MetaBallBatchCache * | metaball_batch_cache_get (MetaBall *mb) |
void | DRW_mball_batch_cache_dirty_tag (MetaBall *mb, int mode) |
void | DRW_mball_batch_cache_free (MetaBall *mb) |
static GPUVertBuf * | mball_batch_cache_get_pos_and_normals (Object *ob, MetaBallBatchCache *cache, const struct Scene *scene) |
static GPUIndexBuf * | mball_batch_cache_get_edges_adj_lines (Object *ob, MetaBallBatchCache *cache) |
MetaBall API for render engines.
Definition in file draw_cache_impl_metaball.c.
typedef struct MetaBallBatchCache MetaBallBatchCache |
Definition at line 101 of file draw_cache_impl_metaball.c.
References MetaBall::batch_cache, BKE_MBALL_BATCH_DIRTY_ALL, BLI_assert, MetaBallBatchCache::is_dirty, and NULL.
Referenced by DRW_engines_register().
Definition at line 134 of file draw_cache_impl_metaball.c.
References MetaBall::batch_cache, MEM_SAFE_FREE, and metaball_batch_cache_clear().
Referenced by DRW_engines_register().
struct GPUVertBuf* DRW_mball_batch_cache_pos_vertbuf_get | ( | Object * | ob | ) |
Definition at line 275 of file draw_cache_impl_metaball.c.
References BKE_mball_is_basis(), Object::data, DRW_context_state_get(), mball_batch_cache_get_pos_and_normals(), metaball_batch_cache_get(), NULL, scene, and DRWContextState::scene.
Referenced by DRW_cache_object_pos_vertbuf_get().
Definition at line 88 of file draw_cache_impl_metaball.c.
References metaball_batch_cache_clear(), metaball_batch_cache_init(), and metaball_batch_cache_valid().
Referenced by drw_batch_cache_validate().
struct GPUBatch* DRW_metaball_batch_cache_get_edge_detection | ( | struct Object * | ob, |
bool * | r_is_manifold | ||
) |
Definition at line 249 of file draw_cache_impl_metaball.c.
References BKE_mball_is_basis(), Object::data, DRW_context_state_get(), MetaBallBatchCache::edge_detection, GPU_batch_create, GPU_PRIM_LINES_ADJ, MetaBallBatchCache::is_manifold, mball_batch_cache_get_edges_adj_lines(), mball_batch_cache_get_pos_and_normals(), metaball_batch_cache_get(), NULL, scene, and DRWContextState::scene.
Referenced by DRW_cache_mball_edge_detection_get().
GPUBatch** DRW_metaball_batch_cache_get_surface_shaded | ( | Object * | ob, |
MetaBall * | mb, | ||
struct GPUMaterial ** | UNUSEDgpumat_array, | ||
uint | gpumat_array_len | ||
) |
Definition at line 193 of file draw_cache_impl_metaball.c.
References BKE_mball_is_basis(), BLI_assert, DRW_metaball_batch_cache_get_triangles_with_normals(), DRW_metaball_material_count_get(), MetaBallBatchCache::mat_len, MEM_callocN, metaball_batch_cache_get(), NULL, and MetaBallBatchCache::shaded_triangles.
Definition at line 169 of file draw_cache_impl_metaball.c.
References MetaBallBatchCache::batch, BKE_mball_is_basis(), Object_Runtime::curve_cache, Object::data, CurveCache::disp, DRW_context_state_get(), DRW_displist_indexbuf_create_triangles_in_order(), GPU_batch_create_ex(), GPU_BATCH_OWNS_INDEX, GPU_indexbuf_calloc(), GPU_PRIM_TRIS, mball_batch_cache_get_pos_and_normals(), metaball_batch_cache_get(), NULL, Object::runtime, scene, and DRWContextState::scene.
Referenced by DRW_cache_mball_surface_get(), and DRW_metaball_batch_cache_get_surface_shaded().
Definition at line 217 of file draw_cache_impl_metaball.c.
References MetaBallBatchCache::batch, BKE_mball_is_basis(), Object_Runtime::curve_cache, Object::data, CurveCache::disp, DRW_context_state_get(), DRW_displist_indexbuf_create_lines_in_order(), DRW_displist_vertbuf_create_wiredata(), MetaBallBatchCache::face_wire, GPU_batch_create_ex(), GPU_BATCH_OWNS_INDEX, GPU_batch_vertbuf_add_ex(), GPU_indexbuf_calloc(), GPU_PRIM_LINES, GPU_vertbuf_calloc(), mball_batch_cache_get_pos_and_normals(), metaball_batch_cache_get(), NULL, Object::runtime, scene, and DRWContextState::scene.
Referenced by DRW_cache_mball_face_wireframe_get().
int DRW_metaball_material_count_get | ( | MetaBall * | mb | ) |
Definition at line 289 of file draw_cache_impl_metaball.c.
References max_ii(), and MetaBall::totcol.
Referenced by DRW_cache_object_material_count_get(), and DRW_metaball_batch_cache_get_surface_shaded().
|
static |
Definition at line 152 of file draw_cache_impl_metaball.c.
References Object_Runtime::curve_cache, CurveCache::disp, DRW_displist_indexbuf_create_edges_adjacency_lines(), MetaBallBatchCache::edges_adj_lines, GPU_indexbuf_calloc(), MetaBallBatchCache::is_manifold, NULL, and Object::runtime.
Referenced by DRW_metaball_batch_cache_get_edge_detection().
|
static |
Definition at line 140 of file draw_cache_impl_metaball.c.
References Object_Runtime::curve_cache, CurveCache::disp, DRW_displist_vertbuf_create_pos_and_nor(), GPU_vertbuf_calloc(), NULL, MetaBallBatchCache::pos_nor_in_order, Object::runtime, and scene.
Referenced by DRW_mball_batch_cache_pos_vertbuf_get(), DRW_metaball_batch_cache_get_edge_detection(), DRW_metaball_batch_cache_get_triangles_with_normals(), and DRW_metaball_batch_cache_get_wireframes_face().
Definition at line 116 of file draw_cache_impl_metaball.c.
References MetaBallBatchCache::batch, MetaBall::batch_cache, MetaBallBatchCache::edge_detection, MetaBallBatchCache::edges_adj_lines, MetaBallBatchCache::face_wire, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, MetaBallBatchCache::is_manifold, MetaBallBatchCache::mat_len, MEM_SAFE_FREE, MetaBallBatchCache::pos_nor_in_order, and MetaBallBatchCache::shaded_triangles.
Referenced by DRW_mball_batch_cache_free(), and DRW_mball_batch_cache_validate().
|
static |
Definition at line 96 of file draw_cache_impl_metaball.c.
References MetaBall::batch_cache.
Referenced by DRW_mball_batch_cache_pos_vertbuf_get(), DRW_metaball_batch_cache_get_edge_detection(), DRW_metaball_batch_cache_get_surface_shaded(), DRW_metaball_batch_cache_get_triangles_with_normals(), and DRW_metaball_batch_cache_get_wireframes_face().
Definition at line 70 of file draw_cache_impl_metaball.c.
References MetaBallBatchCache::batch, MetaBall::batch_cache, MetaBallBatchCache::edge_detection, MetaBallBatchCache::edges_adj_lines, MetaBallBatchCache::face_wire, MetaBallBatchCache::is_dirty, MetaBallBatchCache::is_manifold, MetaBallBatchCache::mat_len, MEM_mallocN, NULL, MetaBallBatchCache::pos_nor_in_order, and MetaBallBatchCache::shaded_triangles.
Referenced by DRW_mball_batch_cache_validate().
Definition at line 59 of file draw_cache_impl_metaball.c.
References MetaBall::batch_cache, MetaBallBatchCache::is_dirty, and NULL.
Referenced by DRW_mball_batch_cache_validate().