Open CASCADE Technology  7.7.0
Protected Member Functions

OpenGl_ShaderManager::OpenGl_ShaderProgramFFP Class Reference

Fake OpenGL program for tracking FFP state in the way consistent to programmable pipeline. More...

#include <OpenGl_ShaderManager.hxx>

Inheritance diagram for OpenGl_ShaderManager::OpenGl_ShaderProgramFFP:
Inheritance graph
[legend]

Protected Member Functions

 OpenGl_ShaderProgramFFP ()
 
- Protected Member Functions inherited from OpenGl_ShaderProgram
bool Share ()
 Increments counter of users. Used by OpenGl_ShaderManager. More...
 
bool UnShare ()
 Decrements counter of users. Used by OpenGl_ShaderManager. More...
 
Standard_Boolean link (const Handle< OpenGl_Context > &theCtx)
 Links the program object. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Public Member Functions inherited from OpenGl_ShaderProgram
 OpenGl_ShaderProgram (const Handle< Graphic3d_ShaderProgram > &theProxy=NULL, const TCollection_AsciiString &theId="")
 Creates uninitialized shader program. More...
 
virtual ~OpenGl_ShaderProgram ()
 Releases resources of shader program. More...
 
Standard_Boolean Create (const Handle< OpenGl_Context > &theCtx)
 Creates new empty shader program of specified type. More...
 
virtual void Release (OpenGl_Context *theCtx) override
 Destroys shader program. More...
 
virtual Standard_Size EstimatedDataSize () const override
 Returns estimated GPU memory usage - cannot be easily estimated. More...
 
Standard_Boolean AttachShader (const Handle< OpenGl_Context > &theCtx, const Handle< OpenGl_ShaderObject > &theShader)
 Attaches shader object to the program object. More...
 
Standard_Boolean DetachShader (const Handle< OpenGl_Context > &theCtx, const Handle< OpenGl_ShaderObject > &theShader)
 Detaches shader object to the program object. More...
 
Standard_Boolean Initialize (const Handle< OpenGl_Context > &theCtx, const Graphic3d_ShaderObjectList &theShaders)
 Initializes program object with the list of shader objects. More...
 
Standard_Boolean Link (const Handle< OpenGl_Context > &theCtx, bool theIsVerbose=true)
 Links the program object. More...
 
Standard_Boolean FetchInfoLog (const Handle< OpenGl_Context > &theCtx, TCollection_AsciiString &theLog)
 Fetches information log of the last link operation. More...
 
Standard_Boolean ApplyVariables (const Handle< OpenGl_Context > &theCtx)
 Fetches uniform variables from proxy shader program. More...
 
const Handle< Graphic3d_ShaderProgram > & Proxy () const
 
bool IsValid () const
 
GLuint ProgramId () const
 
Standard_Boolean HasTessellationStage () const
 Return TRUE if program defines tessellation stage. More...
 
Standard_Integer NbLightsMax () const
 Return the length of array of light sources (THE_MAX_LIGHTS), to be used for initialization occLightSources (OpenGl_OCC_LIGHT_SOURCE_PARAMS). More...
 
Standard_Integer NbShadowMaps () const
 Return the length of array of shadow maps (THE_NB_SHADOWMAPS); 0 by default. More...
 
Standard_Integer NbClipPlanesMax () const
 Return the length of array of clipping planes (THE_MAX_CLIP_PLANES), to be used for initialization occClipPlaneEquations (OpenGl_OCC_CLIP_PLANE_EQUATIONS) and occClipPlaneChains (OpenGl_OCC_CLIP_PLANE_CHAINS). More...
 
Standard_Integer NbFragmentOutputs () const
 Return the length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS), to be used for initialization occFragColorArray/occFragColorN. More...
 
Standard_Boolean HasAlphaTest () const
 Return true if Fragment Shader should perform alpha test; FALSE by default. More...
 
Graphic3d_RenderTransparentMethod OitOutput () const
 Return if Fragment Shader color should output the OIT values; OFF by default. More...
 
Standard_Integer TextureSetBits () const
 Return texture units declared within the program,. More...
 
OpenGl_ShaderUniformLocation GetUniformLocation (const Handle< OpenGl_Context > &theCtx, const GLchar *theName) const
 Returns location of the specific uniform variable. More...
 
