Volumetric shadows and ray traced shadows together?

Hello,
is there a way to make Volumetric shadows and ray traced shadows work together?

Ray traced shadows ON / Volumetric Fog ON

Ray traced shadows OFF / Volumetric Fog ON

Yes there is, but your options are a little interesting.

  1. William Faucher had a video on exactly this problem. The essential issue is that the volumetric fog is shadowed via shadow maps effecting the froxels, and RT shadows aren’t recognized by the fog as shadowing. What he suggested is to have two lights, one traditional and one RT. the traditional one is very dim but has high volumetric scattering, and the RT light doesn’t scatter but casts shadows.

There are many reasons this is a problematic approach, but it is an option, and here’s the video elaborating on it: Mix Volumetric Fog & Raytraced Shadows the RIGHT Way (Unreal Engine 4.26) - YouTube

  1. Download NVRTX. Nvidia has an enhanced version of UE5_0 that solves exactly this problem: it gives a handful of options to the user, including keeping RT shadows but using volumeric shadowmaps, or using RT to light the froxels directly. They let you choose according to performance needs, but it’s certainly an option if you believe it’ll fit your project. Best of luck to you!
2 Likes

Thank you for your reply!

I already tried the method of that video, sadly it does not work well in UE5, you get a lot of artifacts and funny things using two directional lights

About your second solution, sadly the Github page from Nvidia does not work: https://github.com/NvRTX/UnrealEngine
I found the link in the official nvidia page about NVRTX:RTX Branch of Unreal Engine (NvRTX) | NVIDIA Developer

thank you anyway!

It does not work well, you are correct, and it has very strange implications on indirect lighting as well. It’s a good cheat for renders but not much more.

And that link actually works perfectly for me, but I think I know why you’re facing issues: if it’s throwing a 404, it’s because you’re not authorized to access the repository. You need to make sure your epic games and github accounts are linked (documentation explains how), and Nvidia may or may not require a special application, you should check. Either way, I’ve pulled down their repo before with great success.

1 Like

thank you for your replies!!

I had my account linked but I missed one email confirmation from github

1 Like

Yep, that would do it. It was a pretty big hassle for me as well to get everything configured, I can relate to your problems. And I’m happy to help if I can, this problem in particular was one of the thorniest for me when dealing with atmospheric lighting, and I’m happy if I can lend a hand :slight_smile:

UPDATE: there is a way to make ray-traced lights affect volumetric fog normally, simply use the CVAR
r.VolumetricFog.InjectRaytracedLights 1. The older technique shouldn’t be used, as it is extremely hacky.

1 Like

As a Lead Lighting TA I’m going to say this as I say many times, if you are making a real game that you plan on releasing to the public do not have directional lights. Especially shadow casting ones. There is a laundry list of reasons why, but trust me don’t do that. Especially with Lumen/ Nanite. You will murder your performance, not to mention introduce a slew of rendering issues

huh? a lead ta? for what type of game?

ofc you can use directional lights. how would you do a sun without it? volume interaction works just fine with shadow maps. for the performance you gotta limit how much geometry you draw into the shadow cascade. and ofc raytraced does the job if you got the hardware for it, and the cvar is on. actually… currently (5.5 from last week)… the directional light is the only one that supports volumetric shadows on all types of meshes. this screenshot is with raytraced shadows.

i dunno how nanite handles all of this. i’m building with polygons not sculpts, yet.

It handles it with either proxy meshes or nanite streaming, although the latter has thrashes that make it essentially unshippable, nevermind the massive memory or compute costs.

Do you mean baking lights out statically? Pardon me saying it, but games have been shipping with directional lights and CSMs for years, including UE ones. Lumen and nanite are both separate questions, as one is a real-time GI solution that definitely requires its’ own optimizations, but nanite is plug-and-play for most content the average game will have. That said, VSMs do have significant performance costs and aren’t usually acceptable from my knowledge.

I have no doubt you are very knowledgeable about your craft, but from my understanding, the features that you can ship with are entirely a product of what game you want to make. Maybe a multiplayer MMORPG would struggle with lumen and nanite, but a single-player corridor shooter could accommodate it easier. That said, I am curious what you mean by ‘a slew of rendering issues’. I look forward to learning more.