NVIDIA / Q2RTX

NVIDIA’s implementation of RTX ray-tracing in Quake II
Other
1.21k stars 180 forks source link

Sync with Q2PRO: Water warp effect #376

Closed res2k closed 4 months ago

res2k commented 4 months ago

Upstream added a "water warp" effect to the GL renderer. This adds the same effect to the RTX renderer.

The principle is the same; the water warp is applied as the last step after rendering the view. I opted to do this in the "final blit" step; the "final_blit_lanczos" shader was turned into a more generic "final_blit" shader, with lanczos filtering and warping controllable via specialization constants. (It's now also used for a "simple blit", ie both filtering and warping is turned off.)

apanteleev commented 4 months ago

Thanks @res2k - I'm not sure why someone would want to make playing underwater even more difficult, but if q2pro has this effect, why not. :)

I tested the effect, and it looks good, but there's one issue: when DRS is enabled and drs_maxscale > 100, there is a wavy black border at the right and bottom edges of the screen.

res2k commented 4 months ago

Thanks @res2k - I'm not sure why someone would want to make playing underwater even more difficult, but if q2pro has this effect, why not. :)

Actually, this effect was a feature of original Quake II, back when it shipped - albeit in the software renderer only, as it wasn't feasible with the 3D accelerators back then. So you could see this as actually restoring a feature ;)

I tested the effect, and it looks good, but there's one issue: when DRS is enabled and drs_maxscale > 100, there is a wavy black border at the right and bottom edges of the screen.

Fixed it with some clamping.

Also added menu entries for warping.

Lastly, I noticed some "border weirdness" when FSR is enabled... but this seems to be more an FSR thing than warping, so I'll look into that separately.