GLint GetAttributeLocation (const Handle< OpenGl_Context > &theCtx, const GLchar *theName) const
 Returns index of the generic vertex attribute by variable name. More...
 
const OpenGl_ShaderUniformLocationGetStateLocation (OpenGl_StateVariable theVariable) const
 Returns location of the OCCT state uniform variable. More...
 
template<typename ValueType >
bool GetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, ValueType &theValue) const
 Returns the value of the uniform variable from given name. More...
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, OpenGl_Vec4i &theValue) const
 Returns the value of the integer uniform variable. Wrapper for glGetUniformiv() More...
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, OpenGl_Vec4 &theValue) const
 Returns the value of the float uniform variable. Wrapper for glGetUniformfv() More...
 
template<typename ValueType >
bool GetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, ValueType &theValue) const
 Returns the vertex attribute from given name. More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, OpenGl_Vec4i &theValue) const
 Returns the integer vertex attribute. Wrapper for glGetVertexAttribiv() More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, OpenGl_Vec4 &theValue) const
 Returns the float vertex attribute. Wrapper for glGetVertexAttribfv() More...
 
Standard_Boolean SetAttributeName (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const GLchar *theName)
 Wrapper for glBindAttribLocation() More...
 
template<typename ValueType >
bool SetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const ValueType &theValue)
 Wrapper for glVertexAttrib*() for attribute with the given name. More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, GLfloat theValue)
 Wrapper for glVertexAttrib1f() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec2 &theValue)
 Wrapper for glVertexAttrib2fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec3 &theValue)
 Wrapper for glVertexAttrib3fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec4 &theValue)
 Wrapper for glVertexAttrib4fv() More...
 
template<typename ValueType >
bool SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const ValueType &theValue)
 Specifies the value of the uniform variable with given name. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLint theValue)
 Specifies the value of the integer uniform variable. Wrapper for glUniform1i() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec2i &theValue)
 Specifies the value of the integer uniform 2D vector. Wrapper for glUniform2iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec3i &theValue)
 Specifies the value of the integer uniform 3D vector. Wrapper for glUniform3iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec4i &theValue)
 Specifies the value of the integer uniform 4D vector. Wrapper for glUniform4iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec2u &theValue)
 Specifies the value of the unsigned integer uniform 2D vector (uvec2). Wrapper for glUniform2uiv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const GLsizei theCount, const OpenGl_Vec2u *theValue)
 Specifies the value of the uvec2 uniform array Wrapper for glUniform2uiv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const GLsizei theCount, const OpenGl_Vec2u *theValue)
 Specifies the value of the uvec2 uniform array Wrapper for glUniform2uiv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLfloat theValue)
 Specifies the value of the float uniform variable. Wrapper for glUniform1f() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec2 &theValue)
 Specifies the value of the float uniform 2D vector. Wrapper for glUniform2fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec3 &theValue)
 Specifies the value of the float uniform 3D vector. Wrapper for glUniform3fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec4 &theValue)
 Specifies the value of the float uniform 4D vector. Wrapper for glUniform4fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const NCollection_Mat3< float > *theData)
 Specifies the value of the array of float uniform 3x3 matrices. Wrapper over glUniformMatrix3fv(). More...
 
bool SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Mat4 &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. Wrapper for glUniformMatrix4fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Mat4 &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. Wrapper for glUniformMatrix4fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Mat4 *theData)
 Specifies the value of the array of float uniform 4x4 matrices. Wrapper over glUniformMatrix4fv(). More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const Standard_ShortReal *theData)
 Specifies the value of the float uniform array Wrapper over glUniform1fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec2 *theData)
 Specifies the value of the float2 uniform array Wrapper over glUniform2fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec3 *theData)
 Specifies the value of the float3 uniform array Wrapper over glUniform3fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec4 *theData)
 Specifies the value of the float4 uniform array Wrapper over glUniform4fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const Standard_Integer *theData)
 Specifies the value of the integer uniform array Wrapper over glUniform1iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec2i *theData)
 Specifies the value of the int2 uniform array Wrapper over glUniform2iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec3i *theData)
 Specifies the value of the int3 uniform array Wrapper over glUniform3iv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec4i *theData)
 Specifies the value of the int4 uniform array Wrapper over glUniform4iv() More...
 
