HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClosureLayerNodeMdl.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_CLOSURELAYERNODEMDL_H
7 #define MATERIALX_CLOSURELAYERNODEMDL_H
8 
11 
14 
16 
17 /// Holds all constants required by the layering and its transformations.
19 {
20  StringConstantsMdl() = delete;
21 
22  public:
23  /// String constants
24  static const string TOP; ///< layer parameter name of the top component
25  static const string BASE; ///< layer parameter name of the base component
26  static const string FG; ///< mix parameter name of the foreground
27  static const string BG; ///< mix parameter name of the background
28  static const string MIX; ///< mix parameter name of the amount
29  static const string TOP_WEIGHT; ///< mix amount forwarded into layer top component
30 };
31 
32 /// Closure layer node implementation for MDL.
34 {
35  public:
36  static ShaderNodeImplPtr create();
37 
38  void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
39 };
40 
41 /// Layerable BSDF node.
42 /// Because MDL does not support vertical layering the nodes are transformed in a way that
43 /// the base node is passed as parameter to the top layer node.
44 /// Note, not all elemental bsdfs support this kind of transformation.
46 {
47  using BASE = SourceCodeNodeMdl;
48 
49  public:
50  virtual ~LayerableNodeMdl() = default;
51  static ShaderNodeImplPtr create();
52 
53  void addInputs(ShaderNode& node, GenContext&) const override;
54  bool isEditable(const ShaderInput& input) const override;
55 };
56 
58 
59 #endif
Holds all constants required by the layering and its transformations.
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:39
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
#define MX_GENMDL_API
Definition: Export.h:18
static ShaderNodeImplPtr create()
static const string TOP_WEIGHT
mix amount forwarded into layer top component
virtual bool isEditable(const ShaderInput &) const
static const string BG
mix parameter name of the background
virtual void addInputs(ShaderNode &node, GenContext &context) const
Add additional inputs on a node.
static const string BASE
layer parameter name of the base component
static const string MIX
mix parameter name of the amount
Closure layer node implementation for MDL.
static const string FG
mix parameter name of the foreground
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
static const string TOP
String constants.
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...