Advance M0 scene and rendering foundations
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-06-06 03:50:03 -04:00
1 parent 2fa64106c8
commit 2054fa2558
21 files changed
+711 -159

No files matched your search

+2
View File
@@ -12,9 +12,11 @@ Levels under `assets/levels/` need forward-compatible migrations as authoring co
- Track `schema_version` in scene files (wrapper or sidecar during transition).
- Provide `scene_schema` module with `migrate_scene_text` and `validate_level_file`.
- Route editor save/load through `scene::document::SceneDocument`, an internal Bevy-free seam that preserves DynamicScene RON while exposing stable actor/component document identities and patch operations for tools.
- CI / `xtask validate-levels` loads all committed levels and fails on unknown versions.
## Consequences
- Breaking component changes require a migration step and version bump.
- Editor save may wrap scenes with schema header in a follow-up change.
- The current storage format remains DynamicScene RON; `SceneDocument` is not a BSN/JSN migration.
@@ -16,12 +16,12 @@ All rendering configuration previously lived in `RenderingSettings` (`assets/pro
|------|----------|
| `GiMode::Auto` | Startup default: Solari deferred when RT GPU support is available; Forward PBR otherwise |
| `GiMode::Forward` | Bevy Forward PBR with HDR/TAA/SSAO/atmosphere/shadows |
| `GiMode::Solari` | Request Solari deferred; camera attaches Bevy Solari when RT support is available and no local shadow-light fallback is required |
| `GiMode::Solari` | Request Solari deferred; camera attaches Bevy Solari when RT support is available |
Runtime exposes `RenderingCapabilities { rt_supported, active_gi_path }` and a resolved `ActiveCameraRenderProfile` each frame.
ADR 0016 supersedes the ambiguous `active_gi_path` wording with explicit requested/effective GI fields and `EffectiveRenderStack` fallback reasons.
Bevy 0.18 Solari samples directional lights and emissive meshes, while point and spot lights require the normal PBR light pass that Solari cameras skip. The editor surfaces this limitation in Rendering diagnostics; point/spot light authoring uses Forward PBR. Requested Solari tags project geometry for raytracing and switches camera plus opaque-renderer components to Solari as soon as RT support is available; render-world readiness counters report whether BLAS/TLAS/bind-group setup and compatible lights are actually ready.
Bevy 0.18 Solari samples directional lights and emissive meshes, while point and spot lights require the normal PBR light pass that Solari cameras skip. The editor surfaces this limitation directly on point/spot `LightDesc` components and runtime-disables them while Solari is active; point/spot light authoring uses Forward PBR. Requested Solari tags project geometry for raytracing and switches camera plus opaque-renderer components to Solari as soon as RT support is available; render-world readiness counters report whether BLAS/TLAS/bind-group setup and compatible lights are actually ready.
### WYSIWYG
@@ -11,8 +11,9 @@ components were still stripped in multiple places (`scene_view`, play session, a
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.
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`.
@@ -25,8 +26,9 @@ used by `ProjectSun`.
`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).
3. **`effective_viewport_gi_path`** does not switch paths for local lights. When Solari is active,
point/spot `LightDesc` authoring remains in the scene but hydrates no runtime light component,
and the inspector marks the component unsupported until authors switch to Directional or Forward.
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.
@@ -34,7 +36,8 @@ used by `ProjectSun`.
## 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)”.
- 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_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.
+15 -8
View File
@@ -14,7 +14,7 @@ Bevy 0.18 Solari is still experimental. It needs raytracing-capable hardware, el
`Mesh3d + MeshMaterial3d<StandardMaterial>` scene geometry, Solari-compatible mesh assets
(TriangleList, POSITION/NORMAL/UV_0/TANGENT, U32 indices), a render-scene bind group, and a
compatible directional or emissive light source. It also does not replace Forward PBR local
point/spot shadow lighting.
point/spot lighting.
## Decision
@@ -24,14 +24,19 @@ point/spot shadow lighting.
- `game_hot` owns runtime application of the stack. Camera systems call the shared resolver and
mirror the result into `RenderingCapabilities` for renderer method selection and diagnostics.
- Requested Solari and effective Solari are distinct. Requested Solari keeps eligible project
geometry tagged for raytracing and attaches Bevy Solari as soon as RT support is available, unless
local-shadow fallback is required.
- Effective Solari forces an HDR camera target regardless of authored HDR settings, because Bevy
Solari requires `STORAGE_BINDING` on the camera main texture and wgpu rejects storage usage on
sRGB target formats.
geometry tagged for raytracing and attaches Bevy Solari as soon as RT support is available.
- Point/spot `LightDesc` components are runtime-disabled while Solari is active. They stay authored
and editable enough to switch kind, but hydration strips/skips their Bevy `PointLight`/`SpotLight`
components and the inspector explains the limitation on the component.
- Effective Solari and atmosphere force an HDR camera target regardless of authored HDR settings.
Bevy Solari requires `STORAGE_BINDING` on the camera main texture, and Bevy sky/atmosphere
pipelines must not be carried onto an SDR swapchain render pass.
- Runtime changes that alter the active render target or effective Solari/Forward path rebuild the
active camera stack instead of incrementally patching it. This
prevents stale pipelines from surviving texture-format transitions.
- Hybrid Auto remains the default policy: use Solari for directional/emissive scenes, surface
readiness diagnostics while it warms up, and fall back to Forward PBR when local point/spot shadow
correctness or unavailable RT features require it.
readiness diagnostics while it warms up, and fall back to Forward PBR only when RT features are
unavailable.
- Material authoring includes emissive color, intensity, and texture fields so scenes can create
Solari-compatible emissive contributors without Rust changes.
@@ -39,6 +44,8 @@ point/spot shadow lighting.
- Diagnostics must report requested GI, effective GI, and fallback reason from
`EffectiveRenderStack` rather than deriving labels independently.
- Project settings can disable user-authored HDR, but the active camera still receives `Hdr` when
atmosphere or effective Solari requires an HDR target.
- Solari mesh eligibility is based on hydrated project geometry under `LevelObject` ancestry with
`RaytracingExcluded` helpers filtered out. Built-in primitive hydration generates tangents for
Solari compatibility; imported/custom meshes remain visible in diagnostics when they lack