NVIDIAGameWorks / rtx-remix

Combined repo for the RTX-Remix runtime
https://www.nvidia.com/en-us/geforce/rtx-remix/
MIT License
1.35k stars 68 forks source link

Star Wars Battlefront 2 (2005) (Steam) - Sky Auto Detect Not Hiding Transparent Objects Between Geometry #478

Open Arrokoth7323 opened 3 months ago

Arrokoth7323 commented 3 months ago

Describe the bug Star Wars Battlefront 2 (2005) (Steam), Sky Tuning's Sky Auto Detect not taking effect. When enabling Sky Auto-Detect to hide transparent objects in the distance between other geometry, said transparent objects as of Remix 0.5.0 no longer remain hidden. Hence always visible.

GPU used RTX 3090 using driver 552.12.

Attach files! d3d9.log NvRemixBridge.log BattlefrontII_d3d9.log rtx.conf

To Reproduce Steps to reproduce the behavior:

  1. Load into any Instant Action level
  2. Go to 'Game Setup'
  3. Click on 'Step 2: Parameter Tuning'
  4. Expand 'Sky Tuning'
  5. Select 'By Camera Position and Depth' from 'Sky Auto-Detect'
  6. Go behind any surface and look in the direction of a command post to observe if command post holograph visible through geometry. Same can be done with any other transparent object such as a window.

Expected behavior

Screenshots RayTracing Enabled - Sky Auto Detect On RayTracing Enabled - Sky Auto Detect Off

RayTracing Disabled

sion3951 commented 3 months ago

Have you tried turning "Orthographic as UI" off in Heuristics, that mostly fixes the issue in Star Wars Battlefront 04 but I still get an issue where some of the transparent stuff is rendered on top of the RTX stuff sometimes.

Arrokoth7323 commented 3 months ago

Have you tried turning "Orthographic as UI" off in Heuristics, that mostly fixes the issue in Star Wars Battlefront 04 but I still get an issue where some of the transparent stuff is rendered on top of the RTX stuff sometimes.

Doing so will make the skybox take over the screen

20240506153412_1

Kim2091 commented 3 months ago

@Arrokoth7323 Are you using automatic skybox detection? If so, turn it off and manually mark the skybox textures

If you're not using it, also try turning it on

NV-LL commented 2 months ago

@Arrokoth7323 Are you using automatic skybox detection? If so, turn it off and manually mark the skybox textures

If you're not using it, also try turning it on

@Arrokoth7323 have you had a chance to try this suggestion yet?

sion3951 commented 2 months ago

@Arrokoth7323 Are you using automatic skybox detection? If so, turn it off and manually mark the skybox textures If you're not using it, also try turning it on

@Arrokoth7323 have you had a chance to try this suggestion yet?

So the issue is that when "Orthographic is UI" (I think that is the name, but I don't quite remember as it was a while ago when I worked this out) is turned on then all textures that have something going on in the alpha channel are treated as UI and are visible through walls. If that is turned off, Automatic Sky detection doesn't work so has to be turned off.

This resolves the issue

Arrokoth7323 commented 2 months ago

@Arrokoth7323 Are you using automatic skybox detection? If so, turn it off and manually mark the skybox textures If you're not using it, also try turning it on

@Arrokoth7323 have you had a chance to try this suggestion yet?

So the issue is that when "Orthographic is UI" (I think that is the name, but I don't quite remember as it was a while ago when I worked this out) is turned on then all textures that have something going on in the alpha channel are treated as UI and are visible through walls. If that is turned off, Automatic Sky detection doesn't work so has to be turned off.

This resolves the issue

As much as I would like to state this is an accurate workaround. It is not. Before the 0.5.0 update we were able to properly hide any sky like object, aka objects I suppose the game thought light shouldn't cast onto. This could be windows, the skybox, or holographs from the command posts.

After 0.5.0 all of the above mentioned items would no longer be hidden through geometry when using Sky auto-detect. In order to properly hide them so they are not present on screen at all times use settings:

rtx.orthographicIsUI = False rtx.skyAutoDetect = 0

Before 0.5.0 we used:

rtx.orthographicIsUI = True rtx.skyAutoDetect = 2

The difference now between pre-0.5.0 and after 0.5.0 with these new settings enabled is that...

  1. Windows now act properly as windows. Before with the old settings they would treated like Sky and ignored regardless of texture categorization
  2. Holographic projections from Command Posts were visible, now they are not. The "cone" in this image is what I referring to what is missing now. https://osiris.gamefront.com/gamefront/screenshots/84/files2/84712_1.jpg
  3. With the new settings a gray texture will appear covering your screen on initial load in, marking as ignore will remove it for all maps and whenever you launch the game.

RTX.conf: rtx.conf.txt

I suppose what I am getting at with this post, is if you could explain what changes were made to sky auto-detect if any since 0.50+?

NV-LL commented 1 month ago

REMIX-3371 for tracking

sultim-t-nv commented 2 weeks ago

From what I understood, the "Sky Auto-Detect" is used here purely to hide game's transparent objects? If so, then I don't quite know if it actually would work -- because the primary use of "Sky Auto-Detect" is to automatically mark D3D9 draw calls as sky, mostly on Valve's Source-like 3D skyboxes. To mark a sky, texture tags can be used; and to hide these transparent objects... hopefully also texture tags, assuming that the transparent draw calls have textures.

(To clarify, 'sky' -- is a distant geometry that is rendered into a cubemap, so when a traced ray misses a scene geometry, it would get a color from that cubemap.)

explain what changes

Optionally store more information about potential sky draw calls to reproject 3D sky geometry to main camera space (look Sky Tuning -> Advanced -> Reproject Sky to Main Camera which is disabled by default), so it can be ray traced. For that, some parts of sky auto-detection was moved between CPU threads, but orthographicIsUI check was preserved relative to sky auto-detection logic 🤔