Description

When r.SSR.Stencil is enabled, the areas with high roughnesss are not discarded and Unlit materials are incorrectly handled.

See the linked EPS case (Additional Info URL) for a full explanation of the issue and where the logic appears to be inverted in Engine\Shaders\Private\SSRT\SSRTReflections.usf

TThe proposed fix is to invert the condition in ScreenSpaceReflectionsStencilPS to be:

if (RoughnessFade > 0.0 && bNoMaterial == false)
{
    discard;
}

This may be confusing, but since the discarded side is the area that will be computed by SSR, Unlit materials should pass this condition, and areas with RoughnessFade <= 0 should pass, as well.

Since RoughnessFade applies only to non-Unlit materials, this condition becomes logically good.

After applying the corrected code, the resulting stencil looks correct and the sky and high-roughness areas are correctly marked. These painted areas are the ones that should be discarded.

Steps to Reproduce

1. Extract the attached SSR_StencilTest.zip into a UE 5.6 project.
2. Launch the project.
3. Enter the following console command: r.SSR.Stencil 1

Expected

When r.SSR.Stencil is enabled, it is expected to mark the areas that should not be calculated in the stencil buffer. After that, the main SSR process begins, and the heavy pixel shader processing is supposed to be correctly culled by Early Stencil. 

Actual

The actually output stencil looks like the attached image and the result appears to be reversed. Areas with high roughness are supposed to be discarded, so it is strange that everything except the sky becomes perfectly clean in this state.

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Graphics Features
Affects Versions5.6
CreatedDec 19, 2025
UpdatedDec 19, 2025
View Jira Issue