HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShaderTranslator.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_SHADERTRANSLATOR_H
7 #define MATERIALX_SHADERTRANSLATOR_H
8 
10 
13 
15 
16 /// A shared pointer to a ShaderTranslator
17 using ShaderTranslatorPtr = shared_ptr<class ShaderTranslator>;
18 
19 /// @class ShaderTranslator
20 /// A helper class for translating content between shading models.
22 {
23  public:
25  {
27  }
28 
29  /// Translate a shader node to the destination shading model.
30  void translateShader(NodePtr shader, const string& destCategory);
31 
32  /// Translate each material in the input document to the destination
33  /// shading model.
34  void translateAllMaterials(DocumentPtr doc, const string& destShader);
35 
36  protected:
38 
39  // Connect translation node inputs from the original shader
40  void connectTranslationInputs(NodePtr shader, NodeDefPtr translationNodeDef);
41 
42  // Connect translation node outputs to finalize shader translation
43  void connectTranslationOutputs(NodePtr shader);
44 
45  protected:
48 };
49 
51 
52 #endif
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
#define MX_GENSHADER_API
Definition: Export.h:18
shared_ptr< class ShaderTranslator > ShaderTranslatorPtr
A shared pointer to a ShaderTranslator.
NodeGraphPtr _graph
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
Definition: Document.h:22
static ShaderTranslatorPtr create()
GLuint shader
Definition: glcorearb.h:785
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
shared_ptr< NodeGraph > NodeGraphPtr
A shared pointer to a NodeGraph.
Definition: Node.h:34
shared_ptr< Node > NodePtr
A shared pointer to a Node.
Definition: Node.h:24
shared_ptr< NodeDef > NodeDefPtr
A shared pointer to a NodeDef.
Definition: Definition.h:32