Skip to content

Vp::GridShader

Shader for the infinite grid.

#include "Viewport/shader/GridShader.h"

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

Public Functions

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

Public Attributes

Name
glm::vec3m_axisXColor
glm::vec3m_axisYColor
glm::vec3m_axisZColor
floatm_grid1FadeEnd
floatm_grid1FadeStart
floatm_grid2FadeEnd
floatm_grid2FadeStart
glm::vec3m_gridColor
floatm_gridSize
floatm_gridStrength
floatm_lineWidth
boolm_showGrid
boolm_showXAxis
boolm_showYAxis
boolm_showZAxis

Protected Attributes

Name
GLintm_axisXColorId
GLintm_axisYColorId
GLintm_axisZColorId
GLintm_farId
GLintm_grid1FadeEndId
GLintm_grid1FadeStartId
GLintm_grid2FadeEndId
GLintm_grid2FadeStartId
GLintm_gridColorId
GLintm_gridSizeId
GLintm_gridStrengthId
GLintm_lineWidthId
GLintm_nearId
GLintm_showGridId
GLintm_showXAxisId
GLintm_showYAxisId
GLintm_showZAxisId

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 GridShader

cpp
explicit GridShader(
    GLuint id
)
explicit GridShader(
    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

Public Attributes Documentation

variable m_axisXColor

cpp
glm::vec3 m_axisXColor {glm::vec3(1.0, 0.49, 0.53)};
glm::vec3 m_axisXColor {glm::vec3(1.0, 0.49, 0.53)};

variable m_axisYColor

cpp
glm::vec3 m_axisYColor {glm::vec3(0.41, 0.96, 0.49)};
glm::vec3 m_axisYColor {glm::vec3(0.41, 0.96, 0.49)};

variable m_axisZColor

cpp
glm::vec3 m_axisZColor {glm::vec3(0.45, 0.49, 1.0)};
glm::vec3 m_axisZColor {glm::vec3(0.45, 0.49, 1.0)};

variable m_grid1FadeEnd

cpp
float m_grid1FadeEnd {0.4f};
float m_grid1FadeEnd {0.4f};

variable m_grid1FadeStart

cpp
float m_grid1FadeStart {0.0f};
float m_grid1FadeStart {0.0f};

variable m_grid2FadeEnd

cpp
float m_grid2FadeEnd {1.0f};
float m_grid2FadeEnd {1.0f};

variable m_grid2FadeStart

cpp
float m_grid2FadeStart {0.1f};
float m_grid2FadeStart {0.1f};

variable m_gridColor

cpp
glm::vec3 m_gridColor {glm::vec3(0.45, 0.49, 0.53)};
glm::vec3 m_gridColor {glm::vec3(0.45, 0.49, 0.53)};

variable m_gridSize

cpp
float m_gridSize {1.0f};
float m_gridSize {1.0f};

variable m_gridStrength

cpp
float m_gridStrength {0.5f};
float m_gridStrength {0.5f};

variable m_lineWidth

cpp
float m_lineWidth {1.0f};
float m_lineWidth {1.0f};

variable m_showGrid

cpp
bool m_showGrid = true;
bool m_showGrid = true;

variable m_showXAxis

cpp
bool m_showXAxis = true;
bool m_showXAxis = true;

variable m_showYAxis

cpp
bool m_showYAxis = true;
bool m_showYAxis = true;

variable m_showZAxis

cpp
bool m_showZAxis = true;
bool m_showZAxis = true;

Protected Attributes Documentation

variable m_axisXColorId

cpp
GLint m_axisXColorId;
GLint m_axisXColorId;

variable m_axisYColorId

cpp
GLint m_axisYColorId;
GLint m_axisYColorId;

variable m_axisZColorId

cpp
GLint m_axisZColorId;
GLint m_axisZColorId;

variable m_farId

cpp
GLint m_farId;
GLint m_farId;

variable m_grid1FadeEndId

cpp
GLint m_grid1FadeEndId;
GLint m_grid1FadeEndId;

variable m_grid1FadeStartId

cpp
GLint m_grid1FadeStartId;
GLint m_grid1FadeStartId;

variable m_grid2FadeEndId

cpp
GLint m_grid2FadeEndId;
GLint m_grid2FadeEndId;

variable m_grid2FadeStartId

cpp
GLint m_grid2FadeStartId;
GLint m_grid2FadeStartId;

variable m_gridColorId

cpp
GLint m_gridColorId;
GLint m_gridColorId;

variable m_gridSizeId

cpp
GLint m_gridSizeId;
GLint m_gridSizeId;

variable m_gridStrengthId

cpp
GLint m_gridStrengthId;
GLint m_gridStrengthId;

variable m_lineWidthId

cpp
GLint m_lineWidthId;
GLint m_lineWidthId;

variable m_nearId

cpp
GLint m_nearId;
GLint m_nearId;

variable m_showGridId

cpp
GLint m_showGridId;
GLint m_showGridId;

variable m_showXAxisId

cpp
GLint m_showXAxisId;
GLint m_showXAxisId;

variable m_showYAxisId

cpp
GLint m_showYAxisId;
GLint m_showYAxisId;

variable m_showZAxisId

cpp
GLint m_showZAxisId;
GLint m_showZAxisId;

Updated on 2024-03-16 at 19:15:01 +0000