HTV04 / funkin-rewritten

Optimized rewrite of Friday Night Funkin' built on LÖVE
GNU General Public License v3.0
109 stars 39 forks source link

Bad texture size and compression format for mobile GPUs #14

Open CalibriLight opened 3 years ago

CalibriLight commented 3 years ago

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

HTV04 commented 3 years ago

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

CalibriLight commented 3 years ago

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

AM7999 commented 2 years ago

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

ghost commented 2 years ago

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

AM7999 commented 2 years ago

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))

ghost commented 2 years ago

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.

HTV04 commented 2 years ago

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.

Fordi commented 2 years ago

(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.]

AM7999 commented 2 years ago

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 :/

Fordi commented 2 years ago

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.

AM7999 commented 2 years ago

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

Fordi commented 2 years ago

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.

AM7999 commented 2 years ago

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 commented 2 years ago

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

AM7999 commented 1 year ago

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 commented 9 months ago

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

DarkBlueStealth commented 4 months ago

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.

GuglioIsStupid commented 4 months ago

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

DarkBlueStealth commented 4 months ago

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.

AM7999 commented 4 months ago

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

GuglioIsStupid commented 4 months ago

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

DarkBlueStealth commented 4 months ago

@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.