Skip to content

Commit

Permalink
Fix HeightToNormalNode shadergen for GLSL and MSL targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolassavva-autodesk committed Oct 18, 2023
1 parent a5780ea commit 0f987dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/MaterialXGenGlsl/Nodes/HeightToNormalNodeGlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ ShaderNodeImplPtr HeightToNormalNodeGlsl::create()
return std::make_shared<HeightToNormalNodeGlsl>();
}

// override removes undesirable parent ConvolutionNode shader code
void HeightToNormalNodeGlsl::createVariables(const ShaderNode&, GenContext&, Shader&) const
{
}

void HeightToNormalNodeGlsl::computeSampleOffsetStrings(const string& sampleSizeName, const string& offsetTypeString,
unsigned int, StringVec& offsetStrings) const
{
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXGenGlsl/Nodes/HeightToNormalNodeGlsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class MX_GENGLSL_API HeightToNormalNodeGlsl : public ConvolutionNode
public:
static ShaderNodeImplPtr create();

void createVariables(const ShaderNode&, GenContext&, Shader& shader) const override;

void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;

Expand Down
5 changes: 5 additions & 0 deletions source/MaterialXGenMsl/Nodes/HeightToNormalNodeMsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ ShaderNodeImplPtr HeightToNormalNodeMsl::create()
return std::make_shared<HeightToNormalNodeMsl>();
}

// override removes undesirable parent ConvolutionNode shader code
void HeightToNormalNodeMsl::createVariables(const ShaderNode&, GenContext&, Shader&) const
{
}

void HeightToNormalNodeMsl::computeSampleOffsetStrings(const string& sampleSizeName, const string& offsetTypeString,
unsigned int, StringVec& offsetStrings) const
{
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXGenMsl/Nodes/HeightToNormalNodeMsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class MX_GENMSL_API HeightToNormalNodeMsl : public ConvolutionNode
public:
static ShaderNodeImplPtr create();

void createVariables(const ShaderNode&, GenContext&, Shader& shader) const override;

void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;

Expand Down

0 comments on commit 0f987dd

Please sign in to comment.