bool SetSampler (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const Graphic3d_TextureUnit theTextureUnit)
 Specifies the value of the sampler uniform variable. More...
 
Standard_Boolean SetSampler (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const Graphic3d_TextureUnit theTextureUnit)
 Specifies the value of the sampler uniform variable. More...
 
Standard_Boolean UpdateDebugDump (const Handle< OpenGl_Context > &theCtx, const TCollection_AsciiString &theFolder="", Standard_Boolean theToBeautify=Standard_False, Standard_Boolean theToReset=Standard_False)
 Update the shader program from external files (per shader stage) in the following way: 1) If external file does not exist, then it will be created (current source code will be dumped, no recompilation) and FALSE will be returned. 2) If external file exists and it has the same timestamp as myDumpDate, nothing will be done and FALSE will be returned. 3) If external file exists and it has newer timestamp than myDumpDate, shader will be recompiled and relinked and TRUE will be returned. More...
 
- Public Member Functions inherited from OpenGl_NamedResource
 OpenGl_NamedResource (const TCollection_AsciiString &theId)
 Empty constructor. More...
 
const TCollection_AsciiStringResourceId () const
 Return resource name. More...
 
- Public Member Functions inherited from OpenGl_Resource
 OpenGl_Resource ()
 Empty constructor. More...
 
virtual ~OpenGl_Resource ()
 Destructor. Inheritors should call Clean (NULL) within it. More...
 
virtual void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 
- Static Public Member Functions inherited from OpenGl_ShaderProgram
static bool compileShaderVerbose (const Handle< OpenGl_Context > &theCtx, const Handle< OpenGl_ShaderObject > &theShader, const TCollection_AsciiString &theSource, bool theToPrintSource=true)
 Wrapper for compiling shader object with verbose printing on error. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 
- Static Public Attributes inherited from OpenGl_ShaderProgram
static const GLuint NO_PROGRAM = 0
 Non-valid shader name. More...
 
static const GLint INVALID_LOCATION = -1
 Invalid location of uniform/attribute variable. More...
 
static Standard_CString PredefinedKeywords [OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
 List of pre-defined OCCT state uniform variables. More...
 
- Protected Attributes inherited from OpenGl_ShaderProgram
GLuint myProgramID
 Handle of OpenGL shader program. More...
 
OpenGl_ShaderList myShaderObjects
 List of attached shader objects. More...
 
Handle< Graphic3d_ShaderProgrammyProxy
 Proxy shader program (from application layer) More...
 
Standard_Integer myShareCount
 program users count, initialized with 1 (already shared by one user) More...
 
Standard_Integer myNbLightsMax
 length of array of light sources (THE_MAX_LIGHTS) More...
 
Standard_Integer myNbShadowMaps
 length of array of shadow maps (THE_NB_SHADOWMAPS) More...
 
Standard_Integer myNbClipPlanesMax
 length of array of clipping planes (THE_MAX_CLIP_PLANES) More...
 
Standard_Integer myNbFragOutputs
 length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS) More...
 
Standard_Integer myTextureSetBits
 texture units declared within the program, More...
 
Graphic3d_RenderTransparentMethod myOitOutput
 flag indicating that Fragment Shader includes OIT outputs More...
 
Standard_Boolean myHasAlphaTest
 flag indicating that Fragment Shader should perform alpha-test More...
 
Standard_Boolean myHasTessShader
 flag indicating that program defines tessellation stage More...
 
Standard_Size myCurrentState [OpenGl_UniformStateType_NB]
 defines last modification for variables of each state type More...
 
OpenGl_ShaderUniformLocation myStateLocations [OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
 Stores locations of OCCT state uniform variables. More...
 
- Protected Attributes inherited from OpenGl_NamedResource
TCollection_AsciiString myResourceId
 resource name More...
 
- Static Protected Attributes inherited from OpenGl_ShaderProgram
static OpenGl_VariableSetterSelector mySetterSelector
 

Detailed Description

Fake OpenGL program for tracking FFP state in the way consistent to programmable pipeline.

Constructor & Destructor Documentation

◆ OpenGl_ShaderProgramFFP()

OpenGl_ShaderManager::OpenGl_ShaderProgramFFP::OpenGl_ShaderProgramFFP ( )
inlineprotected

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