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:
parent
4278f5462b
commit
e00950c7e5
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue