solution for images animating with a jitter / shake / trembling / wobble / wiggle / bobble

It’s hard to explain but the position of a sprite seems to offset back and forth by a small amount during an animation. This would only happen on the mobile device, not on the desktop simulator. It’s a hard problem to describe unless you have experienced it. The problem found in sources below is due to floating point error in the default vertex and fragment shaders.

http://forum.cocos2d-iphone.org/t/strange-ccanimation-behavior-with-npot-textures-object-slightly-shakes/1990/18
http://code.google.com/p/cocos2d-iphone/issues/detail?id=1345
http://www.cocos2d-x.org/forums/6/topics/38696?r=38700


highp_fragment_shader.fsh.zip (0.4 KB)


highp_vertex_shader.vsh.zip (0.4 KB)