library: scene: mesh: parse emitted light from MTL
This commit is contained in:
parent
a10fd07f43
commit
0c289ca482
|
@ -28,7 +28,6 @@ rand = "0.7"
|
|||
rayon = "1.3.0"
|
||||
serde_yaml = "0.8"
|
||||
structopt = "0.3"
|
||||
tobj = "1.0"
|
||||
|
||||
[dependencies.nalgebra]
|
||||
version = "0.20.0"
|
||||
|
@ -37,3 +36,7 @@ features = ["serde-serialize"]
|
|||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
features = ["derive"]
|
||||
|
||||
[dependencies.tobj]
|
||||
git = "https://github.com/alarsyo/tobj" # forked for Ke support
|
||||
rev = "82b5c2ca"
|
||||
|
|
|
@ -97,6 +97,7 @@ impl TryFrom<Wavefront> for Mesh {
|
|||
|
||||
let diffuse = 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(
|
||||
diffuse.clone(),
|
||||
|
@ -104,8 +105,7 @@ impl TryFrom<Wavefront> for Mesh {
|
|||
// FIXME: material.dissolve is supposed to be "the alpha term"
|
||||
// Needs translation to our ReflTransEnum
|
||||
None,
|
||||
// FIXME: parse 'Ke' component for emitted light
|
||||
LinearColor::black(),
|
||||
emitted,
|
||||
));
|
||||
|
||||
// we only handle uniform textures
|
||||
|
|
Loading…
Reference in a new issue