Hi everyone.

<br>

I'm making a 2D platformer and quite fascinated with what Godot engine is capable of.&nbsp;

<br>But now I'm on a struggle bus with some shading issues.

<br>

On desktop my 2D shaders seems to work quite well.

<br>

However, when I'm running my game on Android device they are gone.

<br>

I'm receiving the following messages from ADB whenever my shader should activate itself:

<br>I/godot &nbsp; (13606): ERROR: set_custom_uniform: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:329.<br>I/godot &nbsp; (13606): ERROR: set_custom_uniform: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:329.<br>I/godot &nbsp; (13606): ERROR: get_custom_uniform_location: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:336.<br>V/AudioTrack(13606): obtainBuffer(1536) returned 1536 = 1536 + 0 err 0<br>V/AudioTrack(13606): obtainBuffer(1024) returned 1024 = 1024 + 0 err 0<br>I/godot &nbsp; (13606): ERROR: set_custom_uniform: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:329.<br>I/godot &nbsp; (13606): ERROR: set_custom_uniform: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:329.<br>I/godot &nbsp; (13606): ERROR: get_custom_uniform_location: Index p_idx out of size (version-&gt;custom_uniform_locations.size()).<br>I/godot &nbsp; (13606): &nbsp; &nbsp;At: ./drivers/gles2/shader_gles2.h:336.

<br>

All shaders are implemented within materials for the TextureFrame nodes.

<br>

Here's the example of one that doesn't work:

<br>// this is a simple texture-based Vignette modulated shader<br>uniform texture vignette;<br>uniform float lightness;<br>uniform vec3 modulate;<br>vec3 screen = texscreen( SCREEN_UV ).rgb;<br>vec4 tex = tex(vignette, UV) lightness;<br>// combine final color<br>color res = color( tex.r, tex.g, tex.b, tex.a);<br>res.rgb = mix( res.rgb, _screen.rgb, lightness );<br>res.rgb = modulate;<br>COLOR = res;

<br>

<br>

Hi again to everyone :)<br><br>To not to break the establishing tradition of self-answering... I've found the solution to the aforementioned problem :)<br><br>While looking into adb logcat I've stumbled across the following things:<br><br>

I/godot &nbsp; ( &nbsp;419): ERROR: 0:124:5 &nbsp;color containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 0:125:5 &nbsp;bw_mult containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 0:126:1 &nbsp;bw_mult containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 0:127:1 &nbsp;color containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 0:128:17 &nbsp;color containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 0:128:30 &nbsp;bw_mult containing two consecutive underscores () is reserved as possible future keyword.<br>I/godot &nbsp; ( &nbsp;419): ERROR: 6 compilation errors. No code generated.

<br>Which are the shader compilation errors. Strange thing that I didn't use the two consecutive underscores, but I guess the names of the variables ( both local scope and uniform ) where the cause of all the mess.<br><br>After renaming 'tex' to 'textureColor' and 'bw_mult' to 'modulate' ( and so on ), I've managed to get shaders work on Android.<br><br>P.S.<br>Btw, anyone knows what is the purpose of the 'Use driver GLES2' option within the project settings? It seems that GLES2 is used anyway, regardless to the checkbox state.

6 years later