25 #ifndef PXR_USD_SDR_SHADER_NODE_H
26 #define PXR_USD_SDR_SHADER_NODE_H
31 #include "pxr/usd/sdr/api.h"
36 PXR_NAMESPACE_OPEN_SCOPE
41 #define SDR_NODE_METADATA_TOKENS \
42 ((Category, "category")) \
44 ((Departments, "departments")) \
48 ((Primvars, "primvars")) \
49 ((ImplementationName, "__SDR__implementationName"))\
50 ((Target, "__SDR__target"))
57 #define SDR_NODE_CONTEXT_TOKENS \
58 ((Pattern, "pattern")) \
59 ((Surface, "surface")) \
60 ((Volume, "volume")) \
61 ((Displacement, "displacement")) \
63 ((LightFilter, "lightFilter")) \
64 ((SampleFilter, "sampleFilter")) \
65 ((PixelFilter, "pixelFilter"))
67 #define SDR_NODE_ROLE_TOKENS \
68 ((Primvar, "primvar")) \
69 ((Texture, "texture")) \
87 const NdrVersion& version,
88 const std::string& name,
92 const std::string& definitionURI,
93 const std::string& implementationURI,
94 NdrPropertyUniquePtrVec&& properties,
95 const NdrTokenMap& metadata = NdrTokenMap(),
96 const std::string &sourceCode = std::string());
168 const NdrTokenVec&
GetPages()
const {
return _pages; };
187 return _primvarNamingProperties;
225 void _PostProcessProperties();
234 NdrTokenVec _primvars;
235 NdrTokenVec _primvarNamingProperties;
240 NdrTokenVec _departments;
243 SdrPropertyMap _shaderInputs;
244 SdrPropertyMap _shaderOutputs;
248 void _InitializePrimvars();
251 NdrTokenVec _ComputePages()
const;
254 PXR_NAMESPACE_CLOSE_SCOPE
256 #endif // PXR_USD_SDR_SHADER_NODE_H
SDR_API SdrShaderNode(const NdrIdentifier &identifier, const NdrVersion &version, const std::string &name, const TfToken &family, const TfToken &context, const TfToken &sourceType, const std::string &definitionURI, const std::string &implementationURI, NdrPropertyUniquePtrVec &&properties, const NdrTokenMap &metadata=NdrTokenMap(), const std::string &sourceCode=std::string())
Constructor.
SDR_API NdrTokenVec GetAssetIdentifierInputNames() const
Returns the list of all inputs that are tagged as asset identifier inputs.
SDR_API const NdrTokenVec & GetDepartments() const
The departments this node is associated with, if any.
SDR_API std::string GetHelp() const
The help message assigned to this node, if any.
SDR_API const NdrTokenVec & GetPages() const
Gets the pages on which the node's properties reside (an aggregate of the unique SdrShaderProperty::G...
SDR_API const NdrTokenVec & GetPrimvars() const
The list of primvars this node knows it requires / uses.
SDR_API const TfToken & GetCategory() const
The category assigned to this node, if any.
Token for efficient comparison, assignment, and hashing of known strings.
Represents an abstract node.
SDR_API NdrTokenVec GetAllVstructNames() const
Gets all vstructs that are present in the shader.
SDR_API const NdrTokenVec & GetAdditionalPrimvarProperties() const
The list of string input properties whose values provide the names of additional primvars consumed by...
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
SDR_API std::string GetImplementationName() const
Returns the implementation name of this node.
SDR_API std::string GetRole() const
Returns the role of this node.
SDR_API SdrShaderPropertyConstPtr GetShaderOutput(const TfToken &outputName) const
Get a shader output property by name.
A specialized version of NdrNode which holds shading information.
SDR_API SdrShaderPropertyConstPtr GetShaderInput(const TfToken &inputName) const
Get a shader input property by name.
SDR_API SdrShaderPropertyConstPtr GetDefaultInput() const
Returns the first shader input that is tagged as the default input.
This file defines some macros that are useful for declaring and using static TfTokens.
SDR_API NdrTokenVec GetPropertyNamesForPage(const std::string &pageName) const
Gets the names of the properties on a certain page (one that was returned by GetPages()).
SDR_API const TfToken & GetLabel() const
The label assigned to this node, if any.