Vp::GridShader
Shader for the infinite grid of the standard basis.
#include "Viewport/shader/GridShader.h"
Inherits from Vp::ObjectShader, Vp::WorldShader, Vp::Shader
Inherited by Vp::GridShaderGeneric
Public Functions
| Name | |
|---|---|
| GridShader(GLuint id) | |
| virtual void | init(bool initSuperclass) override |
| virtual void | setUniforms() override<br>Set uniforms before rendering. |
Public Attributes
| Name | |
|---|---|
| const float * | m_axisXColor |
| const float * | m_axisYColor |
| const float * | m_axisZColor |
| float | m_grid1FadeEnd |
| float | m_grid1FadeStart |
| float | m_grid2FadeEnd |
| float | m_grid2FadeStart |
| const float * | m_gridColor |
| float | m_gridSize |
| float | m_gridStrength |
| float | m_lineWidth |
| glm::mat4 | m_modelInv |
| bool | m_showGrid |
| bool | m_showXAxis |
| bool | m_showYAxis |
| bool | m_showZAxis |
Protected Attributes
| Name | |
|---|---|
| GLint | m_axisXColorId |
| GLint | m_axisYColorId |
| GLint | m_axisZColorId |
| GLint | m_farId |
| GLint | m_grid1FadeEndId |
| GLint | m_grid1FadeStartId |
| GLint | m_grid2FadeEndId |
| GLint | m_grid2FadeStartId |
| GLint | m_gridColorId |
| GLint | m_gridSizeId |
| GLint | m_gridStrengthId |
| GLint | m_lineWidthId |
| GLint | m_nearId |
| GLint | m_showGridId |
| GLint | m_showXAxisId |
| GLint | m_showYAxisId |
| GLint | m_showZAxisId |
| GLint | modelMatrixInvId |
Additional inherited members
Public Functions inherited from Vp::ObjectShader
| Name | |
|---|---|
| ObjectShader(GLuint id) |
Public Attributes inherited from Vp::ObjectShader
| Name | |
|---|---|
| float | m_opacity |
Protected Attributes inherited from Vp::ObjectShader
| Name | |
|---|---|
| GLint | opacityId |
Public Functions inherited from Vp::WorldShader
| Name | |
|---|---|
| WorldShader(GLuint id) | |
| void | setWorldTransform(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection)<br>Updates MVP matrices. |
Public Attributes inherited from Vp::WorldShader
| 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 |
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 GridShader
explicit GridShader(
GLuint id
)explicit GridShader(
GLuint id
)function init
virtual void init(
bool initSuperclass
) overridevirtual void init(
bool initSuperclass
) overrideReimplements: Vp::Shader::init
Reimplemented by: Vp::GridShaderGeneric::init
function setUniforms
virtual void setUniforms() overridevirtual void setUniforms() overrideSet uniforms before rendering.
Reimplements: Vp::Shader::setUniforms
Reimplemented by: Vp::GridShaderGeneric::setUniforms
Public Attributes Documentation
variable m_axisXColor
const float * m_axisXColor;const float * m_axisXColor;variable m_axisYColor
const float * m_axisYColor;const float * m_axisYColor;variable m_axisZColor
const float * m_axisZColor;const float * m_axisZColor;variable m_grid1FadeEnd
float m_grid1FadeEnd {0.4f};float m_grid1FadeEnd {0.4f};variable m_grid1FadeStart
float m_grid1FadeStart {0.0f};float m_grid1FadeStart {0.0f};variable m_grid2FadeEnd
float m_grid2FadeEnd {1.0f};float m_grid2FadeEnd {1.0f};variable m_grid2FadeStart
float m_grid2FadeStart {0.1f};float m_grid2FadeStart {0.1f};variable m_gridColor
const float * m_gridColor;const float * m_gridColor;variable m_gridSize
float m_gridSize {1.0f};float m_gridSize {1.0f};variable m_gridStrength
float m_gridStrength {0.5f};float m_gridStrength {0.5f};variable m_lineWidth
float m_lineWidth {1.0f};float m_lineWidth {1.0f};variable m_modelInv
glm::mat4 m_modelInv;glm::mat4 m_modelInv;variable m_showGrid
bool m_showGrid = true;bool m_showGrid = true;variable m_showXAxis
bool m_showXAxis = true;bool m_showXAxis = true;variable m_showYAxis
bool m_showYAxis = true;bool m_showYAxis = true;variable m_showZAxis
bool m_showZAxis = true;bool m_showZAxis = true;Protected Attributes Documentation
variable m_axisXColorId
GLint m_axisXColorId;GLint m_axisXColorId;variable m_axisYColorId
GLint m_axisYColorId;GLint m_axisYColorId;variable m_axisZColorId
GLint m_axisZColorId;GLint m_axisZColorId;variable m_farId
GLint m_farId;GLint m_farId;variable m_grid1FadeEndId
GLint m_grid1FadeEndId;GLint m_grid1FadeEndId;variable m_grid1FadeStartId
GLint m_grid1FadeStartId;GLint m_grid1FadeStartId;variable m_grid2FadeEndId
GLint m_grid2FadeEndId;GLint m_grid2FadeEndId;variable m_grid2FadeStartId
GLint m_grid2FadeStartId;GLint m_grid2FadeStartId;variable m_gridColorId
GLint m_gridColorId;GLint m_gridColorId;variable m_gridSizeId
GLint m_gridSizeId;GLint m_gridSizeId;variable m_gridStrengthId
GLint m_gridStrengthId;GLint m_gridStrengthId;variable m_lineWidthId
GLint m_lineWidthId;GLint m_lineWidthId;variable m_nearId
GLint m_nearId;GLint m_nearId;variable m_showGridId
GLint m_showGridId;GLint m_showGridId;variable m_showXAxisId
GLint m_showXAxisId;GLint m_showXAxisId;variable m_showYAxisId
GLint m_showYAxisId;GLint m_showYAxisId;variable m_showZAxisId
GLint m_showZAxisId;GLint m_showZAxisId;variable modelMatrixInvId
GLint modelMatrixInvId;GLint modelMatrixInvId;Updated on 2026-05-21 at 15:39:36 +0000