add split_screen example, with 1, 2, or 4 cameras #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a split_screen example, based on dynamic example.
It defaults to
QuadSplitwith 4 cameras, which works fine and you can toggle between camera layouts with F1.However, if you change the default to
Singleit crashes when changing toVerticalSplit:this is a reproduction in example form of #14
2025-04-25T10:24:43.624996Z INFO split_screen: Toggling camera layout 2025-04-25T10:24:43.625023Z INFO split_screen: Despawning 1 cameras 2025-04-25T10:24:43.625026Z INFO split_screen: Spawning cameras for VerticalSplit 2025-04-25T10:24:43.625028Z INFO split_screen: Spawning 2 cameras 2025-04-25T10:24:43.625114Z INFO split_screen: Setting camera viewports 2025-04-25T10:24:43.625129Z INFO split_screen: Setting viewport for camera 1: Viewport { physical_position: UVec2(0, 0), physical_size: UVec2(1280, 1440), depth: 0.0..1.0 } 2025-04-25T10:24:43.625135Z INFO split_screen: Setting viewport for camera 2: Viewport { physical_position: UVec2(1280, 0), physical_size: UVec2(1280, 1440), depth: 0.0..1.0 } 2025-04-25T10:24:43.630858Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default thread '' panicked at /Users/rj/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-24.0.3/src/backend/wgpu_core.rs:3273:26: wgpu error: Validation Error Caused by: In RenderPass::end In a set_bind_group command Dynamic binding offset index 0 with offset 2304 would overrun the buffer bound to BindGroup with 'particle_view_bind_group' label 0 -> binding 0. Buffer size is 1536 bytes, the binding binds bytes 0..752, meaning the maximum the binding can be offset is 784 bytes note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 2025-04-25T10:24:43.631200Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default thread 'Compute Task Pool (0)' panicked at /Users/rj/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-24.0.3/src/backend/wgpu_core.rs:3273:26: wgpu error: Validation Error Caused by: In RenderPass::end In a set_bind_group command Dynamic binding offset index 0 with offset 1536 would overrun the buffer bound to BindGroup with 'particle_view_bind_group' label 0 -> binding 0. Buffer size is 1536 bytes, the binding binds bytes 0..752, meaning the maximum the binding can be offset is 784 bytes Encountered a panic in system `bevy_render::renderer::render_system`!