library: scene: mesh: parse emitted light from MTL

This commit is contained in:
Antoine Martin 2020-04-07 17:31:19 +02:00
parent a10fd07f43
commit 0c289ca482
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,6 @@ rand = "0.7"
rayon = "1.3.0" rayon = "1.3.0"
serde_yaml = "0.8" serde_yaml = "0.8"
structopt = "0.3" structopt = "0.3"
tobj = "1.0"
[dependencies.nalgebra] [dependencies.nalgebra]
version = "0.20.0" version = "0.20.0"
@ -37,3 +36,7 @@ features = ["serde-serialize"]
[dependencies.serde] [dependencies.serde]
version = "1.0" version = "1.0"
features = ["derive"] features = ["derive"]
[dependencies.tobj]
git = "https://github.com/alarsyo/tobj" # forked for Ke support
rev = "82b5c2ca"

View file

@ -97,6 +97,7 @@ impl TryFrom<Wavefront> for Mesh {
let diffuse = LinearColor::from_slice(&mesh_mat.ambient[..]); let diffuse = LinearColor::from_slice(&mesh_mat.ambient[..]);
let specular = LinearColor::from_slice(&mesh_mat.ambient[..]); let specular = LinearColor::from_slice(&mesh_mat.ambient[..]);
let emitted = LinearColor::from_slice(&mesh_mat.emission[..]);
let material = UniformMaterial::new(LightProperties::new( let material = UniformMaterial::new(LightProperties::new(
diffuse.clone(), diffuse.clone(),
@ -104,8 +105,7 @@ impl TryFrom<Wavefront> for Mesh {
// FIXME: material.dissolve is supposed to be "the alpha term" // FIXME: material.dissolve is supposed to be "the alpha term"
// Needs translation to our ReflTransEnum // Needs translation to our ReflTransEnum
None, None,
// FIXME: parse 'Ke' component for emitted light emitted,
LinearColor::black(),
)); ));
// we only handle uniform textures // we only handle uniform textures