From e5ac9d48a6a00f514bc6e00b77853a2e3800b090 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 14 Apr 2020 23:07:00 +1000 Subject: [PATCH] mathnode: added path for math between a texture and a matrix --- app/node/math/math.cpp | 6 ++++++ app/node/math/math.h | 1 + 2 files changed, 7 insertions(+) diff --git a/app/node/math/math.cpp b/app/node/math/math.cpp index 7bd031240..461058d98 100644 --- a/app/node/math/math.cpp +++ b/app/node/math/math.cpp @@ -84,6 +84,7 @@ Node::Capabilities MathNode::GetCapabilities(const NodeValueDatabase &input) con case kPairTextureColor: case kPairTextureNumber: case kPairTextureTexture: + case kPairTextureMatrix: return kShader; case kPairSampleNumber: return kSampleProcessor; @@ -260,6 +261,7 @@ NodeValueTable MathNode::Value(const NodeValueDatabase &value) const case kPairTextureColor: case kPairTextureNumber: case kPairTextureTexture: + case kPairTextureMatrix: case kPairSampleNumber: // Do nothing break; @@ -319,6 +321,8 @@ QString MathNode::GetShaderUniformType(const NodeParam::DataType &type) return QStringLiteral("sampler2D"); case NodeParam::kColor: return QStringLiteral("vec4"); + case NodeParam::kMatrix: + return QStringLiteral("mat4"); default: return QStringLiteral("float"); } @@ -349,6 +353,7 @@ QVector MathNode::GetPairLikelihood(const NodeValueTable &table) } else if (type & NodeParam::kMatrix) { likelihood.replace(kPairMatrixMatrix, i); likelihood.replace(kPairMatrixVec, i); + likelihood.replace(kPairTextureMatrix, i); } else if (type & NodeParam::kColor) { likelihood.replace(kPairColorColor, i); likelihood.replace(kPairNumberColor, i); @@ -366,6 +371,7 @@ QVector MathNode::GetPairLikelihood(const NodeValueTable &table) likelihood.replace(kPairTextureTexture, i); likelihood.replace(kPairTextureNumber, i); likelihood.replace(kPairTextureColor, i); + likelihood.replace(kPairTextureMatrix, i); } } diff --git a/app/node/math/math.h b/app/node/math/math.h index 50448feb9..2720298ce 100644 --- a/app/node/math/math.h +++ b/app/node/math/math.h @@ -77,6 +77,7 @@ private: kPairNumberColor, kPairTextureNumber, kPairTextureColor, + kPairTextureMatrix, kPairSampleSample, kPairSampleNumber,