library: render: scene: fix spatial lighting

The spatial lighting did not take into account the object's color when
calculating the amount of diffuse and specular light that was emitted.
This commit is contained in:
Bruno BELANYI 2020-03-19 18:21:32 +01:00
parent 4278f5462b
commit e00950c7e5

View file

@ -162,9 +162,9 @@ impl Scene {
normal: Vector,
reflected: Vector,
) -> LinearColor {
let ambient = self.illuminate_ambient(object_color);
let ambient = self.illuminate_ambient(object_color.clone());
let spatial = self.illuminate_spatial(point, properties, normal, reflected);
ambient + spatial
ambient + object_color * spatial
}
fn illuminate_ambient(&self, color: LinearColor) -> LinearColor {