Blender V5.3
draw_cache_impl_gsplat.cc File Reference

GSplat API for render engines. More...

#include <cstring>
#include <fmt/format.h>
#include "BLI_array_utils.hh"
#include "BLI_bounds.hh"
#include "BLI_color_types.hh"
#include "BLI_math_vector.hh"
#include "BLI_task.hh"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_userdef_types.h"
#include "BKE_attribute.hh"
#include "BKE_material.hh"
#include "BKE_pointcloud.hh"
#include "GPU_batch.hh"
#include "GPU_material.hh"
#include "GPU_uniform_buffer.hh"
#include "DRW_render.hh"
#include "draw_attributes.hh"
#include "draw_cache_impl.hh"
#include "draw_cache_inline.hh"
#include "draw_gsplat_private.hh"
#include "draw_shader_shared.hh"

Go to the source code of this file.

Classes

struct  blender::draw::detail::RadiancePack
struct  blender::draw::GSplatBatchCache

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::draw
namespace  blender::draw::detail

Functions

static void blender::draw::detail::index_mask_to_ibo (const IndexMask &mask, gpu::IndexBuf &ibo)
BLI_INLINE float3 blender::draw::detail::pack_quaternion_4_to_3 (const float4 &q)
BLI_INLINE uint4 blender::draw::detail::pack_gaussian (const float3 &bounded_mean, const float3 &bounded_log_scale, bool log_scale_is_zero, const math::Quaternion &rotation, float opacity)
BLI_INLINE RadiancePack blender::draw::detail::pack_radiance (const Array< float3, radiance_coeffs_max > &radiance_sh)
static Vector< VArraySpan< float3 > > blender::draw::detail::read_radiance_sh_attributes (const bke::AttributeAccessor &attributes)
GSplat
gpu::VertBuf ** blender::draw::DRW_gsplat_evaluated_attribute (PointCloud *pointcloud, StringRef name)
gpu::Batch * blender::draw::DRW_gsplat_batch_cache_get_dots (Object *ob)
gpu::Batch * blender::draw::DRW_gsplat_batch_cache_get_edit_dots (Object *ob)
void blender::draw::DRW_gsplat_batch_cache_create_requested (Object *ob)
Expose via BKE callbacks
void blender::draw::DRW_gsplat_batch_cache_dirty_tag (PointCloud *pointcloud, int mode)
void blender::draw::DRW_gsplat_batch_cache_validate (PointCloud *pointcloud)
void blender::draw::DRW_gsplat_batch_cache_free (PointCloud *pointcloud)
Garbage Collection
void blender::draw::DRW_gsplat_batch_cache_free_old (PointCloud *pointcloud, int ctime)

Variables

constexpr uint32_t blender::draw::radiance_degs_max = 3
constexpr uint32_t blender::draw::radiance_coeffs_max = (radiance_degs_max + 1u) * (radiance_degs_max + 1u)
constexpr float blender::draw::value_scale_default = 1e-2f
constexpr float blender::draw::value_opacity_default = 0.5f

Detailed Description

GSplat API for render engines.

Draw cache creating buffers and batches for the gsplat implementation. This handles quantized packing of gsplat attribute data. For matching unpacking, refer to the draw_gsplat_lib.bsl.hh shader-side.

References:

[quat2017] Mark Reynolds Quaternion quantization https://marc-b-reynolds.github.io/quaternions/2017/05/02/QuatQuantPart1.html

[gspt2026] Joris Rijsdijk et al. Gaussian Point Splatting ACM Transactions on Graphics (SIGGRAPH 2026) https://jorisar.nl/gaussian_point_splatting/

Definition in file draw_cache_impl_gsplat.cc.