A factory to create shader cores.
More...
#include "ShaderCoreFactory.h"
A factory to create shader cores.
- Examples
- scg3_table_scene_example.cpp.
Definition at line 56 of file ShaderCoreFactory.h.
◆ ShaderCoreFactory() [1/2]
scg::ShaderCoreFactory::ShaderCoreFactory |
( |
| ) |
|
◆ ShaderCoreFactory() [2/2]
scg::ShaderCoreFactory::ShaderCoreFactory |
( |
const std::string & |
filePath | ) |
|
Constructor with one or more file paths to be searched for shader files. More than one file paths can be defined using ';' or ',' as delimiter.
Example: addFilePath("../shaders1;../shaders2")
◆ ~ShaderCoreFactory()
virtual scg::ShaderCoreFactory::~ShaderCoreFactory |
( |
| ) |
|
|
virtual |
◆ addFilePath()
void scg::ShaderCoreFactory::addFilePath |
( |
const std::string & |
filePath | ) |
|
Add one or more file paths to be searched for shader files. More than one file paths can be defined using ';' or ',' as delimiter.
Example: addFilePath("../shaders1;../shaders2")
◆ createColorShader()
Create a simple shader program without lighting.
attributes: vVertex, vColor
uniforms: mvpMatrix
◆ createGouraudShader()
ShaderCoreSP scg::ShaderCoreFactory::createGouraudShader |
( |
| ) |
|
Create a simple shader program with Gouraud shading for a single light without texturing.
attributes: vVertex, vNormal
uniforms: modelViewMatrix, projectionMatrix, mvpMatrix, normalMatrix
UBOs: LightBlock, MaterialBlock
◆ createShaderFromSourceFiles() [1/2]
ShaderCoreSP scg::ShaderCoreFactory::createShaderFromSourceFiles |
( |
const std::vector< ShaderFile > & |
shaderFiles | ) |
|
Load shaders from source files, compile, and link to create a shader program.
- Parameters
-
shaderFiles | vector of shader files, each consisting of a file name (to be searched for in known file paths) and a shader type (GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, or GL_GEOMETRY_SHADER). |
◆ createShaderFromSourceFiles() [2/2]
Load shaders from source files, compile, and link to create a shader program.
- Parameters
-
shaderFiles | vector of shader files, each consisting of a file name (to be searched for in known file paths) and a shader type (GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, or GL_GEOMETRY_SHADER). |
◆ loadSourceFile_()
int scg::ShaderCoreFactory::loadSourceFile_ |
( |
GLuint |
shader, |
|
|
const std::string & |
fileName |
|
) |
| const |
|
protected |
Load shader from source file.
- Parameters
-
shader | index the shader shall be attached to |
fileName | file name to be searched for in known file paths |
◆ filePaths_
std::vector<std::string> scg::ShaderCoreFactory::filePaths_ |
|
protected |
The documentation for this class was generated from the following file: