Vendor Bevy Renderer and Eliminate Window Component Duplication #2
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?
Summary
Vendor Bevy's rendering stack (including PBR) and eliminate duplicate window state management between winit and Bevy Window components. Currently Marathon owns the winit event loop but creates separate
bevy::window::Windowcomponents, leading to duplicate state, DPI scaling bugs, and unclear ownership.Scope
In Scope
bevy_render,bevy_pbr,bevy_core_pipeline, and necessary wgpu integrationbevy::window::Windowcomponent creation from platform executorsOut of Scope
Success Criteria
Features & Tasks
This epic breaks down into the following work items:
Phase 1: Vendoring
bevy_renderinto Marathon codebasebevy_pbrfor full PBR material systembevy_core_pipelinefor rendering pipelinePhase 2: Renderer Refactoring
WindowInfowrapper for render target queriesRawHandleWrapperto provide necessary infoPhase 3: Executor Cleanup
bevy::window::Windowcreation from iOS executorbevy::window::Windowcreation from desktop executorWindowAttributesfor all window configurationWindowModeusagePhase 4: egui Integration
Phase 5: Testing & Documentation
Dependencies
Depends on: None
Blocks: Future renderer improvements, cleaner window API
Background
Marathon currently manages windows in two places:
This duplication causes:
The solution is to vendor Bevy's renderer (including full PBR pipeline for low-poly + realistic lighting aesthetic) and refactor it to work directly with our winit handles.
Technical Notes
Why PBR?
Aspen uses spatial audio for immersion, so we need visuals that reinforce that sense of place. Low-poly geometry with PBR materials gives us:
Current Problem (iOS executor example):
Target Architecture:
Priority: Medium (architectural improvement)
Effort: Extra Large (multi-phase refactoring with PBR system)
Type: Epic
✅ Phase 1: Vendoring - COMPLETE
Successfully vendored all three Bevy rendering crates from v0.17.2 into Marathon:
Crates Vendored
Location
All vendored to
crates/libmarathon/src/render/with:Key Changes
crates/macros/(merged with sync-macros)crate::renderinstead ofbevy_renderBuild Status
Files Modified
Cargo.toml(workspace)crates/libmarathon/Cargo.toml(21 bevy subcrate dependencies added)crates/app/Cargo.toml(removed vendored features from bevy dependency)crates/macros/(renamed from sync-macros, merged bevy_render_macros)crates/libmarathon/src/lib.rs(export render module)crates/libmarathon/src/render/mod.rs(created with re-exports)Next Steps
Phase 2 ready to begin: Renderer refactoring to work directly with winit handles.
Closes the Phase 1 checklist from the issue description.