Skip to main content

plasma_prp/material/
layer_composite.rs

1//! Layer compositing — plLayerOr, plLayerDepth, plLayerShadowBase.
2//!
3//! These layers modify render state through bitwise operations or depth bias.
4//!
5//! C++ ref: plSurface/plLayerOr.h/.cpp, plLayerDepth.h/.cpp, plLayerShadowBase.h/.cpp
6
7use super::state::MatState;
8
9/// plLayerOr — bitwise-OR state flags onto a layer.
10#[derive(Debug, Clone)]
11pub struct LayerOrData {
12    pub or_state: MatState,
13}
14
15impl Default for LayerOrData {
16    fn default() -> Self {
17        Self {
18            or_state: MatState::default(),
19        }
20    }
21}
22
23/// plLayerDepth — applies depth bias to prevent z-fighting on decals.
24#[derive(Debug, Clone)]
25pub struct LayerDepthData {
26    pub depth_bias: f32,
27}
28
29impl Default for LayerDepthData {
30    fn default() -> Self {
31        Self { depth_bias: 0.0 }
32    }
33}
34
35/// plLayerShadowBase — shadow-specific layer state.
36#[derive(Debug, Clone)]
37pub struct LayerShadowBaseData {
38    pub power: f32,
39    pub ambient: f32,
40}
41
42impl Default for LayerShadowBaseData {
43    fn default() -> Self {
44        Self {
45            power: 1.0,
46            ambient: 0.0,
47        }
48    }
49}