Open CASCADE Technology
7.6.0
|
This class is responsible for managing shader programs. More...
#include <OpenGl_ShaderManager.hxx>
Data Structures | |
struct | OpenGl_ShaderLightParameters |
Packed properties of light source. More... | |
class | OpenGl_ShaderProgramFFP |
Fake OpenGL program for tracking FFP state in the way consistent to programmable pipeline. More... | |
Public Member Functions | |
OpenGl_ShaderManager (OpenGl_Context *theContext) | |
Creates new empty shader manager. More... | |
virtual | ~OpenGl_ShaderManager () |
Releases resources of shader manager. More... | |
void | clear () |
Release all resources. More... | |
void | UpdateSRgbState () |
Fetch sRGB state from caps and invalidates programs, if necessary. More... | |
const gp_XYZ & | LocalOrigin () const |
Return local camera transformation. More... | |
void | SetLocalOrigin (const gp_XYZ &theOrigin) |
Setup local camera transformation for compensating float precision issues. More... | |
Standard_Real | LocalClippingPlaneW (const Graphic3d_ClipPlane &thePlane) const |
Return clipping plane W equation value moved considering local camera transformation. More... | |
Standard_Boolean | Create (const Handle< Graphic3d_ShaderProgram > &theProxy, TCollection_AsciiString &theShareKey, Handle< OpenGl_ShaderProgram > &theProgram) |
Creates new shader program or re-use shared instance. More... | |
void | Unregister (TCollection_AsciiString &theShareKey, Handle< OpenGl_ShaderProgram > &theProgram) |
Unregisters specified shader program. More... | |
const OpenGl_ShaderProgramList & | ShaderPrograms () const |
Returns list of registered shader programs. More... | |
Standard_Boolean | IsEmpty () const |
Returns true if no program objects are registered in the manager. More... | |
Standard_Boolean | BindFaceProgram (const Handle< OpenGl_TextureSet > &theTextures, Graphic3d_TypeOfShadingModel theShadingModel, Graphic3d_AlphaMode theAlphaMode, Standard_Boolean theHasVertColor, Standard_Boolean theEnableEnvMap, const Handle< OpenGl_ShaderProgram > &theCustomProgram) |
Bind program for filled primitives rendering. More... | |
Standard_Boolean | BindFaceProgram (const Handle< OpenGl_TextureSet > &theTextures, Graphic3d_TypeOfShadingModel theShadingModel, Graphic3d_AlphaMode theAlphaMode, Aspect_InteriorStyle theInteriorStyle, Standard_Boolean theHasVertColor, Standard_Boolean theEnableEnvMap, Standard_Boolean theEnableMeshEdges, const Handle< OpenGl_ShaderProgram > &theCustomProgram) |
Bind program for filled primitives rendering. More... | |
Standard_Boolean | BindLineProgram (const Handle< OpenGl_TextureSet > &theTextures, const Aspect_TypeOfLine theLineType, const Graphic3d_TypeOfShadingModel theShadingModel, const Graphic3d_AlphaMode theAlphaMode, const Standard_Boolean theHasVertColor, const Handle< OpenGl_ShaderProgram > &theCustomProgram) |
Bind program for line rendering. More... | |
Standard_Boolean | BindMarkerProgram (const Handle< OpenGl_TextureSet > &theTextures, Graphic3d_TypeOfShadingModel theShadingModel, Graphic3d_AlphaMode theAlphaMode, Standard_Boolean theHasVertColor, const Handle< OpenGl_ShaderProgram > &theCustomProgram) |
Bind program for point rendering. More... | |
Standard_Boolean | BindFontProgram (const Handle< OpenGl_ShaderProgram > &theCustomProgram) |
Bind program for rendering alpha-textured font. More... | |
Standard_Boolean | BindOutlineProgram () |
Bind program for outline rendering. More... | |
Standard_Boolean | BindFboBlitProgram (Standard_Integer theNbSamples, Standard_Boolean theIsFallback_sRGB) |
Bind program for FBO blit operation. More... | |
Standard_Boolean | BindOitCompositingProgram (Standard_Boolean theIsMSAAEnabled) |
Bind program for blended order-independent transparency buffers compositing. More... | |
Standard_Boolean | BindOitDepthPeelingBlendProgram (bool theIsMSAAEnabled) |
Bind program for Depth Peeling order-independent transparency back color blending. More... | |
Standard_Boolean | BindOitDepthPeelingFlushProgram (bool theIsMSAAEnabled) |
Bind program for Depth Peeling order-independent transparency flush. More... | |
Standard_Boolean | BindStereoProgram (Graphic3d_StereoMode theStereoMode) |
Bind program for rendering stereoscopic image. More... | |
Standard_Boolean | BindBoundBoxProgram () |
Bind program for rendering bounding box. More... | |
const Handle< OpenGl_VertexBuffer > & | BoundBoxVertBuffer () const |
Returns bounding box vertex buffer. More... | |
Standard_Boolean | BindPBREnvBakingProgram (Standard_Integer theIndex) |
Bind program for IBL maps generation in PBR pipeline. More... | |
const Handle< Graphic3d_ShaderProgram > & | GetBgCubeMapProgram () |
Generates shader program to render environment cubemap as background. More... | |
const Handle< Graphic3d_ShaderProgram > & | GetColoredQuadProgram () |
Generates shader program to render correctly colored quad. More... | |
const OpenGl_LightSourceState & | LightSourceState () const |
Returns current state of OCCT light sources. More... | |
void | UpdateLightSourceStateTo (const Handle< Graphic3d_LightSet > &theLights, Standard_Integer theSpecIBLMapLevels, const Handle< OpenGl_ShadowMapArray > &theShadowMaps) |
Updates state of OCCT light sources. More... | |
bool | SetCastShadows (const bool theToCast) |
Updates state of OCCT light sources to dynamically enable/disable shadowmap. More... | |
void | UpdateLightSourceState () |
Invalidate state of OCCT light sources. More... | |
void | PushLightSourceState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT light sources to specified program (only on state change). Note that light sources definition depends also on WorldViewState. More... | |
void | pushLightSourceState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT light sources to specified program. More... | |
const OpenGl_ProjectionState & | ProjectionState () const |
Returns current state of OCCT projection transform. More... | |
void | UpdateProjectionStateTo (const OpenGl_Mat4 &theProjectionMatrix) |
Updates state of OCCT projection transform. More... | |
void | PushProjectionState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT projection transform to specified program (only on state change). More... | |
void | pushProjectionState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT projection transform to specified program. More... | |
const OpenGl_ModelWorldState & | ModelWorldState () const |
Returns current state of OCCT model-world transform. More... | |
void | UpdateModelWorldStateTo (const OpenGl_Mat4 &theModelWorldMatrix) |
Updates state of OCCT model-world transform. More... | |
void | PushModelWorldState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT model-world transform to specified program (only on state change). More... | |
void | pushModelWorldState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT model-world transform to specified program. More... | |
const OpenGl_WorldViewState & | WorldViewState () const |
Returns current state of OCCT world-view transform. More... | |
void | UpdateWorldViewStateTo (const OpenGl_Mat4 &theWorldViewMatrix) |
Updates state of OCCT world-view transform. More... | |
void | PushWorldViewState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT world-view transform to specified program (only on state change). More... | |
void | pushWorldViewState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT world-view transform to specified program. More... | |
void | UpdateClippingState () |
Updates state of OCCT clipping planes. More... | |
void | RevertClippingState () |
Reverts state of OCCT clipping planes. More... | |
void | PushClippingState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT clipping planes to specified program (only on state change). More... | |
void | pushClippingState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of OCCT clipping planes to specified program. More... | |
const OpenGl_MaterialState & | MaterialState () const |
Returns current state of material. More... | |
void | UpdateMaterialStateTo (const OpenGl_Material &theMat, const float theAlphaCutoff, const bool theToDistinguish, const bool theToMapTexture) |
Updates state of material. More... | |
void | UpdateMaterialState () |
Updates state of material. More... | |
void | PushMaterialState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of material to specified program (only on state change). More... | |
void | pushMaterialState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes current state of material to specified program. More... | |
void | PushInteriorState (const Handle< OpenGl_ShaderProgram > &theProgram, const Handle< Graphic3d_Aspects > &theAspect) const |
Setup interior style line edges variables. More... | |
const OpenGl_OitState & | OitState () const |
Returns state of OIT uniforms. More... | |
void | ResetOitState () |
Reset the state of OIT rendering pass (only on state change). More... | |
void | SetOitState (Graphic3d_RenderTransparentMethod theMode) |
Set the state of OIT rendering pass (only on state change). More... | |
void | SetWeighedOitState (float theDepthFactor) |
Set the state of weighed OIT rendering pass (only on state change). More... | |
void | PushOitState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes state of OIT uniforms to the specified program. More... | |
void | pushOitState (const Handle< OpenGl_ShaderProgram > &theProgram) const |
Pushes state of OIT uniforms to the specified program. More... | |
void | PushState (const Handle< OpenGl_ShaderProgram > &theProgram, Graphic3d_TypeOfShadingModel theShadingModel=Graphic3d_TypeOfShadingModel_Unlit) const |
Pushes current state of OCCT graphics parameters to specified program. More... | |
void | SetContext (OpenGl_Context *theCtx) |
Overwrites context. More... | |
bool | IsSameContext (OpenGl_Context *theCtx) const |
Returns true when provided context is the same as used one by shader manager. More... | |
Graphic3d_TypeOfShadingModel | ChooseFaceShadingModel (Graphic3d_TypeOfShadingModel theCustomModel, bool theHasNodalNormals) const |
Choose Shading Model for filled primitives. Fallbacks to FACET model if there are no normal attributes. Fallbacks to corresponding non-PBR models if PBR is unavailable. More... | |
Graphic3d_TypeOfShadingModel | ChooseLineShadingModel (Graphic3d_TypeOfShadingModel theCustomModel, bool theHasNodalNormals) const |
Choose Shading Model for line primitives. Fallbacks to UNLIT model if there are no normal attributes. Fallbacks to corresponding non-PBR models if PBR is unavailable. More... | |
Graphic3d_TypeOfShadingModel | ChooseMarkerShadingModel (Graphic3d_TypeOfShadingModel theCustomModel, bool theHasNodalNormals) const |
Choose Shading Model for Marker primitives. More... | |
Graphic3d_TypeOfShadingModel | ShadingModel () const |
Returns default Shading Model. More... | |
void | SetShadingModel (const Graphic3d_TypeOfShadingModel theModel) |
Sets shading model. More... | |
![]() | |
Graphic3d_ShaderManager (Aspect_GraphicsLibrary theGapi) | |
Creates new empty shader manager. More... | |
virtual | ~Graphic3d_ShaderManager () |
Releases resources of shader manager. More... | |
bool | IsGapiGreaterEqual (Standard_Integer theVerMajor, Standard_Integer theVerMinor) const |
Standard_Integer | GapiVersionMajor () const |
Return GAPI version major number. More... | |
Standard_Integer | GapiVersionMinor () const |
Return GAPI version minor number. More... | |
void | SetGapiVersion (Standard_Integer theVerMajor, Standard_Integer theVerMinor) |
Return GAPI version major number. More... | |
bool | UseRedAlpha () const |
Return TRUE if RED channel should be used instead of ALPHA for single-channel textures (e.g. GAPI supports only GL_RED textures and not GL_ALPHA). More... | |
void | SetUseRedAlpha (bool theUseRedAlpha) |
Set if RED channel should be used instead of ALPHA for single-channel textures. More... | |
bool | HasFlatShading () const |
Return flag indicating flat shading usage; TRUE by default. More... | |
bool | ToReverseDFdxSign () const |
Return flag indicating flat shading should reverse normal flag; FALSE by default. More... | |
void | SetFlatShading (bool theToUse, bool theToReverseSign) |
Set flag indicating flat shading usage. More... | |
bool | ToEmulateDepthClamp () const |
Return TRUE if depth clamping should be emulated by GLSL program; TRUE by default. More... | |
void | SetEmulateDepthClamp (bool theToEmulate) |
Set if depth clamping should be emulated by GLSL program. More... | |
bool | HasGlslExtension (Graphic3d_GlslExtension theExt) const |
Return TRUE if specified extension is available. More... | |
void | EnableGlslExtension (Graphic3d_GlslExtension theExt, bool theToEnable=true) |
Set if specified extension is available or not. More... | |
![]() | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (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_Transient * | This () 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 | |
static Graphic3d_TypeOfShadingModel | PBRShadingModelFallback (Graphic3d_TypeOfShadingModel theShadingModel, Standard_Boolean theIsPbrAllowed=Standard_False) |
Resets PBR shading models to corresponding non-PBR ones if PBR is not allowed. More... | |
![]() | |
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... | |
Protected Member Functions | |
Standard_Integer | getClipPlaneBits () const |
Define clipping planes program bits. More... | |
Standard_Integer | getProgramBits (const Handle< OpenGl_TextureSet > &theTextures, Graphic3d_AlphaMode theAlphaMode, Aspect_InteriorStyle theInteriorStyle, Standard_Boolean theHasVertColor, Standard_Boolean theEnableEnvMap, Standard_Boolean theEnableMeshEdges) const |
Define program bits. More... | |
Handle< OpenGl_ShaderProgram > & | getStdProgram (Graphic3d_TypeOfShadingModel theShadingModel, Standard_Integer theBits) |
Prepare standard GLSL program. More... | |
Standard_Boolean | prepareStdProgramUnlit (Handle< OpenGl_ShaderProgram > &theProgram, Standard_Integer theBits, Standard_Boolean theIsOutline=false) |
Prepare standard GLSL program without lighting. More... | |
Standard_Boolean | prepareStdProgramLight (Handle< OpenGl_ShaderProgram > &theProgram, Graphic3d_TypeOfShadingModel theShadingModel, Standard_Integer theBits) |
Prepare standard GLSL program with lighting. More... | |
Standard_Boolean | prepareStdProgramGouraud (Handle< OpenGl_ShaderProgram > &theProgram, const Standard_Integer theBits) |
Prepare standard GLSL program with per-vertex lighting. More... | |
Standard_Boolean | prepareStdProgramPhong (Handle< OpenGl_ShaderProgram > &theProgram, const Standard_Integer theBits, const Standard_Boolean theIsFlatNormal=false, const Standard_Boolean theIsPBR=false) |
Prepare standard GLSL program with per-pixel lighting. More... | |
Standard_Boolean | bindProgramWithState (const Handle< OpenGl_ShaderProgram > &theProgram, Graphic3d_TypeOfShadingModel theShadingModel) |
Bind specified program to current context and apply state. More... | |
void | switchLightPrograms () |
Set pointer myLightPrograms to active lighting programs set from myMapOfLightPrograms. More... | |
Standard_Boolean | prepareStdProgramBoundBox () |
Prepare standard GLSL program for bounding box. More... | |
Standard_Boolean | preparePBREnvBakingProgram (Standard_Integer theIndex) |
Prepare GLSL source for IBL generation used in PBR pipeline. More... | |
Standard_Boolean | IsPbrAllowed () const |
Checks whether one of PBR shading models is set as default model. More... | |
void | addClippingPlane (Standard_Integer &thePlaneId, const Graphic3d_ClipPlane &thePlane, const Graphic3d_Vec4d &theEq, const Standard_Integer theChainFwd) const |
Append clipping plane definition to temporary buffers. More... | |
![]() | |
TCollection_AsciiString | genLightKey (const Handle< Graphic3d_LightSet > &theLights, const bool theHasShadowMap) const |
Generate map key for light sources configuration. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramFont () const |
Prepare standard GLSL program for textured font. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramUnlit (Standard_Integer theBits, Standard_Boolean theIsOutline=false) const |
Prepare standard GLSL program without lighting. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramGouraud (const Handle< Graphic3d_LightSet > &theLights, Standard_Integer theBits) const |
Prepare standard GLSL program with per-vertex lighting. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramPhong (const Handle< Graphic3d_LightSet > &theLights, const Standard_Integer theBits, const Standard_Boolean theIsFlatNormal, const Standard_Boolean theIsPBR, const Standard_Integer theNbShadowMaps) const |
Prepare standard GLSL program with per-pixel lighting. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramBoundBox () const |
Prepare standard GLSL program for bounding box. More... | |
Handle< Graphic3d_ShaderProgram > | getBgCubeMapProgram () const |
Generates shader program to render environment cubemap as background. More... | |
Handle< Graphic3d_ShaderProgram > | getColoredQuadProgram () const |
Generates shader program to render correctly colored quad. More... | |
Handle< Graphic3d_ShaderProgram > | getPBREnvBakingProgram (Standard_Integer theIndex) const |
Prepare GLSL source for IBL generation used in PBR pipeline. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramFboBlit (Standard_Integer theNbSamples, Standard_Boolean theIsFallback_sRGB) const |
Prepare standard GLSL program for FBO blit operation. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramStereo (Graphic3d_StereoMode theStereoMode) const |
Prepare standard GLSL program for stereoscopic image. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramOitCompositing (Standard_Boolean theMsaa) const |
Prepare standard GLSL programs for OIT compositing operation. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramOitDepthPeelingBlend (Standard_Boolean theMsaa) const |
Prepare standard GLSL programs for OIT Depth Peeling blend operation. More... | |
Handle< Graphic3d_ShaderProgram > | getStdProgramOitDepthPeelingFlush (Standard_Boolean theMsaa) const |
Prepare standard GLSL programs for OIT Depth Peeling flush operation. More... | |
bool | hasGlslBitwiseOps () const |
Return TRUE if bitwise operations can be used in GLSL program. More... | |
Standard_Integer | defaultGlslVersion (const Handle< Graphic3d_ShaderProgram > &theProgram, const TCollection_AsciiString &theName, Standard_Integer theBits, bool theUsesDerivates=false) const |
Prepare GLSL version header. More... | |
void | defaultOitGlslVersion (const Handle< Graphic3d_ShaderProgram > &theProgram, const TCollection_AsciiString &theName, bool theMsaa) const |
Prepare GLSL version header for OIT composition programs. More... | |
TCollection_AsciiString | pointSpriteAlphaSrc (Standard_Integer theBits) const |
Prepare standard GLSL program for accessing point sprite alpha. More... | |
TCollection_AsciiString | pointSpriteShadingSrc (const TCollection_AsciiString &theBaseColorSrc, Standard_Integer theBits) const |
Prepare standard GLSL program for computing point sprite shading. More... | |
TCollection_AsciiString | stdComputeLighting (Standard_Integer &theNbLights, const Handle< Graphic3d_LightSet > &theLights, Standard_Boolean theHasVertColor, Standard_Boolean theIsPBR, Standard_Boolean theHasTexColor, Standard_Integer theNbShadowMaps) const |
Define computeLighting GLSL function depending on current lights configuration. More... | |
Additional Inherited Members | |
![]() | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
This class is responsible for managing shader programs.
OpenGl_ShaderManager::OpenGl_ShaderManager | ( | OpenGl_Context * | theContext | ) |
Creates new empty shader manager.
|
virtual |
Releases resources of shader manager.
|
inlineprotected |
Append clipping plane definition to temporary buffers.
|
inline |
Bind program for rendering bounding box.
|
inline |
Bind program for filled primitives rendering.
|
inline |
Bind program for filled primitives rendering.
Standard_Boolean OpenGl_ShaderManager::BindFboBlitProgram | ( | Standard_Integer | theNbSamples, |
Standard_Boolean | theIsFallback_sRGB | ||
) |
Bind program for FBO blit operation.
theNbSamples | [in] number of samples within source MSAA texture |
theIsFallback_sRGB | [in] flag indicating that destination buffer is not sRGB-ready |
Standard_Boolean OpenGl_ShaderManager::BindFontProgram | ( | const Handle< OpenGl_ShaderProgram > & | theCustomProgram | ) |
Bind program for rendering alpha-textured font.
|
inline |
Bind program for line rendering.
Standard_Boolean OpenGl_ShaderManager::BindMarkerProgram | ( | const Handle< OpenGl_TextureSet > & | theTextures, |
Graphic3d_TypeOfShadingModel | theShadingModel, | ||
Graphic3d_AlphaMode | theAlphaMode, | ||
Standard_Boolean | theHasVertColor, | ||
const Handle< OpenGl_ShaderProgram > & | theCustomProgram | ||
) |
Bind program for point rendering.
Standard_Boolean OpenGl_ShaderManager::BindOitCompositingProgram | ( | Standard_Boolean | theIsMSAAEnabled | ) |
Bind program for blended order-independent transparency buffers compositing.
Standard_Boolean OpenGl_ShaderManager::BindOitDepthPeelingBlendProgram | ( | bool | theIsMSAAEnabled | ) |
Bind program for Depth Peeling order-independent transparency back color blending.
Standard_Boolean OpenGl_ShaderManager::BindOitDepthPeelingFlushProgram | ( | bool | theIsMSAAEnabled | ) |
Bind program for Depth Peeling order-independent transparency flush.
|
inline |
Bind program for outline rendering.
|
inline |
Bind program for IBL maps generation in PBR pipeline.
|
protected |
Bind specified program to current context and apply state.
Standard_Boolean OpenGl_ShaderManager::BindStereoProgram | ( | Graphic3d_StereoMode | theStereoMode | ) |
Bind program for rendering stereoscopic image.
|
inline |
Returns bounding box vertex buffer.
|
inline |
Choose Shading Model for filled primitives. Fallbacks to FACET model if there are no normal attributes. Fallbacks to corresponding non-PBR models if PBR is unavailable.
|
inline |
Choose Shading Model for line primitives. Fallbacks to UNLIT model if there are no normal attributes. Fallbacks to corresponding non-PBR models if PBR is unavailable.
|
inline |
Choose Shading Model for Marker primitives.
void OpenGl_ShaderManager::clear | ( | ) |
Release all resources.
Standard_Boolean OpenGl_ShaderManager::Create | ( | const Handle< Graphic3d_ShaderProgram > & | theProxy, |
TCollection_AsciiString & | theShareKey, | ||
Handle< OpenGl_ShaderProgram > & | theProgram | ||
) |
Creates new shader program or re-use shared instance.
theProxy | [IN] program definition |
theShareKey | [OUT] sharing key |
theProgram | [OUT] OpenGL program |
const Handle< Graphic3d_ShaderProgram >& OpenGl_ShaderManager::GetBgCubeMapProgram | ( | ) |
Generates shader program to render environment cubemap as background.
|
inlineprotected |
Define clipping planes program bits.
const Handle< Graphic3d_ShaderProgram >& OpenGl_ShaderManager::GetColoredQuadProgram | ( | ) |
Generates shader program to render correctly colored quad.
|
inlineprotected |
Define program bits.
|
inlineprotected |
Prepare standard GLSL program.
|
inline |
Returns true if no program objects are registered in the manager.
|
inlineprotected |
Checks whether one of PBR shading models is set as default model.
|
inline |
Returns true when provided context is the same as used one by shader manager.
|
inline |
Returns current state of OCCT light sources.
|
inline |
Return clipping plane W equation value moved considering local camera transformation.
|
inline |
Return local camera transformation.
|
inline |
Returns current state of material.
|
inline |
Returns current state of OCCT model-world transform.
|
inline |
Returns state of OIT uniforms.
|
inlinestatic |
Resets PBR shading models to corresponding non-PBR ones if PBR is not allowed.
|
protected |
Prepare GLSL source for IBL generation used in PBR pipeline.
|
protected |
Prepare standard GLSL program for bounding box.
|
protected |
Prepare standard GLSL program with per-vertex lighting.
|
inlineprotected |
Prepare standard GLSL program with lighting.
|
protected |
Prepare standard GLSL program with per-pixel lighting.
theIsFlatNormal | when TRUE, the Vertex normals will be ignored and Face normal will be computed instead |
theIsPBR | when TRUE, the PBR pipeline will be activated |
|
protected |
Prepare standard GLSL program without lighting.
|
inline |
Returns current state of OCCT projection transform.
|
inline |
Pushes current state of OCCT clipping planes to specified program (only on state change).
void OpenGl_ShaderManager::pushClippingState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of OCCT clipping planes to specified program.
void OpenGl_ShaderManager::PushInteriorState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram, |
const Handle< Graphic3d_Aspects > & | theAspect | ||
) | const |
Setup interior style line edges variables.
|
inline |
Pushes current state of OCCT light sources to specified program (only on state change). Note that light sources definition depends also on WorldViewState.
void OpenGl_ShaderManager::pushLightSourceState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of OCCT light sources to specified program.
|
inline |
Pushes current state of material to specified program (only on state change).
void OpenGl_ShaderManager::pushMaterialState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of material to specified program.
|
inline |
Pushes current state of OCCT model-world transform to specified program (only on state change).
void OpenGl_ShaderManager::pushModelWorldState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of OCCT model-world transform to specified program.
|
inline |
Pushes state of OIT uniforms to the specified program.
void OpenGl_ShaderManager::pushOitState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes state of OIT uniforms to the specified program.
|
inline |
Pushes current state of OCCT projection transform to specified program (only on state change).
void OpenGl_ShaderManager::pushProjectionState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of OCCT projection transform to specified program.
void OpenGl_ShaderManager::PushState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram, |
Graphic3d_TypeOfShadingModel | theShadingModel = Graphic3d_TypeOfShadingModel_Unlit |
||
) | const |
Pushes current state of OCCT graphics parameters to specified program.
|
inline |
Pushes current state of OCCT world-view transform to specified program (only on state change).
void OpenGl_ShaderManager::pushWorldViewState | ( | const Handle< OpenGl_ShaderProgram > & | theProgram | ) | const |
Pushes current state of OCCT world-view transform to specified program.
|
inline |
Reset the state of OIT rendering pass (only on state change).
void OpenGl_ShaderManager::RevertClippingState | ( | ) |
Reverts state of OCCT clipping planes.
|
inline |
Updates state of OCCT light sources to dynamically enable/disable shadowmap.
theToCast | [in] flag to enable/disable shadowmap |
|
inline |
Overwrites context.
|
inline |
Setup local camera transformation for compensating float precision issues.
|
inline |
Set the state of OIT rendering pass (only on state change).
theMode | [in] flag indicating whether the special output should be written for OIT algorithm |
void OpenGl_ShaderManager::SetShadingModel | ( | const Graphic3d_TypeOfShadingModel | theModel | ) |
Sets shading model.
|
inline |
Set the state of weighed OIT rendering pass (only on state change).
theDepthFactor | [in] the scalar factor of depth influence to the fragment's coverage |
|
inline |
Returns list of registered shader programs.
|
inline |
Returns default Shading Model.
|
protected |
Set pointer myLightPrograms to active lighting programs set from myMapOfLightPrograms.
void OpenGl_ShaderManager::Unregister | ( | TCollection_AsciiString & | theShareKey, |
Handle< OpenGl_ShaderProgram > & | theProgram | ||
) |
Unregisters specified shader program.
void OpenGl_ShaderManager::UpdateClippingState | ( | ) |
Updates state of OCCT clipping planes.
void OpenGl_ShaderManager::UpdateLightSourceState | ( | ) |
Invalidate state of OCCT light sources.
void OpenGl_ShaderManager::UpdateLightSourceStateTo | ( | const Handle< Graphic3d_LightSet > & | theLights, |
Standard_Integer | theSpecIBLMapLevels, | ||
const Handle< OpenGl_ShadowMapArray > & | theShadowMaps | ||
) |
Updates state of OCCT light sources.
|
inline |
Updates state of material.
|
inline |
Updates state of material.
void OpenGl_ShaderManager::UpdateModelWorldStateTo | ( | const OpenGl_Mat4 & | theModelWorldMatrix | ) |
Updates state of OCCT model-world transform.
void OpenGl_ShaderManager::UpdateProjectionStateTo | ( | const OpenGl_Mat4 & | theProjectionMatrix | ) |
Updates state of OCCT projection transform.
void OpenGl_ShaderManager::UpdateSRgbState | ( | ) |
Fetch sRGB state from caps and invalidates programs, if necessary.
void OpenGl_ShaderManager::UpdateWorldViewStateTo | ( | const OpenGl_Mat4 & | theWorldViewMatrix | ) |
Updates state of OCCT world-view transform.
|
inline |
Returns current state of OCCT world-view transform.
|
protected |
program for background cubemap rendering
|
protected |
standard program for FBO blit emulation
|
protected |
standard program for bounding box
|
protected |
bounding box vertex buffer
|
mutableprotected |
|
protected |
State of OCCT clipping planes.
|
mutableprotected |
|
mutableprotected |
|
protected |
program for correct quad rendering
|
protected |
OpenGL context.
|
protected |
|
protected |
standard program for textured text
|
protected |
flag indicating that local camera transformation has been set
|
mutableprotected |
|
protected |
pointer to active lighting programs matrix
|
protected |
State of OCCT light sources.
|
mutableprotected |
|
protected |
local camera transformation
|
protected |
map of lighting programs depending on lights configuration
|
protected |
State of Front and Back materials.
|
protected |
State of OCCT model-world transformation.
|
protected |
standard program for OIT compositing (default and MSAA).
|
protected |
standard program for OIT Depth Peeling blend (default and MSAA)
|
protected |
standard program for OIT Depth Peeling flush (default and MSAA)
|
protected |
State of OIT uniforms.
|
protected |
programs matrix without lighting for outline presentation
|
protected |
programs for IBL maps generation used in PBR pipeline (0 for Diffuse; 1 for Specular; 2 for fallback)
|
mutableprotected |
manager of IBL maps used in PBR pipeline
|
protected |
The list of shader programs.
|
protected |
State of OCCT projection transformation.
|
protected |
lighting shading model
|
mutableprotected |
|
protected |
standard stereo programs
|
protected |
programs matrix without lighting
|
protected |
State of OCCT world-view transformation.