plasma-prp 0.1.0

Read, write, inspect, and manipulate Plasma engine PRP files used by Myst Online: Uru Live
Documentation
//! Layer compositing — plLayerOr, plLayerDepth, plLayerShadowBase.
//!
//! These layers modify render state through bitwise operations or depth bias.
//!
//! C++ ref: plSurface/plLayerOr.h/.cpp, plLayerDepth.h/.cpp, plLayerShadowBase.h/.cpp

use super::state::MatState;

/// plLayerOr — bitwise-OR state flags onto a layer.
#[derive(Debug, Clone)]
pub struct LayerOrData {
    pub or_state: MatState,
}

impl Default for LayerOrData {
    fn default() -> Self {
        Self {
            or_state: MatState::default(),
        }
    }
}

/// plLayerDepth — applies depth bias to prevent z-fighting on decals.
#[derive(Debug, Clone)]
pub struct LayerDepthData {
    pub depth_bias: f32,
}

impl Default for LayerDepthData {
    fn default() -> Self {
        Self { depth_bias: 0.0 }
    }
}

/// plLayerShadowBase — shadow-specific layer state.
#[derive(Debug, Clone)]
pub struct LayerShadowBaseData {
    pub power: f32,
    pub ambient: f32,
}

impl Default for LayerShadowBaseData {
    fn default() -> Self {
        Self {
            power: 1.0,
            ambient: 0.0,
        }
    }
}