有人可以指导我如何将着色器应用于Beta 3.0中的RenderTexture, 我使用以下代码将着色器应用于renderTexture对象,但代码似乎不再适用于Cocox2dX Beta 3.0
void TestLayer::initRenderTexture()
{
m_renderTexture = CCRenderTexture::create(utility::WindowSize.Size.width,utility::WindowSize.Size.width);
cocos2d::CCGLProgram *pShaderProgram = new CCGLProgram();
pShaderProgram->initWithVertexShaderByteArray(ccPositionTextureA8Color_vert, myFragSource);
m_renderTexture->getSprite()->setShaderProgram(pShaderProgram);
m_renderTexture->getSprite()->getShaderProgram()->addAttribute(kCCAttributeNamePosition, kCCVertexAttrib_Position);
m_renderTexture->getSprite()->getShaderProgram()->addAttribute(kCCAttributeNameColor, kCCVertexAttrib_Color);
m_renderTexture->getSprite()->getShaderProgram()->addAttribute(kCCAttributeNameTexCoord, kCCVertexAttrib_TexCoords);
m_renderTexture->getSprite()->getShaderProgram()->link();
m_renderTexture->getSprite()->getShaderProgram()->updateUniforms();
m_renderTexture->getSprite()->getShaderProgram()->use();
//add renderTexture Object to layer
addChild(m_renderTexture);
}
由于 罗马托马斯