HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HwHeightToNormalNode.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_HWHEIGHTTONORMALNODE_H
7 #define MATERIALX_HWHEIGHTTONORMALNODE_H
8 
10 
12 
14 
15 /// HeightToNormal node implementation for Hw shader languages
17 {
18  public:
19  HwHeightToNormalNode(const string& samplingIncludeFilename) : _samplingIncludeFilename(samplingIncludeFilename) {}
20  virtual ~HwHeightToNormalNode() {}
21 
22  static ShaderNodeImplPtr create(const string& samplingIncludeFilename);
23 
24  void createVariables(const ShaderNode&, GenContext&, Shader& shader) const override;
25 
26  void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
27  void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
28 
29  protected:
30  /// Return if given type is an acceptable input
31  bool acceptsInputType(TypeDesc type) const override;
32 
33  /// Compute offset strings for sampling
34  void computeSampleOffsetStrings(const string& sampleSizeName, const string& offsetTypeString,
35  unsigned int filterWidth, StringVec& offsetStrings) const override;
36 
37  private:
38  const string _samplingIncludeFilename;
39 };
40 
42 
43 #endif
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:39
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
vector< string > StringVec
A vector of strings.
Definition: Library.h:60
virtual bool acceptsInputType(TypeDesc type) const =0
Derived classes are responsible for returning if a given type is an acceptable input.
#define MX_GENSHADER_API
Definition: Export.h:18
virtual void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const
Emit function definition for the given node instance.
virtual void computeSampleOffsetStrings(const string &sampleSizeName, const string &offsetTypeString, unsigned int filterWidth, StringVec &offsetStrings) const =0
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
GLuint shader
Definition: glcorearb.h:785
Definition: Shader.h:32
HeightToNormal node implementation for Hw shader languages.
HwHeightToNormalNode(const string &samplingIncludeFilename)
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
void createVariables(const ShaderNode &node, GenContext &context, Shader &shader) const override
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...