Shader¶
-
class
guerilla.
Shader
¶ Bases:
guerilla.Node
A Shader is a Node that can evaluate itself to a program
A Shader is an composition of ShaderNodes, which can assembledto generate a program or a subpart of a program, and be executed in various contexts. For instance, a Material implements 3 different Shaders, the surface shader, the displacement shader and the line shader. A Light also implements a light shader, which is composed with the material surface shader to generate final pixel shading of the rendered objects.
-
addnode
(filename)¶ add a node into a shader by its filename
Parameters: filename (str) – The file name of the node to add Returns: The created node or None if failed Return type: ShaderNode
-
getinputs
()¶ List the node’s inputs
Returns: The array of inputs in the node Return type: { GraphInput
}
-
getinputsdef
()¶ Get the definition of the shader inputs
This method returns a table that associates the input name to a description of the input data as { Type=type, Value=value }
Returns: The inputs definition Return type: table
-
getoutput
(outputclass)¶ Get the first shader output node of the given type in the shader. If no outputclass is given, looks for “ShaderNodeOutputLight” in a light shader, “ShaderNodeOutputCompo” in a compositing, or “ShaderNodeSurface” otherwise.
Parameters: outputclass (str) – The class name of the output node to find Returns: The shader output to find, or None if none can be found. Return type: ShaderNode
-
getoutputs
()¶ List the node’s outputs
Returns: The array of outputs in the node Return type: { GraphOutput
}
-
inputs
(*args)¶ An iterator on node’s inputs
Available arguments:
Return type: it or
Return type: it
-