I'm developing a game with Godot 3.5 GLES2 and running into the problem that shaders that work fine on desktop or web do not draw when I export my project to Android (I can't upgrade to Godot 4 because my project depend on a plugin which does not work for 4). No shader I've tried works - even very simple ones and even the SpatialMaterial when converted to a shader. VisualShaders don't work either. I've tried using GLES3, but I can't even get the program to run in that mode. Is there a way to get shaders to work on Android?
Frustration Looks like the solution was to reimport the texture map with the compress mode set to something other than Video RAM.
You have to enable 3D + effects in the project settings for GLES2, but not all features are supported.
Preindicate Where are those settings located?
Preindicate Those settings don't seem to be present. At least I can't find them.
Under Rendering > Quality, find Intended Usage header and make sure Framebuffer Allocation.mobile is set to 3D and not 3D without effects or either of the 2D options I guess. Hovering over the Framebuffer Allocation should give a description elaborating further. Even with this tho, if the device hardware is not capable of supporting relevant GLES/glsl version then this might be in vain.
I tried your suggestion, but it does not help. I would hope that my phone would be able to handle GLES2 shaders since it is fairly new. I'm not sure how I'd check for that. It also seems weird that the Framebuffer Allocation.mobile
is greyed out in my editor. Does that indicate something?
Propensity It also seems weird that the Framebuffer Allocation.mobile is greyed out in my editor. Does that indicate something?
It's the same for me, think it's just meant to indicate that it's secondary/not relevant to the platform you are running the editor on. Like it only applies to mobile platforms you would export to. But I'm just speculating on that.
edit: btw, I assumed you already have read it in the docs (since it's the top result on google when making a search for it), but should have asked before if you had:
When using GLES2, some custom shaders may break when exporting to Android. This is caused by a lower shader precision being used by default to improve performance. You can force high precision on all shader computations by enabling
rendering/gles2/compatibility/enable_high_float.Android
project setting, but this has a significant performance cost and won't work on all devices.
Frustration There were a few lines like that. The first image I posted shows my GLES2 project settings, which I think is the same as enabling that flag.
Have you tried also disabling the half float in compatibility. That could very well be something many mobile devices don't support.
Frustration That didn't help either.
Have you tried other godot versions with perhaps a smaller sample project?
Frustration I just tried exporting a project using Godot 4.0 beta 17 and am getting nothing at all. Even a basic scene that contains just a MeshInstance with the default shader, a light and a camera is just giving me a black screen. My phone is a Samsung SM-A037W.
I meant other godot 3 versions, sorry. Should have been more specific. I was thinking along the lines, perhaps there's some bug at play that might have been introduced in the version you are using. And if not using the latest, perhaps it's been fixed in a later one.
Propensity My phone is a Samsung SM-A037W.
https://www.gsmarena.com/samsung_galaxy_a03s-10937.php
https://www.notebookcheck.net/PowerVR-GE8320-Graphics-Card-Benchmarks-and-Specs.372646.0.html
Claims OpenGL ES 3.0 and 3.2 support, I see no mention of 2.0 tho I have a hard time believing it doesn't support it. On the other hand, chipset announcement date is 2014, who knows how well they still support it with drivers...then again, gsm arena clearly indicates it's a 12nm chip, so probably just the gpu arch is ported over from the original 20nm hopefully it is still supported then too.
BTW, gsmarena.com and notebookcheck.net are great for finding out hw specs of phones(and laptops also for the latter). Def. recommend bookmarking them.
Frustration I tried again with Godot 3.5.2 rc2. Same problem.
I'm actually a bit more worried now about Godot 4 not being able to render at all. Has this not been implemented yet?
Propensity I'm actually a bit more worried now about Godot 4 not being able to render at all. Has this not been implemented yet?
I'm pretty sure it should work.
Frustration Looks like the solution was to reimport the texture map with the compress mode set to something other than Video RAM.
I'm glad you figured it out, but this seems like the sort of thing the texture importer/compressor should do automatically and not just fail with no error message.
Preindicate I'd agree. Also, I got a solution to the Godot 4 display problem too. Since my system does not support Vulkan, I need to set my rendering_method.mobile project setting to gl_compatibility. No idea why that would affect deploying it to my android phone or why that wasn't selected by default because I created my project in Compatibility mode, but that fixed it.
© 2022 - 2024 — McMap. All rights reserved.