diff options
-rw-r--r-- | src/main.rs | 20 | ||||
-rw-r--r-- | yellow.jpg | bin | 0 -> 33331 bytes |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index b0ad6b2..2b2afac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,25 @@ fn main() -> Result<(), Box<dyn Error>> ShaderProgram::new()?, )); - engine.spawn((LightSource { ..Default::default() }, Transform::default())); + let light_source_texture = Texture::open(Path::new("yellow.jpg"))?; + + let light_source_texture_id = light_source_texture.id(); + + engine.spawn(( + LightSource { ..Default::default() }, + Transform { + position: Vec3 { x: -2.0, y: 3.0, z: 3.0 }, + ..Default::default() + }, + create_cube_mesh(cube_vertex_builder_cb), + TextureList::from_iter([light_source_texture]), + MaterialBuilder::new() + .ambient_map(light_source_texture_id) + .diffuse_map(light_source_texture_id) + .specular_map(light_source_texture_id) + .build(), + ShaderProgram::new()?, + )); engine.spawn((Camera { current: true, ..Default::default() },)); diff --git a/yellow.jpg b/yellow.jpg Binary files differnew file mode 100644 index 0000000..66d8333 --- /dev/null +++ b/yellow.jpg |