Fix material Sphere Mask node if radius is specified as integer
This commit is contained in:
@@ -378,7 +378,7 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value)
|
||||
const auto invert = tryGetValue(node->GetBox(4), node->Values[2]).AsBool();
|
||||
|
||||
// Get distance and apply radius
|
||||
auto x1 = writeLocal(ValueType::Float, String::Format(TEXT("distance({0},{1}) * (1 / {2})"), a.Value, b.Value, radius.Value), node);
|
||||
auto x1 = writeLocal(ValueType::Float, String::Format(TEXT("distance({0}, {1}) / (float){2}"), a.Value, b.Value, radius.Value), node);
|
||||
|
||||
// Apply hardness, use 0.991 as max since any value above will result in harsh aliasing
|
||||
auto x2 = writeLocal(ValueType::Float, String::Format(TEXT("saturate((1 - {0}) * (1 / (1 - clamp({1}, 0, 0.991f))))"), x1.Value, hardness.Value), node);
|
||||
|
||||
Reference in New Issue
Block a user