Added DDX / DDY nodes

This commit is contained in:
W2.Wizard
2021-01-27 01:39:50 +01:00
parent f1763840c9
commit 1925fe5724
2 changed files with 49 additions and 1 deletions

View File

@@ -391,6 +391,22 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
value = writeLocal(ValueType::Vector2, String::Format(TEXT("{0} * {1} + {2}"), uv.Value, tiling.Value, offset.Value), node);
break;
}
// DDX
case 30:
{
auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
value = writeLocal(inValue.Type, String::Format(TEXT("ddx({0})"), inValue.Value), node);
break;
}
// DDY
case 31:
{
auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
value = writeLocal(inValue.Type, String::Format(TEXT("ddy({0})"), inValue.Value), node);
break;
}
default:
break;