2.4 KiB
2.4 KiB
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<Atmosphere>.
Separately, GiMode::Auto could select Solari while point/spot lights were present.
Solari deferred skips the forward PBR light pass (ADR 0013), so local lights appeared editable
while producing no lighting.
Scene directionals hydrated with hardcoded cascade bounds that did not match project shadow settings
used by ProjectSun.
Decision
game_hot::rendering::viewport_camerais the only module that adds/removes the viewport render stack (ProjectRenderCamera, exposure, GI, atmosphere, bloom, fog, etc.).- Editor
scene_viewandplay/sessionsetRenderTarget,Camera::is_active, andviewport = Noneonly.render_view::sync_project_render_viewcallsclear_viewport_camera_stackon owner handoff andsync_viewport_camera_stackon the active camera (full apply on owner change; incremental when the stack already exists). effective_viewport_gi_pathdoes not switch paths for local lights. When Solari is active, point/spotLightDescauthoring remains in the scene but hydrates no runtime light component, and the inspector marks the component unsupported until authors switch to Directional or Forward.- Scene directionals use
cascade_config_from_renderingfrom project settings at hydration;sync_scene_directional_shadow_cascadesupdates cascades when settings change. - Hydrated lights always insert
Visibility::Visiblewith 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 unsupported Solari-local light authoring without changing the selected GI path.
- Thumbnail studio and multi-viewport remain out of scope; they do not use the viewport camera sync path.
setup_project_camera_effectsno longer skips cameras that already have atmosphere; editor defers player FX viaGameRenderBootstrapand relies onsync_project_render_viewonce HDR RTT exists.