struct mrpt::opengl::CompiledViewport::LightState

Overview

Cached lighting state (for detecting changes that affect rendering).

Light uniforms are uploaded every frame from m_lightParams, so this only needs to detect changes that require matrix recomputation (shadow map P/V depends on primary directional direction) or that should trigger a repaint.

struct LightState
{
    // fields

    float ambient = 0;
    size_t numLights = 0;
    mrpt::math::TVector3Df primaryDirection {0, 0, -1};
    size_t paramsHash = 0;

    // methods

    bool operator != (const LightState& other) const;
};

Fields

size_t paramsHash = 0

Coarse hash of all light parameters to detect any change.