bloc97 / Anime4K

A High-Quality Real Time Upscaler for Anime Video
https://bloc97.github.io/Anime4K/
MIT License
18k stars 1.34k forks source link

MPV: gpu-next + Vulkan causes Anime4K to malfunction. #144

Open Artins90 opened 2 years ago

Artins90 commented 2 years ago

I might be getting ahead of myself by submitting a bug report for an in-development rendering option but I find the HDR passthrough of the new gpu-next quite useful.

Unfortunately gpu-next seems to break Anime4K, making lines disappear and darkening the image

Anime4K OFF [gpu-next + Vulkan]: Screenshot (71)

Anime4K ON [gpu-next + Vulkan]: Screenshot (72)

Anime4K ON [gpu-hq + DX11]: Screenshot (73)

bloc97 commented 2 years ago

gpu-next is the new rendering pipeline based on libplacebo, right? I'll keep an eye out on this as there should not be any differences between running shaders on gpu vs gpu-next, as libplacebo implements the same hook syntax as mpv.

Artins90 commented 2 years ago

Yes, from the mpv manual:

"gpu-next Experimental video renderer based on libplacebo. This supports almost the same set of features as --vo=gpu. See GPU renderer options for a list.

Currently, this only supports --gpu-api=vulkan, and no hardware decoding. Unlike --vo=gpu, the FBO formats are not tunable, but you can still set --gpu-dumb-mode=yes to forcibly disable their use.

Should generally be faster and higher quality, but some features may still be missing or misbehave. Expect (and report!) bugs."

Artins90 commented 2 years ago

I just tried using Vulkan with vo-gpu and, as hooke007 suggested, Vulkan on its own is triggering the issue, I think it's safe to assume it's a Vulkan issue.

hooke007 commented 2 years ago

I deleted the post for I am not sure if it was caused by the vulkan driver or mpv's vulkan api. Maybe report it to mpv?

hooke007 commented 2 years ago

@bloc97 Sry to disturb u, after one commit (not sure which one) of upstream, restore_CNN_M didn't work properly with vo=gpu-next gpu-api=vulkan https://github.com/mpv-player/mpv/issues/9505 (aliasing or no change at all) I wish I was not the only lucky one to meet with the issue. still reproduce here by this build. 20211212 https://sourceforge.net/projects/mpv-player-windows/files/64bit/

bloc97 commented 2 years ago

Hmm... it seems that gpu-next doesn't like //!SAVE MAIN. If you remove that line the shader Anime4K_Restore_CNN_M works correctly. The same can be applied to the upscale shaders.

hooke007 commented 2 years ago

Eh, work for some kinds of cases, but could still produce aliasing in my case.

bloc97 commented 2 years ago

Really? I couldn't reproduce aliasing problems after removing all the //!SAVE MAIN from the shaders.

hooke007 commented 1 year ago

but could still produce aliasing in my case.

With more tests I found it would happen on 720p source(paused) but not 1080p.

apply single Anime4K_Restore_CNN_M.txt (no //!SAVE MAIN)

origin --------------------------------- gpu --------------------------------- gpu-next -- --