80 return (cache && cache->
is_dirty ==
false);
91 memset(cache, 0,
sizeof(*cache));
155 void *userdata,
float (*
verts)[3],
int (*edges)[2],
int totvert,
int totedge)
169 uint pos_hq_id, nor_hq_id;
172 if (
format.attr_len == 0) {
181 static float normal[3] = {1.0f, 0.0f, 0.0f};
206 for (
int i = 0; i < totedge; i++) {
229 if (volume_grid ==
NULL) {
245 void *userdata,
float (*
verts)[3],
int (*tris)[3],
int totvert,
int tottris)
247 Volume *volume = userdata;
252 if (
format.attr_len == 0) {
264 for (
int i = 0; i < tottris; i++) {
278 if (volume_grid ==
NULL) {
295 for (cache_grid = cache->
grids.
first; cache_grid; cache_grid = cache_grid->
next) {
312 if (!
ELEM(channels, 1, 3)) {
342 printf(
"Error: Could not allocate 3D texture for volume.\n");
@ BKE_VOLUME_BATCH_DIRTY_ALL
int BKE_volume_grid_channels(const struct VolumeGrid *grid)
void BKE_volume_grid_unload(const struct Volume *volume, const struct VolumeGrid *grid)
bool BKE_volume_grid_is_loaded(const struct VolumeGrid *grid)
const char * BKE_volume_grid_name(const struct VolumeGrid *grid)
const VolumeGrid * BKE_volume_grid_active_get_for_read(const struct Volume *volume)
bool BKE_volume_load(const struct Volume *volume, const struct Main *bmain)
Volume data-block rendering and viewport drawing utilities.
void BKE_volume_dense_float_grid_clear(DenseFloatVolumeGrid *dense_grid)
bool BKE_volume_grid_dense_floats(const struct Volume *volume, const struct VolumeGrid *volume_grid, DenseFloatVolumeGrid *r_dense_grid)
void BKE_volume_grid_wireframe(const struct Volume *volume, const struct VolumeGrid *volume_grid, BKE_volume_wireframe_cb cb, void *cb_userdata)
void BKE_volume_grid_selection_surface(const struct Volume *volume, const struct VolumeGrid *volume_grid, BKE_volume_selection_surface_cb cb, void *cb_userdata)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
bool invert_m4_m4(float R[4][4], const float A[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Object is a sort of wrapper for general info.
@ VOLUME_WIREFRAME_POINTS
#define DRW_TEXTURE_FREE_SAFE(tex)
#define GPU_batch_create(prim, verts, elem)
int GPU_batch_vertbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo)
#define GPU_BATCH_DISCARD_SAFE(batch)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
bool GPU_use_hq_normals_workaround(void)
struct GPUIndexBuf GPUIndexBuf
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
GPUIndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_line_verts(GPUIndexBufBuilder *, uint v1, uint v2)
void GPU_indexbuf_add_tri_verts(GPUIndexBufBuilder *, uint v1, uint v2, uint v3)
void GPU_texture_swizzle_set(GPUTexture *tex, const char swizzle[4])
void GPU_texture_wrap_mode(GPUTexture *tex, bool use_repeat, bool use_clamp)
GPUTexture * GPU_texture_create_3d(const char *name, int w, int h, int d, int mip_len, eGPUTextureFormat texture_format, eGPUDataFormat data_format, const void *data)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
GPUVertBuf * GPU_vertbuf_calloc(void)
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void GPU_vertbuf_attr_fill_stride(GPUVertBuf *, uint a_idx, uint stride, const void *data)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_attr_fill(GPUVertBuf *, uint a_idx, const void *data)
Read Guarded memory(de)allocation.
void DRW_vertbuf_create_wiredata(struct GPUVertBuf *vbo, const int vert_len)
void DRW_volume_batch_cache_free(Volume *volume)
static DRWVolumeGrid * volume_grid_cache_get(const Volume *volume, const VolumeGrid *grid, VolumeBatchCache *cache)
void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode)
static void drw_volume_selection_surface_cb(void *userdata, float(*verts)[3], int(*tris)[3], int totvert, int tottris)
DRWVolumeGrid * DRW_volume_batch_cache_get_grid(Volume *volume, const VolumeGrid *volume_grid)
static void volume_batch_cache_init(Volume *volume)
struct VolumeBatchCache VolumeBatchCache
GPUBatch * DRW_volume_batch_cache_get_selection_surface(Volume *volume)
static VolumeBatchCache * volume_batch_cache_get(Volume *volume)
static void volume_batch_cache_clear(Volume *volume)
static bool volume_batch_cache_valid(Volume *volume)
static void drw_volume_wireframe_cb(void *userdata, float(*verts)[3], int(*edges)[2], int totvert, int totedge)
struct VolumeWireframeUserData VolumeWireframeUserData
GPUBatch * DRW_volume_batch_cache_get_wireframes_face(Volume *volume)
int DRW_volume_material_count_get(Volume *volume)
void DRW_volume_batch_cache_validate(Volume *volume)
const DRWContextState * DRW_context_state_get(void)
struct @612::@615 attr_id
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
float texture_to_object[4][4]
struct DRWVolumeGrid * next
struct GPUTexture * texture
float object_to_texture[4][4]
float texture_to_object[4][4]
struct VolumeBatchCache::@279 face_wire
GPUVertBuf * pos_nor_in_order
GPUBatch * selection_surface