C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::Shader Class Reference

Shader class implements a pixel shader and its program. This class provides loading and also compiling and performing subprogram of vertexes and shader itself. More...

#include <vsn_shader.h>

Public Member Functions

 Shader ()
 Default consructor.
 
 Shader (std::istream &vertex, std::istream &fragment)
 Constructor with loading vertexes and fragment.
 
 Shader (const Shader &)
 Copy constructor.
 
 ~Shader ()
 Destructor.
 
GLuint GetId () const
 Returns program identifier.
 
bool IsShaderUsed () const
 Returns true if shader is used.
 
bool IsCanBeDeleted () const
 Returns true if shader can be deleted.
 
const StringGetName () const
 Returns shader name.
 
void SetName (const String &name)
 Sets shader name.
 
OpenGLShaderProgram * GetProgramShader ()
 Returns pointer to QGLProgramShader for this shader.
 
int GetPositionAttrId () const
 Returns position identifier.
 
int GetTextureAttrId () const
 Returns texture identifier.
 
int GetColorAttrId () const
 Returns color identifier.
 
int GetNormalAttrId () const
 Returns normal identifier.
 
void SetupVertexFragmentShader (std::istream &vertex, std::istream &fragment)
 Sets shaders of vertexes and fragment from file.
 
void ReplaceShader (const Shader &other)
 Replaces this shader with copy of another shader.
 
int GetModelViewMatrixId () const
 Returns identifier of model view matrix.
 
int GetModelViewProjMatrixId () const
 Returns identifier of projection matrix of model view.
 
int GetModelViewInverseMatrixId () const
 Returns identifier of view inverse matrix (location).
 
int GetEnableLightingId () const
 Returns identifier of lighting enabled.
 
int GetEnableLightingStateId () const
 Returns identifier of lighting state.
 
int GetPositionLightingId (GLenum lightId) const
 Returns position of light source by its identifier.
 
int GetAmbientLightingId (GLenum lightId) const
 Returns value of ambient lighting by identifier.
 
int GetDiffuseLightingId (GLenum lightId) const
 Returns value of diffusion by identifier.
 
int GetSpecularLightingId (GLenum lightId) const
 Returns value of specularity by identifier.
 
int GetSpotDirectionLightingId (GLenum lightId) const
 Returns value of lighting spot by identifier.
 
int GetAttebuationFactorsLightingId (GLenum lightId) const
 Returns value of lighting attenuation by identifier.
 
int GetSpotExponentLightingId (GLenum lightId) const
 Returns value of single lighting (spot) by identifier.
 
int GetSpotCutoffLightingId (GLenum lightId) const
 Returns value of spot cut by identifier.
 
int GetDistanceAttenuationLightingId (GLenum lightId) const
 Returns value of lighting attenuation from distance by identifier.
 
void ActivateProgram ()
 Activates shader program.
 
void CreateLinkProgrammShader ()
 Creates and links shader program. If linking error, then exception occurs.
 
void DeleteShader ()
 Deletes shader.
 
Shaderoperator= (const Shader &other)
 Assigns data to another shader.
 

Static Public Member Functions

static size_t GetShaderCount ()
 Returns shader quantity.
 
static bool IsExistIdAsShader (uint shadingGroupId)
 Returns true if group identifier is applied for shaders.
 
static ShaderGetShaderById (uint shadingGroupId)
 Returns pointer to shader by identifier, if no shader, then nullptr is returned.
 
static bool IsExistActiveShader ()
 Returns true if there is an active shader.
 
static ShaderGetActiveShader ()
 Returns pointer to active shader, if no shader, then nullptr is returned.
 
static bool ActivateProgram (uint ShadingGroupId)
 Activates shader program by identifier.
 
static void DeactivateProgram ()
 Deactivates shader program.
 

Detailed Description

Shader class implements a pixel shader and its program. This class provides loading and also compiling and performing subprogram of vertexes and shader itself.


The documentation for this class was generated from the following file: