Issue with Translucency volume

Hi,

We’re on 5.6.1 and are seeing an issue with VFX that use the translucency volume cascade where VFX that are in shadow can be lit as if they are outside in full daylight. This seems to effect particles that are in the second cascade. We’ve see this on Windows and consoles. Probably related to this, we’ve also seen that particles in the second cascade can flicker (lit/not lit) even when the game is paused, mainly when viewed using PIE on Windows but has also been reported from a Windows packaged build. The images from PS5 below show brightly lit particles when r.TranslucentLightingVolumeInnerDistance is set to 15, and lit as expected when r.TranslucentLightingVolumeInnerDistance is set to 10000.

I had a quick look and it seems to be related to sampling from the virtual shadow map and if I comment out the CollectLightForTranslucencyLightingVolumeInjection() block in TranslucentLighting.cpp (line 2570ish) the problem doesn’t occur.

I think the same issue has been reported in the forums: Niagara translucent particles dont recieve shadows at a distance from the camera

Thanks,

Matt.

Hi there,

I have so far only been able to replicate this if the translucent surface / particles go outside (or near the edge due to smooth fadeout) the bounds of the outer translucent lighting cascade. Can you check with r.TranslucencyLightingVolume.Debug 1 whether your particles are outside the inner cascade but still inside the outer cascade? You can adjust the outer cascade distance as well with r.TranslucencyLightingVolumeOuterDistance. If you can confirm that this is happening for particles inside the outer cascade, then can you send through a minimal reproduction project for this to help me replicate the issue.

Edit: The default value of r.TranslucencyLightingVolumeOuterDistance is only 5000, so in your example you are setting the inner cascade to be larger than the outer. It may be the case that you simply need to expand your outer cascade volume size.

Regards,

Lance Chaney

Hi Lance,

Thanks for highlighting the debug info. I’ve tried to use it in one of our levels and it’s pretty much impossible to see where the lines intersect the world because there’s so much going on. It does at least give the dimensions, based on Inner at 500, Outer at 15000, and Dim of 48. With these settings I’ve tried to capture the vfx showing the flicker using a stationary debug camera and just rotating (apologies for the pretty poor quality gif). The particles are in the outer cascade but not far from the camera in an internal scene (appox. 15m). Does look similar to the light bleeding you were seeing? In your level, where is the light bleeding coming from given what looks like just a single sky light and no shadows being cast in the volume? Turning off the blur actually made the lighter part of the flicker brighter. I’m not sure we can push the volume res higher than 48 due to the cost of the per-frame updates.

Cheers,

Matt.

[Image Removed]

Hi Lance,

Thanks again for the detailed answers, I think I’ve tried everything suggested and I still see the flicker. I also noticed that even with the translucency volume disabled, there can be a slight flicker so maybe there’s more than one thing going on. I’ll ask again if the content team can attempt to recreate the issue so we can send you a repro.

Thanks,

Matt.

Hi Lance,

Yes, we are changing both inner and outer values. We originally found the same issue as you with longer draw distances so had to push the outer value out to 20000. I’ll confirm again that setting the inner value to something really close (like 15, as mentioned in first message) means the particles are pretty much all in the outer cascade, but I’m pretty sure this is the case.

I’ll see I can get the content people to set up a repro but were unable to when I asked them before.

Edit: should also add it’s not 100% repro although it is common with PIE. The particles also sometime flicker between correctly lit and brightly lit (as in the two images), even when the game is paused when using “Pause” on the command line. I’ve tried to capture in PIX but the issue never occurs with PIX capture enabled.

2nd Edit: we’re using a volume res of 48 which seems to make it occur more often than 32. Setting the outer at 20000 and then moving the inner around (say 1500) I could see the particles switching close to the camera using the debug camera, assuming these are in centimetres (like other values) it looked consisted with the inner distance.

Thanks,

Matt.

I recommend using r.TranslucencyLightingVolume.Debug 1 to debug the final volume sizes. There are some extra calculations that affect the size, so the specified CVar values are not the final sizes. I’ve attached a screenshot of what this looks like when InnerDistance is 1500 and OuterDistance is 5000 (default). You can see the final volume sizes in the top left corner. The easiest way to check transition distances in the world is to look at where the bounding volumes intersect the ground plane (there is a slight darkening of the debug line when it goes behind an object). I’ve marked these locations on the screenshot with red arrows to demonstrate.

[Image Removed]Using a resolution of 32 and 48 with such a large outer cascade (20000 -> ~56668) means that you will have very sparse lighting information in your outer cascade. Keep in mind that this will mean you only have a maximum of 48 depth slices across this entire distance that you can sample from, and in between sample points you will be getting an interpolated value, causing a lot of light bleed. There is also a blur applied in all dimensions by default (r.TranslucencyVolumeBlur). When using such a sparse volume, you probably want to at least turn this off, since otherwise this will exacerbate light bleed from the sparse samples.

I could not replicate the light flickering in my test project, even testing with the values you specified. So a reproduction might be necessary for me to debug your exact issue, as this seems related if it flicks back and forth between correct and not-correct.

Using OuterDistance of 20000 (final size: ~56668) and r.TranslucencyLightingVolumeDim 48, I do see the lighting transition quite close to the inner cascade, but this is most likely from light bleed caused by sparse samples. Increasing the resolution resolves the issue. Turning off the blur can also help.

Regards,

Lance Chaney

I don’t think I can replicate this exact flickering issue using my setup. If I turn off the blur and get the distance just right I can maybe reproduce something like this, but I don’t think it really flickers back and forth the same way as I see in your example. Would you be able to create a reproduction project that has this fog particle, material, lighting, and rendering setup, and / or can at least reproduce the flickering issue. It could be some interactions with the Material, the Niagara system setup, or your specific lighting / rendering setup that is causing this issue.

In my scene I have a big cube behind the camera that is casting a long shadow from a directional light. Since I’m using the default settings there isn’t much light bleed in my setup. Bleed would come from sampling between two voxels, one that lies in shadow, and one in light. These voxels could be very far apart if the volume is large and the resolution low.

While testing this again with your settings, I’ve realized that there is actually another major source of lighting inconsistency across the translucency lighting volumes. If you have Lumen enabled, the translucent lighting is also affected by Lumen’s radiance caching and its relevant translucency lighting settings. If you do have lumen enabled, it is likely that your radiance cache clipmaps are not large enough to cover your current translucency light volumes. Can you try setting your global illumination method in you post processing volume to None, and re-checking this issue, to isolate whether this is caused by the translucency light volumes, or by Lumen radiance caching. All the CVars for controlling the Lumen settings for translucency are under r.Lumen.TranslucencyVolume.*. The major one you’ll probably want to test adjusting is r.Lumen.TranslucencyVolume.EndDistanceFromCamera. This is default 8000, can you try adjusting it to match the size of your Translucency Light Volume1, as listed by r.TranslucencyLightingVolume.Debug 1 (not the direct CVar values you set). You should also be aware that r.Lumen.TranslucencyVolume.EndDistanceFromCamera is scaled by FinalPostProcessSettings.LumenSceneViewDistance / 20000.0f as well, so your post processing volume settings will also affect this.

To visualize the Lumen translucency volume radiance cache, you can set `r.Lumen.RadianceCache.Visualize 1` + `r.Lumen.TranslucencyVolume.RadianceCache.Visualize 1`. You can also use r.Lumen.RadianceCache.VisualizeClipmapIndex to visualize specific clipmaps. Note that increasing r.Lumen.TranslucencyVolume.EndDistanceFromCamera will likely have performance implications if you find you need to do that.

Below is an example showing the effect of r.Lumen.TranslucencyVolume.EndDistanceFromCamera when Lumen is enabled*.*

r.Lumen.TranslucencyVolume.EndDistanceFromCamera 8000

[Image Removed]r.Lumen.TranslucencyVolume.EndDistanceFromCamera 40000

[Image Removed]

FYI, my colleague has also answered a similar case to this in the past. You can review his response [Content removed] It might give you some more ideas on how to work around this issue. One of his suggestions was to switch to a dithered masked material at a distance. Of course the problem with this is trying to hide any popping with the transition.

Regards,

Lance Chaney

Thanks for that, I think a reproduction will be required to debug this specific case.

Regards,

Lance Chaney