This shader works on Windows and ExperiaZ3 (Android 5.1), but crash on Samsung Galaxy S3 (Android 4.3).
I have assumption, it’s because atan function, but i don’t know how to fix it.
Hi, i try to remove const , but still doesn’t work.
After short research i found this:
OpenGL ES 3.0 - This API specification is supported by Android 4.3 (API level 18) and higher.
And this https://www.opengl.org/sdk/docs/man/html/atan.xhtml.
I found were is my problem. Maybe old phone support only halfs. And when we have something like float a = 0.1f; cant compile it. So solution is just remove f -> “float a = 0.1;”
yep the f is not part of the glsl syntax. on windows there is a transtype of glsl to directx by angle so the problem not appear systematically. but in fact this kind of syntax error might cause error in log not crash.
if you want to be sure that your syntax is good,
you can check your shader with a offline tool like this soft http://www.funparadigm.com/xshade/ by select the GLES mode
There are addons depending on the IDE you are using that have code highlighting and error detection for GLSL. The reason there is no f in glsl is because all values are assumed to be float. The gpu only deals with floats, it’s specifically optimized for float operations/calculations.