Skip to content

Vp::WorldShader

Abstract shader that provides PVM matrices uniforms.

#include "Viewport/shader/WorldShader.h"

Inherits from Vp::Shader

Inherited by Vp::ObjectShader

Public Functions

Name
WorldShader(GLuint id)
virtual voidinit(bool initSuperclass) override
virtual voidsetUniforms() override<br>Set uniforms before rendering.
voidsetWorldTransform(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection)<br>Updates MVP matrices.

Public Attributes

Name
glm::mat4m_model
glm::mat4m_projection
glm::mat4m_view
GLintm_wboitFarId
GLintm_wboitNearId
GLintmodelMatrixId
GLintnormalMatrixId
GLintprojectionMatrixId
GLintpvmMatrixId
GLintviewMatrixId

Additional inherited members

Public Functions inherited from Vp::Shader

Name
Shader(GLuint id)
virtual~Shader() =default
voidbindTexture2D(GLuint textureUnit, GLuint textureID, GLint samplerLocation)
voidbindTexture2DMS(GLuint textureUnit, GLuint textureID, GLint samplerLocation)
boolhasUniform(GLint location)
virtual voidsetUniformsPerMeshPart(Core::Mesh::MeshPart & meshPart)<br>Set uniforms before rendering individual mesh parts.
boolsupportsWboit()
virtual voiduse() const

Public Attributes inherited from Vp::Shader

Name
GLuintm_id
boolm_wboit <br>Whether to use weighted blended transparency for output if supported.
intm_wboitFunc

Protected Attributes inherited from Vp::Shader

Name
GLintm_wboitFlagId <br>Uniform id of the wboit enable/disable flag.
GLintm_wboitFuncId

Public Functions Documentation

function WorldShader

cpp
explicit WorldShader(
    GLuint id
)
explicit WorldShader(
    GLuint id
)

function init

cpp
virtual void init(
    bool initSuperclass
) override
virtual void init(
    bool initSuperclass
) override

Reimplements: Vp::Shader::init

function setUniforms

cpp
virtual void setUniforms() override
virtual void setUniforms() override

Set uniforms before rendering.

Reimplements: Vp::Shader::setUniforms

function setWorldTransform

cpp
void setWorldTransform(
    const glm::mat4 & model,
    const glm::mat4 & view,
    const glm::mat4 & projection
)
void setWorldTransform(
    const glm::mat4 & model,
    const glm::mat4 & view,
    const glm::mat4 & projection
)

Updates MVP matrices.

Parameters:

  • model Model use
  • view View use
  • projection Projection use

Public Attributes Documentation

variable m_model

cpp
glm::mat4 m_model;
glm::mat4 m_model;

variable m_projection

cpp
glm::mat4 m_projection;
glm::mat4 m_projection;

variable m_view

cpp
glm::mat4 m_view;
glm::mat4 m_view;

variable m_wboitFarId

cpp
GLint m_wboitFarId;
GLint m_wboitFarId;

variable m_wboitNearId

cpp
GLint m_wboitNearId;
GLint m_wboitNearId;

variable modelMatrixId

cpp
GLint modelMatrixId;
GLint modelMatrixId;

variable normalMatrixId

cpp
GLint normalMatrixId;
GLint normalMatrixId;

variable projectionMatrixId

cpp
GLint projectionMatrixId;
GLint projectionMatrixId;

variable pvmMatrixId

cpp
GLint pvmMatrixId;
GLint pvmMatrixId;

variable viewMatrixId

cpp
GLint viewMatrixId;
GLint viewMatrixId;

Updated on 2024-11-06 at 20:16:53 +0000