Description

Summary

In 5.8, Hierarchical Instanced Static Mesh (HISM) instances whose Opaque material uses Dithered LOD Transition flicker black while the camera moves when the project enables Use Stencil for LOD Dither Fading (r.StencilForLODDither=1). It happens in the Blueprint editor viewport and in PIE. It did not happen in 5.6/5.7.

This is a regression from [Link Removed] (CL 48668262 / 48668307, which removed the Instanced Static Mesh vertex factory on full-GPU-Scene platforms).

Root cause (from code; confirmed by A/B tests)

  • In 5.8, ISM/HISM on SM6 use FLocalVertexFactory, which supports a null pixel shader and position-only drawing (Engine/Source/Runtime/Engine/Private/LocalVertexFactory.cpp:667-682). The old ISM VF had DoesNotSupportNullPixelShader and no position-only support.
  • With r.StencilForLODDither=1, FMaterial::WritesEveryPixel() (Engine/Source/Runtime/Engine/Private/Materials/MaterialShared.cpp:4886-4895) treats an Opaque material with Dithered LOD Transition as writing every pixel.
  • So the depth prepass (Renderer/Private/DepthRendering.cpp:961-970) and the velocity pass (VelocityRendering.cpp:920-948) draw the HISM position-only, with no pixel shader.
  • The position-only VS does not apply the per-instance LOD visibility (Shaders/Private/LocalVertexFactory.ush:1193-1199 vs :1065-1071), and there is no ClipLODTransition.
  • The stencil dither path only covers static mesh batches (DepthRendering.cpp:237); HISM is dynamic-relevance only, so its per-instance dither gets no stencil coverage.
  • The base pass runs the full VS (instances outside their LOD band are collapsed) plus the per-instance ClipLODTransition (MaterialTemplate.ush:4509-4517), with no depth write and a NearOrEqual test.
  • Result: prepass depth with no GBuffer behind it, so black pixels that move with LOD distance and dither as the camera moves.

Steps to reproduce

  1. 5.8 project, DX12 SM6, Windows. In Project Settings > Engine > Rendering > Optimizations, enable Use Stencil for LOD Dither Fading (r.StencilForLODDither=True) and restart.
  2. Use a non-Nanite static mesh with 2+ LODs and an Opaque material with Dithered LOD Transition enabled.
  3. Add a Hierarchical Instanced Static Mesh component with several instances of that mesh (e.g. in a Blueprint).
  4. Open the Blueprint (or place it in a level and PIE) and move the camera so instances cross their LOD transition distance.

Expected: smooth dithered LOD transitions.

Actual: fast black dithering/flickering on the instances.

Reproduced on the 5.8.3 launcher build (NVIDIA RTX 2080 SUPER) with the licensee's repro project (available on the linked SF case). Repro rate 100%.

A/B results (5.8.3, licensee project)

Config Result
— —
Licensee DefaultEngine.ini (r.StencilForLODDither=True) Flickers
+ foliage.DitheredLOD 0 Fixed
+ r.MeshDrawCommands.DynamicInstancing 0 Flickers (not [Link Removed])
r.StencilForLODDither=False Fixed
r.InstancedStaticMeshes.UseInstancedStaticMeshVertexFactory=1 (stencil dither still on) Fixed
r.EarlyZPassOnlyMaterialMasking=True Flickers

Workarounds

  • Disable Use Stencil for LOD Dither Fading (r.StencilForLODDither=False, the engine default).
  • Or set r.InstancedStaticMeshes.UseInstancedStaticMeshVertexFactory=1 in [ConsoleVariables] (more shader permutations).
  • Or foliage.DitheredLOD 0 / disable Dithered LOD Transition on the material (LODs pop).

Possible fix direction

Do not let ISM/HISM draws on the Local VF take the null-PS / position-only prepass path when the material uses dithered LOD transition (or when per-instance LOD visibility is needed). Alternatively, make the position-only VS honour per-instance visibility and dither.

Related: [Link Removed], [Link Removed] (HISM flicker with StencilForLODDither, closed Cannot Reproduce), [Link Removed] (different ISM flicker, ruled out).

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Rendering - Architecture
Affects Versions5.8
Target Fix6.0
CreatedOct 28, 2026
UpdatedDec 3, 2026
View Jira Issue