This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofShader Class Reference
#include <ofShader.h>
Classes | |
struct | TransformFeedbackBaseBinding |
struct | TransformFeedbackRangeBinding |
struct | TransformFeedbackSettings |
Public Types | |
enum | defaultAttributes { POSITION_ATTRIBUTE =0 , COLOR_ATTRIBUTE , NORMAL_ATTRIBUTE , TEXCOORD_ATTRIBUTE , INDEX_ATTRIBUTE } |
Public Member Functions | |
ofShader () | |
~ofShader () | |
ofShader (const ofShader &shader) | |
ofShader & | operator= (const ofShader &shader) |
ofShader (ofShader &&shader) | |
ofShader & | operator= (ofShader &&shader) |
bool | load (const of::filesystem::path &shaderName) |
bool | load (const of::filesystem::path &vertName, const of::filesystem::path &fragName, const of::filesystem::path &geomName="") |
bool | setup (const ofShaderSettings &settings) |
bool | setup (const TransformFeedbackSettings &settings) |
void | setGeometryInputType (GLenum type) |
void | setGeometryOutputType (GLenum type) |
void | setGeometryOutputCount (int count) |
int | getGeometryMaxOutputCount () const |
void | unload () |
bool | isLoaded () const |
void | begin () const |
void | end () const |
void | beginTransformFeedback (GLenum mode) const |
void | beginTransformFeedback (GLenum mode, const TransformFeedbackRangeBinding &binding) const |
void | beginTransformFeedback (GLenum mode, const std::vector< TransformFeedbackRangeBinding > &binding) const |
void | beginTransformFeedback (GLenum mode, const TransformFeedbackBaseBinding &binding) const |
void | beginTransformFeedback (GLenum mode, const std::vector< TransformFeedbackBaseBinding > &binding) const |
void | endTransformFeedback () const |
void | endTransformFeedback (const TransformFeedbackRangeBinding &binding) const |
void | endTransformFeedback (const std::vector< TransformFeedbackRangeBinding > &binding) const |
void | endTransformFeedback (const TransformFeedbackBaseBinding &binding) const |
void | endTransformFeedback (const std::vector< TransformFeedbackBaseBinding > &binding) const |
void | setUniformTexture (const std::string &name, const ofBaseHasTexture &img, int textureLocation) const |
void | setUniformTexture (const std::string &name, const ofTexture &img, int textureLocation) const |
void | setUniformTexture (const std::string &name, int textureTarget, GLint textureID, int textureLocation) const |
void | setUniform1i (const std::string &name, int v1) const |
void | setUniform2i (const std::string &name, int v1, int v2) const |
void | setUniform3i (const std::string &name, int v1, int v2, int v3) const |
void | setUniform4i (const std::string &name, int v1, int v2, int v3, int v4) const |
void | setUniform1f (const std::string &name, float v1) const |
void | setUniform2f (const std::string &name, float v1, float v2) const |
void | setUniform3f (const std::string &name, float v1, float v2, float v3) const |
void | setUniform4f (const std::string &name, float v1, float v2, float v3, float v4) const |
void | setUniform2f (const std::string &name, const glm::vec2 &v) const |
void | setUniform3f (const std::string &name, const glm::vec3 &v) const |
void | setUniform4f (const std::string &name, const glm::vec4 &v) const |
void | setUniform4f (const std::string &name, const ofFloatColor &v) const |
void | setUniform1iv (const std::string &name, const int *v, int count=1) const |
void | setUniform2iv (const std::string &name, const int *v, int count=1) const |
void | setUniform3iv (const std::string &name, const int *v, int count=1) const |
void | setUniform4iv (const std::string &name, const int *v, int count=1) const |
void | setUniform1fv (const std::string &name, const float *v, int count=1) const |
void | setUniform2fv (const std::string &name, const float *v, int count=1) const |
void | setUniform3fv (const std::string &name, const float *v, int count=1) const |
void | setUniform4fv (const std::string &name, const float *v, int count=1) const |
void | setUniforms (const ofParameterGroup ¶meters) const |
void | setUniformMatrix3f (const std::string &name, const glm::mat3 &m, int count=1) const |
void | setUniformMatrix4f (const std::string &name, const glm::mat4 &m, int count=1) const |
GLint | getUniformLocation (const std::string &name) const |
GLint | getAttributeLocation (const std::string &name) const |
void | setAttribute1s (GLint location, short v1) const |
void | setAttribute2s (GLint location, short v1, short v2) const |
void | setAttribute3s (GLint location, short v1, short v2, short v3) const |
void | setAttribute4s (GLint location, short v1, short v2, short v3, short v4) const |
void | setAttribute1f (GLint location, float v1) const |
void | setAttribute2f (GLint location, float v1, float v2) const |
void | setAttribute3f (GLint location, float v1, float v2, float v3) const |
void | setAttribute4f (GLint location, float v1, float v2, float v3, float v4) const |
void | setAttribute1d (GLint location, double v1) const |
void | setAttribute2d (GLint location, double v1, double v2) const |
void | setAttribute3d (GLint location, double v1, double v2, double v3) const |
void | setAttribute4d (GLint location, double v1, double v2, double v3, double v4) const |
void | setAttribute1fv (const std::string &name, const float *v, GLsizei stride=sizeof(float)) const |
void | setAttribute2fv (const std::string &name, const float *v, GLsizei stride=sizeof(float) *2) const |
void | setAttribute3fv (const std::string &name, const float *v, GLsizei stride=sizeof(float) *3) const |
void | setAttribute4fv (const std::string &name, const float *v, GLsizei stride=sizeof(float) *4) const |
void | bindAttribute (GLuint location, const std::string &name) const |
void | printActiveUniforms () const |
void | printActiveAttributes () const |
bool | setShadowUniforms (int textureLocation) const |
bool | setPbrEnvironmentMapUniforms (int textureLocation) const |
bool | setupShaderFromSource (GLenum type, std::string source, std::string sourceDirectoryPath="") |
bool | setupShaderFromFile (GLenum type, const of::filesystem::path &filename) |
bool | linkProgram () |
bool | bindDefaults () |
GLuint | getProgram () const |
GLuint | getShader (GLenum type) const |
bool | operator== (const ofShader &other) const |
bool | operator!= (const ofShader &other) const |
std::string | getShaderSource (GLenum type) const |
returns the shader source as it was passed to the GLSL compiler | |
Member Enumeration Documentation
◆ defaultAttributes
Constructor & Destructor Documentation
◆ ofShader() [1/3]
ofShader::ofShader | ( | ) |
◆ ~ofShader()
ofShader::~ofShader | ( | ) |
◆ ofShader() [2/3]
ofShader::ofShader | ( | const ofShader & | shader | ) |
◆ ofShader() [3/3]
ofShader::ofShader | ( | ofShader && | shader | ) |
Member Function Documentation
◆ begin()
void ofShader::begin | ( | ) | const |
◆ beginTransformFeedback() [1/5]
void ofShader::beginTransformFeedback | ( | GLenum | mode | ) | const |
◆ beginTransformFeedback() [2/5]
void ofShader::beginTransformFeedback | ( | GLenum | mode, |
const std::vector< TransformFeedbackBaseBinding > & | binding | ||
) | const |
◆ beginTransformFeedback() [3/5]
void ofShader::beginTransformFeedback | ( | GLenum | mode, |
const std::vector< TransformFeedbackRangeBinding > & | binding | ||
) | const |
◆ beginTransformFeedback() [4/5]
void ofShader::beginTransformFeedback | ( | GLenum | mode, |
const TransformFeedbackBaseBinding & | binding | ||
) | const |
◆ beginTransformFeedback() [5/5]
void ofShader::beginTransformFeedback | ( | GLenum | mode, |
const TransformFeedbackRangeBinding & | binding | ||
) | const |
◆ bindAttribute()
void ofShader::bindAttribute | ( | GLuint | location, |
const std::string & | name | ||
) | const |
◆ bindDefaults()
bool ofShader::bindDefaults | ( | ) |
◆ end()
void ofShader::end | ( | ) | const |
◆ endTransformFeedback() [1/5]
void ofShader::endTransformFeedback | ( | ) | const |
◆ endTransformFeedback() [2/5]
void ofShader::endTransformFeedback | ( | const std::vector< TransformFeedbackBaseBinding > & | binding | ) | const |
◆ endTransformFeedback() [3/5]
void ofShader::endTransformFeedback | ( | const std::vector< TransformFeedbackRangeBinding > & | binding | ) | const |
◆ endTransformFeedback() [4/5]
void ofShader::endTransformFeedback | ( | const TransformFeedbackBaseBinding & | binding | ) | const |
◆ endTransformFeedback() [5/5]
void ofShader::endTransformFeedback | ( | const TransformFeedbackRangeBinding & | binding | ) | const |
◆ getAttributeLocation()
GLint ofShader::getAttributeLocation | ( | const std::string & | name | ) | const |
◆ getGeometryMaxOutputCount()
int ofShader::getGeometryMaxOutputCount | ( | ) | const |
◆ getProgram()
GLuint ofShader::getProgram | ( | ) | const |
◆ getShader()
GLuint ofShader::getShader | ( | GLenum | type | ) | const |
◆ getShaderSource()
string ofShader::getShaderSource | ( | GLenum | type | ) | const |
returns the shader source as it was passed to the GLSL compiler
- Parameters
-
type (GL_VERTEX_SHADER | GL_FRAGMENT_SHADER | GL_GEOMETRY_SHADER_EXT) the shader source you'd like to inspect.
◆ getUniformLocation()
GLint ofShader::getUniformLocation | ( | const std::string & | name | ) | const |
◆ isLoaded()
bool ofShader::isLoaded | ( | ) | const |
◆ linkProgram()
bool ofShader::linkProgram | ( | ) |
◆ load() [1/2]
bool ofShader::load | ( | const of::filesystem::path & | shaderName | ) |
◆ load() [2/2]
bool ofShader::load | ( | const of::filesystem::path & | vertName, |
const of::filesystem::path & | fragName, | ||
const of::filesystem::path & | geomName = "" |
||
) |
◆ operator!=()
bool ofShader::operator!= | ( | const ofShader & | other | ) | const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool ofShader::operator== | ( | const ofShader & | other | ) | const |
◆ printActiveAttributes()
void ofShader::printActiveAttributes | ( | ) | const |
◆ printActiveUniforms()
void ofShader::printActiveUniforms | ( | ) | const |
◆ setAttribute1d()
void ofShader::setAttribute1d | ( | GLint | location, |
double | v1 | ||
) | const |
◆ setAttribute1f()
void ofShader::setAttribute1f | ( | GLint | location, |
float | v1 | ||
) | const |
◆ setAttribute1fv()
void ofShader::setAttribute1fv | ( | const std::string & | name, |
const float * | v, | ||
GLsizei | stride = sizeof(float) |
||
) | const |
◆ setAttribute1s()
void ofShader::setAttribute1s | ( | GLint | location, |
short | v1 | ||
) | const |
◆ setAttribute2d()
void ofShader::setAttribute2d | ( | GLint | location, |
double | v1, | ||
double | v2 | ||
) | const |
◆ setAttribute2f()
void ofShader::setAttribute2f | ( | GLint | location, |
float | v1, | ||
float | v2 | ||
) | const |
◆ setAttribute2fv()
void ofShader::setAttribute2fv | ( | const std::string & | name, |
const float * | v, | ||
GLsizei | stride = sizeof(float)*2 |
||
) | const |
◆ setAttribute2s()
void ofShader::setAttribute2s | ( | GLint | location, |
short | v1, | ||
short | v2 | ||
) | const |
◆ setAttribute3d()
void ofShader::setAttribute3d | ( | GLint | location, |
double | v1, | ||
double | v2, | ||
double | v3 | ||
) | const |
◆ setAttribute3f()
void ofShader::setAttribute3f | ( | GLint | location, |
float | v1, | ||
float | v2, | ||
float | v3 | ||
) | const |
◆ setAttribute3fv()
void ofShader::setAttribute3fv | ( | const std::string & | name, |
const float * | v, | ||
GLsizei | stride = sizeof(float)*3 |
||
) | const |
◆ setAttribute3s()
void ofShader::setAttribute3s | ( | GLint | location, |
short | v1, | ||
short | v2, | ||
short | v3 | ||
) | const |
◆ setAttribute4d()
void ofShader::setAttribute4d | ( | GLint | location, |
double | v1, | ||
double | v2, | ||
double | v3, | ||
double | v4 | ||
) | const |
◆ setAttribute4f()
void ofShader::setAttribute4f | ( | GLint | location, |
float | v1, | ||
float | v2, | ||
float | v3, | ||
float | v4 | ||
) | const |
◆ setAttribute4fv()
void ofShader::setAttribute4fv | ( | const std::string & | name, |
const float * | v, | ||
GLsizei | stride = sizeof(float)*4 |
||
) | const |
◆ setAttribute4s()
void ofShader::setAttribute4s | ( | GLint | location, |
short | v1, | ||
short | v2, | ||
short | v3, | ||
short | v4 | ||
) | const |
◆ setGeometryInputType()
void ofShader::setGeometryInputType | ( | GLenum | type | ) |
◆ setGeometryOutputCount()
void ofShader::setGeometryOutputCount | ( | int | count | ) |
◆ setGeometryOutputType()
void ofShader::setGeometryOutputType | ( | GLenum | type | ) |
◆ setPbrEnvironmentMapUniforms()
bool ofShader::setPbrEnvironmentMapUniforms | ( | int | textureLocation | ) | const |
◆ setShadowUniforms()
bool ofShader::setShadowUniforms | ( | int | textureLocation | ) | const |
◆ setUniform1f()
void ofShader::setUniform1f | ( | const std::string & | name, |
float | v1 | ||
) | const |
◆ setUniform1fv()
void ofShader::setUniform1fv | ( | const std::string & | name, |
const float * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform1i()
void ofShader::setUniform1i | ( | const std::string & | name, |
int | v1 | ||
) | const |
◆ setUniform1iv()
void ofShader::setUniform1iv | ( | const std::string & | name, |
const int * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform2f() [1/2]
void ofShader::setUniform2f | ( | const std::string & | name, |
const glm::vec2 & | v | ||
) | const |
◆ setUniform2f() [2/2]
void ofShader::setUniform2f | ( | const std::string & | name, |
float | v1, | ||
float | v2 | ||
) | const |
◆ setUniform2fv()
void ofShader::setUniform2fv | ( | const std::string & | name, |
const float * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform2i()
void ofShader::setUniform2i | ( | const std::string & | name, |
int | v1, | ||
int | v2 | ||
) | const |
◆ setUniform2iv()
void ofShader::setUniform2iv | ( | const std::string & | name, |
const int * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform3f() [1/2]
void ofShader::setUniform3f | ( | const std::string & | name, |
const glm::vec3 & | v | ||
) | const |
◆ setUniform3f() [2/2]
void ofShader::setUniform3f | ( | const std::string & | name, |
float | v1, | ||
float | v2, | ||
float | v3 | ||
) | const |
◆ setUniform3fv()
void ofShader::setUniform3fv | ( | const std::string & | name, |
const float * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform3i()
void ofShader::setUniform3i | ( | const std::string & | name, |
int | v1, | ||
int | v2, | ||
int | v3 | ||
) | const |
◆ setUniform3iv()
void ofShader::setUniform3iv | ( | const std::string & | name, |
const int * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform4f() [1/3]
void ofShader::setUniform4f | ( | const std::string & | name, |
const glm::vec4 & | v | ||
) | const |
◆ setUniform4f() [2/3]
void ofShader::setUniform4f | ( | const std::string & | name, |
const ofFloatColor & | v | ||
) | const |
◆ setUniform4f() [3/3]
void ofShader::setUniform4f | ( | const std::string & | name, |
float | v1, | ||
float | v2, | ||
float | v3, | ||
float | v4 | ||
) | const |
◆ setUniform4fv()
void ofShader::setUniform4fv | ( | const std::string & | name, |
const float * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniform4i()
void ofShader::setUniform4i | ( | const std::string & | name, |
int | v1, | ||
int | v2, | ||
int | v3, | ||
int | v4 | ||
) | const |
◆ setUniform4iv()
void ofShader::setUniform4iv | ( | const std::string & | name, |
const int * | v, | ||
int | count = 1 |
||
) | const |
◆ setUniformMatrix3f()
void ofShader::setUniformMatrix3f | ( | const std::string & | name, |
const glm::mat3 & | m, | ||
int | count = 1 |
||
) | const |
◆ setUniformMatrix4f()
void ofShader::setUniformMatrix4f | ( | const std::string & | name, |
const glm::mat4 & | m, | ||
int | count = 1 |
||
) | const |
◆ setUniforms()
void ofShader::setUniforms | ( | const ofParameterGroup & | parameters | ) | const |
◆ setUniformTexture() [1/3]
void ofShader::setUniformTexture | ( | const std::string & | name, |
const ofBaseHasTexture & | img, | ||
int | textureLocation | ||
) | const |
◆ setUniformTexture() [2/3]
void ofShader::setUniformTexture | ( | const std::string & | name, |
const ofTexture & | img, | ||
int | textureLocation | ||
) | const |
◆ setUniformTexture() [3/3]
void ofShader::setUniformTexture | ( | const std::string & | name, |
int | textureTarget, | ||
GLint | textureID, | ||
int | textureLocation | ||
) | const |
◆ setup() [1/2]
bool ofShader::setup | ( | const ofShaderSettings & | settings | ) |
◆ setup() [2/2]
bool ofShader::setup | ( | const TransformFeedbackSettings & | settings | ) |
◆ setupShaderFromFile()
bool ofShader::setupShaderFromFile | ( | GLenum | type, |
const of::filesystem::path & | filename | ||
) |
◆ setupShaderFromSource()
bool ofShader::setupShaderFromSource | ( | GLenum | type, |
std::string | source, | ||
std::string | sourceDirectoryPath = "" |
||
) |
◆ unload()
void ofShader::unload | ( | ) |
The documentation for this class was generated from the following files:
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/gl/ofShader.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/gl/ofShader.cpp