工程中有对spine动画进行置灰操作,用shader方式置灰,在原来3.12上没有问题,换了3.13的工程置灰过的动画位置就全都跑偏了,置灰的处理如下:
const GLchar* pszFragSource =
"#ifdef GL_ES \n\
precision mediump float; \n\
#endif \n\
varying vec2 v_texCoord; \n\
varying vec4 v_fragmentColor; \n\
void main(void) \n\
{ \n\
// Convert to greyscale using NTSC weightings \n\
vec4 col = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n\
float grey = dot(col.rgb, vec3(0.299, 0.587, 0.114)); \n\
gl_FragColor = vec4(grey, grey, grey, col.a); \n\
}";
pProgram->initWithVertexShaderByteArray(ccPositionTextureColor_vert, pszFragSource);