[Runtime Bug]: Worse shadowing detail in NRC due to direct Sky illumination
Describe the bug
In the photo you can see a sink and a faucet on the sink, which, in theory and according to the reference (look at the "expected behavior") should cast a shadow, but NRC is not able to process this quickly and keep it in its cache
How do you reproduce the bug?
-
Download Garry's Mod and launcher from CR and Xenthio (https://github.com/Xenthio/RTXLauncher/releases/tag/v1.0.13)
-
Half-Life 2 must be installed on your computer
-
Select map "d2_coast_05"
-
Disable bots in the context menu (button "C")
-
Get to this house
-
The windows should be broken (as in the photo), as it will be dark with them
What is the expected behavior?
NRC should look roughly the same as ReSTIR GI, as well as the reference
ReSTIR GI:
Reference (1024 frames):
Version
1.1.0
Logs
The launcher automatically creates a config (the same one I use)
Crash dumps
No response
Media
No response
REMIX-4588 for tracking
Edit: OK, after hitting apply and install for the remaining sections in the advanced install, the rtx.conf got deployed.
Hi, I looked at your repro, but it's missing setup steps. I deployed RTXLauncher to Garry's mod, hit install/Update for RTX Remix in the advanced tab, but it didn't create an rtx.conf as you specified on the github ticket. Can you clarify all the steps needed to set this up?
Running it locally, NRC is quite close to ReSTIR Gi as far as prominence of the shadow due to the occluding faucet goes. Can you retry this on vanilla GMod install?
NRC:
ReSTIR GI
I forgot to add that you need to turn off spot and point lights, because in the room itself there are other light sources that were standard in HL2
Tl;dr: this is by design and the problem is really in Remix's direct lighting method not importance sampling the sky contribution. Then ReSTIR GI and NRC sample it instead at a worse sampling rate. ReSTIR GI allows to boost indirect samples on 1st bounce and thus can better recover such lighting. However, RTXDI SDK supports environmental map sampling, but it's not integrated in Remix, I don't think. So the solution here for NRC path would be to add that as well as replace the sky with an environment map in this HL2/GMod scenario.
Disabling spot, directional and point lights - the room is illuminated by in-game sky and so is the shadow cast by a faucet from an occluded sky light. It is technically a direct light shadow, but our direct lighting (RTXDI) implementation doesn't sample or boost sky when it comes from a missed ray - not that it could, but RTXDI SDK does support environment map sampling and that could be the solution here to let RTXDI resolve this contribution for the 1st bounce. Right now, the sky does get sampled indirectly but at a very poor rate. Using a reference denoiser shows this gets captured for both NRC and ReSTIR GI, so it's a problem of very poor sampling of this light source.
Why ReSTIR GI works better in this case? It's because ReSTIR GI boosts indirect samples on primary surfaces while NRC boosts indirect lighting from a 2nd+ bounce - NRC paths generally only query NRC cache from 2nd+ bounce and paths that miss on 1st bounce are simply the same as in the importance sample method, so NRC path output is the same for these 1st bounce misses. Note, NRC does better recover indirect lighting from 2nd+ bounces even for lighting coming from the sky. So that's for bounces that don't miss on first bounce. Notice, the brighter highlights on the gun in NRC case, while this is mostly missing in ReSTIR GI case.
Indirect lighting from 2nd bounce is often lower frequency than that of the 1st bounce lighting since such lighting will be more diffuse/spread, and hence, why the "missing" shadow behind a faucet is more pronounced.
So you mean I should try something like hdri sky?
Can't you make it so that you don't have to replace it with an environment map? so that there is more compatibility
I tried it with HDRI, the effect is the same as in the previous photos
RESTIR GI
NRC
I tried it with HDRI, the effect is the same as in the previous photos
No, this is not integrated in Remix yet, but it's in Remix SDK or one of its samples, meaning it's a potential future improvement.
Can't you make it so that you don't have to replace it with an environment map? so that there is more compatibility
Yes, it should be possible to support a constant value and let the improved sampling work the same way as with an HDRI map.
How long will it take for it to be in remix?
We don't have any timelines to share for this feature at this time.
If you run into more cases/games where there's clear lack of detail due to global sky (+ NRC), please share them here, it'll help with prioritization.
The scenarios more sensitive to this are where sky contribution is dominant but the sky is considerably occluded - like in the use case in this ticket - a sky shining in through a window.
Alright, so again the same scenario where the sun goes through the door. ReSTIR GI again shows more detailed shadows, while NRC takes a long time to process this same shadow and the result is still not as detailed as ReSTIR
ReSTIR GI
And again the same case, where ReSTIR is more detailed than NRC. This table seems to lack shadows coming from the window in NRC.
I have just noticed that the shadow from the props (in the photos above) is also missing (or barely noticeable)
1st one with a chair: NRC looks better there. It's bouncing off indirect lighting softening the shadows which is the desired behavior. But then the screenshots have different cameras, which is not optimal for comparisons, so maybe I am missing something you tried to show.
2nd one: the shading is kind of diffused and there are big differences outside of shadow detail for some reason.
3rd one with kitchen: are those shadows due to a direct sky illumination or is it bounced off some surface outside? It's hard to tell. If it's due to direct occlusion of sky then it's the same. If it's bounced off lighting then please share repro steps since that's a bit of a different case from the one in OP.
The above screenshots are all from GMod + HL2 aren't they? We don't need more cases of the same game - we already know it'd help. If you run into this case in other games, it'll be helpful to share those cases.
3rd one with kitchen: are those shadows due to a direct sky illumination or is it bounced off some surface outside? It's hard to tell. If it's due to direct occlusion of sky then it's the same. If it's bounced off lighting then please share repro steps since that's a bit of a difference case than OP.
probably yes, the light doesn't go directly into the window, but bounces off the ground
So I will share with steps so that it can be repeated
The above screenshots are all from GMod + HL2 aren't they? We don't need more cases of the same game - we already know it'd help. If you run into this case in other games, it'll be helpful to share those cases.
Honestly, I don't know which games to check, because gmod is mostly best for remix