Cocos2D Shaders On Kindles

I work with lots of games developed with Cocos2D and have been surprised to find that newest Kindle Fires cannot run many of them. The culprit is the Cocos fragment shader ccShader_PositionColorLengthTexture_frag.h.

I've followed the discussion on this, and it seems like everyone's saying it's someone else's fault. Anyways, if you want to get your app running in the mean time then just comment out all references to GL_OES_standard_derivatives.

Looks like the latest version of Cocos2D-x has this change implemented. Strange, indeed.

Anyways the file should look (something) like this: 

[this file is just a guide, make sure to match the format in your flavour of Cocos]

ccShader_PositionColorLengthTexture_frag.h

"                                                                                                    \n\
// #extension GL_OES_standard_derivatives : enable                                                    \n\
                                                                                                    \n\
#ifdef GL_ES                                                                                        \n\
varying mediump vec4 v_color;                                                                        \n\
varying mediump vec2 v_texcoord;                                                                    \n\
#else                                                                                                \n\
varying vec4 v_color;                                                                                \n\
varying vec2 v_texcoord;                                                                            \n\
#endif                                                                                                \n\
                                                                                                    \n\
void main()                                                                                            \n\
{                                                                                                    \n\
// #if defined GL_OES_standard_derivatives                                                            \n\
    gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord));   \n\
// #else                                                                                            \n\
    gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord));                                     \n\
// #endif                                                                                            \n\
}                                                                                                    \n\
";
In Tags ,