|
| ShaderGraph (const ShaderGraph *parent, const string &name, ConstDocumentPtr document, const StringSet &reservedWords) |
| Constructor.
|
|
virtual | ~ShaderGraph () |
| Desctructor.
|
|
bool | isAGraph () const override |
| Return true if this node is a graph. More...
|
|
ShaderNode * | getNode (const string &name) |
| Get an internal node by name.
|
|
const ShaderNode * | getNode (const string &name) const |
| Get an internal node by name.
|
|
const vector< ShaderNode * > & | getNodes () const |
| Get a vector of all nodes in order.
|
|
size_t | numInputSockets () const |
| Get number of input sockets.
|
|
size_t | numOutputSockets () const |
| Get number of output sockets.
|
|
ShaderGraphInputSocket * | getInputSocket (size_t index) |
| Get socket by index.
|
|
ShaderGraphOutputSocket * | getOutputSocket (size_t index=0) |
|
const ShaderGraphInputSocket * | getInputSocket (size_t index) const |
|
const ShaderGraphOutputSocket * | getOutputSocket (size_t index=0) const |
|
ShaderGraphInputSocket * | getInputSocket (const string &name) |
| Get socket by name.
|
|
ShaderGraphOutputSocket * | getOutputSocket (const string &name) |
|
const ShaderGraphInputSocket * | getInputSocket (const string &name) const |
|
const ShaderGraphOutputSocket * | getOutputSocket (const string &name) const |
|
const vector< ShaderGraphInputSocket * > & | getInputSockets () const |
| Get vector of sockets.
|
|
const vector< ShaderGraphOutputSocket * > & | getOutputSockets () const |
|
void | applyInputTransforms (ConstNodePtr node, ShaderNodePtr shaderNode, GenContext &context) |
| Apply color and unit transforms to each input of a node.
|
|
ShaderNode * | createNode (ConstNodePtr node, GenContext &context) |
| Create a new node in the graph.
|
|
ShaderGraphInputSocket * | addInputSocket (const string &name, TypeDesc type) |
| Add input sockets.
|
|
ShaderGraphInputSocket * | addInputSocket (const string &name, const TypeDesc *type) |
|
ShaderGraphOutputSocket * | addOutputSocket (const string &name, TypeDesc type) |
| Add output sockets.
|
|
ShaderGraphOutputSocket * | addOutputSocket (const string &name, const TypeDesc *type) |
|
void | addDefaultGeomNode (ShaderInput *input, const GeomPropDef &geomprop, GenContext &context) |
| Add a default geometric node and connect to the given input.
|
|
void | topologicalSort () |
| Sort the nodes in topological order.
|
|
IdentifierMap & | getIdentifierMap () |
| Return the map of unique identifiers used in the scope of this graph.
|
|
| ShaderNode (const ShaderGraph *parent, const string &name) |
| Constructor.
|
|
virtual bool | isAGraph () const |
| Return true if this node is a graph. More...
|
|
const ShaderGraph * | getParent () const |
| Return the parent graph that owns this node. More...
|
|
void | setClassification (uint32_t c) |
| Set classification bits for this node, replacing any previous set bits.
|
|
uint32_t | getClassification () const |
| Get classification bits set for this node.
|
|
void | addClassification (uint32_t c) |
| Add classification bits to this node.
|
|
bool | hasClassification (uint32_t c) const |
| Return true if this node matches the given classification.
|
|
const string & | getName () const |
| Return the name of this node.
|
|
const ShaderNodeImpl & | getImplementation () const |
| Return the implementation used for this node.
|
|
void | initialize (const Node &node, const NodeDef &nodeDef, GenContext &context) |
| Initialize this shader node with all required data from the given node and nodedef.
|
|
ShaderInput * | addInput (const string &name, TypeDesc type) |
| Add inputs/outputs.
|
|
ShaderOutput * | addOutput (const string &name, TypeDesc type) |
|
size_t | numInputs () const |
| Get number of inputs/outputs.
|
|
size_t | numOutputs () const |
|
ShaderInput * | getInput (size_t index) |
| Get inputs/outputs by index.
|
|
ShaderOutput * | getOutput (size_t index=0) |
|
const ShaderInput * | getInput (size_t index) const |
|
const ShaderOutput * | getOutput (size_t index=0) const |
|
ShaderInput * | getInput (const string &name) |
| Get inputs/outputs by name.
|
|
ShaderOutput * | getOutput (const string &name) |
|
const ShaderInput * | getInput (const string &name) const |
|
const ShaderOutput * | getOutput (const string &name) const |
|
const vector< ShaderInput * > & | getInputs () const |
| Get vector of inputs/outputs.
|
|
const vector< ShaderOutput * > & | getOutputs () const |
|
void | setMetadata (ShaderMetadataVecPtr metadata) |
| Set the metadata vector.
|
|
ShaderMetadataVecPtr | getMetadata () |
| Get the metadata vector.
|
|
const ShaderMetadataVecPtr & | getMetadata () const |
| Get the metadata vector.
|
|
bool | isEditable (const ShaderInput &input) const |
| Returns true if an input is editable by users. More...
|
|
bool | isEditable (const ShaderGraphInputSocket &input) const |
| Returns true if a graph input is accessible by users. More...
|
|
|
void | createConnectedNodes (const ElementPtr &downstreamElement, const ElementPtr &upstreamElement, ElementPtr connectingElement, GenContext &context) |
| Create node connections corresponding to the connection between a pair of elements. More...
|
|
void | addNode (ShaderNodePtr node) |
| Add a node to the graph.
|
|
void | addInputSockets (const InterfaceElement &elem, GenContext &context) |
| Add input sockets from an interface element (nodedef, nodegraph or node)
|
|
void | addOutputSockets (const InterfaceElement &elem) |
| Add output sockets from an interface element (nodedef, nodegraph or node)
|
|
void | addUpstreamDependencies (const Element &root, GenContext &context) |
| Traverse from the given root element and add all dependencies upstream. More...
|
|
void | addColorTransformNode (ShaderInput *input, const ColorSpaceTransform &transform, GenContext &context) |
| Add a color transform node and connect to the given input.
|
|
void | addColorTransformNode (ShaderOutput *output, const ColorSpaceTransform &transform, GenContext &context) |
| Add a color transform node and connect to the given output.
|
|
void | addUnitTransformNode (ShaderInput *input, const UnitTransform &transform, GenContext &context) |
| Add a unit transform node and connect to the given input.
|
|
void | addUnitTransformNode (ShaderOutput *output, const UnitTransform &transform, GenContext &context) |
| Add a unit transform node and connect to the given output.
|
|
void | finalize (GenContext &context) |
| Perform all post-build operations on the graph.
|
|
void | optimize () |
| Optimize the graph, removing redundant paths.
|
|
void | bypass (ShaderNode *node, size_t inputIndex, size_t outputIndex=0) |
| Bypass a node for a particular input and output, effectively connecting the input's upstream connection with the output's downstream connections.
|
|
void | setVariableNames (GenContext &context) |
| For inputs and outputs in the graph set the variable names to be used in generated code. More...
|
|
void | populateColorTransformMap (ColorManagementSystemPtr colorManagementSystem, ShaderPort *shaderPort, const string &sourceColorSpace, const string &targetColorSpace, bool asInput) |
| Populate the color transform map for the given shader port, if the provided combination of source and target color spaces are supported for its data type.
|
|
void | populateUnitTransformMap (UnitSystemPtr unitSystem, ShaderPort *shaderPort, ValueElementPtr element, const string &targetUnitSpace, bool asInput) |
| Populates the appropriate unit transform map if the provided input/parameter or output has a unit attribute and is of the supported type.
|
|
void | disconnect (ShaderNode *node) const |
| Break all connections on a node.
|
|
void | createMetadata (const NodeDef &nodeDef, GenContext &context) |
| Create metadata from the nodedef according to registered metadata.
|
|
Class representing a graph (DAG) for shader generation.