NVIDIAGameWorks / rtx-remix

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

[Runtime Bug]: Raytraced Rendertargets - Add Light to Texture + Crash #658

Open xoxor4d opened 1 month ago

xoxor4d commented 1 month ago

Describe the bug

First of all, great Feature!

I've noticed two issues when using Raytraced Rendertargets:

1) If a texture tagged as Add Light to Texture is present in the scene that is being rendered to a different rendertarget, it will not be rendered/used in that RT scene. Instead, it will be rendered in the world that draws the rendertarget on a eg. monitor (relative to the object using that texture and the monitor that draws the RT texture).

2) If I then enable the light debug view (to visualize the light positions and hashes), the runtime throws an assertion. image

How do you reproduce the bug?

  1. Add category Add Light to Texture to a texture that is used in the raytraced rendertarget scene
  2. See that this light is not present in that raytraced rt scene when looking at the monitor displaying that scene
  3. See that the light is added to the "main" world -> relative to the position of the monitor screen and the mesh with the Add Light to Texture texture

What is the expected behavior?

No response

Version

0.6.0-rc3

Logs

No response

Crash dumps

No response

Media

Video on the showcase discord server: https://discord.com/channels/1028444667789967381/1289195427119501424/1297532870830592041

NV-LL commented 1 month ago

REMIX-3645 for tracking

xoxor4d commented 1 month ago

I'm also encountering a nullptr access when starting the game from visual studio with a debugger attached (dxvk-runtime: debug / optimized). I've only added one raytraced RT texture to raytracedRenderTargetTextures.

image

It's starting fine with no debugger attached or if I attach the debugger after game initialization.

xoxor4d commented 1 month ago

^ m_image is null image

Edit: I've added a nullptr check which prevents the access but now it fails in D3D9Rtx::isRenderingUI() -> D3D9Rtx::checkBoundTextureCategory() when trying to get the hash from the image.

Should be reproducible when launching portal 2 without any further modifications. All that's needed is d3d9.shaderModel = 2