feat: basic texture support

- add texture support (ambient, diffuse, specular)
- use opacity in fragment shader
- calculate normal matrix on cpu for matricies with big determinants
This commit is contained in:
2023-11-02 04:15:59 +02:00
committed by Illusion
parent 4b15990703
commit 08659a0a78
9 changed files with 190 additions and 181 deletions
+4
View File
@@ -31,6 +31,7 @@ pub struct State {
pub logger: logger::WritableLog,
pub settings: Settings,
pub fps: f32,
pub show_textures: bool
}
impl Default for State {
@@ -55,6 +56,7 @@ impl Default for State {
logger: logger::WritableLog::default(),
settings: Settings::default(),
fps: 0.0,
show_textures: true
}
}
}
@@ -487,6 +489,8 @@ fn draw_viewport(ui: &imgui::Ui, state: &mut State, texture: u32) {
ui.same_line();
ui.checkbox("FOV zoom", &mut state.fov_zoom);
ui.same_line();
ui.checkbox("Show Textures", &mut state.show_textures);
ui.same_line();
ui.set_next_item_width(150.0);
imgui::Drag::new("Camera Speed")
.range(1.0, 10000.0)