11#include <Eigen/Geometry>
14#include <unordered_map>
15#include <unordered_set>
28namespace visualization {
31class FilamentResourceManager;
42 Eigen::Vector2i
tile_size = Eigen::Vector2i(16, 16);
77 Camera::ProjectionMatrix::Identity();
79 Camera::Transform::Identity();
176 std::vector<std::uint16_t>& out,
191 std::vector<float>& out,
212 const std::unordered_set<const FilamentView*>& live_views);
244 std::vector<std::uint16_t>& out,
251 std::vector<float>& out,
272 OutputTargets& PrepareOutputTargets(
FilamentView& view);
273 void ResetOutputTargets(OutputTargets& targets);
274 ViewRenderData ExtractViewRenderData(
const FilamentView& view)
const;
275 bool UpdateViewRenderData(OutputTargets& targets,
const FilamentView& view);
276 bool ValidateRenderConfig(
const RenderConfig& config)
const;
278 filament::Engine& engine_;
280 std::unordered_map<ViewKey, OutputTargets> outputs_;
281 RenderConfig render_config_;
282 std::unique_ptr<Backend> backend_;
283 bool enabled_ =
false;
284 std::uint64_t frame_index_ = 0;
Eigen::Transform< float, 3, Eigen::Projective > ProjectionMatrix
Definition Camera.h:26
Eigen::Transform< float, 3, Eigen::Affine > Transform
Definition Camera.h:25
Definition FilamentResourceManager.h:50
Definition FilamentScene.h:70
Definition FilamentView.h:33
GPU backend for geometry + composite compute (OpenGL or Metal).
Definition GaussianSplatRenderer.h:138
virtual bool PrepareOutputTextures(FilamentView &view, FilamentResourceManager &resource_mgr, std::uint32_t width, std::uint32_t height, OutputTargets &targets)=0
virtual void ReleaseOutputTextures(FilamentResourceManager &resource_mgr, OutputTargets &targets)=0
virtual bool ReadCompositeDepthToFloatCpu(const FilamentView &view, std::vector< float > &out, std::uint32_t width, std::uint32_t height)
Definition GaussianSplatRenderer.h:190
virtual void ForgetView(const FilamentView &view)=0
virtual void BeginFrame(std::uint64_t frame_index)=0
virtual bool ReadMergedDepthToUint16Cpu(const FilamentView &view, std::vector< std::uint16_t > &out, std::uint32_t width, std::uint32_t height)
Definition GaussianSplatRenderer.h:175
virtual const char * GetName() const =0
virtual bool RenderCompositeStage(const FilamentView &view, const ViewRenderData &render_data, OutputTargets &targets)=0
virtual bool RenderGeometryStage(const FilamentView &view, const FilamentScene &scene, const ViewRenderData &render_data, OutputTargets &targets)=0
virtual ~Backend()=default
Definition GaussianSplatRenderer.h:38
bool RenderCompositeStage(FilamentView &view)
Returns true if the composite pass ran and the backend reported success.
Definition GaussianSplatRenderer.cpp:283
void RequestRedrawForView(const FilamentView &view)
Definition GaussianSplatRenderer.cpp:309
void SetRenderConfig(const RenderConfig &config)
Definition GaussianSplatRenderer.cpp:379
const ViewRenderData * GetViewRenderData(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:366
void BeginFrame()
Definition GaussianSplatRenderer.cpp:235
void RequestDepthReadbackForView(const FilamentView &view, bool wanted=true)
Definition GaussianSplatRenderer.cpp:436
bool ReadCompositeDepthToFloatCpu(const FilamentView &view, std::vector< float > &out, std::uint32_t width, std::uint32_t height)
Definition GaussianSplatRenderer.cpp:425
TextureHandle GetDepthTexture(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:401
bool ReadMergedDepthToUint16Cpu(const FilamentView &view, std::vector< std::uint16_t > &out, std::uint32_t width, std::uint32_t height)
Definition GaussianSplatRenderer.cpp:414
std::uint32_t GetSceneDepthGLHandle(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:444
void RenderGeometryStage(FilamentView &view, const FilamentScene &scene)
Definition GaussianSplatRenderer.cpp:244
~GaussianSplatRenderer()
Definition GaussianSplatRenderer.cpp:228
const char * GetBackendName() const
Definition GaussianSplatRenderer.cpp:450
void PruneOutputs(const std::unordered_set< const FilamentView * > &live_views)
Definition GaussianSplatRenderer.cpp:331
bool IsSupported() const
Definition GaussianSplatRenderer.cpp:354
bool HasOutput(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:358
RenderTargetHandle GetColorReadbackRT(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:407
void SetEnabled(bool enabled)
Definition GaussianSplatRenderer.cpp:350
void InvalidateOutputForView(FilamentView &view)
Definition GaussianSplatRenderer.cpp:317
TextureHandle GetColorTexture(const FilamentView &view) const
Definition GaussianSplatRenderer.cpp:395
bool IsEnabled() const
Definition GaussianSplatRenderer.cpp:348
const RenderConfig & GetRenderConfig() const
Definition GaussianSplatRenderer.cpp:375
Definition FilamentEngine.h:15
Definition PinholeCameraIntrinsic.cpp:16
Definition GaussianSplatRenderer.h:89
bool has_render_data
Definition GaussianSplatRenderer.h:126
std::uintptr_t color_vk_image
Definition GaussianSplatRenderer.h:111
std::uint32_t depth_gl_mem_obj
glCreateMemoryObjectsEXT name
Definition GaussianSplatRenderer.h:116
std::uintptr_t scene_depth_mtl_texture
Definition GaussianSplatRenderer.h:120
bool wants_depth_readback
Definition GaussianSplatRenderer.h:132
std::uint32_t color_gl_mem_obj
glCreateMemoryObjectsEXT name
Definition GaussianSplatRenderer.h:113
std::uint32_t width
Definition GaussianSplatRenderer.h:93
RenderTargetHandle gs_readback_rt
Definition GaussianSplatRenderer.h:125
std::uint32_t height
Definition GaussianSplatRenderer.h:94
TextureHandle depth
Definition GaussianSplatRenderer.h:91
std::uint64_t last_scene_change_id
Definition GaussianSplatRenderer.h:133
std::uintptr_t color_vk_memory
Definition GaussianSplatRenderer.h:112
bool has_valid_output
Definition GaussianSplatRenderer.h:127
std::uintptr_t gs_color_mtl_texture
Definition GaussianSplatRenderer.h:121
std::uint64_t last_updated_frame
Definition GaussianSplatRenderer.h:134
std::uintptr_t depth_vk_memory
Definition GaussianSplatRenderer.h:115
ViewRenderData render_data
Definition GaussianSplatRenderer.h:122
RenderTargetHandle render_target
Definition GaussianSplatRenderer.h:92
bool needs_render
Definition GaussianSplatRenderer.h:128
TextureHandle color
Definition GaussianSplatRenderer.h:90
std::uint32_t scene_depth_gl_handle
Definition GaussianSplatRenderer.h:97
std::uint32_t color_gl_handle
Definition GaussianSplatRenderer.h:100
bool uses_vulkan_interop
Definition GaussianSplatRenderer.h:106
std::uintptr_t depth_vk_image
Definition GaussianSplatRenderer.h:114
Tunable knobs for the compute pipeline, set once at construction.
Definition GaussianSplatRenderer.h:41
std::uint32_t avg_tiles_per_splat
Definition GaussianSplatRenderer.h:54
std::uint32_t max_tiles_per_splat
Definition GaussianSplatRenderer.h:50
Eigen::Vector2i composite_group_size
Definition GaussianSplatRenderer.h:44
int projection_group_size
Definition GaussianSplatRenderer.h:43
int max_sh_degree
Definition GaussianSplatRenderer.h:45
bool antialias
Definition GaussianSplatRenderer.h:65
std::uint32_t max_tile_entries_total
Definition GaussianSplatRenderer.h:58
Eigen::Vector2i tile_size
Definition GaussianSplatRenderer.h:42
Camera and viewport state extracted per-view each geometry pass.
Definition GaussianSplatRenderer.h:69
bool screen_y_down
Definition GaussianSplatRenderer.h:73
Camera::Transform model_matrix
Definition GaussianSplatRenderer.h:74
Eigen::Vector2i viewport_origin
Definition GaussianSplatRenderer.h:70
Camera::Transform culling_projection_matrix
Definition GaussianSplatRenderer.h:78
Camera::Transform view_matrix
Definition GaussianSplatRenderer.h:75
double far_plane
Definition GaussianSplatRenderer.h:82
Camera::ProjectionMatrix projection_matrix
Definition GaussianSplatRenderer.h:76
double near_plane
Definition GaussianSplatRenderer.h:81
Camera::ProjectionInfo projection
Definition GaussianSplatRenderer.h:80
Eigen::Vector2i viewport_size
Definition GaussianSplatRenderer.h:71
Eigen::Vector3f camera_position
Definition GaussianSplatRenderer.h:72