| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tlp::GlShader Class ReferenceA class to manage shader objects, components of a shader program. More...
Public Member Functions
Friends
Detailed DescriptionA class to manage shader objects, components of a shader program. This class allow to create and compile OpenGL shader object. Shaders are used to program the graphics processing unit (GPU) rendering pipeline. The three existing types of shaders are managed : -> Vertex shader : run once for each vertex given to the graphics processor. The purpose is to transform each vertex's 3D position in virtual space to the 2D coordinate at which it appears on the screen (as well as a depth value for the Z-buffer). Vertex shaders can manipulate properties such as position, color, and texture coordinate, but cannot create new vertices. The output of the vertex shader goes to the next stage in the pipeline, which is either a geometry shader if present or the rasterizer otherwise. -> Geometry shader : can add and remove vertices from a mesh. Geometry shaders can be used to generate geometry procedurally or to add volumetric detail to existing meshes that would be too costly to process on the CPU. If geometry shaders are being used, the output is then sent to the rasterizer. -> Fragment shader (Pixel shader) : calculate the color of individual pixels. The input to this stage comes from the rasterizer, which fills in the polygons being sent through the graphics pipeline. Shaders source codes have to be written with the "OpenGL Shading Language (GLSL)" Constructor & Destructor Documentation
Vertex and Fragment shader constructor Use this constructor to create either a vertex shader or a fragment shader
Geometry shader constructor Use this constructor to create a geometry shader
GlShader destructor Member Function Documentation
Set the shader source code from a C++ string and compile it.
Set the shader source code from a C string and compile it.
Set the shader source code from a file and compile it.
Return the log output by the shader compiler
Method only relevant for geometry shaders. Return the graphic primitive type this geometry shader takes as input.
Method only relevant for geometry shaders. Return the graphics primitives type this geometry shader will output.
Return the GL identifier of this shader object
Return the type of the shader (Vertex, Geometry or Fragment)
Return true if the shader compilation was successfull, false otherwise
Method only relevant for geometry shaders. Set the graphic primitive type this geometry shader takes as input. Note that when modifying the input primitive type, the associated shader program (whose object is from type GlShaderProgram) has to be relinked for changes to take effect.
Method only relevant for geometry shaders. Set the graphics primitives type this geometry shader will output. Note that when modifying the output primitive type, the associated shader program (whose object is from type GlShaderProgram) has to be relinked for changes to take effect.
Friends And Related Function Documentation
|
Tulip Software by LaBRI Visualization Team 2001 - 2011 |