![]() |
Murl Engine API
Version 2018.3
|
The IShader graph node interface. More...
#include <murl_graph_i_shader.h>
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.
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... | |
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
Directly set the shader's source code from a given string.
source | The shader source code. |
|
pure virtual |
Get the shader's source code, if it was explicitly set via SetSource().
|
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.
type | The shader type. |
|
pure virtual |
Get the shader type.
|
pure virtual |
Get the shader's number of stages.
|
pure virtual |
Get the shader's internal video renderer object for a given type.
stage | The stage to query. |
type | The shader type, either SHADER_TYPE_VERTEX or SHADER_TYPE_FRAGMENT. |
Check if the shader is valid.
If creation/compilation of the shader object fails, this method returns false.
checkFallbacks | If false, only the current shader is considered. Otherwise, the method returns true if any of its fallback shaders is valid. |
|
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.