The IShader graph node interface. More...
#include "murl_graph_i_shader.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual IShaderResourceTarget * | GetShaderResourceTarget ()=0 |
Get a mutable Graph::IShaderResourceTarget container. More... | |
virtual const IShaderResourceTarget * | GetShaderResourceTarget () const =0 |
Get a constant Graph::IShaderResourceTarget container. More... | |
virtual IShaderNodeTarget * | GetFallbackShaderNodeTarget ()=0 |
Get the mutable Graph::IShader container storing an optional fallback shader. More... | |
virtual const IShaderNodeTarget * | GetFallbackShaderNodeTarget () const =0 |
Get the constant Graph::IShader container storing an optional fallback shader. More... | |
virtual Bool | SetSource (const String &source)=0 |
Directly set the shader's source code from a given string. More... | |
virtual const String & | GetSource () const =0 |
Get the shader's source code, if it was explicitly set via SetSource(). More... | |
virtual Bool | SetType (IEnums::ShaderType type)=0 |
Set the shader type. More... | |
virtual IEnums::ShaderType | GetType () const =0 |
Get the shader type. More... | |
virtual UInt32 | GetNumberOfStages () const =0 |
Get the shader's number of stages. More... | |
virtual Video::IShader * | GetVideoShaderObject (UInt32 stage, IEnums::ShaderType type) const =0 |
Get the shader's internal video renderer object for a given type. More... | |
virtual Bool | IsValid (Bool checkFallbacks) const =0 |
Check if the shader is valid. More... | |
virtual const String & | GetCompilerLog () const =0 |
Get the shader compiler log. More... | |
Detailed Description
The IShader graph node interface.
This interface represents a node that holds the source code for either a vertex shader or a fragment shader of a GPU program, or both. If the node is set to a single type (either vertex or fragment shader) and the selected video API allows for runtime shader compilation, the actual shader code may be set directly via SetSource(). Otherwise, a valid Resource::IShader object must be provided, which contains the necessary type(s) of shader data.
See Graph::IShaderProgram for attaching a shader to a program.
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
◆ GetNodeInterface() [2/2]
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
- Returns
- The constant Graph::INode interface, or null if not available
◆ GetShaderResourceTarget() [1/2]
|
pure virtual |
Get a mutable Graph::IShaderResourceTarget container.
This method returns a mutable pointer to a Graph::IShaderResourceTarget container, which allows to add, remove or query the shader resources referenced by a node implementing this interface.
- Returns
- The mutable Graph::IShaderResourceTarget container, or null if not available
◆ GetShaderResourceTarget() [2/2]
|
pure virtual |
Get a constant Graph::IShaderResourceTarget container.
This method returns a constant pointer to a Graph::IShaderResourceTarget container, which allows to query the shader resources referenced by a node implementing this interface.
- Returns
- The constant Graph::IShaderResourceTarget container, or null if not available
◆ GetFallbackShaderNodeTarget() [1/2]
|
pure virtual |
Get the mutable Graph::IShader container storing an optional fallback shader.
This method returns a mutable pointer to the node's Graph::IShader container that stores an optional reference to another shader node that is used instead, if compilation of the shader object(s) failed.
- Returns
- The mutable Graph::IShader fallback container, or null if not available.
◆ GetFallbackShaderNodeTarget() [2/2]
|
pure virtual |
Get the constant Graph::IShader container storing an optional fallback shader.
This method returns a constant pointer to the node's Graph::IShader container that stores an optional reference to another shader node that is used instead, if compilation of the shader object(s) failed.
- Returns
- The constant Graph::IShader fallback container, or null if not available.
◆ SetSource()
Directly set the shader's source code from a given string.
- Parameters
-
source The shader source code.
- Returns
- true if successful.
◆ GetSource()
|
pure virtual |
Get the shader's source code, if it was explicitly set via SetSource().
- Returns
- The shader source code.
◆ SetType()
|
pure virtual |
Set the shader type.
If set to IEnums::SHADER_TYPE_ALL, the given shader resource must contain both vertex and fragment shader data valid for the selected video API.
- Parameters
-
type The shader type.
- Returns
- true if successful.
◆ GetType()
|
pure virtual |
Get the shader type.
- Returns
- The shader type.
◆ GetNumberOfStages()
|
pure virtual |
Get the shader's number of stages.
- Returns
- The number of stages.
◆ GetVideoShaderObject()
|
pure virtual |
Get the shader's internal video renderer object for a given type.
- Parameters
-
stage The stage to query. type The shader type, either SHADER_TYPE_VERTEX or SHADER_TYPE_FRAGMENT.
- Returns
- The video renderer object.
◆ IsValid()
Check if the shader is valid.
If creation/compilation of the shader object fails, this method returns false.
- Parameters
-
checkFallbacks If false, only the current shader is considered. Otherwise, the method returns true if any of its fallback shaders is valid.
- Returns
- true if shader compilation succeeded during initialization.
◆ GetCompilerLog()
|
pure virtual |
Get the shader compiler log.
If creation/compilation of the shader object fails, this method returns the output provided by the OS/video API. Otherwise, an empty string is returned.
- Returns
- The compiler log message.
The documentation for this interface was generated from the following file:
- murl_graph_i_shader.h