Skip to content

Commit

Permalink
Expose hardcoded UDIM transform names. Currently for atlas lookup but (
Browse files Browse the repository at this point in the history
…#1274)

can be used for array lookup as well.
  • Loading branch information
bernardkwok authored Jul 19, 2021
1 parent d9420ea commit 5c66311
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/Nodes/HwImageNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
namespace MaterialX
{
// Additional implementaton arguments for image nodes
const string UV_SCALE = "uv_scale";
const string UV_OFFSET = "uv_offset";
string HwImageNode::UV_SCALE = "uv_scale";
string HwImageNode::UV_OFFSET = "uv_offset";

ShaderNodeImplPtr HwImageNode::create()
{
Expand Down
6 changes: 6 additions & 0 deletions source/MaterialXGenShader/Nodes/HwImageNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class MX_GENSHADER_API HwImageNode : public HwSourceCodeNode

void addInputs(ShaderNode& node, GenContext& context) const override;
void setValues(const Node& node, ShaderNode& shaderNode, GenContext& context) const override;

// Aguments which may be added as part of the signature for image nodes
// to allow for additional texture coordinate transformations.
// Currently these are added to support UDIM texture atlas lookup.
static string UV_SCALE;
static string UV_OFFSET;
};

} // namespace MaterialX
Expand Down

0 comments on commit 5c66311

Please sign in to comment.