Description

Hi Epic,

In MaterialExpressions.cpp UMaterialExpressionSphereMask::Compile(), hardness is not calculated the same way in both <if> conditions. One is missing a multiplication by 0.01f.

Specifically:

int32 Softness = Compiler->Sub(Compiler->Constant(1.0f), Hardness.Compile(Compiler));

should be:

int32 Softness = Compiler->Sub(Compiler->Constant(1.0f), Compiler->Mul(Hardness.Compile(Compiler), Compiler->Constant(0.01f)));

<pre class="ql-syntax" spellcheck="false">In addition, FMath::Max(x, 0.00001f); doesn't work well with half precision shaders because 1 / 0.00001f = 100000. Which is a number higher than the highest half precision value supported. For that reason consider using 0.0001f instead (for radius and other cases too).

</pre>

Steps to Reproduce

1. Add a SphereMaskNode
2. Examine the HLSL output of the node when an input is provided to the node vs without.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-300808 in the post.

0
Login to Vote

Unresolved
ComponentUE - Rendering Architecture - Materials
Affects Versions5.35.45.55.6
CreatedJun 27, 2025
UpdatedJun 27, 2025
View Jira Issue