MaterialX 1.38.9
Loading...
Searching...
No Matches
HeightToNormalNodeGlsl.h
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_HEIGHTTONORMALNODEGLSL_H
7#define MATERIALX_HEIGHTTONORMALNODEGLSL_H
8
10
11#include <MaterialXGenShader/Nodes/ConvolutionNode.h>
12
13MATERIALX_NAMESPACE_BEGIN
14
16class MX_GENGLSL_API HeightToNormalNodeGlsl : public ConvolutionNode
17{
18 public:
19 static ShaderNodeImplPtr create();
20
21 void createVariables(const ShaderNode&, GenContext&, Shader& shader) const override;
22
23 void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
24 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
25
26 const string& getTarget() const override;
27
28 protected:
30 bool acceptsInputType(const TypeDesc* type) const override;
31
33 void computeSampleOffsetStrings(const string& sampleSizeName, const string& offsetTypeString,
34 unsigned int filterWidth, StringVec& offsetStrings) const override;
35};
36
37MATERIALX_NAMESPACE_END
38
39#endif
vector< string > StringVec
A vector of strings.
Definition: Library.h:57
Macros for declaring imported and exported symbols.
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Utility class for implementations of nodes which perform convolutions.
Definition: ConvolutionNode.h:22
virtual bool acceptsInputType(const TypeDesc *type) const =0
Derived classes are responsible for returning if a given type is an acceptable input.
void createVariables(const ShaderNode &node, GenContext &context, Shader &shader) const override
Create shader variables needed for the implementation of this node (e.g.
Definition: ConvolutionNode.cpp:37
A context class for shader generation.
Definition: GenContext.h:31
HeightToNormal node implementation for GLSL.
Definition: HeightToNormalNodeGlsl.h:17
Class containing all data needed during shader generation.
Definition: Shader.h:33
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:326
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.
Definition: ShaderNodeImpl.cpp:57
virtual void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const
Emit function definition for the given node instance.
Definition: ShaderNodeImpl.cpp:53
virtual const string & getTarget() const
Return an identifier for the target used by this implementation.
Definition: ShaderNodeImpl.h:39
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:28