struct mrpt::opengl::RenderContext

Overview

Rendering context passed to RenderableProxy::render().

Contains all state needed for rendering an object.

#include <mrpt/opengl/RenderableProxy.h>

struct RenderContext
{
    // fields

    Program* shader = nullptr;
    shader_id_t shader_id = DefaultShaderID::NONE;
    const TRenderMatrices* state = nullptr;
    const mrpt::viz::TLightParameters* lights = nullptr;
    bool isShadowMapPass = false;
    int instanceCount = 0;
    Buffer* instanceBuffer = nullptr;
    size_t instanceBufferOffset = 0;
};

Fields

Program* shader = nullptr

The shader program to use for rendering.

shader_id_t shader_id = DefaultShaderID::NONE

ID of the shader being used.

const TRenderMatrices* state = nullptr

Projection/view/model matrices and camera state.

const mrpt::viz::TLightParameters* lights = nullptr

Lighting parameters.

bool isShadowMapPass = false

Is this a shadow map generation pass?

int instanceCount = 0

Instanced draw (only for proxies with supportsInstancing()): the number of instances to draw (0 means a regular draw), and the buffer and byte offset of their model matrices (column-major 4x4 floats, one per instance).

The model matrix uniforms are the identity in such draws.