vmt_parser/material/
unlitgeneric.rs

1use super::deserialize_path;
2use crate::{default_scale, default_scale3, Vec3};
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct UnlitGenericMaterial {
7    /// Defines an albedo texture.
8    #[serde(
9        rename = "$basetexture",
10        default,
11        deserialize_with = "deserialize_path"
12    )]
13    pub base_texture: Option<String>,
14    /// Links the surface to a set of physical properties.
15    #[serde(rename = "$surfaceprop", default)]
16    pub surface_prop: Option<String>,
17    /// Tells this material is used for models and not brushes.
18    #[serde(rename = "$model", default)]
19    pub model: bool,
20
21    /// Independently scales the red, green and blue channels of an albedo.
22    #[serde(rename = "$color", default = "default_scale3")]
23    pub color: Vec3,
24
25    /// Scales the opacity of an entire material.
26    #[serde(rename = "$alpha", default = "default_scale")]
27    pub alpha: f32,
28    /// Specifies a mask to use to determine binary opacity.
29    #[serde(rename = "$alphatest", default)]
30    pub alpha_test: bool,
31    /// Specifies a mask to use to determine binary opacity.
32    #[serde(rename = "$alphatestreference", default = "default_scale")]
33    pub alpha_test_reference: f32,
34    /// Disables backface culling.
35    #[serde(rename = "$nocull", default)]
36    pub no_cull: bool,
37    /// Specifies that the material should be partially see-through.
38    #[serde(rename = "$translucent", default)]
39    pub translucent: bool,
40
41    /// Specifies a texture that will provide three-dimensional lighting information for a material.
42    #[serde(rename = "$bumpmap", default, deserialize_with = "deserialize_path")]
43    pub bump_map: Option<String>,
44
45    /// Ignore z filtering
46    #[serde(rename = "$ignorez", default)]
47    pub ignore_z: bool,
48
49    /// Prevents fog from overdrawing a material.
50    #[serde(rename = "$nofog", default)]
51    pub no_fog: bool,
52
53    /// Allow the player's flashlight to illuminate the material.
54    #[serde(rename = "$receiveflashlight", default)]
55    pub receive_flash_light: bool,
56    /// Possibly used to allow shadows to form from this decal.
57    #[serde(rename = "singlepassflashlight", default)]
58    pub single_pass_flash_light: bool,
59    #[serde(rename = "$no_fullbright", default)]
60    pub no_full_bright: bool,
61}