Analytical Derivatives are not calculated properly when using UMaterialExpressionSwitch. Disjoint UVs in screen space result in large jumps in the derivatives, which can cause artifacts as the wrong MIP is sampled for pixels at this border.
1. Download the attached test project and open
2. Observe the static mesh "SM_Sign_Debug", and the white lines around the letters
3. With the Nanite Overview view mode, observe that there are four rectangles barely in front of the main plane of the mesh, for the letters.
4. Open the Material "/Game/lambert2"
5. Observe how a dynamic Switch Material Expression is used to switch between UV indices.
6. Change the Material to use the texture sample labeled "Static (Working)"
7. Observe the lines around the letters disappear
8. Change the Material to use the texture sampler labeled "Dynamic (Workaround)"
9. Observe the lines around the letters disappear
10. Observe that the Dynamic Workaround method manually interpolates the DDX, DDY values for the texture MIP calculations.
11. Change the Material to use the output of the comment block "Visualize autocalculated DDX, DDY"
12. Observe the high DDX, DDY values on the edges of the four rectangles on the mesh.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-296315 in the post.
0 |
Component | UE - Graphics Features |
---|---|
Affects Versions | 5.5.4, 5.6 |
Created | Jun 13, 2025 |
---|---|
Updated | Jun 13, 2025 |