请问下 为什么 我加在 CCArmature 上的shader 渲染是成功的 但是 加载 ccbone上的话 就 没有效果 ,请问 这是什么原因
顺便 不定期 更新 下 自己 学习的一些 关于 coco2d-x shader的经验
http://blog.csdn.net/mike1989a/article/details/19092057
http://blog.csdn.net/mike1989a/article/details/19092057
求教育啊
CCBone* bone=_armature->getBone("tou");
CCSprite* sp=(CCSprite*)bone->getDisplayRenderNode();
GLchar * fragSource = (GLchar*) CCString::createWithContentsOfFile(CCFileUtils::sharedFileUtils()->fullPathForFilename("Shaders/test11.fsh").c_str())->getCString();
CCGLProgram *p = new CCGLProgram();
p->initWithVertexShaderByteArray(ccPositionTexture_vert, fragSource);
p->addAttribute(kCCAttributeNamePosition, kCCVertexAttrib_Position);
p->addAttribute(kCCAttributeNameTexCoord, kCCVertexAttrib_TexCoords);
p->link();
p->updateUniforms();
bone->setShaderProgram(p);
p->release();
这是我的代码