Implement HDRI skybox support

This commit is contained in:
reo 2025-09-26 22:44:43 +03:00
parent 44489f9fe3
commit 1e9b997aeb
12 changed files with 282 additions and 17 deletions

View file

@ -55,14 +55,8 @@ impl RenderingSystem for BasicMeshRenderingSystem {
}
};
// Direction from the light source (0,+Y) towards the scene.
let light_dir: Vec3 = Vec3::new(0.0, -1.0, 0.0).normalize();
// let asset_manager = ctx.asset_manager.borrow();
// let any_ref: &dyn Any = &**asset_manager;
// if let Some(glium_manager) = any_ref.downcast_ref::<GliumAssetManager>() {
// &glium_manager.models;
// }
// Use HDR-derived environment light direction if provided, otherwise default to downward
let light_dir: Vec3 = if ctx.env_light_dir.length_squared() > 0.0 { ctx.env_light_dir.normalize() } else { Vec3::new(0.0, -1.0, 0.0) };
let asset_manager = ctx.asset_manager.borrow();