vmt_parser/material/
unlittwotexture.rs

1use super::deserialize_path;
2use crate::{default_scale, default_scale3, TextureTransform, Vec3};
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct UnlitTwoTextureMaterial {
7    /// The first texture in the blend.
8    #[serde(
9        rename = "$basetexture",
10        default,
11        deserialize_with = "deserialize_path"
12    )]
13    pub base_texture: Option<String>,
14    /// The second texture to blend to.
15    #[serde(rename = "$texture2", deserialize_with = "deserialize_path")]
16    pub texture2: String,
17    /// Links the surface to a set of physical properties.
18    #[serde(rename = "$surfaceprop", default)]
19    pub surface_prop: Option<String>,
20
21    /// Transforms the texture before use in the material. This does not affect lightmaps on the surface.
22    #[serde(rename = "$basetexturetransform", default)]
23    pub base_texture_transform: TextureTransform,
24    /// Independently scales the red, green and blue channels of an albedo.
25    #[serde(rename = "$color", default = "default_scale3")]
26    pub color: Vec3,
27    /// Independently scales the red, green and blue channels of an albedo.
28    #[serde(rename = "$color2", default = "default_scale3")]
29    pub color2: Vec3,
30
31    /// Scales the opacity of an entire material.
32    #[serde(rename = "$alpha", default = "default_scale")]
33    pub alpha: f32,
34    /// Specifies a mask to use to determine binary opacity.
35    #[serde(rename = "$alphatest", default)]
36    pub alpha_test: bool,
37    /// Specifies a mask to use to determine binary opacity.
38    #[serde(rename = "$alphatestreference", default = "default_scale")]
39    pub alpha_test_reference: f32,
40    /// Vector-like edge filtering.
41    #[serde(rename = "$distancealpha", default)]
42    pub distance_alpha: bool,
43    /// Disables backface culling.
44    #[serde(rename = "$nocull", default)]
45    pub no_cull: bool,
46    /// Specifies that the material should be partially see-through.
47    #[serde(rename = "$translucent", default)]
48    pub translucent: bool,
49
50    /// bumpmap for the first texture.
51    #[serde(rename = "$bumpmap", default, deserialize_with = "deserialize_path")]
52    pub bump_map: Option<String>,
53    /// bumpmap for the second texture.
54    #[serde(rename = "$bumpmap2", default, deserialize_with = "deserialize_path")]
55    pub bump_map2: Option<String>,
56    /// Per-texel color modification via a warp texture.
57    #[serde(
58        rename = "$lightwarptexture",
59        default,
60        deserialize_with = "deserialize_path"
61    )]
62    pub light_wrap_texture: Option<String>,
63    /// Determines whether the surface is self-illuminated independent of environment lighting.
64    #[serde(rename = "$selfillum", default)]
65    pub self_illum: bool,
66    /// Flags the $bumpmap as being a self-shadowing bumpmap.
67    #[serde(rename = "$ssbump", default)]
68    pub ss_bump: bool,
69
70    /// Specular reflections.
71    #[serde(rename = "$envmap", default, deserialize_with = "deserialize_path")]
72    pub env_map: Option<String>,
73    /// Diffuse reflections.
74    #[serde(rename = "$phong", default)]
75    pub phong: f32,
76
77    /// Prevents fog from overdrawing a material.
78    #[serde(rename = "$nofog", default)]
79    pub no_fog: bool,
80
81    /// Ignore z filtering
82    #[serde(rename = "$ignorez", default)]
83    pub ignore_z: bool,
84}