Implement PBR

This commit is contained in:
reo 2025-09-26 16:49:36 +03:00
parent f34a9b01a0
commit 3503fc15d2
14 changed files with 659 additions and 10 deletions

View file

@ -5,14 +5,14 @@ use raidillon_engine::system::SystemContext;
use raidillon_platform::{Platform, Camera};
use raidillon_assets::model_path;
use raidillon_core::engine::EngineTrait;
use raidillon_ecs::components::ModelHandle;
use raidillon_ecs::components::{ModelHandle, PointLight};
use raidillon_ecs::Transform;
use raidillon_core::scene::Scene;
#[cfg(feature = "glium")]
use raidillon_glium::GliumPlatform;
use winit::event::{Event, WindowEvent};
const TEST_GLTF: &str = "pink-monkey.gltf";
const TEST_GLTF: &str = "blue-sphere.gltf";
const MAIN_SCENE_ID: &str = "main_scene";
@ -58,12 +58,25 @@ impl System for RenderingTestSystem {
ctx.scene.world.spawn((
Transform {
translation: Vec3::new(0.0, 0.0, 0.0),
rotation: Quat::IDENTITY,
scale: Vec3::new(1.0, 1.0, 1.0),
translation: Vec3::new(0.0, 0.0, 0.0),
rotation: Quat::IDENTITY,
scale: Vec3::new(1.0, 1.0, 1.0),
},
ModelHandle(TEST_GLTF),
));
ctx.scene.world.spawn((
Transform {
translation: Vec3::new(0.0, 3.0, 0.0),
rotation: Quat::IDENTITY,
scale: Vec3::ONE,
},
PointLight {
color: Vec3::ONE,
intensity: 1.0,
range: 10.0,
},
));
}
fn frame_update(&mut self, ctx: &mut SystemContext) {
@ -79,7 +92,6 @@ impl System for RenderingTestSystem {
t.rotation *= Quat::from_rotation_y(*self.rotation_speed.borrow() * ctx.platform_context.time_ctx.fixed_dt);
});
}
}
fn main() {