libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
ShaderProgram specialized for rendering Model instances in 3D. More...
#include <donut/graphics/Shader3D.hpp>
Public Member Functions | |
Shader3D (const ShaderProgramOptions &programOptions, const Shader3DOptions &options={}) | |
Compile and link a 3D shader program. More... | |
Public Attributes | |
Shader3DOptions | options |
Shader configuration that was supplied in the constructor. More... | |
ShaderProgram | program |
Shader program. More... | |
ShaderParameter | projectionMatrix {program, "projectionMatrix"} |
Identifier for the uniform shader variable for the projection matrix. More... | |
ShaderParameter | viewMatrix {program, "viewMatrix"} |
Identifier for the uniform shader variable for the view matrix. More... | |
ShaderParameter | viewProjectionMatrix {program, "viewProjectionMatrix"} |
Identifier for the uniform shader variable for the combined view-projection matrix. More... | |
ShaderParameter | diffuseMap {program, "diffuseMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's diffuse map. More... | |
ShaderParameter | specularMap {program, "specularMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's specular map. More... | |
ShaderParameter | normalMap {program, "normalMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's normal map. More... | |
ShaderParameter | emissiveMap {program, "emissiveMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's emissive map. More... | |
ShaderParameter | diffuseColor {program, "diffuseColor"} |
Identifier for the uniform shader variable for the active material's diffuse color. More... | |
ShaderParameter | specularColor {program, "specularColor"} |
Identifier for the uniform shader variable for the active material's specular color. More... | |
ShaderParameter | normalScale {program, "normalScale"} |
Identifier for the uniform shader variable for the active material's normal scale. More... | |
ShaderParameter | emissiveColor {program, "emissiveColor"} |
Identifier for the uniform shader variable for the active material's emissive color. More... | |
ShaderParameter | specularExponent {program, "specularExponent"} |
Identifier for the uniform shader variable for the active material's specular exponent. More... | |
ShaderParameter | dissolveFactor {program, "dissolveFactor"} |
Identifier for the uniform shader variable for the active material's specular exponent. More... | |
ShaderParameter | occlusionFactor {program, "occlusionFactor"} |
Identifier for the uniform shader variable for the active material's occlusion factor. More... | |
Static Public Attributes | |
static const char *const | VERTEX_SHADER_SOURCE_CODE_INSTANCED_MODEL |
Pointer to a statically allocated string containing the GLSL source code for a plain vertex shader. More... | |
static const char *const | FRAGMENT_SHADER_SOURCE_CODE_UNLIT |
Pointer to a statically allocated string containing the GLSL source code for a fragment shader that uses a fullbright shading model with no lights. More... | |
static const char *const | FRAGMENT_SHADER_SOURCE_CODE_BLINN_PHONG |
Pointer to a statically allocated string containing the GLSL source code for a fragment shader that uses the Blinn-Phong shading model with a single basic point light at a fixed position. More... | |
static Shader3D *const | UNLIT |
Pointer to the statically allocated storage for the built-in unlit shader. More... | |
static Shader3D *const | BLINN_PHONG |
Pointer to the statically allocated storage for the built-in blinn-phong shader. More... | |
ShaderProgram specialized for rendering Model instances in 3D.
|
inline |
Compile and link a 3D shader program.
programOptions | base options for the ShaderProgram, see ShaderProgramOptions. |
options | additional options for the shader, see Shader3DOptions. |
graphics::Error | on failure to create a shader object, create the shader program object, compile the shader code or link the shader program. |
std::bad_alloc | on allocation failure. |
|
static |
Pointer to a statically allocated string containing the GLSL source code for a plain vertex shader.
|
static |
Pointer to a statically allocated string containing the GLSL source code for a fragment shader that uses a fullbright shading model with no lights.
|
static |
Pointer to a statically allocated string containing the GLSL source code for a fragment shader that uses the Blinn-Phong shading model with a single basic point light at a fixed position.
|
static |
Pointer to the statically allocated storage for the built-in unlit shader.
|
static |
Pointer to the statically allocated storage for the built-in blinn-phong shader.
Shader3DOptions donut::graphics::Shader3D::options |
Shader configuration that was supplied in the constructor.
ShaderProgram donut::graphics::Shader3D::program |
Shader program.
ShaderParameter donut::graphics::Shader3D::projectionMatrix {program, "projectionMatrix"} |
Identifier for the uniform shader variable for the projection matrix.
ShaderParameter donut::graphics::Shader3D::viewMatrix {program, "viewMatrix"} |
Identifier for the uniform shader variable for the view matrix.
ShaderParameter donut::graphics::Shader3D::viewProjectionMatrix {program, "viewProjectionMatrix"} |
Identifier for the uniform shader variable for the combined view-projection matrix.
ShaderParameter donut::graphics::Shader3D::diffuseMap {program, "diffuseMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's diffuse map.
ShaderParameter donut::graphics::Shader3D::specularMap {program, "specularMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's specular map.
ShaderParameter donut::graphics::Shader3D::normalMap {program, "normalMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's normal map.
ShaderParameter donut::graphics::Shader3D::emissiveMap {program, "emissiveMap"} |
Identifier for the uniform shader variable for the texture unit of the active material's emissive map.
ShaderParameter donut::graphics::Shader3D::diffuseColor {program, "diffuseColor"} |
Identifier for the uniform shader variable for the active material's diffuse color.
ShaderParameter donut::graphics::Shader3D::specularColor {program, "specularColor"} |
Identifier for the uniform shader variable for the active material's specular color.
ShaderParameter donut::graphics::Shader3D::normalScale {program, "normalScale"} |
Identifier for the uniform shader variable for the active material's normal scale.
ShaderParameter donut::graphics::Shader3D::emissiveColor {program, "emissiveColor"} |
Identifier for the uniform shader variable for the active material's emissive color.
ShaderParameter donut::graphics::Shader3D::specularExponent {program, "specularExponent"} |
Identifier for the uniform shader variable for the active material's specular exponent.
ShaderParameter donut::graphics::Shader3D::dissolveFactor {program, "dissolveFactor"} |
Identifier for the uniform shader variable for the active material's specular exponent.
ShaderParameter donut::graphics::Shader3D::occlusionFactor {program, "occlusionFactor"} |
Identifier for the uniform shader variable for the active material's occlusion factor.