clay/material/
luminous.rs

1use std::collections::HashSet;
2use crate::{prelude::*, material::*};
3
4
5/// Luminous material.
6///
7/// Returns the white color (to specify color use `Colored<_>` adapter)
8/// and doesn't produce secondary ray.
9#[derive(Clone, Debug, Default)]
10pub struct Luminous {}
11
12impl Material for Luminous {
13    fn brightness(&self) -> f64 {
14        1.0
15    }
16}
17
18impl Instance<MaterialClass> for Luminous {
19    fn source(_: &mut HashSet<u64>) -> String {
20        "#include <clay/material/luminous.h>".to_string()
21    }
22    fn inst_name() -> String {
23        "luminous".to_string()
24    }
25}
26
27impl Pack for Luminous {
28    fn size_int() -> usize { 0 }
29    fn size_float() -> usize { 0 }
30    fn pack_to(&self, _buffer_int: &mut [i32], _buffer_float: &mut [f32]) {}
31}