cleanup
This commit is contained in:
@@ -4,13 +4,14 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
[dependencies]
|
||||
cfg-if = "1"
|
||||
env_logger = "0.10"
|
||||
log = "0.4"
|
||||
pollster = "0.3"
|
||||
anyhow = "1.0"
|
||||
nalgebra = "0.32.3"
|
||||
nalgebra = {version = "0.32.3"}
|
||||
roots = "0.0.8"
|
||||
|
||||
imgui = "0.11"
|
||||
|
||||
34
src/gui.rs
34
src/gui.rs
@@ -24,12 +24,12 @@ const RAYS_MIN: i32 = 100;
|
||||
const RAYS_MAX: i32 = 10000;
|
||||
|
||||
//MATERIAL CONSTANTS
|
||||
// const MIN_D: f32 = 0.0;
|
||||
// const MIN_S: f32 = 0.0;
|
||||
// const MIN_SHINE: f32 = 0.0;
|
||||
// const MAX_D: f32 = 1.0;
|
||||
// const MAX_S: f32 = 1.0;
|
||||
// const MAX_SHINE: f32 = 50.0;
|
||||
const MIN_D: f32 = 0.0;
|
||||
const MIN_S: f32 = 0.0;
|
||||
const MIN_SHINE: f32 = 0.0;
|
||||
const MAX_D: f32 = 1.0;
|
||||
const MAX_S: f32 = 1.0;
|
||||
const MAX_SHINE: f32 = 50.0;
|
||||
|
||||
//TRANSFORMATION CONSTANTS
|
||||
const MIN_COLOUR: f32 = 0.0;
|
||||
@@ -287,17 +287,17 @@ impl Gui {
|
||||
}
|
||||
}
|
||||
// Edit materials
|
||||
// if let Some(_t) = ui.tree_node("Materials") {
|
||||
// for (label, material) in &mut self.scene.materials {
|
||||
// if let Some(_t) = ui.tree_node(label) {
|
||||
// ui.slider_config("ks", MIN_D, MIN_D)
|
||||
// .build_array(material.ks.as_mut_slice());
|
||||
// ui.slider_config("kd", MIN_S, MAX_S)
|
||||
// .build_array(material.kd.as_mut_slice());
|
||||
// ui.slider("fov", MIN_SHINE, MAX_SHINE, &mut material.shininess);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if let Some(_t) = ui.tree_node("Materials") {
|
||||
for (label, material) in &mut self.scene.materials {
|
||||
if let Some(_t) = ui.tree_node(label) {
|
||||
ui.slider_config("ks", MIN_D, MAX_D)
|
||||
.build_array(material.ks.as_mut_slice());
|
||||
ui.slider_config("kd", MIN_S, MAX_S)
|
||||
.build_array(material.kd.as_mut_slice());
|
||||
ui.slider("shine", MIN_SHINE, MAX_SHINE, &mut material.shininess);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Edit color, position and falloff of lights
|
||||
if let Some(_t) = ui.tree_node("Lights") {
|
||||
for (label, light) in &mut self.scene.lights {
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
use crate::state::run;
|
||||
use error_iter::ErrorIter;
|
||||
|
||||
const EPSILON: f64 = 1e-6;
|
||||
const EPSILON: f64 = 1e-8;
|
||||
const INFINITY: f64 = 1e-10;
|
||||
|
||||
use log::error;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
|
||||
mod bvh;
|
||||
mod camera;
|
||||
mod gui;
|
||||
mod light;
|
||||
mod material;
|
||||
mod node;
|
||||
mod primitive;
|
||||
mod ray;
|
||||
mod raytracer;
|
||||
mod scene;
|
||||
mod state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user