funkin-rewritten icon indicating copy to clipboard operation
funkin-rewritten copied to clipboard

Bad texture size and compression format for mobile GPUs

Open CalibriLight opened this issue 4 years ago • 22 comments

Screenshot_2021-09-17-20-15-37 Android

CalibriLight avatar Sep 18 '21 06:09 CalibriLight

Yikes, might need to use a different compression format for Android devices, currently working on an ETC1 variant for all graphics

It's worth noting that Android isn't one of the officially supported platforms right now

htv04 avatar Sep 18 '21 10:09 htv04

Yikes, might need to use a different compression format for Android devices, currently working on an ETC1 variant for all graphics

It's worth noting that Android isn't one of the officially supported platforms right now

Sad, can i put my bf image? If i can tell me how plz

CalibriLight avatar Sep 18 '21 17:09 CalibriLight

Just to add a somewhat "plausible" closure to your issue. As HTV04 has stated there will need to be a ETC1 variant of all the sprites, the reason i can think of him going this route is most android devices may not have enough VRAM (note this is not something you can adjust on your phone) and secondly (unrelated to the first point of HTV04 saying you need ETC1) Even if you can plug in a USB keyboard into your phone using adapters and whatnot it wouldn't be the most (how do i say this) elegant solution as i personally think that having touch buttons corresponding to the note would make the game a bit more "accessible" to the average user who would probably not have the adapters to plug in a USB keyboard.

And finally You also last asked

Sad, can i put my bf image? If i can tell me how plz

One way you could probably do it is to download and install Android Studio if you have a computer and figure out how to export images to ETC1

AM7999 avatar Mar 20 '22 03:03 AM7999

Hold up, I have that same exact issue on my Raspberry Pi, I hadn't read this until now

ghost avatar Apr 11 '22 13:04 ghost

Hold up, I have that same exact issue on my Raspberry Pi, I hadn't read this until now

@GalaxytedYT The reason for this is because Raspberry pis have similar hardware to a modern smartphone (arm SoC (system on a chip))

AM7999 avatar Apr 20 '22 05:04 AM7999

Hold up, I have that same exact issue on my Raspberry Pi, I hadn't read this until now

@GalaxytedYT The reason for this is because Raspberry pis have similar hardware to a modern smartphone (arm SoC (system on a chip))

@AM7999 Then how come the Switch doesn't have that issue? I've heard it's an SoC as well, also I don't really mind the issue just as long as the songs work.

ghost avatar May 11 '22 09:05 ghost

Hold up, I have that same exact issue on my Raspberry Pi, I hadn't read this until now

@GalaxytedYT The reason for this is because Raspberry pis have similar hardware to a modern smartphone (arm SoC (system on a chip))

@AM7999 Then how come the Switch doesn't have that issue? I've heard it's an SoC as well, also I don't really mind the issue just as long as the songs work.

It has a Tegra X1 SoC with more RAM and support for compressed textures, while the Raspberry Pi has a much less powerful SoC.

htv04 avatar May 11 '22 14:05 htv04

(Doing this on a Pi 400)

I'm attempting to in-place (in the most recent beta release .love file) add a pkm imageType and set it as an option in the hardwareCompression setting. Will report back later.

[Edit: whoa, etc1tool does not compress well. It's fricken slow, and, as an example, girlfriend.png went from 5.6M to 33M. Might have something to do with that file being 256M raw, though]

[Edit: haha. Not better. Not only do the images not show, but they don't have transparency either.]

Fordi avatar Jun 03 '22 03:06 Fordi

Fun Fact: i have already gone ahead and done this whole dance with etc1tool it did not work as the textures still did not show up

[Edit] I didnt fully read yours so i though you didnt already get the same result i did :/

AM7999 avatar Jun 03 '22 03:06 AM7999

Yeah, I think it's more an issue with löve being unable to decompress the whole image into memory (which, as I noted for the GF, is like 256M). It fails to allocate and just displays whatever. Tried PNGquanting girlfriend.png down to 16 colors / 8 bit alpha as well as a hail-mary - still no löve.

Fordi avatar Jun 03 '22 03:06 Fordi

i have seen a "better optimized for the pi4/400" version of Löve. Not 100% sure that would change anything

AM7999 avatar Jun 03 '22 03:06 AM7999

I have an 8GB Pi4 laying around somewhere. I'm going to try running it on that. May take a couple days before I get a chance though; it's almost midnight, and I have a day job.

If it runs, it means we're hitting the memory limit at 4 GB.

Cropping girlfriend.png may fix it - she's got a lot of empty space beneath her. I'm not sure what would need to be refactored in the code to compensate, but I'll try that experiment as well.

Fordi avatar Jun 03 '22 03:06 Fordi

I have a pi4 w/ 8gb can confirm to you that it does practically the same thing

actual fun fact time: i use that pi4 as my daily driver since my actual x86 based machine died

[Edit] using a 64 bit OS just to make a bit more sense here

AM7999 avatar Jun 03 '22 03:06 AM7999

@HTV04 Do you mind changing this issue name to Bad compression format for Android and the Raspberry pi 4?

AM7999 avatar Jun 03 '22 03:06 AM7999

I have an 8GB Pi4 laying around somewhere. I'm going to try running it on that. May take a couple days before I get a chance though; it's almost midnight, and I have a day job.

If it runs, it means we're hitting the memory limit at 4 GB.

Cropping girlfriend.png may fix it - she's got a lot of empty space beneath her. I'm not sure what would need to be refactored in the code to compensate, but I'll try that experiment as well.

It seems as if there is a texture limit, the limit being 4096x4096 as it turns out

AM7999 avatar Nov 02 '22 01:11 AM7999

If anyone in this issue thread has a Pi5 could they test it on that

AM7999 avatar Dec 17 '23 02:12 AM7999

Hello, I've gotten the bad texture issue on my RPi 3 and started to work on this to see if I can do anything to fix it. Yesterday I was able to fix the textures by reducing the resolution of all images by 4x and setting the hardwareCompression value to false in the settings.ini file. Here's the folder of my reduced images here: https://file.io/p0IzzCWyk2zw As far as I know this only works on the raspberry pi 3.

DarkBlueStealth avatar May 24 '24 19:05 DarkBlueStealth

The whole reason on why images are messed up is due to the raspberry pi's texture size limit (I believe its 2048x2048?), so making the images smaller would indeed get them to show

GuglioIsStupid avatar May 24 '24 19:05 GuglioIsStupid

Ah, apparently I forgot about the pixel area in week six so all of the characters are fuzzy. I'll make a fix for it.

DarkBlueStealth avatar May 24 '24 20:05 DarkBlueStealth

On the pi4 and pi5 i heard Gman say it was 4096x4096 @GuglioIsStupid, now i'm not sure about other pis

AM7999 avatar May 28 '24 22:05 AM7999

2048x2048 or 4096x4096, its either or

i just went based off a simple search result as I dont have my pi4 setup correctly, but i think it indeed is 4096x4096 for pi4/pi5

GuglioIsStupid avatar May 28 '24 23:05 GuglioIsStupid

@GuglioIsStupid, I have both a pi3 and a pi4 on hand right now. I'll see what max textures they can handle just to verify.

DarkBlueStealth avatar Jun 04 '24 14:06 DarkBlueStealth