diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-19 21:41:41 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-19 21:41:41 +0200 |
commit | f06880383420da3f8d14079817ff271e71791abb (patch) | |
tree | ab2c49e05888b7a726f0d1539c62a015441fb1ea | |
parent | 5ce6133e120bd5e3d7490db1872bc8b667a0fb4f (diff) |
fix: use updated engine light API
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index 8346cbf..2a4f9e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use engine::file_format::wavefront::mtl::parse as parse_mtl; use engine::file_format::wavefront::obj::parse as parse_obj; use engine::input::Extension as InputExtension; use engine::lighting::{GlobalLight, LightSource}; -use engine::material::Builder as MaterialBuilder; +use engine::material::{Builder as MaterialBuilder, Flags as MaterialFlags}; use engine::renderer::Extension as RendererExtension; use engine::shader::Program as ShaderProgram; use engine::transform::Transform; @@ -82,15 +82,12 @@ fn main() -> Result<(), Box<dyn Error>> .to_mesh()?, MaterialBuilder::new().ambient(YELLOW * 5.0).build(), ShaderProgram::new()?, + MaterialFlags::builder().use_ambient_color(true).build(), )); engine.spawn((Camera { current: true, ..Default::default() },)); - engine.add_sole( - GlobalLight::builder() - .ambient_offset(-Color::WHITE_F32) - .build(), - )?; + engine.add_sole(GlobalLight::default())?; engine.register_system(StartEvent, prepare_window); |