-
Notifications
You must be signed in to change notification settings - Fork 18
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
Shaders on Android #17
Comments
gl es doesn't support implicit type casting between int and float or default uniform values. you need to edit the shaders to remove default values from extern statements, and also to explicitly cast int to float, and vice-versa. to not break functionality, you should also edit the lua files to send the default values to the shader at the very start, to emulate how default values work in desktop glsl. |
@WarpspeedSCP Can these changes be made on the PC without ill effect as well? Perhaps to fix this, the repo should just have modified shaders to start with. |
@Guard13007 I think it would work on desktop as well since the ES version of GLSL is a restricted form of desktop GLSL. I've seen forum posts confirm this as well. |
I would really like to use this lib for a cross platform game I'm making, so I placed a 100$ bounty on this issue to help out. |
Well, I sort of managed it before, so I guess I'll just try it again and issue a pull request some time? |
Sure, as long as the lib works on all platforms (win/mac/linux/android/ios) I'm happy. Would try it myself but haven't got the time, so money is the best help I can offer. |
I'll get around to it as soon as possible. |
I added a util.loadShader function to load the shaders and send the initial extern values, and fixed the implicit conversions in the shaders : #31 |
Would this also fix ios? The bounty and issue are for android, but it would be nice to get two birds with one stone. Sadly I cant test ios myself. |
It should. There's nothing platform specific in the way love handles graphics. |
So is it good ? |
It fixes most of it, but 1 shader( EDIT OK, I tried these changes on my phone (android) and it caused a kernel panic or something (it freezes, then reboots) Maybe it's just the demo, but something in this code doesn't agree with android (maybe also ios?). |
lw.zip Try it (if you dare) rename the .zip to .love. I haven't tested on desktop (though it probably wouldn't cause such problems) EDIT - Desktop works fine. It's absoutely unusable on android though. |
Weird! I just tried the phosphor.glsl again, but it works fine on my phone. |
Not all examples work and some crash the app without giving me a useful error. But this is great progress none the less. Ultimately if I can get a 256x160 @ 60fps game on my phone I would be super happy. It may not work out and I will just have to use a classic tile based fog of war instead of using lighting to show only whats visible, but with the semi working zip above I am now at least hopeful we will get there. :) |
@F483 Just curious, but what phone do you have? Which examples are you able to run? That error with the read only thing happens in all android phones as far as I've seen. Seems to be an implementation issue on love's end. |
If you let it idle for a while at the title screen, does anything untoward happen? Which examples crash on your phone? Because it invariably drives my phone nuts and makes it reboot. My phone isn't any pushover either. Very inexplicable. |
Okay, I fixed the read-only file issue Indeed, for me it seems after some time on the menu screen the example just crashes. It does only if I am on the menu screen though, if I select an example and stay it won't crash. Strange. All the examples seem to work for me, although some take a while to load. |
I really have a hard-time pinpointing any errors. Sometimes it crashes straight when opening an example. Other times it works fine. Sometimes even the main screen crashes. Maybe it is time based? Seems very random at least. Will give the new zip a try in a bit, got to go eat. |
Seems like my phone is different from the rest, love just won't cooperate. Or not. With issues like this, maybe you should consider a different library to use for your game. |
Can confirm the read only error is fixed. Still not sure about the crashes, they seem to be random and I have a hard time pinpointing it or getting any error. Have you tried running it in the emulator? Can you get a console log from the emulator that is useful? |
In reference to the error about the read-only FS, can someone confirm that it was an error in the permissions for the app or something else? (That was my first assumption but I want to know if that was it or not in preparation for the possibility of encountering a similar error myself later on.) |
I can confirm that the fix by @SpaVec worked in regards to the read-only FS issue, it still does crash after some time. |
@SpaVec What did you do that fixed the read-only FS issue? |
@Guard13007 I just used love.filesystem.write instead of the lua function, so that it tries to write to the LÖVE save folder instead of some place it doesn't have access |
Any update on the status of the issue? Would love to use this for an android/ios game. |
Are you still searching? What do you need in the light engine(bodys -> raycasting, which effects(just lights or also water, blur etc.))? |
It seems that shaders are not compatible with GLSL ES, I attempted to run an example on adroid and it was not able to create shaders.
The text was updated successfully, but these errors were encountered: