Blender V4.3
draw_pbvh.cc File Reference
#include "BLI_map.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
#include "DNA_object_types.h"
#include "BKE_attribute.hh"
#include "BKE_attribute_math.hh"
#include "BKE_customdata.hh"
#include "BKE_mesh.hh"
#include "BKE_paint.hh"
#include "BKE_pbvh_api.hh"
#include "BKE_subdiv_ccg.hh"
#include "DEG_depsgraph_query.hh"
#include "GPU_batch.hh"
#include "DRW_engine.hh"
#include "DRW_pbvh.hh"
#include "attribute_convert.hh"
#include "bmesh.hh"

Go to the source code of this file.

Classes

struct  blender::DefaultHash< draw::pbvh::AttributeRequest >
 
struct  blender::draw::pbvh::OrigMeshData
 
class  blender::draw::pbvh::DrawCacheImpl
 

Namespaces

namespace  blender
 
namespace  blender::draw
 
namespace  blender::draw::pbvh
 

Functions

DrawCacheblender::draw::pbvh::ensure_draw_data (std::unique_ptr< bke::pbvh::DrawCache > &ptr)
 
static BLI_NOINLINE void blender::draw::pbvh::free_ibos (const MutableSpan< gpu::IndexBuf * > ibos, const IndexMask &node_mask)
 
static BLI_NOINLINE void blender::draw::pbvh::free_vbos (const MutableSpan< gpu::VertBuf * > vbos, const IndexMask &node_mask)
 
static BLI_NOINLINE void blender::draw::pbvh::free_batches (const MutableSpan< gpu::Batch * > batches, const IndexMask &node_mask)
 
static const GPUVertFormatblender::draw::pbvh::position_format ()
 
static const GPUVertFormatblender::draw::pbvh::normal_format ()
 
static const GPUVertFormatblender::draw::pbvh::mask_format ()
 
static const GPUVertFormatblender::draw::pbvh::face_set_format ()
 
static GPUVertFormat blender::draw::pbvh::attribute_format (const OrigMeshData &orig_mesh_data, const StringRefNull name, const eCustomDataType data_type)
 
static GPUVertFormat blender::draw::pbvh::format_for_request (const OrigMeshData &orig_mesh_data, const AttributeRequest &request)
 
static bool blender::draw::pbvh::pbvh_attr_supported (const AttributeRequest &request)
 
short4 blender::draw::pbvh::normal_float_to_short (const float3 &value)
 
template<typename T >
void blender::draw::pbvh::extract_data_vert_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< T > attribute, const Span< int > face_indices, gpu::VertBuf &vbo)
 
template<typename T >
void blender::draw::pbvh::extract_data_face_mesh (const OffsetIndices< int > faces, const Span< T > attribute, const Span< int > face_indices, gpu::VertBuf &vbo)
 
template<typename T >
void blender::draw::pbvh::extract_data_corner_mesh (const OffsetIndices< int > faces, const Span< T > attribute, const Span< int > face_indices, gpu::VertBuf &vbo)
 
template<typename T >
const Tblender::draw::pbvh::bmesh_cd_vert_get (const BMVert &vert, const int offset)
 
template<typename T >
const Tblender::draw::pbvh::bmesh_cd_loop_get (const BMLoop &loop, const int offset)
 
template<typename T >
const Tblender::draw::pbvh::bmesh_cd_face_get (const BMFace &face, const int offset)
 
template<typename T >
void blender::draw::pbvh::extract_data_vert_bmesh (const Set< BMFace *, 0 > &faces, const int cd_offset, gpu::VertBuf &vbo)
 
template<typename T >
void blender::draw::pbvh::extract_data_face_bmesh (const Set< BMFace *, 0 > &faces, const int cd_offset, gpu::VertBuf &vbo)
 
template<typename T >
void blender::draw::pbvh::extract_data_corner_bmesh (const Set< BMFace *, 0 > &faces, const int cd_offset, gpu::VertBuf &vbo)
 
static const CustomDatablender::draw::pbvh::get_cdata (const BMesh &bm, const bke::AttrDomain domain)
 
template<typename T >
T blender::draw::pbvh::fallback_value_for_fill ()
 
template<>
ColorGeometry4f blender::draw::pbvh::fallback_value_for_fill ()
 
template<>
ColorGeometry4b blender::draw::pbvh::fallback_value_for_fill ()
 
static int blender::draw::pbvh::count_visible_tris_bmesh (const Set< BMFace *, 0 > &faces)
 
