Core manager for shader program compilation, uniform binding, and rendering.
More...
#include <shader.h>
|
| | Shader () |
| void | applyMaterialUniforms (std::shared_ptr< Material > mat) |
| | Binds material properties and active textures to the shader pipeline.
|
| void | setLight (Light *light, int lightIndex) |
| void | updateLight (Light *light) |
| GLuint | init (std::string vertShaderLocation, std::string fragShaderLocation) |
| | Compiles and links vertex and fragment shaders.
|
| void | update (Camera &camera, int winWidth, int winHeight, float deltaTime) |
| | Updates global shader uniforms (Camera, Fog, Time).
|
| void | draw (Mesh &mesh, bool drawTransparent, float deltaTime) |
| | Issues draw calls for a specific mesh.
|
Core manager for shader program compilation, uniform binding, and rendering.
◆ Shader()
| copakond::Shader::Shader |
( |
| ) |
|
◆ applyMaterialUniforms()
| void copakond::Shader::applyMaterialUniforms |
( |
std::shared_ptr< Material > | mat | ) |
|
Binds material properties and active textures to the shader pipeline.
◆ draw()
| void copakond::Shader::draw |
( |
Mesh & | mesh, |
|
|
bool | drawTransparent, |
|
|
float | deltaTime ) |
Issues draw calls for a specific mesh.
- Parameters
-
| drawTransparent | If true, renders only transparent submeshes (for blending). If false, renders opaque. |
| deltaTime | Passed for procedural vertex wave animations. |
◆ getWorldAmbient()
| glm::vec3 copakond::Shader::getWorldAmbient |
( |
| ) |
|
|
inlinestatic |
◆ init()
| GLuint copakond::Shader::init |
( |
std::string | vertShaderLocation, |
|
|
std::string | fragShaderLocation ) |
Compiles and links vertex and fragment shaders.
- Returns
- The generated OpenGL shader program ID.
◆ setLight()
| void copakond::Shader::setLight |
( |
Light * | light, |
|
|
int | lightIndex ) |
◆ update()
| void copakond::Shader::update |
( |
Camera & | camera, |
|
|
int | winWidth, |
|
|
int | winHeight, |
|
|
float | deltaTime ) |
Updates global shader uniforms (Camera, Fog, Time).
◆ updateLight()
| void copakond::Shader::updateLight |
( |
Light * | light | ) |
|
◆ _alpha
| GLint copakond::Shader::_alpha = 0 |
|
protected |
◆ _alphaMapUID
| GLuint copakond::Shader::_alphaMapUID = 0 |
|
protected |
◆ _ambient
| GLint copakond::Shader::_ambient = 0 |
|
protected |
◆ _camPos
| GLint copakond::Shader::_camPos = 0 |
|
protected |
◆ _diffuse
| GLint copakond::Shader::_diffuse = 0 |
|
protected |
◆ _diffuseMapUID
| GLuint copakond::Shader::_diffuseMapUID = 0 |
|
protected |
◆ _fogColor
| GLint copakond::Shader::_fogColor = 0 |
|
protected |
◆ _fogEnabled
| GLint copakond::Shader::_fogEnabled = 0 |
|
protected |
◆ _fogEnd
| GLint copakond::Shader::_fogEnd = 0 |
|
protected |
◆ _fogStart
| GLint copakond::Shader::_fogStart = 0 |
|
protected |
◆ _isTextLabelUID
| GLuint copakond::Shader::_isTextLabelUID = 0 |
|
protected |
◆ _isVertexWaveUID
| GLuint copakond::Shader::_isVertexWaveUID = 0 |
|
protected |
◆ _modelUID
| GLint copakond::Shader::_modelUID = 0 |
|
protected |
◆ _normalMapUID
| GLuint copakond::Shader::_normalMapUID = 0 |
|
protected |
◆ _normalMatrix
| GLint copakond::Shader::_normalMatrix = 0 |
|
protected |
◆ _numLights
| GLint copakond::Shader::_numLights = 0 |
|
protected |
◆ _position
| glm::vec3 copakond::Shader::_position |
|
protected |
◆ _projectionM
| glm::mat4 copakond::Shader::_projectionM |
|
protected |
◆ _projectionUID
| GLint copakond::Shader::_projectionUID = 0 |
|
protected |
◆ _pvmUID
| GLint copakond::Shader::_pvmUID = 0 |
|
protected |
◆ _shaderProgram
| GLuint copakond::Shader::_shaderProgram = 0 |
|
protected |
◆ _shininess
| GLint copakond::Shader::_shininess = 0 |
|
protected |
◆ _shininessMapUID
| GLuint copakond::Shader::_shininessMapUID = 0 |
|
protected |
◆ _specular
| GLint copakond::Shader::_specular = 0 |
|
protected |
◆ _specularMapUID
| GLuint copakond::Shader::_specularMapUID = 0 |
|
protected |
◆ _timeUID
| GLuint copakond::Shader::_timeUID = 0 |
|
protected |
◆ _useAlphaMapUID
| GLuint copakond::Shader::_useAlphaMapUID = 0 |
|
protected |
◆ _useDiffuseMapUID
| GLuint copakond::Shader::_useDiffuseMapUID = 0 |
|
protected |
◆ _useNormalMapUID
| GLuint copakond::Shader::_useNormalMapUID = 0 |
|
protected |
◆ _useShininessMapUID
| GLuint copakond::Shader::_useShininessMapUID = 0 |
|
protected |
◆ _useSpecularMapUID
| GLuint copakond::Shader::_useSpecularMapUID = 0 |
|
protected |
◆ _viewM
| glm::mat4 copakond::Shader::_viewM |
|
protected |
◆ _viewUID
| GLint copakond::Shader::_viewUID = 0 |
|
protected |
◆ _worldAmbientUID
| GLuint copakond::Shader::_worldAmbientUID = 0 |
|
protected |
◆ totalNumLights
| size_t copakond::Shader::totalNumLights = 0 |
|
protected |
The documentation for this class was generated from the following files: