Skip to content

Vp::ColorShader

Basic shader to display unlit colored primitives.

#include "Viewport/shader/ColorShader.h"

Inherits from Vp::ObjectShader, Vp::WorldShader, Vp::Shader

Inherited by Vp::FrustumShader

Public Functions

Name
ColorShader(GLuint id)
virtual voidinit(bool initSuperclass) override
virtual voidsetUniforms() override<br>Set uniforms before rendering.

Public Attributes

Name
glm::vec3m_singleColor
boolm_useSingleColor

Protected Attributes

Name
GLintsingleColorId
GLintuseSingleColorId

Additional inherited members

Public Functions inherited from Vp::ObjectShader

Name
ObjectShader(GLuint id)

Public Attributes inherited from Vp::ObjectShader

Name
floatm_opacity

Protected Attributes inherited from Vp::ObjectShader

Name
GLintopacityId

Public Functions inherited from Vp::WorldShader

Name
WorldShader(GLuint id)
voidsetWorldTransform(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection)<br>Updates MVP matrices.

Public Attributes inherited from Vp::WorldShader

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

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 ColorShader

cpp
explicit ColorShader(
    GLuint id
)
explicit ColorShader(
    GLuint id
)

function init

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

Reimplements: Vp::Shader::init

Reimplemented by: Vp::FrustumShader::init

function setUniforms

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

Set uniforms before rendering.

Reimplements: Vp::Shader::setUniforms

Reimplemented by: Vp::FrustumShader::setUniforms

Public Attributes Documentation

variable m_singleColor

cpp
glm::vec3 m_singleColor {1.0f, 0.0f, 1.0f};
glm::vec3 m_singleColor {1.0f, 0.0f, 1.0f};

variable m_useSingleColor

cpp
bool m_useSingleColor {false};
bool m_useSingleColor {false};

Protected Attributes Documentation

variable singleColorId

cpp
GLint singleColorId;
GLint singleColorId;

variable useSingleColorId

cpp
GLint useSingleColorId;
GLint useSingleColorId;

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