MaterialX 1.39.3
Loading...
Searching...
No Matches
HwHeightToNormalNode.h
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
11#include <MaterialXGenShader/Nodes/ConvolutionNode.h>
12
13MATERIALX_NAMESPACE_BEGIN
14
16class MX_GENSHADER_API HwHeightToNormalNode : public ConvolutionNode
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:
31 bool acceptsInputType(TypeDesc type) const override;
32
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
41MATERIALX_NAMESPACE_END
42
43#endif
Hardware shader generator base class.
vector< string > StringVec
A vector of strings.
Definition Library.h:60
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition Library.h:39
ConvolutionNode()
Constructor.
A context class for shader generation.
Definition GenContext.h:30
void computeSampleOffsetStrings(const string &sampleSizeName, const string &offsetTypeString, unsigned int filterWidth, StringVec &offsetStrings) const override
Compute offset strings for sampling.
void createVariables(const ShaderNode &, GenContext &, Shader &shader) const override
Create shader variables needed for the implementation of this node (e.g.
void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit function definition for the given node instance.
void emitFunctionCall(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit the function call or inline source code for given node instance in the given context.
bool acceptsInputType(TypeDesc type) const override
Return if given type is an acceptable input.
Class containing all data needed during shader generation.
Definition Shader.h:33
Class representing a node in the shader generation DAG.
Definition ShaderNode.h:320
A shader stage, containing the state and resulting source code for the stage.
Definition ShaderStage.h:139
A type descriptor for MaterialX data types.
Definition TypeDesc.h:40