Added Material Node to Blend Normals

This commit is contained in:
Richard
2021-01-24 22:31:45 +11:00
parent 71110c9f29
commit 843a04604d
2 changed files with 24 additions and 0 deletions

View File

@@ -337,6 +337,14 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
case 25:
value = Value(VariantType::Vector3, TEXT("GetObjectSize(input)"));
break;
case 26:
{
const auto BaseNormal = tryGetValue(node->GetBox(0), Value::Zero).AsVector3();
const auto AdditionalNormal = tryGetValue(node->GetBox(1), Value::Zero).AsVector3();
const String text = String::Format(TEXT("float3((float2({0}.xy) + float2({1}.xy) * 2.0), sqrt(saturate(1.0 - dot((float2({0}.xy) + float2({1}.xy) * 2.0).xy, (float2({0}.xy) + float2({1}.xy) * 2.0).xy))))"), BaseNormal.Value, AdditionalNormal.Value);
value = writeLocal(ValueType::Vector3, text, node);
break;
}
default:
break;
}