Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders. More...
#include <GLSL.hpp>
Public Member Functions | |
GLSLProgram () | |
Constructor. More... | |
~GLSLProgram () | |
Destructor. Calls deleteProgram(). More... | |
virtual ERenderState | type () const |
virtual ref< RenderState > | clone () const |
bool | reload () |
Reloads all the shaders source and recompiles them and relinks. Returns true on success. More... | |
void | createProgram () |
Calls glCreateProgram() in order to acquire a GLSL program handle, see also http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgram.xml for more information. More... | |
void | deleteProgram () |
Deletes the GLSL program calling glDeleteProgram(handle()), see also http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgram.xml for more information. More... | |
unsigned int | handle () const |
The handle of the GLSL program as returned by glCreateProgram() More... | |
void | apply (int index, const Camera *, OpenGLContext *ctx) const |
Calls OpenGLContext::useGLSLProgram() More... | |
bool | linkProgram (bool force_relink=false) |
Links the GLSLProgram calling glLinkProgram(handle()) only if the program needs to be linked. More... | |
bool | linkStatus () const |
bool | linked () const |
Returns true if the program has been succesfully linked. More... | |
void | scheduleRelinking () |
Schedules a relink of the GLSL program. More... | |
bool | attachShader (GLSLShader *shader) |
Attaches the GLSLShader to this GLSLProgram. More... | |
bool | detachShader (GLSLShader *shader) |
Detaches a GLSLShader from the GLSLShader (note: it does NOT schedule a relink of the program), see also http://www.opengl.org/sdk/docs/man/xhtml/glDetachShader.xml for more information. More... | |
void | discardAllShaders () |
Detaches all the shaders and deletes them (note that the GLSL Program remains still valid). More... | |
String | infoLog () const |
Returns the info log of this GLSL program using the OpenGL function glGetProgramInfoLog(), see also http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml for more information. More... | |
bool | validateProgram () const |
Returns true if the validation of this GLSL program is succesful, see also http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml for more information. More... | |
void | bindAttribLocation (unsigned int index, const char *name) |
Equivalent to glBindAttribLocation(handle(), index, name.c_str()) with the difference that this function will automatically create a GLSL program if none is present and it will schedule a re-link since the new specified bindings take effect after linking the GLSL program. More... | |
int | getAttribLocation (const char *name) const |
Eqivalento to glGetAttribLocation(handle(), name). More... | |
int | shaderCount () const |
Returns the number of GLSLShader objects bound to this GLSLProgram. More... | |
const GLSLShader * | shader (int i) const |
Returns the i-th GLSLShader objects bound to this GLSLProgram. More... | |
GLSLShader * | shader (int i) |
Returns the i-th GLSLShader objects bound to this GLSLProgram. More... | |
void | detachAllShaders () |
Removes all the previously linked shaders and schedules a relinking. More... | |
void | bindFragDataLocation (int color_number, const char *name) |
void | unbindFragDataLocation (const char *name) |
int | fragDataLocation (const char *name) const |
const std::map< std::string, int > & | fragDataLocations () const |
void | setProgramBinaryRetrievableHint (bool hint) |
Indicate to the implementation the intention of the application to retrieve the program's binary representation with glGetProgramBinary. More... | |
bool | programBinaryRetrievableHint () const |
Indicate to the implementation the intention of the application to retrieve the program's binary representation with glGetProgramBinary. More... | |
void | setProgramSeparable (bool separable) |
Indicates whether program can be bound to individual pipeline stages via glUseProgramStages, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml. More... | |
bool | programSeparable () const |
Indicates whether program can be bound to individual pipeline stages via glUseProgramStages, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml. More... | |
bool | getProgramBinary (GLenum &binary_format, std::vector< unsigned char > &binary) const |
glGetProgramBinary wrapper: returns a binary representation of a program object's compiled and linked executable source, see also http://www.opengl.org/sdk/docs/man4/xhtml/glGetProgramBinary.xml More... | |
bool | programBinary (GLenum binary_format, const std::vector< unsigned char > &binary) |
glProgramBinary wrapper: loads a program object with a program binary, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramBinary.xml More... | |
bool | programBinary (GLenum binary_format, const void *binary, int length) |
glProgramBinary wrapper: loads a program object with a program binary, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramBinary.xml More... | |
bool | applyUniformSet (const UniformSet *uniforms=NULL) const |
Applies a set of uniforms to the currently bound GLSL program. More... | |
int | getUniformLocation (const char *name) const |
Returns the binding index of the given uniform. More... | |
void | getUniformfv (int location, float *params) const |
Equivalent to glGetUniformfv(handle(), location, params) More... | |
void | getUniformfv (const char *name, float *params) const |
Equivalent to getUniformfv(getUniformLocation(name), params) More... | |
void | getUniformiv (int location, int *params) const |
Equivalent to glGetUniformiv(handle(), location, params) More... | |
void | getUniformiv (const char *name, int *params) const |
Equivalent to getUniformiv(getUniformLocation(name) More... | |
void | getUniform (int location, fvec2 &vec) const |
void | getUniform (int location, fvec3 &vec) const |
void | getUniform (int location, fvec4 &vec) const |
void | getUniform (int location, fmat2 &mat) const |
void | getUniform (int location, fmat3 &mat) const |
void | getUniform (int location, fmat4 &mat) const |
void | getUniform (int location, ivec2 &vec) const |
void | getUniform (int location, ivec3 &vec) const |
void | getUniform (int location, ivec4 &vec) const |
void | getUniform (const char *name, fvec2 &vec) const |
void | getUniform (const char *name, fvec3 &vec) const |
void | getUniform (const char *name, fvec4 &vec) const |
void | getUniform (const char *name, fmat2 &mat) const |
void | getUniform (const char *name, fmat3 &mat) const |
void | getUniform (const char *name, fmat4 &mat) const |
void | getUniform (const char *name, ivec2 &vec) const |
void | getUniform (const char *name, ivec3 &vec) const |
void | getUniform (const char *name, ivec4 &vec) const |
UniformSet * | getUniformSet () |
Returns a GLSLProgram's static UniformSet. Static uniforms are those uniforms whose value is constant across one rendering as opposed to Shader uniforms that change across Shaders and Actor uniforms that change across Actors. More... | |
const UniformSet * | getUniformSet () const |
Returns a GLSLProgram's static UniformSet. Static uniforms are those uniforms whose value is constant across one rendering as opposed to Shader uniforms that change across Shaders and Actor uniforms that change across Actors. More... | |
void | setUniformSet (UniformSet *uniforms) |
Sets a GLSLProgram's static UniformSet. More... | |
void | setUniform (Uniform *uniform) |
Utility function using getUniformSet(). Adds a Uniform to this program's static uniform set. More... | |
Uniform * | getUniform (const char *name) |
Utility function using getUniformSet(). Returns the specified Uniform. Returns NULL if there isn't such a Uniform. More... | |
Uniform * | gocUniform (const char *name) |
Utility function using getUniformSet(). Gets or creates the specified Uniform. More... | |
void | eraseUniform (const char *name) |
Utility function using getUniformSet(). Erases the specified uniform. More... | |
void | eraseUniform (const Uniform *uniform) |
Utility function using getUniformSet(). Erases the specified uniform. More... | |
void | eraseAllUniforms () |
Utility function using getUniformSet(). Erases all the uniforms. More... | |
int | vl_WorldMatrix () const |
Returns the binding location of the vl_WorldMatrix uniform variable or -1 if no such variable is used by the GLSLProgram. More... | |
int | vl_ModelViewMatrix () const |
Returns the binding location of the vl_ModelViewMatrix uniform variable or -1 if no such variable is used by the GLSLProgram. More... | |
int | vl_ProjectionMatrix () const |
Returns the binding location of the vl_ProjectionMatrix uniform variable or -1 if no such variable is used by the GLSLProgram. More... | |
int | vl_ModelViewProjectionMatrix () const |
Returns the binding location of the vl_ModelViewProjectionMatrix uniform variable or -1 if no such variable is used by the GLSLProgram. More... | |
int | vl_NormalMatrix () const |
Returns the binding location of the vl_NormalMatrix uniform variable or -1 if no such variable is used by the GLSLProgram vl_NormalMatrix is simply transpose( inverse( vl_ModelViewMatrix ) ) which usually allows to transform normals without having to renormalized them one by one by undoing the scaling that might be present in vl_ModelViewMatrix. More... | |
int | vl_VertexPosition () const |
int | vl_VertexNormal () const |
int | vl_VertexColor () const |
int | vl_VertexSecondaryColor () const |
int | vl_VertexFogCoord () const |
int | vl_VertexTexCoord0 () const |
int | vl_VertexTexCoord1 () const |
int | vl_VertexTexCoord2 () const |
int | vl_VertexTexCoord3 () const |
int | vl_VertexTexCoord4 () const |
int | vl_VertexTexCoord5 () const |
int | vl_VertexTexCoord6 () const |
int | vl_VertexTexCoord7 () const |
int | vl_VertexTexCoord8 () const |
int | vl_VertexTexCoord9 () const |
int | vl_VertexTexCoord10 () const |
Public Member Functions inherited from vl::RenderStateNonIndexed | |
RenderStateNonIndexed () | |
Public Member Functions inherited from vl::RenderState | |
RenderState () | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
std::vector< ref< GLSLShader > > | mShaders |
std::map< std::string, int > | mFragDataLocation |
ref< UniformSet > | mUniformSet |
unsigned int | mHandle |
bool | mScheduleLink |
bool | mProgramBinaryRetrievableHint |
bool | mProgramSeparable |
int | m_vl_WorldMatrix |
int | m_vl_ModelViewMatrix |
int | m_vl_ProjectionMatrix |
int | m_vl_ModelViewProjectionMatrix |
int | m_vl_NormalMatrix |
int | m_vl_VertexPosition |
int | m_vl_VertexNormal |
int | m_vl_VertexColor |
int | m_vl_VertexSecondaryColor |
int | m_vl_VertexFogCoord |
int | m_vl_VertexTexCoord0 |
int | m_vl_VertexTexCoord1 |
int | m_vl_VertexTexCoord2 |
int | m_vl_VertexTexCoord3 |
int | m_vl_VertexTexCoord4 |
int | m_vl_VertexTexCoord5 |
int | m_vl_VertexTexCoord6 |
int | m_vl_VertexTexCoord7 |
int | m_vl_VertexTexCoord8 |
int | m_vl_VertexTexCoord9 |
int | m_vl_VertexTexCoord10 |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Friends | |
class | Renderer |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders.
Note that for option #1 and #2 you need to relink the GLSLProgram in order for the changes to take effect (linkProgram(force_relink=true)). Option #2 and #3 automatically schedule a re-link of the GLSL program. See also http://www.opengl.org/sdk/docs/man/xhtml/glBindAttribLocation.xml
GLSLProgram::GLSLProgram | ( | ) |
GLSLProgram::~GLSLProgram | ( | ) |
Destructor. Calls deleteProgram().
Definition at line 291 of file GLSL.cpp.
References vl::GLSLShader::handle().
|
virtual |
Calls OpenGLContext::useGLSLProgram()
Implements vl::RenderState.
Definition at line 643 of file GLSL.cpp.
References vl::Has_GLSL, vl::OpenGLContext::useGLSLProgram(), and VL_CHECK_OGL.
bool GLSLProgram::applyUniformSet | ( | const UniformSet * | uniforms = NULL | ) | const |
Applies a set of uniforms to the currently bound GLSL program.
This function expects the GLSLProgram to be already bound, see OpenGLContext::useGLSLProgram().
uniforms | If NULL uses GLSLProgram::getUniformSet() |
Definition at line 652 of file GLSL.cpp.
References vl::Log::bug(), vl::Uniform::count(), vl::Uniform::doubleData(), vl::Uniform::floatData(), vl::GLSLShader::handle(), vl::Has_GLSL, vl::Uniform::intData(), vl::Uniform::mType, vl::Uniform::name(), vl::Uniform::uintData(), vl::UniformSet::uniforms(), vl::UT_DOUBLE, vl::UT_DOUBLE_MAT2, vl::UT_DOUBLE_MAT2x3, vl::UT_DOUBLE_MAT2x4, vl::UT_DOUBLE_MAT3, vl::UT_DOUBLE_MAT3x2, vl::UT_DOUBLE_MAT3x4, vl::UT_DOUBLE_MAT4, vl::UT_DOUBLE_MAT4x2, vl::UT_DOUBLE_MAT4x3, vl::UT_DOUBLE_VEC2, vl::UT_DOUBLE_VEC3, vl::UT_DOUBLE_VEC4, vl::UT_FLOAT, vl::UT_FLOAT_MAT2, vl::UT_FLOAT_MAT2x3, vl::UT_FLOAT_MAT2x4, vl::UT_FLOAT_MAT3, vl::UT_FLOAT_MAT3x2, vl::UT_FLOAT_MAT3x4, vl::UT_FLOAT_MAT4, vl::UT_FLOAT_MAT4x2, vl::UT_FLOAT_MAT4x3, vl::UT_FLOAT_VEC2, vl::UT_FLOAT_VEC3, vl::UT_FLOAT_VEC4, vl::UT_INT, vl::UT_INT_VEC2, vl::UT_INT_VEC3, vl::UT_INT_VEC4, vl::UT_NONE, vl::UT_UNSIGNED_INT, vl::UT_UNSIGNED_INT_VEC2, vl::UT_UNSIGNED_INT_VEC3, vl::UT_UNSIGNED_INT_VEC4, VL_CHECK, VL_CHECK_OGL, VL_TRAP, and vl::Log::warning().
Referenced by vl::Renderer::renderRaw().
bool GLSLProgram::attachShader | ( | GLSLShader * | shader | ) |
Attaches the GLSLShader to this GLSLProgram.
Definition at line 354 of file GLSL.cpp.
References vl::GLSLShader::compile(), vl::GLSLShader::createShader(), vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
Referenced by vlX::VLXClassWrapper_GLSLProgram::importGLSLProgram(), and vl::Terrain::init().
void GLSLProgram::bindAttribLocation | ( | unsigned int | index, |
const char * | name | ||
) |
Equivalent to glBindAttribLocation(handle(), index, name.c_str()) with the difference that this function will automatically create a GLSL program if none is present and it will schedule a re-link since the new specified bindings take effect after linking the GLSL program.
Definition at line 633 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
void GLSLProgram::bindFragDataLocation | ( | int | color_number, |
const char * | name | ||
) |
Definition at line 775 of file GLSL.cpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::importGLSLProgram().
|
inlinevirtual |
Implements vl::RenderState.
void GLSLProgram::createProgram | ( | ) |
Calls glCreateProgram() in order to acquire a GLSL program handle, see also http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgram.xml for more information.
Definition at line 324 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, vl::GLSLShader::mHandle, VL_CHECK, and VL_CHECK_OGL.
void GLSLProgram::deleteProgram | ( | ) |
Deletes the GLSL program calling glDeleteProgram(handle()), see also http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgram.xml for more information.
After this function handle() will return 0.
Definition at line 339 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, vl::GLSLShader::mHandle, and VL_CHECK.
void GLSLProgram::detachAllShaders | ( | ) |
Removes all the previously linked shaders and schedules a relinking.
Definition at line 386 of file GLSL.cpp.
References VL_CHECK_OGL.
bool GLSLProgram::detachShader | ( | GLSLShader * | shader | ) |
Detaches a GLSLShader from the GLSLShader (note: it does NOT schedule a relink of the program), see also http://www.opengl.org/sdk/docs/man/xhtml/glDetachShader.xml for more information.
Definition at line 394 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
void GLSLProgram::discardAllShaders | ( | ) |
Detaches all the shaders and deletes them (note that the GLSL Program remains still valid).
Use this function when your GLSL program compiled well, you don't want to re-link or re-compile it and you want to save some memory by discarding unnecessary shaders objects.
Definition at line 420 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
|
inline |
Utility function using getUniformSet(). Erases all the uniforms.
|
inline |
Utility function using getUniformSet(). Erases the specified uniform.
|
inline |
Utility function using getUniformSet(). Erases the specified uniform.
int GLSLProgram::fragDataLocation | ( | const char * | name | ) | const |
|
inline |
Definition at line 353 of file GLSL.hpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::exportGLSLProgram().
|
inline |
Eqivalento to glGetAttribLocation(handle(), name).
Definition at line 320 of file GLSL.hpp.
References vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::MorphingCallback::onActorRenderStarted().
bool GLSLProgram::getProgramBinary | ( | GLenum & | binary_format, |
std::vector< unsigned char > & | binary | ||
) | const |
glGetProgramBinary wrapper: returns a binary representation of a program object's compiled and linked executable source, see also http://www.opengl.org/sdk/docs/man4/xhtml/glGetProgramBinary.xml
Definition at line 796 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::length(), NULL, VL_CHECK, VL_CHECK_OGL, and VL_TRAP.
|
inline |
Definition at line 450 of file GLSL.hpp.
References vl::Vector2< T_Scalar >::ptr().
|
inline |
Definition at line 451 of file GLSL.hpp.
References vl::Vector3< T_Scalar >::ptr().
|
inline |
Definition at line 452 of file GLSL.hpp.
References vl::Vector4< T_Scalar >::ptr().
|
inline |
Definition at line 453 of file GLSL.hpp.
References vl::Matrix2< T_Scalar >::ptr().
|
inline |
Definition at line 454 of file GLSL.hpp.
References vl::Matrix3< T_Scalar >::ptr().
|
inline |
Definition at line 455 of file GLSL.hpp.
References vl::Matrix4< T_Scalar >::ptr().
|
inline |
Definition at line 456 of file GLSL.hpp.
References vl::Vector2< T_Scalar >::ptr().
|
inline |
Definition at line 457 of file GLSL.hpp.
References vl::Vector3< T_Scalar >::ptr().
|
inline |
Definition at line 458 of file GLSL.hpp.
References vl::Vector4< T_Scalar >::ptr().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Equivalent to glGetUniformfv(handle(), location, params)
Definition at line 424 of file GLSL.hpp.
References vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
|
inline |
Equivalent to getUniformfv(getUniformLocation(name), params)
Definition at line 434 of file GLSL.hpp.
References getUniformfv().
Referenced by getUniformfv().
|
inline |
Equivalent to glGetUniformiv(handle(), location, params)
Definition at line 436 of file GLSL.hpp.
References vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
|
inline |
Equivalent to getUniformiv(getUniformLocation(name)
Definition at line 446 of file GLSL.hpp.
References getUniformiv().
Referenced by getUniformiv().
|
inline |
Returns the binding index of the given uniform.
Definition at line 405 of file GLSL.hpp.
References vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::MorphingCallback::onActorRenderStarted(), vl::RaycastVolume::updateUniforms(), and vl::SlicedVolume::updateUniforms().
|
inline |
Returns a GLSLProgram's static
UniformSet. Static
uniforms are those uniforms whose value is constant across one rendering as opposed to Shader uniforms that change across Shaders and Actor uniforms that change across Actors.
Definition at line 470 of file GLSL.hpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::exportGLSLProgram(), and vl::Renderer::renderRaw().
|
inline |
Returns a GLSLProgram's static
UniformSet. Static
uniforms are those uniforms whose value is constant across one rendering as opposed to Shader uniforms that change across Shaders and Actor uniforms that change across Actors.
|
inline |
Utility function using getUniformSet(). Gets or creates the specified Uniform.
|
inline |
The handle of the GLSL program as returned by glCreateProgram()
Definition at line 273 of file GLSL.hpp.
Referenced by vl::Renderer::renderRaw(), and vl::OpenGLContext::useGLSLProgram().
String GLSLProgram::infoLog | ( | ) | const |
Returns the info log of this GLSL program using the OpenGL function glGetProgramInfoLog(), see also http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml for more information.
Definition at line 593 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, NULL, vl::Object::objectName(), VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::Renderer::renderRaw().
|
inline |
Returns true if the program has been succesfully linked.
Definition at line 288 of file GLSL.hpp.
Referenced by vl::Rendering::fillRenderQueue(), vl::Renderer::renderRaw(), and vl::OpenGLContext::useGLSLProgram().
bool GLSLProgram::linkProgram | ( | bool | force_relink = false | ) |
Links the GLSLProgram calling glLinkProgram(handle()) only if the program needs to be linked.
Definition at line 446 of file GLSL.cpp.
References vl::Log::bug(), vl::String::empty(), vl::GLSLShader::handle(), vl::Has_GL_Version_3_0, vl::Has_GL_Version_4_0, vl::Has_GLSL, vl::GLSLShader::infoLog(), vl::log(), vl::Object::objectName(), vl::VA_Color, vl::VA_FogCoord, vl::VA_Normal, vl::VA_Position, vl::VA_SecondaryColor, vl::VA_TexCoord0, vl::VA_TexCoord1, vl::VA_TexCoord10, vl::VA_TexCoord2, vl::VA_TexCoord3, vl::VA_TexCoord4, vl::VA_TexCoord5, vl::VA_TexCoord6, vl::VA_TexCoord7, vl::VA_TexCoord8, vl::VA_TexCoord9, VL_CHECK, VL_CHECK_OGL, VL_TRAP, and vl::Log::warning().
Referenced by vl::Rendering::fillRenderQueue().
bool GLSLProgram::linkStatus | ( | ) | const |
Definition at line 576 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
|
inline |
glProgramBinary wrapper: loads a program object with a program binary, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramBinary.xml
Definition at line 387 of file GLSL.hpp.
References vl::length(), NULL, and programBinary().
Referenced by programBinary().
bool GLSLProgram::programBinary | ( | GLenum | binary_format, |
const void * | binary, | ||
int | length | ||
) |
glProgramBinary wrapper: loads a program object with a program binary, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramBinary.xml
Definition at line 828 of file GLSL.cpp.
References vl::Log::bug(), vl::String::empty(), vl::GLSLShader::handle(), vl::GLSLShader::infoLog(), vl::log(), vl::Object::objectName(), VL_CHECK, VL_CHECK_OGL, VL_TRAP, and vl::Log::warning().
|
inline |
Indicate to the implementation the intention of the application to retrieve the program's binary representation with glGetProgramBinary.
The implementation may use this information to store information that may be useful for a future query of the program's binary. See http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml
|
inline |
Indicates whether program can be bound to individual pipeline stages via glUseProgramStages, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml.
bool GLSLProgram::reload | ( | ) |
|
inline |
|
inline |
Indicate to the implementation the intention of the application to retrieve the program's binary representation with glGetProgramBinary.
The implementation may use this information to store information that may be useful for a future query of the program's binary. See http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml
|
inline |
Indicates whether program can be bound to individual pipeline stages via glUseProgramStages, see also http://www.opengl.org/sdk/docs/man4/xhtml/glProgramParameter.xml.
|
inline |
Utility function using getUniformSet(). Adds a Uniform to this program's static
uniform set.
Definition at line 476 of file GLSL.hpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::importGLSLProgram(), and vl::Terrain::init().
|
inline |
Sets a GLSLProgram's static
UniformSet.
|
inline |
Returns the i-th GLSLShader objects bound to this GLSLProgram.
Definition at line 337 of file GLSL.hpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::exportGLSLProgram().
|
inline |
Returns the i-th GLSLShader objects bound to this GLSLProgram.
|
inline |
Returns the number of GLSLShader objects bound to this GLSLProgram.
Definition at line 334 of file GLSL.hpp.
Referenced by vlX::VLXClassWrapper_GLSLProgram::exportGLSLProgram(), and vl::OpenGLContext::useGLSLProgram().
|
inlinevirtual |
Reimplemented from vl::RenderState.
Definition at line 247 of file GLSL.hpp.
References vl::RS_GLSLProgram.
void GLSLProgram::unbindFragDataLocation | ( | const char * | name | ) |
bool GLSLProgram::validateProgram | ( | ) | const |
Returns true if the validation of this GLSL program is succesful, see also http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml for more information.
Definition at line 615 of file GLSL.cpp.
References vl::GLSLShader::handle(), vl::Has_GLSL, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::Renderer::renderRaw().
|
inline |
Returns the binding location of the vl_ModelViewMatrix uniform variable or -1 if no such variable is used by the GLSLProgram.
vl_ModelViewMatrix transforms a point from object space to camera space.
Definition at line 494 of file GLSL.hpp.
Referenced by vl::ProjViewTransfCallback::updateMatrices().
|
inline |
Returns the binding location of the vl_ModelViewProjectionMatrix uniform variable or -1 if no such variable is used by the GLSLProgram.
Definition at line 502 of file GLSL.hpp.
Referenced by vl::ProjViewTransfCallback::updateMatrices().
|
inline |
Returns the binding location of the vl_NormalMatrix uniform variable or -1 if no such variable is used by the GLSLProgram vl_NormalMatrix is simply transpose( inverse( vl_ModelViewMatrix ) ) which usually allows to transform normals without having to renormalized them one by one by undoing
the scaling that might be present in vl_ModelViewMatrix.
Definition at line 507 of file GLSL.hpp.
Referenced by vl::ProjViewTransfCallback::updateMatrices().
|
inline |
Returns the binding location of the vl_ProjectionMatrix uniform variable or -1 if no such variable is used by the GLSLProgram.
vl_ProjectionMatrix is used to transform a point from camera space to projection space (ie. clip coordinates; you can get normalized device coordinates
by dividing x, y & z by w). See http://www.songho.ca/opengl/gl_projectionmatrix.html.
Definition at line 499 of file GLSL.hpp.
Referenced by vl::ProjViewTransfCallback::updateMatrices().
|
inline |
|
inline |
Returns the binding location of the vl_WorldMatrix uniform variable or -1 if no such variable is used by the GLSLProgram.
vl_WorldMatrix transforms a point from object space to world space.
Definition at line 490 of file GLSL.hpp.
Referenced by vl::ProjViewTransfCallback::updateMatrices().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:50.
© Copyright Michele Bosi. All rights reserved.