Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / How to determine which shaders are supported on Android or other platform?

Author
Message
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 10th Aug 2024 11:20
Hi everyone, I'm probably missing something, but is there a command to verify what shader versions are supported on Android? I am aware of doing the check if a shader fails to load with GetShaderExists(), but is there a more general command to see what is supported? I'm currently troubleshooting a 2D shader, which won't run properly on Android (it's about passing values using SetShaderConstantByName() which returns that a shader doesn't exist.

On PC the shader runs great, no problems.

Thanks in advance.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 10th Aug 2024 16:52
G'day PHeMoX.
I don't know if this will help or not. Might be worth a look.

https://developer.android.com/develop/ui/views/graphics/opengl/about-opengl#version-check
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Aug 2024 22:54 Edited at: 10th Aug 2024 22:56
/Guides/Shaders wrote: "
OpenGL ES 2.0 shaders on mobile"

?

i don't know if there is an actual command to verify, as you requested, but GetRendererName() might help.

ie, i really know very little about shaders but you might be having an issue running on/converting from vulkan so choosing #Renderer "Basic" might help, as well?
Arch-Ok
AGK Developer
5
Years of Service
User Offline
Joined: 11th Jul 2019
Location: Bursa/TÜRKIYE
Posted: 11th Aug 2024 00:40
They really must accept that the Studio's shaders/shader commands are buggy. I'm trying to fix my 2D shaders too but no luck with that. The help documentation clearly states that we do not have to do extra coding for shaders. I hope someone fixes that, soon!
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 11th Aug 2024 09:28 Edited at: 11th Aug 2024 09:28
@Virtual Nomad: Yeah, I'm already using #renderer "Basic". Not sure why, but using the Vulkan renderer currently makes a lot of 2D shaders not work and crawl to a stop. Thanks though.

@Arch-Ok: Did you make sure the shaders themselves have nothing declared outside of the main Void() ? That's often step one of getting stuff to work at the moment. Other thing might be to force the OpenGL renderer. No idea why there's such a big difference in Vulkan vs OpenGl when it comes to shaders. I'm pretty sure my laptop is 90% of the problem there though.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 11th Aug 2024 09:44
Thanks @Ando , I kind of wish the general GetRendererName() command would return that information already, if available.

By the way, I found the fix. In one of my shaders I forced a version of GLSL, which I forgot about. Removed that line and now it works.

But it did make me realize I need to add fallbacks for all of them, probably.

Login to post a reply

Server time is: 2024-11-17 22:43:02
Your offset time is: 2024-11-17 22:43:02