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

Split up massive templates automatically to avoid OOM #59

Open
adudyak opened this issue Jul 25, 2023 · 8 comments
Open

Split up massive templates automatically to avoid OOM #59

adudyak opened this issue Jul 25, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@adudyak
Copy link

adudyak commented Jul 25, 2023

Once I open settings with template https://ua.rocks/img/canvas.png - page crashes.
image
image
Chrome Version 114.0.5735.248 (Official Build) (64-bit)
Version 115.0.5790.102 (Official Build) (64-bit)
Win 10

@LittleEndu LittleEndu added the bug Something isn't working label Jul 26, 2023
@LittleEndu
Copy link
Contributor

LittleEndu commented Jul 26, 2023

That image is 2500x1500 and the overlay script needs to turn it into 7500x4500 image to display it, your GPU would need to allocate a 16k texture to save it in memory.

@LittleEndu LittleEndu changed the title Memory exceeded Split up massive templates automatically to avoid OOM Jul 26, 2023
@Yay295
Copy link

Yay295 commented Jul 27, 2023

Is there a reason you copy the templates to a canvas instead of using mask directly on the template images?

@LittleEndu
Copy link
Contributor

Because we want the "show only every Nth pixel" feature.

@LittleEndu
Copy link
Contributor

In addition we currently support variable amounts of dithering if you use the priority mask. I don't think anyone besides us actually used it so we can probably drop the support for priority masks and just find a way to generate a mask that shows every Nth pixel but is also infinitely repeating

@Yay295
Copy link

Yay295 commented Jul 27, 2023

Ah, right. A mask wouldn't be able to do randomness.

@LittleEndu
Copy link
Contributor

I think they can, I think you can use SVG as mask so the only thing we would need to do is generate our own SVGs.

@LittleEndu
Copy link
Contributor

The other thing to consider with the mask is animated templates. If animated template wants to spend time being dithered then any template overlapping with the animate template needs a part of it masked out. idk if we can stack masks like that, probably can if we use <div> elements with different masks applied to each

@Yay295
Copy link

Yay295 commented Jul 27, 2023

It looks like Bocchi used a priority mask: https://nyaan.moe/bocchiplace2023.json

MLP also used a priority mask, but only when using their own overlay script: https://github.com/r-ainbowroad/2023-minimap
They provided a template compatible with this template manager, but it didn't include the priority mask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants