Honor SceneView::viewport (split-screen / picture-in-picture) #76
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SceneView::viewport(engine/include/sophia/scene_view.hpp) is declared but never read. Every scene view pass renders to its whole target:RenderGraph::recordRenderingsets the viewport and scissor to the full attachment, andSceneRenderer::rendercomputes the camera's aspect ratio from the full target extent. So several views can't share one target side by side.Proposed approach
viewport(normalizedx, y, width, height) to a pixelvk::Rect2Dfor the target, clamped to it. Skip views whose rect is empty.SceneRenderer::render, set the viewport and scissor to that rect, and compute aspect from the rect instead of the full extent.loadOpclear always covers the whole attachment, so a second split-screen view would wipe the first. When a view doesn't cover its whole target:vkCmdClearAttachments, according toclearFlags;loadOpclears.application.cpp. It should only fire when the clear actually overlaps an earlier view's area.Notes
editor/panels/viewport_panel.cpp) assumes the view fills the target. It would need the rect too if the editor ever uses a partial viewport.