vmt_parser/material/
cable.rs

1use super::deserialize_path;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct CableMaterial {
6    /// Defines an albedo texture.
7    #[serde(rename = "$basetexture", deserialize_with = "deserialize_path")]
8    pub base_texture: String,
9    /// Specifies a texture that will provide three-dimensional lighting information for a material.
10    #[serde(rename = "$bumpmap", default, deserialize_with = "deserialize_path")]
11    pub bump_map: Option<String>,
12
13    /// Use computed vertex colors.
14    #[serde(rename = "$vertexcolor", default)]
15    pub vertex_color: bool,
16
17    /// Minimum amount of light received
18    #[serde(rename = "$minlight", default = "default_min_light")]
19    pub min_light: f32,
20    /// Maximum amount of light received
21    #[serde(rename = "$maxlight", default = "default_max_light")]
22    pub max_light: f32,
23
24    /// Disables backface culling.
25    #[serde(rename = "$nocull", default)]
26    pub no_cull: bool,
27}
28
29fn default_min_light() -> f32 {
30    0.1
31}
32fn default_max_light() -> f32 {
33    0.3
34}