|
| Graphic3d_ShaderProgram () |
| Creates new empty program object.
|
|
virtual | ~Graphic3d_ShaderProgram () |
| Releases resources of program object.
|
|
virtual Standard_Boolean | IsDone () const |
| Checks if the program object is valid or not.
|
|
const TCollection_AsciiString & | GetId () const |
| Returns unique ID used to manage resource in graphic driver.
|
|
void | SetId (const TCollection_AsciiString &theId) |
| Sets unique ID used to manage resource in graphic driver. WARNING! Graphic3d_ShaderProgram constructor generates a unique id for proper resource management; however if application overrides it, it is responsibility of application to avoid name collisions.
|
|
const TCollection_AsciiString & | Header () const |
| Returns GLSL header (version code and extensions).
|
|
void | SetHeader (const TCollection_AsciiString &theHeader) |
| Setup GLSL header containing language version code and used extensions. Will be prepended to the very beginning of the source code. Example:
|
|
void | AppendToHeader (const TCollection_AsciiString &theHeaderLine) |
| Append line to GLSL header.
|
|
Standard_Integer | NbLightsMax () const |
| Return the length of array of light sources (THE_MAX_LIGHTS), to be used for initialization occLightSources. Default value is THE_MAX_LIGHTS_DEFAULT.
|
|
void | SetNbLightsMax (Standard_Integer theNbLights) |
| Specify the length of array of light sources (THE_MAX_LIGHTS).
|
|
Standard_Integer | NbShadowMaps () const |
| Return the length of array of shadow maps (THE_NB_SHADOWMAPS); 0 by default.
|
|
void | SetNbShadowMaps (Standard_Integer theNbMaps) |
| Specify the length of array of shadow maps (THE_NB_SHADOWMAPS).
|
|
Standard_Integer | NbClipPlanesMax () const |
| Return the length of array of clipping planes (THE_MAX_CLIP_PLANES), to be used for initialization occClipPlaneEquations. Default value is THE_MAX_CLIP_PLANES_DEFAULT.
|
|
void | SetNbClipPlanesMax (Standard_Integer theNbPlanes) |
| Specify the length of array of clipping planes (THE_MAX_CLIP_PLANES).
|
|
Standard_Boolean | AttachShader (const Handle< Graphic3d_ShaderObject > &theShader) |
| Attaches shader object to the program object.
|
|
Standard_Boolean | DetachShader (const Handle< Graphic3d_ShaderObject > &theShader) |
| Detaches shader object from the program object.
|
|
const Graphic3d_ShaderObjectList & | ShaderObjects () const |
| Returns list of attached shader objects.
|
|
const Graphic3d_ShaderVariableList & | Variables () const |
| The list of currently pushed but not applied custom uniform variables. This list is automatically cleared after applying to GLSL program.
|
|
const Graphic3d_ShaderAttributeList & | VertexAttributes () const |
| Return the list of custom vertex attributes.
|
|
void | SetVertexAttributes (const Graphic3d_ShaderAttributeList &theAttributes) |
| Assign the list of custom vertex attributes. Should be done before GLSL program initialization.
|
|
Standard_Integer | NbFragmentOutputs () const |
| Returns the number (1+) of Fragment Shader outputs to be written to (more than 1 can be in case of multiple draw buffers); 1 by default.
|
|
void | SetNbFragmentOutputs (const Standard_Integer theNbOutputs) |
| Sets the number of Fragment Shader outputs to be written to. Should be done before GLSL program initialization.
|
|
Standard_Boolean | HasAlphaTest () const |
| Return true if Fragment Shader should perform alpha test; FALSE by default.
|
|
void | SetAlphaTest (Standard_Boolean theAlphaTest) |
| Set if Fragment Shader should perform alpha test. Note that this flag is designed for usage with - custom shader program may discard fragment regardless this flag.
|
|
Standard_Boolean | HasDefaultSampler () const |
| Return TRUE if standard program header should define default texture sampler occSampler0; TRUE by default for compatibility.
|
|
void | SetDefaultSampler (Standard_Boolean theHasDefSampler) |
| Set if standard program header should define default texture sampler occSampler0.
|
|
Graphic3d_RenderTransparentMethod | OitOutput () const |
| Return if Fragment Shader color should output to OIT buffers; OFF by default.
|
|
void | SetOitOutput (Graphic3d_RenderTransparentMethod theOutput) |
| Set if Fragment Shader color should output to OIT buffers. Note that weighted OIT also requires at least 2 Fragment Outputs (color + coverage), and Depth Peeling requires at least 3 Fragment Outputs (depth + front color + back color),.
|
|
Standard_Boolean | IsPBR () const |
| Return TRUE if standard program header should define functions and variables used in PBR pipeline. FALSE by default.
|
|
void | SetPBR (Standard_Boolean theIsPBR) |
| Sets whether standard program header should define functions and variables used in PBR pipeline.
|
|
Standard_Integer | TextureSetBits () const |
| Return texture units declared within the program,.
|
|
void | SetTextureSetBits (Standard_Integer theBits) |
| Set texture units declared within the program.
|
|
template<class T > |
Standard_Boolean | PushVariable (const TCollection_AsciiString &theName, const T &theValue) |
| Pushes custom uniform variable to the program. The list of pushed variables is automatically cleared after applying to GLSL program. Thus after program recreation even unchanged uniforms should be pushed anew.
|
|
void | ClearVariables () |
| Removes all custom uniform variables from the program.
|
|
Standard_Boolean | PushVariableFloat (const TCollection_AsciiString &theName, const float theValue) |
| Pushes float uniform.
|
|
Standard_Boolean | PushVariableVec2 (const TCollection_AsciiString &theName, const Graphic3d_Vec2 &theValue) |
| Pushes vec2 uniform.
|
|
Standard_Boolean | PushVariableVec3 (const TCollection_AsciiString &theName, const Graphic3d_Vec3 &theValue) |
| Pushes vec3 uniform.
|
|
Standard_Boolean | PushVariableVec4 (const TCollection_AsciiString &theName, const Graphic3d_Vec4 &theValue) |
| Pushes vec4 uniform.
|
|
Standard_Boolean | PushVariableInt (const TCollection_AsciiString &theName, const int theValue) |
| Pushes int uniform.
|
|
Standard_Boolean | PushVariableVec2i (const TCollection_AsciiString &theName, const Graphic3d_Vec2i &theValue) |
| Pushes vec2i uniform.
|
|
Standard_Boolean | PushVariableVec3i (const TCollection_AsciiString &theName, const Graphic3d_Vec3i &theValue) |
| Pushes vec3i uniform.
|
|
Standard_Boolean | PushVariableVec4i (const TCollection_AsciiString &theName, const Graphic3d_Vec4i &theValue) |
| Pushes vec4i uniform.
|
|
Public Member Functions inherited from Standard_Transient |
| Standard_Transient () |
| Empty constructor.
|
|
| Standard_Transient (const Standard_Transient &) |
| Copy constructor – does nothing.
|
|
Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter.
|
|
virtual | ~Standard_Transient () |
| Destructor must be virtual.
|
|
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object.
|
|
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type.
|
|
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName.
|
|
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.
|
|
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.
|
|
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.
|
|
Standard_Integer | GetRefCount () const noexcept |
| Get the reference counter of this object.
|
|
void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object.
|
|
Standard_Integer | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value.
|
|
virtual void | Delete () const |
| Memory deallocator for transient classes.
|
|
This class is responsible for managing shader programs.