Fixes and improvements
This commit is contained in:
@@ -56,10 +56,8 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
}
|
||||
// Screen Size
|
||||
case 7:
|
||||
{
|
||||
value = Value(VariantType::Vector2, box->ID == 0 ? TEXT("ScreenSize.xy") : TEXT("ScreenSize.zw"));
|
||||
break;
|
||||
}
|
||||
// Custom code
|
||||
case 8:
|
||||
{
|
||||
@@ -331,7 +329,7 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
|
||||
// Evaluate the function output
|
||||
_graphStack.Push(graph);
|
||||
value = functionOutputBox && functionOutputBox->HasConnection() ? eatBox(node, functionOutputBox->FirstConnection()) : Value::Zero;
|
||||
value = tryGetValue(functionOutputBox, Value::Zero);
|
||||
_graphStack.Pop();
|
||||
break;
|
||||
}
|
||||
@@ -400,7 +398,6 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 30:
|
||||
{
|
||||
const auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||
|
||||
value = writeLocal(inValue.Type, String::Format(TEXT("ddx({0})"), inValue.Value), node);
|
||||
break;
|
||||
}
|
||||
@@ -408,7 +405,6 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 31:
|
||||
{
|
||||
const auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||
|
||||
value = writeLocal(inValue.Type, String::Format(TEXT("ddy({0})"), inValue.Value), node);
|
||||
break;
|
||||
}
|
||||
@@ -416,7 +412,6 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 32:
|
||||
{
|
||||
const auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||
|
||||
value = writeLocal(ValueType::Float, String::Format(TEXT("sign({0})"), inValue.Value), node);
|
||||
break;
|
||||
}
|
||||
@@ -424,7 +419,6 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 33:
|
||||
{
|
||||
const auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||
|
||||
value = writeLocal(ValueType::Bool, String::Format(TEXT("any({0})"), inValue.Value), node);
|
||||
break;
|
||||
}
|
||||
@@ -432,7 +426,6 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
case 34:
|
||||
{
|
||||
const auto inValue = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||
|
||||
value = writeLocal(ValueType::Bool, String::Format(TEXT("all({0})"), inValue.Value), node);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user