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>
1. Add a SphereMaskNode
2. Examine the HLSL output of the node when an input is provided to the node vs without.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-300808 in the post.
0 |
Component | UE - Rendering Architecture - Materials |
---|---|
Affects Versions | 5.3, 5.4, 5.5, 5.6 |
Created | Jun 27, 2025 |
---|---|
Updated | Jun 27, 2025 |