2.2 KiB
2.2 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 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
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_pathforcesGiPath::Forwardwhen anyPointLightorSpotLightwithshadows_enabledexists in the world (auto-forward for local shadows).- 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 “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_effectsno longer skips cameras that already have atmosphere; editor defers player FX viaGameRenderBootstrapand relies onsync_project_render_viewonce HDR RTT exists.