-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support instancing and multiple cameras #47
Comments
@MiniMinerX I appreciate the help! the gaussian splat forward rasterization requires per-view (camera) depth sort. in the current implementation, the sort buffers are instantiated once per gaussian cloud entity. this is a problem for the current sort strategies (radix sort is a render-graph level compute node, CPU sort is done in the main world), since there is only one buffer, fix-sized to 1x number of gaussians, see CPU sort where multiple cameras write to the same memory: bevy_gaussian_splatting/src/sort/std.rs Line 61 in 08f6e4a
there are two strategies:
|
let sorted_bind_group = render_device.create_bind_group( |
use a single storage buffer with dynamic index
-
the single sorted_entry_buffer would need to be sized based on the number of cameras in the scene:
bevy_gaussian_splatting/src/render/mod.rs
Line 821 in 08f6e4a
size: BufferSize::new((cloud.count * std::mem::size_of::<(u32, u32)>()) as u64), -
the sorted_bind_group would need to be set with dynamic index, example of setting dynamic index here:
bevy_gaussian_splatting/src/render/mod.rs
Line 987 in 08f6e4a
pass.set_bind_group(3, &bind_groups.sorted_bind_group, &[]);
in either case, writing to SortedEntries
(on CPU) or (on GPU) would need to be aware of the buffer layout/indexing strategy.
the error in #111 would also need to be addressed. I think it refers to a bug in queue_gaussian_view_bind_groups
, for some reason, the view_binding
in Res<ViewUniforms>
is not correlated correctly with the ViewUniformOffset
. It might be good to log which entity has the invalid offset for further debugging.
separate entry_buffer_a binding into unique a bind group to optimize buffer updates
bevy_gaussian_splatting/src/sort/mod.rs
Line 214 in 5c9a20a
The text was updated successfully, but these errors were encountered: