Specified variants

This commit is contained in:
W2.Wizard
2021-01-25 12:37:42 +01:00
parent ee166bafed
commit c0c2da34d7
2 changed files with 4 additions and 4 deletions

View File

@@ -405,9 +405,9 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
// Remap
case 48:
{
auto inVal = tryGetValue(node->GetBox(0), node->Values[0]);
auto rangeA = tryGetValue(node->GetBox(1), node->Values[1]);
auto rangeB = tryGetValue(node->GetBox(2), node->Values[2]);
auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat);
auto rangeA = tryGetValue(node->GetBox(1), node->Values[1].AsVector2());
auto rangeB = tryGetValue(node->GetBox(2), node->Values[2].AsVector2());
// Clamp value?
if (node->Values[3].AsBool)

View File

@@ -378,7 +378,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
const Vector2 rangeA = tryGetValue(node->GetBox(1), node->Values[1]).AsVector2();
const Vector2 rangeB = tryGetValue(node->GetBox(2), node->Values[2]).AsVector2();
// Use clamp?
// Clamp value?
if (node->Values[3].AsBool)
{
value = Math::Clamp(rangeB.X + (inVal - rangeA.X) * (rangeB.Y - rangeB.X) / (rangeA.Y - rangeA.X), rangeB.X, rangeB.Y);