struct mrpt::opengl::TLightParameters

Unidirectional lighting model parameters for triangle shaders.

Refer to standard OpenGL literature and tutorials for the meaning of each field, and to the shader GLSL code itself.

#include <mrpt/opengl/TLightParameters.h>

struct TLightParameters
{
    //
fields

    mrpt::img::TColorf color = {1.0f, 1.0f, 1.0f};
    float diffuse = 0.8f;
    float ambient = 0.2f;
    float specular = 0.95f;
    mrpt::math::TVector3Df direction = {-0.40825f, -0.40825f, -0.81650f};
    float shadow_bias = 1e-5;
    float shadow_bias_cam2frag = 1e-5;
    float shadow_bias_normal = 1e-4;

    // construction

    TLightParameters();

    //
methods

    void writeToStream(mrpt::serialization::CArchive& out) const;
    void readFromStream(mrpt::serialization::CArchive& in);
};

Fields

mrpt::math::TVector3Df direction = {-0.40825f, -0.40825f, -0.81650f}

Light direction (must be normalized)

float shadow_bias = 1e-5

Shadow tuning parameters (“anti shadow acne”)