Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any thoughts on porting shaders to WebGL / WebGPU for web-based viewers? #4

Open
kvnxiao opened this issue Sep 25, 2024 · 2 comments
Open

Comments

@kvnxiao
Copy link

kvnxiao commented Sep 25, 2024

Had thoughts of working on a web-based application for reading manga and thought this would be a great way to up the quality of old sources. Of course, this would require using WebGL / WebGPU.

@funnyplanter
Copy link
Owner

Yes this seems like a cool idea. The main problem I have right now (even with the current repo) is that it will be annoying and probably quite bloatful to generate all the possible permutations of shaders for each backend every time I update/add new models.
What I'm thinking right now is that I'll use free time next month to work the shader generation into a github.io page using something like Pyodide. Then I would only pre-generate the mpv(/dp4a)/Magpie shaders onto the repo, but I'll upload the raw model files as well which would be able to work with the webapp generator.
This will complete #5 as well.

@kvnxiao
Copy link
Author

kvnxiao commented Oct 1, 2024

Awesome, I'm afraid I can't help too much here since I'm not familiar with writing shader code, but I think the next step would be to investigate how to use the .glsl shaders in a web context via WebGL or WebGPU.

There is, for example, this reference https://github.com/Anime4KWebBoost/Anime4K-WebGPU for using Anime4K with WebGPU - and likely the approach would be very similar here as well.


I know there are a few tools online that can help convert glsl shader code to wgsl which WebGPU uses, for example this discussion from gfx-rs/wgpu#1812 (comment) -- but not sure how relevant or helpful it will be here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants