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 void | init(bool initSuperclass) override |
| virtual void | setUniforms() override<br>Set uniforms before rendering. |
| void | setWorldTransform(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection)<br>Updates MVP matrices. |
Public Attributes
| Name | |
|---|---|
| glm::mat4 | m_model |
| bool | m_normal <br>Whether to provide normal matrix uniform. |
| glm::mat4 | m_projection |
| bool | m_pvm <br>Whether to provide precalculated PVM matrix uniform. |
| bool | m_pvmSeparate <br>Whether to provide individual pvm matrices. |
| glm::mat4 | m_view |
| GLint | m_wboitFarId |
| GLint | m_wboitNearId |
| GLint | modelMatrixId |
| GLint | normalMatrixId |
| GLint | projectionMatrixId |
| GLint | pvmMatrixId |
| GLint | viewMatrixId |
Additional inherited members
Public Functions inherited from Vp::Shader
| Name | |
|---|---|
| Shader(GLuint id) | |
| virtual | ~Shader() =default |
| void | bindTexture2D(GLuint textureUnit, GLuint textureID, GLint samplerLocation) |
| void | bindTexture2DArray(GLuint textureUnit, GLuint textureID, GLint samplerLocation) |
| void | bindTexture2DMS(GLuint textureUnit, GLuint textureID, GLint samplerLocation) |
| bool | hasUniform(GLint location) const |
| virtual void | setUniformsPerMeshPart(Core::Mesh::MeshPart & meshPart)<br>Set uniforms before rendering individual mesh parts. |
| bool | supportsUserClipping() const |
| bool | supportsWboit() const |
| virtual void | use() const |
Public Attributes inherited from Vp::Shader
| Name | |
|---|---|
| const std::array< glm::vec4, 6 > * | m_clippingPlanes |
| std::string | m_fragSource |
| std::string | m_geoSource |
| GLuint | m_id |
| std::string | m_injectedSource |
| std::string | m_vertSource |
| bool | m_wboit <br>Whether to use weighted blended transparency for output if supported. |
| int | m_wboitFunc |
Protected Attributes inherited from Vp::Shader
| Name | |
|---|---|
| std::array< GLint, 6 > | m_clippingPlanesId |
| GLint | m_wboitFlagId <br>Uniform id of the wboit enable/disable flag. |
| GLint | m_wboitFuncId |
Public Functions Documentation
function WorldShader
cpp
explicit WorldShader(
GLuint id
)explicit WorldShader(
GLuint id
)function init
cpp
virtual void init(
bool initSuperclass
) overridevirtual void init(
bool initSuperclass
) overrideReimplements: Vp::Shader::init
function setUniforms
cpp
virtual void setUniforms() overridevirtual void setUniforms() overrideSet 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_normal
cpp
bool m_normal {true};bool m_normal {true};Whether to provide normal matrix uniform.
variable m_projection
cpp
glm::mat4 m_projection;glm::mat4 m_projection;variable m_pvm
cpp
bool m_pvm {true};bool m_pvm {true};Whether to provide precalculated PVM matrix uniform.
variable m_pvmSeparate
cpp
bool m_pvmSeparate {true};bool m_pvmSeparate {true};Whether to provide individual pvm matrices.
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 2026-05-21 at 15:39:36 +0000