![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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.
Murl.Graph.INode GetNodeInterface()
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.
Murl.Graph.IGenericResourceTarget.ResourceIShader GetShaderResourceTarget()
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.
Murl.Graph.IGenericNodeTarget.GraphIShader GetFallbackShaderNodeTarget()
Directly set the shader's source code from a given string.
Boolean SetSource(String source)
source | The shader source code. |
Get the shader's source code, if it was explicitly set via SetSource().
String GetSource()
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.
Boolean SetType(Murl.IEnums.ShaderType type)
type | The shader type. |
Get the shader type.
Murl.IEnums.ShaderType GetType()
Get the shader's number of stages.
Integer GetNumberOfStages()
Check if the shader is valid. If creation/compilation of the shader object fails, this method returns false.
Boolean IsValid(Boolean checkFallbacks)
checkFallbacks | If false, only the current shader is considered. Otherwise, the method returns true if any of its fallback shaders is valid. |
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.
String GetCompilerLog()