static void blender::draw::pbvh::fill_vbo_normal_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< bool > sharp_faces, const Span< float3 > vert_normals, const Span< float3 > face_normals, const Span< int > face_indices, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_mask_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< float > mask, const Span< int > face_indices, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbo_face_set_mesh (const OffsetIndices< int > faces, const Span< int > face_sets, const int color_default, const int color_seed, const Span< int > face_indices, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_attribute_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GSpan attribute, const bke::AttrDomain domain, const Span< int > face_indices, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_position_grids (const CCGKey &key, const Span< float3 > positions, const bool use_flat_layout, const Span< int > grids, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_normal_grids (const CCGKey &key, const Span< float3 > positions, const Span< float3 > normals, const Span< int > grid_to_face_map, const Span< bool > sharp_faces, const bool use_flat_layout, const Span< int > grids, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_mask_grids (const CCGKey &key, const Span< float > masks, const bool use_flat_layout, const Span< int > grids, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbo_face_set_grids (const CCGKey &key, const Span< int > grid_to_face_map, const Span< int > face_sets, const int color_default, const int color_seed, const bool use_flat_layout, const Span< int > grid_indices, gpu::VertBuf &vert_buf)
 
static void blender::draw::pbvh::fill_vbos_grids (const Object &object, const OrigMeshData &orig_mesh_data, const BitSpan use_flat_layout, const IndexMask &node_mask, const AttributeRequest &request, const MutableSpan< gpu::VertBuf * > vbos)
 
static void blender::draw::pbvh::fill_vbos_mesh (const Object &object, const OrigMeshData &orig_mesh_data, const IndexMask &node_mask, const AttributeRequest &request, const MutableSpan< gpu::VertBuf * > vbos)
 
static void blender::draw::pbvh::fill_vbo_position_bmesh (const Set< BMFace *, 0 > &faces, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbo_normal_bmesh (const Set< BMFace *, 0 > &faces, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbo_mask_bmesh (const Set< BMFace *, 0 > &faces, const int cd_offset, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbo_face_set_bmesh (const Set< BMFace *, 0 > &faces, const int color_default, const int color_seed, const int offset, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbo_attribute_bmesh (const Set< BMFace *, 0 > &faces, const eCustomDataType data_type, const bke::AttrDomain domain, const int offset, gpu::VertBuf &vbo)
 
static void blender::draw::pbvh::fill_vbos_bmesh (const Object &object, const OrigMeshData &orig_mesh_data, const IndexMask &node_mask, const AttributeRequest &request, const MutableSpan< gpu::VertBuf * > vbos)
 
static gpu::IndexBufblender::draw::pbvh::create_index_faces (const OffsetIndices< int > faces, const Span< bool > hide_poly, const Span< int > face_indices)
 
static gpu::IndexBufblender::draw::pbvh::create_index_bmesh (const Set< BMFace *, 0 > &faces, const int visible_faces_num)
 
static void blender::draw::pbvh::create_tri_index_grids (const Span< int > grid_indices, const BitGroupVector<> &grid_hidden, const int gridsize, const int skip, const int totgrid, GPUIndexBufBuilder &elb)
 
static void blender::draw::pbvh::create_tri_index_grids_flat_layout (const Span< int > grid_indices, const BitGroupVector<> &grid_hidden, const int gridsize, const int skip, const int totgrid, GPUIndexBufBuilder &elb)
 
static void blender::draw::pbvh::create_lines_index_grids (const Span< int > grid_indices, int display_gridsize, const BitGroupVector<> &grid_hidden, const int gridsize, const int skip, const int totgrid, GPUIndexBufBuilder &elb_lines)
 
static void blender::draw::pbvh::create_lines_index_grids_flat_layout (const Span< int > grid_indices, int display_gridsize, const BitGroupVector<> &grid_hidden, const int gridsize, const int skip, const int totgrid, GPUIndexBufBuilder &elb_lines)
 
static Array< intblender::draw::pbvh::calc_material_indices (const Object &object, const OrigMeshData &orig_mesh_data)
 
static BitVector blender::draw::pbvh::calc_use_flat_layout (const Object &object, const OrigMeshData &orig_mesh_data)
 
static gpu::IndexBufblender::draw::pbvh::create_tri_index_mesh (const OffsetIndices< int > faces, const Span< int3 > corner_tris, const Span< bool > hide_poly, const bke::pbvh::MeshNode &node)
 
static gpu::IndexBufblender::draw::pbvh::create_tri_index_grids (const CCGKey &key, const BitGroupVector<> &grid_hidden, const bool do_coarse, const Span< int > grid_indices, const bool use_flat_layout)
 
static gpu::IndexBufblender::draw::pbvh::create_lines_index_grids (const CCGKey &key, const BitGroupVector<> &grid_hidden, const bool do_coarse, const Span< int > grid_indices, const bool use_flat_layout)
 
static BLI_NOINLINE void blender::draw::pbvh::ensure_vbos_allocated_mesh (const Object &object, const GPUVertFormat &format, const IndexMask &node_mask, const MutableSpan< gpu::VertBuf * > vbos)
 
static BLI_NOINLINE void blender::draw::pbvh::ensure_vbos_allocated_grids (const Object &object, const GPUVertFormat &format, const BitSpan use_flat_layout, const IndexMask &node_mask, const MutableSpan< gpu::VertBuf * > vbos)
 
static BLI_NOINLINE void blender::draw::pbvh::ensure_vbos_allocated_bmesh (const Object &object, const GPUVertFormat &format, const IndexMask &node_mask, const MutableSpan< gpu::VertBuf * > vbos)
 
static BLI_NOINLINE void blender::draw::pbvh::flush_vbo_data (const Span< gpu::VertBuf * > vbos, const IndexMask &node_mask)
 

Detailed Description

bke::pbvh::Tree drawing. Embeds GPU meshes inside of bke::pbvh::Tree nodes, used by mesh sculpt mode.

Definition in file draw_pbvh.cc.