Squashed from work; the fine-grained history is under tag archive/work-2026-08-26: - render+sim: the two hooks the model viewer already relies on - viewport: Realtime gets the engine's cascaded shadow pass, the NOAA sun, metered exposure with sky ambient, a haze knob, a time-of-day slider in the header, and no grid — the building itself still waits for its casters and direct light - render: the engine's receiver shader takes the sun with two-sided normals and the shadow term for the model batches - fab: a 3D creation shell and the viewer built on it - render: two shaders that never compiled — a let is not assignable, a var is - sim: a declared map facing becomes a body's heading through one rule - render: a HUD that already reads as a game's before anyone styles it - asset+sim: the two modules their own commits already declared
77 lines
2.1 KiB
Rust
77 lines
2.1 KiB
Rust
//! 3D forward renderer: GLB/skin, stage, lighting, sky, terrain.
|
|
//!
|
|
//! [`Renderer`] owns the GPU-side caches (geometries, slabs). Draw structs
|
|
//! stay `#[live]` fields on the host widget so script-side theming keeps
|
|
//! working — the widget lends them per frame via [`SceneDraws`]. Camera
|
|
//! state is per-view ([`CameraRig`]).
|
|
//!
|
|
//! Asset UI / VJ use [`PreviewLook`] + [`Renderer::draw_preview`]. Arcade
|
|
//! still draws a full world through [`Renderer::draw_scene_full`].
|
|
|
|
pub mod ao;
|
|
pub mod level;
|
|
pub mod ao_atlas;
|
|
pub mod ao_lightmapper;
|
|
pub mod aobaker_port;
|
|
pub mod bakerboy;
|
|
pub mod bake;
|
|
pub mod firework;
|
|
pub mod geometry;
|
|
pub mod gpu_lightmap;
|
|
pub mod hud;
|
|
pub mod light_grid;
|
|
pub mod lightmap;
|
|
pub mod model;
|
|
pub mod player_nav;
|
|
pub mod renderer;
|
|
pub mod scene;
|
|
pub mod shaders;
|
|
pub mod skin;
|
|
pub mod stage;
|
|
pub mod particles;
|
|
pub mod play;
|
|
pub mod preview;
|
|
pub mod shadow;
|
|
pub mod shadow_mesh;
|
|
pub mod shadow_csm;
|
|
pub mod shadow_sdf;
|
|
pub mod sky;
|
|
pub mod ssao;
|
|
pub mod sun;
|
|
pub mod thermometer;
|
|
|
|
pub use bake::*;
|
|
pub use gpu_lightmap::{
|
|
dynamic_shadow_tiers, CsmConfig, DynamicShadowTiers, GpuLightmapMode, GpuLmMover,
|
|
GpuLmSkin, DEFAULT_CSM_CONFIG,
|
|
};
|
|
pub use geometry::*;
|
|
pub use hud::*;
|
|
pub use model::*;
|
|
pub use renderer::*;
|
|
pub use scene::*;
|
|
pub use shaders::*;
|
|
pub use stage::*;
|
|
pub use particles::*;
|
|
pub use play::*;
|
|
pub use preview::*;
|
|
pub use shadow::*;
|
|
pub use shadow_mesh::*;
|
|
pub use ssao::*;
|
|
pub use sun::*;
|
|
// `sun::solar_dir` (axis-mapped game-space wrapper) and
|
|
// `makepad_draw::solar_dir` (the underlying shared solar model, pulled in
|
|
// by the glob import below) share a name; this crate's own wrapper is the
|
|
// intended public `makepad_render::solar_dir` — an explicit re-export wins
|
|
// over both globs and resolves the ambiguity.
|
|
pub use sun::solar_dir;
|
|
|
|
use makepad_draw::*;
|
|
|
|
/// Register the scene draw shaders into the script VM. Call after
|
|
/// `makepad_widgets::script_mod` (the shader block uses the widgets prelude)
|
|
/// and before any widget that declares these draw types.
|
|
pub fn script_mod(vm: &mut ScriptVm) -> ScriptValue {
|
|
ssao::script_mod(vm);
|
|
shaders::script_mod(vm)
|
|
}
|