Anime4KWebBoost / Anime4K-WebGPU

Implementation of Anime4K in WebGPU
MIT License
23 stars 2 forks source link

Missing a couple of glsl options? #21

Open guydht opened 1 week ago

guydht commented 1 week ago

Hey, first thanks for an awesome package. This project is a lifesaver to all (like me) who didn't delve into GPU rendering.

I do have a question tho, in the Anime4K repo there are more options of shaders, like CNN_{S, L}, Denoise_CNN_{S, M, L, UL}. I just wonder, is there a specific reason as to not include all the shader varients? Is it hard to add the remaining ones?

plasmas commented 1 week ago

Thanks for your interest! Yes the original Anime4K repo covers more shader options than this repo, and the reason lies in the semi-automated way we currently use to convert those shaders into webGPU pipelines.

Right now, each mpv glsl shader can be converted into multiple wgsl shaders with this script. However, since webGPU, like Vulkan, is low-level, we need to manually write pipelines that chain the wgsl shaders, like this pipeline. These pipelines are easy to write once you understand one of them since they just represent the compute graph of the NNs in glsl.

Also, only a handful of shaders are used in the most popular preset modes defined in the original repo, and they were all made available here in hope that the needs of most users could be satisfied. We are currently out of time and people to cover every shader in the Anime4K repo, but will add more in the future :)