HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShaderNodeImpl Class Reference

#include <ShaderNodeImpl.h>

+ Inheritance diagram for ShaderNodeImpl:

Public Member Functions

virtual ~ShaderNodeImpl ()
 
virtual const stringgetTarget () const
 
virtual void initialize (const InterfaceElement &element, GenContext &context)
 
const stringgetName () 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 ShaderGraphgetGraph () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

virtual ShaderNodeImpl::~ShaderNodeImpl ( )
inlinevirtual

Definition at line 33 of file ShaderNodeImpl.h.

ShaderNodeImpl::ShaderNodeImpl ( )
protected

Protected constructor.

Member Function Documentation

virtual void ShaderNodeImpl::addClassification ( ShaderNode node) const
virtual

Add additional classifications on a node.

Reimplemented in MaterialNode, ClosureCompoundNodeMdl, and ClosureCompoundNode.

virtual void ShaderNodeImpl::addInputs ( ShaderNode node,
GenContext context 
) const
virtual
virtual void ShaderNodeImpl::emitFunctionDefinition ( const ShaderNode node,
GenContext context,
ShaderStage stage 
) const
virtual
virtual void ShaderNodeImpl::emitOutputVariables ( const ShaderNode node,
GenContext context,
ShaderStage stage 
) const
virtual

Emit declaration and initialization of output variables to use in a function call.

virtual ShaderGraph* ShaderNodeImpl::getGraph ( ) const
virtual

Return a pointer to the graph if this implementation is using a graph, or returns nullptr otherwise.

Reimplemented in CompoundNode.

size_t ShaderNodeImpl::getHash ( ) const
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.

const string& ShaderNodeImpl::getName ( ) const
inline

Return the name of this implementation.

Definition at line 47 of file ShaderNodeImpl.h.

virtual const string& ShaderNodeImpl::getTarget ( ) const
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 void ShaderNodeImpl::initialize ( const InterfaceElement element,
GenContext context 
)
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.

virtual bool ShaderNodeImpl::isEditable ( const ShaderInput ) const
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 MslImplementation, GlslImplementation, CarryThinFilmParameters< ShaderNodeImpl >, CarryThinFilmParameters< LayerableNodeMdl >, CarryThinFilmParameters< SourceCodeNodeMdl >, SwizzleNode, GeomPropValueNodeGlsl, and GeomPropValueNodeMsl.

Definition at line 91 of file ShaderNodeImpl.h.

virtual bool ShaderNodeImpl::isEditable ( const ShaderGraphInputSocket ) const
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 void ShaderNodeImpl::setValues ( const Node node,
ShaderNode shaderNode,
GenContext context 
) const
virtual

Set values for additional inputs on a node.

Reimplemented in HwImageNode.

Member Data Documentation

size_t ShaderNodeImpl::_hash
protected

Definition at line 111 of file ShaderNodeImpl.h.

string ShaderNodeImpl::_name
protected

Definition at line 110 of file ShaderNodeImpl.h.


The documentation for this class was generated from the following file: