Why do volumes differ in density between UE Pathtracer and Lumen?

We found that in order to get a match between Pathtracing and Lumen renders of a VDB volume, we have to substantially lower the object’s density (using a shader) on Pathtracing side in order to get a match with the object look on Lumen side at density of 1.

Is there a constant number that is being used on Pathtracing side as a multiplier?

Thanks

Pathtracing using material density of 1.0:

[Image Removed]

Lowering material density to 0.02 and comparing to a Lumen render that uses material density of 1.0:

[Image Removed]

Steps to Reproduce

  1. Import a large vdb
  2. Switch between “Lit” and “Pathtracing” modes.

Update: we discovered that we can get rid of the black artefacts by increasing r.PathTracing.MaxRaymarchSteps 2048. (But the difference between pathtracing and Lumen results is still there)

[Image Removed]

There shouldn’t be a difference in principle. As you’ve noted, at high density you may need to increase the r.PathTracing.MaxRaymarchSteps cvar for the render to look correct.

Some differences in look are expected since Lumen can’t really simulate multiple scattering, which the path tracer does by default.

Would you be able to share your test scene so we can compare? I am curious what kind of density values are in the vdb itself (relative to its scale).

Hey Chris, we had a meeting with Epic yesterday, we are prepping up a pdf version of our document where we logged all of our test environment/parameter values. Once you guys take a look we can pick this back up from there.

Thanks

Just checking in to make sure you were able to send us the pdf? Who was your contact point for the meeting you had so I can follow up internally?

Hi Chris - Michel Neely is our TPM, we have provided this PDF via an email to him. Please let me know if you need me to send this to you directly.

Sorry for the delay, we finally got some cycles to take a look at your project in detail. [mention removed]​ and I tracked the difference in density between Lumen and the Path Tracer down to handling of the scale in the transform.

The vdb in the scene you provided has an implicit scale factor of 10. If we “cancel out” this scale factor in the engine by scaling the heterogeneous volume by 0.1 uniformly, the lit and path traced views agree much more closely. You should expect some lighting differences due to the fact the path tracer bounces light inside the volume by default. You can eliminate that variable by setting your path tracing max bounces to 1 in the PostProcessVolume. That should also help align with the default behavior in your production renderer as well.

Patrick is going to be looking at tracking down the mismatch coming from the scale. For now the workaround would be to avoid scaling the volume if you can, but we hopefully can get a fix into the next build of UE 5.6.

Hope this helps!

Hi Chris,

Thank you for looking into this. This is very helpful, please keep us posted as to the upcoming fix.

Thank you

Another observation [mention removed]​ has mentioned is that it appears much of what you are running into appear to be associated with the voxelizer running out of memory. That being said, these two CVars will increase the bottom-level memory pool for the path tracing implementation:

r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes (default=128)

r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes (default=128)

On a high-memory card, I would crank those up to 1024 without issue

Hope this additional info helps!

Michael

Hi Michael, thank you. Yes, we are already running these at 1024 and 2048 respectively.

Here’s a list of cvars I found help us get large volumes to render without issues:

r.HeterogeneousVolumes.HardwareRayTracing 1

r.HeterogeneousVolumes.IndirectLighting 1

r.HeterogeneousVolumes.MaxTraceDistance 150000

r.PathTracing.MaxRaymarchSteps 2048

r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes 1024

r.HeterogeneousVolumes.frustumGrid.ShadingRate 1

r.HeterogeneousVolumes.FrustumGrid.FarPlaneDistance 0

r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes 2048

r.HeterogeneousVolumes.OrthoGrid.ShadingRate 1

Just to add to this, I did run a comparison with path tracing bounces set to 1 and I see fairly good agreement on density.

Again I’d happily look into your setup to see if there’s something else that I haven’t thought of that might be impacting the result.