alelievr / HDRP-Custom-Passes

A bunch of custom passes made for HDRP
MIT License
1.25k stars 136 forks source link

Not compatible with Dynamic Resolution #32

Closed brytag closed 7 months ago

brytag commented 3 years ago

I am not able to get the outline to work correctly when using Dynamic Resolution. It looks like is being drawn after the resolution is applied rather than before. Any ideas for a work-around?

alelievr commented 2 years ago

Hello, which version of HDRP are you using? I tested with HDRP 11 and 12 and I didn't had any issues with dynamic res

Tanshaydar commented 2 years ago

For the masked blur, I'm using HDRP 12.1.3 and when I enable DLSS in the project only a quarter of the screen is drawn (lower left). If you like, I can provide screens.

I'm using Unity 2021.2.8 HDRP 12.1.3 Build target is desktop

gewl commented 2 years ago

For the masked blur, I'm using HDRP 12.1.3 and when I enable DLSS in the project only a quarter of the screen is drawn (lower left). If you like, I can provide screens.

I'm using Unity 2021.2.8 HDRP 12.1.3 Build target is desktop

I'm encountering this as well, although with the foreground passes rather than the masked blur. Is it related to this unity issue?

Tanshaydar commented 2 years ago

I'm encountering this as well, although with the foreground passes rather than the masked blur. Is it related to this unity issue?

Yeah it's related to that issue. I'm having the same issue with some other custom Post Process effects, too. Currently I'm not able to utilize DLSS or FSR due to this issue, which has been in review for quite some time now.

Tanshaydar commented 2 years ago

I'm sorry, this is closed now, but it's not fixed.

I'm on Unity 2021.3.6f1 and using HDRP 12.1.7

Here's how Blur looks with default settings: image

And this is how it looks when DLSS is enabled: image

I've seen your commits in Unity graphics repository which seemingly resolved this issue, but they're not backported into HDRP 12.x versions, nor 2021.3.x versions yet. So, if this is a Unity issue, and if it's not going to be fixed/backported (which I think it won't), then either this issue must be pinned or must take place in the Readme as Custom Passes and Custom Post Process effects are broken in Dynamic Resolution.

alelievr commented 2 years ago

Sorry I thought it was fixed since the issue on the unity reporter side was fixed, I'm going to check locally

alelievr commented 1 year ago

@Tanshaydar the issue is related to the blur function we use, so the outline effect should not be concerned. Can you check that it's the case?

Tanshaydar commented 1 year ago

@alelievr this issue only affects custom post process and custom pass effects that works in screen space. TIPS, Selection, SeeThrough, Glass, Glitch etc. are working. (If you are interested, Liquid and Scrolling Formulas are not working on Unity 2021.3.9 & HDRP 12.1.7 but that's another issue.)

As I said, I already saw your commit in the next HDRP (Unity Graphics repository) to fix this issue, but it is not backported to 2021.3 HDRP 12.x I think the file and folder structure changed a lot with 13.x onward, so I can't do it myself. I mean the backporting thing.

So it's not "the blur function", it's because Blur is a fullscreen custom pass that does not translate with dynamic resolution. And that's a Unity bug that has not been resolved since 2021.2.

My only workaround is to custom implement staging/2021.3 branch from Graphics repository and add an "After Post Process" injection point for DLSS to work after post process, which resolves the issue, but when a blur is upscaled with DLSS, it becomes really messy.

alelievr commented 7 months ago

I fixed the last issue with dynamic resolution with this commit: 4fe545c1ca65e1a4420e2660568cb7e19e21e41f (tested all the scenes so it should work correctly with Unity 2022.3).

The dynamic scaling system is a big mess though, there are way too many different variables used for scaling. At some point, I hope we'll be able to simplify the API. The problem is that as long as we need to support Dx11 we can't remove the scaling and each texture you sample needs to have an appropriate scaling depending on where it comes from (before upscaler or after upscaler) so it's a big can of worms 😕

If a new scaling issue appear in a custom pass, you can reopen this or make a new issue.