#include <OpenFlipper/libs_required/ACG/GL/ShaderGenerator.hh>
|
static void | setShaderDir (QString _dir) |
|
static QString | getShaderDir () |
|
static unsigned int | registerModifier (ShaderModifier *_modifier) |
| Shader modifiers have to be registered before they can be used. They also must remain allocated for the rest of the applications runtime. Use a combination of modifier-IDs in the constructor of ShaderProgGen to active them. More...
|
|
static bool | loadStringListFromFile (QString _fileName, QStringList *_out) |
| Load a text file as string list. More...
|
|
static QString | getAbsFilePath (QString _fileName) |
| Convert a filename to an absolute filename. More...
|
|
|
void | loadShaderTemplateFromFile () |
| Loads external shader templates.
|
|
void | scanShaderTemplate (QStringList &_templateSrc, QString _templateFilename, QStringList *_outLayoutDirectives=0) |
| Scans loaded shader template for requested inputs, glsl version or includes.
|
|
void | init (const ShaderGenDesc *_desc, ShaderModifier *const *_modifiers, unsigned int _numActiveMods) |
| Called in constructor.
|
|
void | init (const ShaderGenDesc *_desc, const unsigned int *_modifiers, unsigned int _numActiveMods) |
|
void | buildVertexShader () |
|
void | buildTessControlShader () |
|
void | buildTessEvalShader () |
|
void | buildGeometryShader () |
|
void | buildFragmentShader () |
|
void | addVertexBeginCode (QStringList *_code) |
|
void | addVertexEndCode (QStringList *_code) |
|
void | addFragmentBeginCode (QStringList *_code) |
|
void | addFragmentEndCode (QStringList *_code) |
|
void | addLightingFunctions (QStringList *_code) |
| Adds lighting definition functions. More...
|
|
void | addLightingCode (QStringList *_code) |
| Adds lighting function calls to code.
|
|
void | modifyLightingCode (QStringList *_code, ShaderModifier *_modifier) |
| Calls lighting modifier for each light.
|
|
void | addTexGenCode (QStringList *_code, bool _fragmentShader) |
| Add texture coordinate generation code.
|
|
int | checkForIncludes (QString _str, ShaderGenerator *_gen, QString _includePath) |
|
int | checkForIncludes (QString _str, QStringList *_outImport, QString _includePath) |
|
void | initGenDefines (ShaderGenerator *_gen) |
| provide generated defines to shader
|
|
|
static QString | getPathName (QString _strFileName) |
| returns path to _strFileName without last slash
|
|
static void | loadLightingFunctions () |
|
ShaderProgGenerator is responsible for generating a matching pair of vertex and fragment shaders.
Definition at line 1189 of file ShaderGenerator.hh.
◆ ShaderProgGenerator() [1/7]
ACG::ShaderProgGenerator::ShaderProgGenerator |
( |
const ShaderGenDesc * |
_desc | ) |
|
|
explicit |
◆ ShaderProgGenerator() [2/7]
ACG::ShaderProgGenerator::ShaderProgGenerator |
( |
const ShaderGenDesc * |
_desc, |
|
|
const std::vector< unsigned int > & |
_modifierIDs |
|
) |
| |
- Parameters
-
_desc | description-set of shader properties. |
_modifierIDs | array of modifier-IDs that should be used for the generation. |
Definition at line 838 of file ShaderGenerator.cc.
◆ ShaderProgGenerator() [3/7]
ACG::ShaderProgGenerator::ShaderProgGenerator |
( |
const ShaderGenDesc * |
_desc, |
|
|
const std::vector< unsigned int > * |
_modifierIDs |
|
) |
| |
- Parameters
-
_desc | description-set of shader properties. |
_modifierIDs | array of modifier-IDs that should be used for the generation. |
Definition at line 844 of file ShaderGenerator.cc.
◆ ShaderProgGenerator() [4/7]
ACG::ShaderProgGenerator::ShaderProgGenerator |
( |
const ShaderGenDesc * |
_desc, |
|
|
const unsigned int * |
_modifierIDs, |
|
|
unsigned int |
_numModifiers |
|
) |
| |
- Parameters
-
_desc | description-set of shader properties. |
_modifierIDs | array of modifier-IDs that should be used for the generation. |
_numModifiers | number of modifiers in _modifierIDs |
Definition at line 832 of file ShaderGenerator.cc.
◆ ShaderProgGenerator() [5/7]
ACG::ShaderProgGenerator::ShaderProgGenerator |
( |
const ShaderGenDesc * |
_desc, |
|
|
ShaderModifier *const * |
_modifiers, |
|
|
unsigned int |
_numModifiers |
|
) |
| |
- Parameters
-
_desc | description-set of shader properties. |
_modifiers | array of modifiers that should be used for the generation. |
_numModifiers | number of modifiers in _modifierIDs |
Definition at line 851 of file ShaderGenerator.cc.
◆ ShaderProgGenerator() [6/7]
- Parameters
-
_desc | description-set of shader properties. |
_modifiers | array of modifiers that should be used for the generation. |
Definition at line 857 of file ShaderGenerator.cc.
◆ ShaderProgGenerator() [7/7]
- Parameters
-
_desc | description-set of shader properties. |
_modifiers | array of modifiers that should be used for the generation. |
Definition at line 863 of file ShaderGenerator.cc.
◆ addLightingFunctions()
void ACG::ShaderProgGenerator::addLightingFunctions |
( |
QStringList * |
_code | ) |
|
|
private |
◆ checkForIncludes() [1/2]
int ACG::ShaderProgGenerator::checkForIncludes |
( |
QString |
_str, |
|
|
ShaderGenerator * |
_gen, |
|
|
QString |
_includePath |
|
) |
| |
|
private |
checks if _str is an include directive eventually imports the included file to the specified generator
Definition at line 1252 of file ShaderGenerator.cc.
◆ checkForIncludes() [2/2]
int ACG::ShaderProgGenerator::checkForIncludes |
( |
QString |
_str, |
|
|
QStringList * |
_outImport, |
|
|
QString |
_includePath |
|
) |
| |
|
private |
checks if _str is an include directive eventually imports the included file to the specified stringlist
Definition at line 1273 of file ShaderGenerator.cc.
◆ getAbsFilePath()
QString ACG::ShaderProgGenerator::getAbsFilePath |
( |
QString |
_fileName | ) |
|
|
static |
Convert a filename to an absolute filename.
- Parameters
-
_fileName | relative (from shader dir) or absolute file name |
Definition at line 2435 of file ShaderGenerator.cc.
◆ getShaderDir()
QString ACG::ShaderProgGenerator::getShaderDir |
( |
| ) |
|
|
static |
Return shader directory path as previosly specified by user
Definition at line 2451 of file ShaderGenerator.cc.
◆ loadStringListFromFile()
bool ACG::ShaderProgGenerator::loadStringListFromFile |
( |
QString |
_fileName, |
|
|
QStringList * |
_out |
|
) |
| |
|
static |
Load a text file as string list.
- Parameters
-
_fileName | relative (from shader dir) or absolute file name |
_out | lines from text file |
- Returns
- true on success, false otherwise
Definition at line 963 of file ShaderGenerator.cc.
◆ registerModifier()
unsigned int ACG::ShaderProgGenerator::registerModifier |
( |
ShaderModifier * |
_modifier | ) |
|
|
static |
Shader modifiers have to be registered before they can be used. They also must remain allocated for the rest of the applications runtime. Use a combination of modifier-IDs in the constructor of ShaderProgGen to active them.
- Parameters
-
_modifier | address of a modifier implementation |
- Returns
- modifier ID
Definition at line 2457 of file ShaderGenerator.cc.
◆ setShaderDir()
void ACG::ShaderProgGenerator::setShaderDir |
( |
QString |
_dir | ) |
|
|
static |
The shader directory has to be defined first before making use of the generator! For example: setShaderDir(OpenFlipper::Options::shaderDirStr())
Definition at line 2446 of file ShaderGenerator.cc.
The documentation for this class was generated from the following files: