Hi, as many others we are having trouble with performance on Android. After trying many tests, we concluded that mainly, for us, the problem lays on OpenGLES2.0 devices, like the Galaxy Nexus. Looking at the logs, we see shaders fail to compile, and we only use the default sprite shader. Is there a way to “hack” this shader to change it?
Any help would be appreciated!
Here is part of the logs:
09-23 16:33:16.993: D/Unity(20153): -------- Shader compilation failed
09-23 16:33:16.993: D/Unity(20153): #version 100
09-23 16:33:16.993: D/Unity(20153): #extension GL_EXT_shader_texture_lod : enable
09-23 16:33:16.993: D/Unity(20153): lowp vec4 impl_low_textureCubeLodEXT(lowp samplerCube sampler, highp vec3 coord, mediump float lod)
09-23 16:33:16.993: D/Unity(20153): {
09-23 16:33:16.993: D/Unity(20153): #if defined(GL_EXT_shader_texture_lod)
09-23 16:33:16.993: D/Unity(20153): return textureCubeLodEXT(sampler, coord, lod);
09-23 16:33:16.993: D/Unity(20153): #else
09-23 16:33:16.993: D/Unity(20153): return textureCube(sampler, coord, lod);
09-23 16:33:16.993: D/Unity(20153): #endif
09-23 16:33:16.993: D/Unity(20153): }
09-23 16:33:16.993: D/Unity(20153): uniform mediump vec4 _TexA_HDR;
09-23 16:33:16.993: D/Unity(20153): uniform mediump vec4 _TexB_HDR;
09-23 16:33:16.993: D/Unity(20153): uniform lowp samplerCube _TexA;
09-23 16:33:16.993: D/Unity(20153): uniform lowp samplerCube _TexB;
09-23 16:33:16.993: D/Unity(20153): uniform highp float _Level;
09-23 16:33:16.993: D/Unity(20153): uniform highp float _value;
09-23 16:33:16.993: D/Unity(20153): varying highp vec3 xlv_TEXCOORD0;
09-23 16:33:16.993: D/Unity(20153): void main ()
09-23 16:33:16.993: D/Unity(20153): {
09-23 16:33:16.993: D/Unity(20153): mediump vec3 res_1;
09-23 16:33:16.993: D/Unity(20153): mediump vec4 tmpvar_2;
09-23 16:33:16.993: D/Unity(20153): lowp vec4 tmpvar_3;
09-23 16:33:16.993: D/Unity(20153): tmpvar_3 = impl_low_textureCubeLodEXT (_TexA, xlv_TEXCOORD0, _Level);
09-23 16:33:16.993: D/Unity(20153): tmpvar_2 = tmpvar_3;
09-23 16:33:16.993: D/Unity(20153): mediump vec3 tmpvar_4;
09-23 16:33:16.993: D/Unity(20153): tmpvar_4 = ((_TexA_HDR.x * tmpvar_2.w) * tmpvar_2.xyz);
09-23 16:33:16.993: D/Unity(20153): mediump vec4 tmpvar_5;
09-23 16:33:16.993: D/Unity(20153): lowp vec4 tmpvar_6;
09-23 16:33:16.993: D/Unity(20153): tmpvar_6 = impl_low_textureCubeLodEXT (_TexB, xlv_TEXCOORD0, _Level);
09-23 16:33:16.993: D/Unity(20153): tmpvar_5 = tmpvar_6;
09-23 16:33:16.993: D/Unity(20153): mediump vec3 tmpvar_7;
09-23 16:33:16.993: D/Unity(20153): tmpvar_7 = ((_TexB_HDR.x * tmpvar_5.w) * tmpvar_5.xyz);
09-23 16:33:16.993: D/Unity(20153): highp vec3 tmpvar_8;
09-23 16:33:16.993: D/Unity(20153): tmpvar_8 = mix (tmpvar_4, tmpvar_7, vec3(_value));
09-23 16:33:16.993: D/Unity(20153): res_1 = tmpvar_8;
09-23 16:33:16.993: D/Unity(20153): mediump vec4 tmpvar_9;
09-23 16:33:16.993: D/Unity(20153): tmpvar_9.w = 1.0;
09-23 16:33:16.993: D/Unity(20153): tmpvar_9.xyz = res_1;
09-23 16:33:16.993: D/Unity(20153): gl_FragData[0] = tmpvar_9;
09-23 16:33:16.993: D/Unity(20153): }
09-23 16:33:17.000: D/Unity(20153): -------- failed compiling:
09-23 16:33:17.000: D/Unity(20153): fragment evaluation shader
09-23 16:33:17.000: D/Unity(20153): -------- GLSL error:
09-23 16:33:17.000: D/Unity(20153): Compile failed.
09-23 16:33:17.000: D/Unity(20153): ERROR: 0:8: ‘textureCubeLodEXT’ : no matching overloaded function found
09-23 16:33:17.000: D/Unity(20153): ERROR: 0:8: ‘return’ : function return is not matching type
09-23 16:33:17.000: D/Unity(20153): ERROR: 2 compilation errors. No code generated.
09-23 16:33:17.000: D/Unity(20153): textureCubeLodEXT or textureCubeGradEXT usage detected.
09-23 16:33:17.000: D/Unity(20153): GL_EXT_shader_texture_lod extension is buggy on PowerVR drivers.
09-23 16:33:17.000: D/Unity(20153): replacing textureCubeLodEXT->textureCubeLod and textureCubeGradEXT->textureCubeGradARB as a workaround.
09-23 16:33:18.789: D/Unity(20153): -------- Shader compilation failed
09-23 16:33:18.789: D/Unity(20153): #version 100
09-23 16:33:18.789: D/Unity(20153): #extension GL_EXT_shader_texture_lod : enable
09-23 16:33:18.789: D/Unity(20153): lowp vec4 impl_low_textureCubeLodEXT(lowp samplerCube sampler, highp vec3 coord, mediump float lod)
09-23 16:33:18.789: D/Unity(20153): {
09-23 16:33:18.789: D/Unity(20153): #if defined(GL_EXT_shader_texture_lod)
09-23 16:33:18.789: D/Unity(20153): return textureCubeLodEXT(sampler, coord, lod);
09-23 16:33:18.789: D/Unity(20153): #else
09-23 16:33:18.789: D/Unity(20153): return textureCube(sampler, coord, lod);
09-23 16:33:18.789: D/Unity(20153): #endif
09-23 16:33:18.789: D/Unity(20153): }
09-23 16:33:18.789: D/Unity(20153): uniform lowp samplerCube _MainTex;
09-23 16:33:18.789: D/Unity(20153): uniform mediump float _Level;
09-23 16:33:18.789: D/Unity(20153): varying mediump vec4 xlv_TEXCOORD0;
09-23 16:33:18.789: D/Unity(20153): void main ()
09-23 16:33:18.789: D/Unity(20153): {
09-23 16:33:18.789: D/Unity(20153): mediump vec4 tmpvar_1;
09-23 16:33:18.789: D/Unity(20153): lowp vec4 tmpvar_2;
09-23 16:33:18.789: D/Unity(20153): tmpvar_2 = impl_low_textureCubeLodEXT (_MainTex, xlv_TEXCOORD0.xyz, _Level);
09-23 16:33:18.789: D/Unity(20153): tmpvar_1 = tmpvar_2;
09-23 16:33:18.789: D/Unity(20153): gl_FragData[0] = tmpvar_1;
09-23 16:33:18.789: D/Unity(20153): }
09-23 16:33:18.789: D/Unity(20153): -------- failed compiling:
09-23 16:33:18.789: D/Unity(20153): fragment evaluation shader
09-23 16:33:18.789: D/Unity(20153): -------- GLSL error:
09-23 16:33:18.789: D/Unity(20153): Compile failed.
09-23 16:33:18.789: D/Unity(20153): ERROR: 0:8: ‘textureCubeLodEXT’ : no matching overloaded function found
09-23 16:33:18.789: D/Unity(20153): ERROR: 0:8: ‘return’ : function return is not matching type
09-23 16:33:18.789: D/Unity(20153): ERROR: 2 compilation errors. No code generated.
09-23 16:33:18.789: D/Unity(20153): textureCubeLodEXT or textureCubeGradEXT usage detected.
09-23 16:33:18.789: D/Unity(20153): GL_EXT_shader_texture_lod extension is buggy on PowerVR drivers.
09-23 16:33:18.789: D/Unity(20153): replacing textureCubeLodEXT->textureCubeLod and textureCubeGradEXT->textureCubeGradARB as a workaround.
09-23 16:33:19.688: D/Unity(20153): -------- Shader compilation failed
09-23 16:33:19.688: D/Unity(20153): #version 100
09-23 16:33:19.688: D/Unity(20153): #extension GL_EXT_shader_texture_lod : enable
09-23 16:33:19.688: D/Unity(20153): lowp vec4 impl_low_textureCubeLodEXT(lowp samplerCube sampler, highp vec3 coord, mediump float lod)
09-23 16:33:19.688: D/Unity(20153): {
09-23 16:33:19.688: D/Unity(20153): #if defined(GL_EXT_shader_texture_lod)
09-23 16:33:19.688: D/Unity(20153): return textureCubeLodEXT(sampler, coord, lod);
09-23 16:33:19.688: D/Unity(20153): #else
09-23 16:33:19.688: D/Unity(20153): return textureCube(sampler, coord, lod);
09-23 16:33:19.688: D/Unity(20153): #endif
09-23 16:33:19.688: D/Unity(20153): }
09-23 16:33:19.688: D/Unity(20153): uniform highp float _Level;
09-23 16:33:19.688: D/Unity(20153): uniform lowp samplerCube _MainTex;
09-23 16:33:19.688: D/Unity(20153): varying highp vec4 xlv_TEXCOORD0;
09-23 16:33:19.688: D/Unity(20153): void main ()
09-23 16:33:19.688: D/Unity(20153): {
09-23 16:33:19.688: D/Unity(20153): highp vec4 tmpvar_1;
09-23 16:33:19.688: D/Unity(20153): lowp vec4 tmpvar_2;
09-23 16:33:19.688: D/Unity(20153): tmpvar_2 = impl_low_textureCubeLodEXT (_MainTex, xlv_TEXCOORD0.xyz, _Level);
09-23 16:33:19.688: D/Unity(20153): tmpvar_1 = tmpvar_2;
09-23 16:33:19.688: D/Unity(20153): gl_FragData[0] = tmpvar_1;
09-23 16:33:19.688: D/Unity(20153): }
09-23 16:33:19.688: D/Unity(20153): -------- failed compiling:
09-23 16:33:19.688: D/Unity(20153): fragment evaluation shader
09-23 16:33:19.688: D/Unity(20153): -------- GLSL error:
09-23 16:33:19.688: D/Unity(20153): Compile failed.
09-23 16:33:19.688: D/Unity(20153): ERROR: 0:8: ‘textureCubeLodEXT’ : no matching overloaded function found
09-23 16:33:19.688: D/Unity(20153): ERROR: 0:8: ‘return’ : function return is not matching type
09-23 16:33:19.688: D/Unity(20153): ERROR: 2 compilation errors. No code generated.
09-23 16:33:19.688: D/Unity(20153): textureCubeLodEXT or textureCubeGradEXT usage detected.
09-23 16:33:19.688: D/Unity(20153): GL_EXT_shader_texture_lod extension is buggy on PowerVR drivers.
09-23 16:33:19.688: D/Unity(20153): replacing textureCubeLodEXT->textureCubeLod and textureCubeGradEXT->textureCubeGradARB as a workaround.