# ADR 0015: Viewport camera stack ownership ## Status Accepted ## Context ADR 0014 unified the editor viewport render target and camera binding, but post-processing and GI components were still stripped in multiple places (`scene_view`, play session, and full strip/reapply in `render_view`). That caused WYSIWYG gaps between edit and play, lost FX after resize, and interacted badly with `setup_project_camera_effects` filtering on `Without`. Separately, `GiMode::Auto` could select Solari while shadow-casting point/spot lights were present. Solari deferred skips the forward PBR light pass (ADR 0013), so local light shadows disappeared. Scene directionals hydrated with hardcoded cascade bounds that did not match project shadow settings used by `ProjectSun`. ## Decision 1. **`game_hot::rendering::viewport_camera`** is the only module that adds/removes the viewport render stack (`ProjectRenderCamera`, exposure, GI, atmosphere, bloom, fog, etc.). 2. **Editor** `scene_view` and `play/session` set `RenderTarget`, `Camera::is_active`, and `viewport = None` only. **`render_view::sync_project_render_view`** calls `clear_viewport_camera_stack` on owner handoff and `sync_viewport_camera_stack` on the active camera (full apply on owner change; incremental when the stack already exists). 3. **`effective_viewport_gi_path`** forces `GiPath::Forward` when any `PointLight` or `SpotLight` with `shadows_enabled` exists in the world (auto-forward for local shadows). 4. **Scene directionals** use `cascade_config_from_rendering` from project settings at hydration; `sync_scene_directional_shadow_cascades` updates cascades when settings change. 5. **Hydrated lights** always insert `Visibility::Visible` with runtime light components. ## Consequences - Edit/play possession (F5/F8) and settings Apply no longer flash unlit frames from scattered FX strips. - Rendering diagnostics can report “Solari requested, Forward (local shadow lights)”. - Thumbnail studio and multi-viewport remain out of scope; they do not use the viewport camera sync path. - `setup_project_camera_effects` no longer skips cameras that already have atmosphere; editor defers player FX via `GameRenderBootstrap` and relies on `sync_project_render_view` once HDR RTT exists.