he3d_core/material.rs
1use crate::Rgb;
2
3/// Per-object shading parameters.
4/// 每个对象的着色参数。
5///
6/// First version only carries a tint; texture tint and additional surface parameters are added without breaking the constructor shape.
7/// 首个版本只携带一个色调;纹理色调和额外的表面参数会在不破坏构造函数形态的前提下添加。
8#[derive(Clone, Copy, PartialEq, Debug)]
9pub struct Material {
10 /// Multiplicative tint applied to the sampled texture or solid color.
11 /// 应用于采样纹理或纯色的倍增色调。
12 pub tint: Rgb,
13}
14
15impl Material {
16 pub const fn new(tint: Rgb) -> Self {
17 Self { tint }
18 }
19}
20
21impl Default for Material {
22 fn default() -> Self {
23 Self { tint: Rgb::WHITE }
24 }
25}