summaryrefslogtreecommitdiff
path: root/engine/src/lighting.rs
blob: e0608efea6b307245648df23805c04f9844c5274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use ecs::Component;

use crate::color::Color;

#[derive(Debug, Clone, Component)]
pub struct LightSource
{
    pub ambient: Color<f32>,
    pub diffuse: Color<f32>,
    pub specular: Color<f32>,
}

impl Default for LightSource
{
    fn default() -> Self
    {
        Self {
            ambient: Color { red: 0.2, green: 0.2, blue: 0.2 },
            diffuse: Color { red: 0.5, green: 0.5, blue: 0.5 },
            specular: Color { red: 1.0, green: 1.0, blue: 1.0 },
        }
    }
}