Vp::Shader
Base class for shaders. More...
#include "Viewport/shader/Shader.h"
Inherited by Vp::BoxBlurShader, Vp::ScreenOverlayShader, Vp::SelectionCompositeShader, Vp::WBOITCompositeShader, Vp::WorldShader
Public Functions
Name | |
---|---|
Shader(GLuint id) | |
virtual | ~Shader() =default |
void | bindTexture2D(GLuint textureUnit, GLuint textureID, GLint samplerLocation) |
void | bindTexture2DMS(GLuint textureUnit, GLuint textureID, GLint samplerLocation) |
bool | hasUniform(GLint location) |
virtual void | init(bool initSuperclass) |
virtual void | setUniforms()<br>Set uniforms before rendering. |
virtual void | setUniformsPerMeshPart(Core::Mesh::MeshPart & meshPart)<br>Set uniforms before rendering individual mesh parts. |
bool | supportsWboit() |
virtual void | use() const |
Public Attributes
Name | |
---|---|
GLuint | m_id |
bool | m_wboit <br>Whether to use weighted blended transparency for output if supported. |
int | m_wboitFunc |
Protected Attributes
Name | |
---|---|
GLint | m_wboitFlagId <br>Uniform id of the wboit enable/disable flag. |
GLint | m_wboitFuncId |
Detailed Description
class Vp::Shader;
class Vp::Shader;
Base class for shaders.
Note that shader objects are just a facade/API for the glsl shaders. They shouldn't store state across frames and should have ALL their variables and uniforms set before each use. However sometimes it makes sense to store values in them. Just be aware that shaders are shared between many objects.
Public Functions Documentation
function Shader
explicit Shader(
GLuint id
)
explicit Shader(
GLuint id
)
function ~Shader
virtual ~Shader() =default
virtual ~Shader() =default
function bindTexture2D
void bindTexture2D(
GLuint textureUnit,
GLuint textureID,
GLint samplerLocation
)
void bindTexture2D(
GLuint textureUnit,
GLuint textureID,
GLint samplerLocation
)
function bindTexture2DMS
void bindTexture2DMS(
GLuint textureUnit,
GLuint textureID,
GLint samplerLocation
)
void bindTexture2DMS(
GLuint textureUnit,
GLuint textureID,
GLint samplerLocation
)
function hasUniform
bool hasUniform(
GLint location
)
bool hasUniform(
GLint location
)
function init
virtual void init(
bool initSuperclass
)
virtual void init(
bool initSuperclass
)
Reimplemented by: Vp::BoxBlurShader::init, Vp::ColorShader::init, Vp::FrustumShader::init, Vp::GridShader::init, Vp::ObjectShader::init, Vp::PhongShader::init, Vp::ScreenOverlayShader::init, Vp::SelectionCompositeShader::init, Vp::WBOITCompositeShader::init, Vp::WorldShader::init
function setUniforms
virtual void setUniforms()
virtual void setUniforms()
Set uniforms before rendering.
Reimplemented by: Vp::BoxBlurShader::setUniforms, Vp::ColorShader::setUniforms, Vp::FrustumShader::setUniforms, Vp::GridShader::setUniforms, Vp::ObjectShader::setUniforms, Vp::PhongShader::setUniforms, Vp::ScreenOverlayShader::setUniforms, Vp::SelectionCompositeShader::setUniforms, Vp::WBOITCompositeShader::setUniforms, Vp::WorldShader::setUniforms
function setUniformsPerMeshPart
virtual void setUniformsPerMeshPart(
Core::Mesh::MeshPart & meshPart
)
virtual void setUniformsPerMeshPart(
Core::Mesh::MeshPart & meshPart
)
Set uniforms before rendering individual mesh parts.
Parameters:
- meshPart MeshPart being rendered
Reimplemented by: Vp::PhongShader::setUniformsPerMeshPart
function supportsWboit
bool supportsWboit()
bool supportsWboit()
Return: Whether this shader supports output to wboit buffers
function use
virtual void use() const
virtual void use() const
Public Attributes Documentation
variable m_id
GLuint m_id;
GLuint m_id;
variable m_wboit
bool m_wboit = false;
bool m_wboit = false;
Whether to use weighted blended transparency for output if supported.
See: supportsWboit()
variable m_wboitFunc
int m_wboitFunc = 0;
int m_wboitFunc = 0;
Protected Attributes Documentation
variable m_wboitFlagId
GLint m_wboitFlagId {-1};
GLint m_wboitFlagId {-1};
Uniform id of the wboit enable/disable flag.
variable m_wboitFuncId
GLint m_wboitFuncId {-1};
GLint m_wboitFuncId {-1};
Updated on 2024-11-06 at 20:16:53 +0000