ft (wip): texture/material overhaul
This commit is contained in:
1 parent
2800d911c3
commit
968c232388
11 files changed
+89
-33
No files matched your search
+5
-1
@@ -1,3 +1,4 @@
|
||||
use crate::objects::materials::colour_source::ColourSource;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rand::RngExt;
|
||||
@@ -78,7 +79,7 @@ impl Scene {
|
||||
world.push(Arc::new(Sphere::new(
|
||||
center,
|
||||
0.2,
|
||||
Arc::new(Lambertian::new(Vec3::random() * Vec3::random(), 1.)),
|
||||
Arc::new(Lambertian::new(ColourSource::Colour(Vec3::random() * Vec3::random()), 1.)),
|
||||
)));
|
||||
} else if mat < 0.95 {
|
||||
// metal
|
||||
@@ -186,6 +187,9 @@ struct SceneDef {
|
||||
pub max_depth: u32,
|
||||
}
|
||||
|
||||
// TODO (low priority): rn textures are tightly coupled to materials; what if we wnat different
|
||||
// materials to share a texture? apply the same technique we used for decoupling materials/objects
|
||||
// on textures/materials.
|
||||
impl<'de> Deserialize<'de> for Scene {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
|
||||