//! The client's custom render materials, and [`MaterialsPlugin`], which registers //! all of them. //! //! One module per client module the types came from; the client re-exports each //! type from its old path (`cartopolis::systems::water::WaterMaterial`, …). Why //! they live in a crate of their own is this crate's `Cargo.toml`. use bevy::pbr::MaterialPlugin; use bevy::prelude::*; pub mod building_fade; pub mod building_windows; pub mod crowd; pub mod data_layers; pub mod design_floor; pub mod globe_ocean; pub mod grass; pub mod ground_detail; pub mod label_sign; pub mod lens; pub mod particles; pub mod road_depth; pub mod satellites; pub mod sky; pub mod sky_dome; pub mod splash; pub mod sun_rays; pub mod water; /// Every custom material's plugin, in the order `cartopolis::run` added them /// before they moved here. pub struct MaterialsPlugin; impl Plugin for MaterialsPlugin { fn build(&self, app: &mut App) { app.add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) // The sky for adapters that cannot run the atmosphere above (its module // header has the whole story). The plugin is added unconditionally — the // shell is only spawned on the runs that need it. .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) // Sunbeams: a full-screen pass on the camera, switched by `render_features`. .add_plugins( bevy::core_pipeline::fullscreen_material::FullscreenMaterialPlugin::< sun_rays::SunRays, >::default(), ) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) // The basemap and the ground surfaces, carrying the half-metre residual slope // the geometry is too coarse to hold (`systems::ground_detail`). .add_plugins(MaterialPlugin::::default()) // The LoD2.2 buildings' walls, with the window pattern on them // (`systems::building_windows`). .add_plugins(MaterialPlugin::::default()) // The far building tier's own material: the same `StandardMaterial`, plus a // vertex stage that takes the outermost ring down into the map rather than // ending the city at a cell edge (`systems::building_fade`). .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) // The street walkers: their walk is baked poses the vertex stage plays // (`systems::crowd`). .add_plugins(MaterialPlugin::::default()) // Roads and their casings. The ladder that decides which of two // overlapping ribbons is on top rides in a vertex attribute, so the road // groups need a pipeline that declares it (`systems::road_depth`). .add_plugins(MaterialPlugin::::default()) // The street names on the road: one material and one atlas for the // whole sign pool (`systems::street_labels`, `systems::label_atlas`). .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()) // The design room's floor and grid (`systems::design_room`). .add_plugins(MaterialPlugin::::default()) .add_plugins(MaterialPlugin::::default()); } }