Description

When a groom is present, setting any SamplesPerRay SMRT CVar to zero results in an unexpected complete shadow projected from the light.

ProjectLight() in VirtualShadowMapProjection.usf has additional code to handle groom shadows when a groom is present in the scene. This code iterates of the minimum of the SamplesPerRayHair and the SamplesPerRay of the light being projected. When either value is zero, the body of the subsequent for loop does not run.

After the for loop, AccShadowFactor is normalised based on the raycount on line 451. Since the loop did not execute, AccShadowFactor should be zero. On 452, the resultant shadow factor is set to minimum of itself and the AccShadowFactor, leading to the shadow factor also becoming zero and causing a completely shadowed projection.

Steps to Reproduce

In a level, place a directional light and a local light such that both case a visible shadow.
Add geometry to cast a shadow if the local light does not cast a visible shadow.

Confirm that SamplesPerRayLocal and SamplesPerRayDirectional behave normally by setting either to zero. The result should be the reduction of the SMRT soft shadow effect on the VSM shadows to zero.

Reset these values to any value above 0.

Add a groom to the scene.

Repeat the above check, and notice that the zero value now causes complete shadowing instead of a lack of soft shadows.

SamplesPerRayHair at 0 has the effect of causing the above effect to occur on all VSM light sources.

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Graphics Features
Affects Versions5.55.6
CreatedMay 28, 2025
UpdatedMay 30, 2025
View Jira Issue