HDK
|
#include <ShaderNodeImpl.h>
Public Member Functions | |
virtual | ~ShaderNodeImpl () |
virtual const string & | getTarget () const |
virtual void | initialize (const InterfaceElement &element, GenContext &context) |
const string & | getName () const |
Return the name of this implementation. More... | |
size_t | getHash () const |
virtual void | addInputs (ShaderNode &node, GenContext &context) const |
Add additional inputs on a node. More... | |
virtual void | setValues (const Node &node, ShaderNode &shaderNode, GenContext &context) const |
Set values for additional inputs on a node. More... | |
virtual void | addClassification (ShaderNode &node) const |
Add additional classifications on a node. More... | |
virtual void | createVariables (const ShaderNode &node, GenContext &context, Shader &shader) const |
virtual void | emitFunctionDefinition (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
Emit function definition for the given node instance. More... | |
virtual void | emitFunctionCall (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
Emit the function call or inline source code for given node instance in the given context. More... | |
virtual void | emitOutputVariables (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
Emit declaration and initialization of output variables to use in a function call. More... | |
virtual ShaderGraph * | getGraph () const |
virtual bool | isEditable (const ShaderInput &) const |
virtual bool | isEditable (const ShaderGraphInputSocket &) const |
Protected Member Functions | |
ShaderNodeImpl () | |
Protected constructor. More... | |
Protected Attributes | |
string | _name |
size_t | _hash |
Class handling the shader generation implementation for a node. Responsible for emitting the function definition and function call that is the node implementation.
Definition at line 30 of file ShaderNodeImpl.h.
|
inlinevirtual |
Definition at line 33 of file ShaderNodeImpl.h.
|
protected |
Protected constructor.
|
virtual |
Add additional classifications on a node.
Reimplemented in MaterialNode, ClosureCompoundNodeMdl, and ClosureCompoundNode.
|
virtual |
Add additional inputs on a node.
Reimplemented in LayerableNodeMdl, CarryThinFilmParameters< ShaderNodeImpl >, CarryThinFilmParameters< LayerableNodeMdl >, CarryThinFilmParameters< SourceCodeNodeMdl >, ImageNodeMdl, and HwImageNode.
|
virtual |
Create shader variables needed for the implementation of this node (e.g. uniforms, inputs and outputs). Used if the node requires input data from the application.
Reimplemented in GeomPropValueNodeGlslAsUniform, GeomPropValueNodeMslAsUniform, LightCompoundNodeGlsl, LightCompoundNodeMsl, LightShaderNodeGlsl, LightShaderNodeMsl, ConvolutionNode, SurfaceShaderNodeGlsl, SurfaceShaderNodeMsl, CompoundNode, SurfaceNodeGlsl, SurfaceNodeMsl, HeightToNormalNodeGlsl, LightNodeGlsl, NumLightsNodeGlsl, HeightToNormalNodeMsl, LightNodeMsl, NumLightsNodeMsl, GeomColorNodeGlsl, GeomPropValueNodeGlsl, GeomColorNodeMsl, GeomPropValueNodeMsl, HwBitangentNode, HwFrameNode, HwNormalNode, HwPositionNode, HwTangentNode, HwTexCoordNode, HwTimeNode, HwViewDirectionNode, and HwTransformNode.
|
virtual |
Emit the function call or inline source code for given node instance in the given context.
Reimplemented in ThinFilmCombineNodeMdl, ClosureLayerNodeMdl, CompoundNodeMdl, LightCompoundNodeGlsl, LightCompoundNodeMsl, GeomPropValueNodeGlslAsUniform, GeomPropValueNodeMslAsUniform, LightShaderNodeGlsl, ImageNodeMdl, LightShaderNodeMsl, CompoundNode, SourceCodeNode, SurfaceShaderNodeGlsl, SourceCodeNodeMdl, SurfaceShaderNodeMsl, HeightToNormalNodeGlsl, SurfaceNodeGlsl, HeightToNormalNodeMsl, SurfaceNodeMsl, ClosureCompoundNode, LightNodeGlsl, LightNodeMsl, ClosureCompoundNodeMdl, MaterialNodeOsl, SurfaceNodeOsl, MaterialNode, GeomColorNodeGlsl, GeomPropValueNodeGlsl, BlurNodeMdl, CombineNodeMdl, HeightToNormalNodeMdl, MaterialNodeMdl, SurfaceNodeMdl, GeomColorNodeMsl, GeomPropValueNodeMsl, HwBitangentNode, HwFrameNode, HwNormalNode, HwPositionNode, HwTangentNode, HwTexCoordNode, HwTimeNode, HwViewDirectionNode, UnlitSurfaceNodeGlsl, UnlitSurfaceNodeMsl, ClosureLayerNodeOsl, ClosureSourceCodeNode, ClosureAddNode, ClosureLayerNode, ClosureMixNode, ClosureMultiplyNode, CombineNode, ConvertNode, SwitchNode, SwizzleNode, ClosureSourceCodeNodeMdl, BlurNode, and HwTransformNode.
|
virtual |
Emit function definition for the given node instance.
Reimplemented in CompoundNodeMdl, LightCompoundNodeGlsl, LightCompoundNodeMsl, CompoundNode, SourceCodeNode, SourceCodeNodeMdl, HeightToNormalNodeGlsl, NumLightsNodeGlsl, HeightToNormalNodeMsl, NumLightsNodeMsl, ClosureCompoundNode, LightSamplerNodeGlsl, ClosureCompoundNodeMdl, LightSamplerNodeMsl, MaterialNodeOsl, and BlurNode.
|
virtual |
Emit declaration and initialization of output variables to use in a function call.
|
virtual |
Return a pointer to the graph if this implementation is using a graph, or returns nullptr otherwise.
Reimplemented in CompoundNode.
|
inline |
Return a hash for this implementation. The hash should correspond to the function signature generated for the node, and can be used to compare implementations, e.g. to query if an identical function has already been emitted during shader generation.
Definition at line 56 of file ShaderNodeImpl.h.
|
inline |
Return the name of this implementation.
Definition at line 47 of file ShaderNodeImpl.h.
|
inlinevirtual |
Return an identifier for the target used by this implementation. By default an empty string is returned, representing all targets. Only override this method if your derived node implementation class is for a specific target.
Reimplemented in MslImplementation, GlslImplementation, LightCompoundNodeGlsl, LightCompoundNodeMsl, HeightToNormalNodeGlsl, HeightToNormalNodeMsl, LightShaderNodeGlsl, HeightToNormalNodeMdl, LightShaderNodeMsl, SurfaceShaderNodeGlsl, and SurfaceShaderNodeMsl.
Definition at line 39 of file ShaderNodeImpl.h.
|
virtual |
Initialize with the given implementation element. Initialization must set the name and hash for the implementation, as well as any other data needed to emit code for the node.
Reimplemented in CompoundNodeMdl, LightCompoundNodeGlsl, LightCompoundNodeMsl, LightShaderNodeGlsl, LightShaderNodeMsl, SourceCodeNode, SourceCodeNodeMdl, and CompoundNode.
|
inlinevirtual |
Returns true if an input is editable by users. Editable inputs are allowed to be published as shader uniforms and hence must be presentable in a user interface. By default all inputs are considered to be editable.
Reimplemented in HwImplementation, CarryThinFilmParameters< ShaderNodeImpl >, CarryThinFilmParameters< LayerableNodeMdl >, CarryThinFilmParameters< SourceCodeNodeMdl >, ImageNodeMdl, SwizzleNode, GeomPropValueNodeGlsl, and GeomPropValueNodeMsl.
Definition at line 91 of file ShaderNodeImpl.h.
|
inlinevirtual |
Returns true if a graph input is accessible by users. Accessible inputs are allowed to be published as shader uniforms and hence must be presentable in a user interface. By default all graph inputs are considered to be acessible.
Definition at line 100 of file ShaderNodeImpl.h.
|
virtual |
Set values for additional inputs on a node.
Reimplemented in HwImageNode.
|
protected |
Definition at line 111 of file ShaderNodeImpl.h.
|
protected |
Definition at line 110 of file ShaderNodeImpl.h.