TurboWarp / extensions

User-contributed unsandboxed extension gallery for TurboWarp
https://extensions.turbowarp.org/
MIT License
107 stars 217 forks source link

[Canvas Effects] Pixelated rendering mode + render size not working on mobile/android #1549

Open Dogo6647 opened 1 week ago

Dogo6647 commented 1 week ago

I'm trying to make a GBA-styled game where I need the canvas to "snap" to a resolution of 338x160 so that it looks convincingly low-res when sprites are scaled and rotated and every sprite pixel is equally squared (Scratch has a weird bug where low-res bitmaps look warped on some screens). So far these two blocks have worked pretty well for achieving the desired effect...

Until I tested my game packaged on my phone (packaged on PC works fine). I've tested several different mobile browsers (Brave, Built-in Jelly Browser on LineageOS, Via Browser, Google Chrome) and devices (Pixel 6a, Galaxy Tab A7 Lite, Honor 9X, Nexus 5, Galaxy S5, running android 14, 13, 10, 13, and 11 respectively (yes I custom rom a lot, that's why the N5 and S5 are running recent versions)), and none of them seem to do the render size thing at all.

This may sound kinda desperate but I absolutely need those blocks to work for the reasons listed above, as well as a graphical glitch in my tile-based scrolling level engine that causes a few gaps between the blocks to appear, which instantly gets fixed when those canvas effects are applied. If anyone needs more information, please let me know.

GarboMuffin commented 1 week ago

can you post a small example project for us?

Dogo6647 commented 1 week ago

Sure! I actually happened to have a test project early in the development of the game to test just that. I just updated it to include some newer graphics from the game to better illustrate the issue.

Here's a screenshot of the test project on desktop showing a rotated sprite (how the low-res effect SHOULD look like): desktop_gbalftest And a 1-pixel line: (Again, on the desktop): onepixelphone_gbalftest

Whereas on my phone it looks like this: phone_gbalftest onepixeldesktop_gbalftest

Notice how when the sprite is rotated/scaled, pixels on the phone look unrealistically thin for a retro-styled game because of the blocks not working? Plus, here's the horrid gap glitch on the level tiles as I mentioned earlier: Screenshot_20240618-001441_Via Whereas on the desktop, it simply doesn't exist: nonexistent

I think this has more to do with Scratch automatically rounding some decimals on the x/y value of the tiles without me telling it to do so, but the low-res effect doubles as a quick fix for that so it's still relevant.

Oh, and here's the test project's sb3 file, along with a packaged version of it: gbaLFTest_ghissue.zip To reproduce the issue, simply copy the packaged project to an android device and run it there.