首页 > 代码库 > cocos2dx 3.13 etc1 ClippingNode Bug 修正

cocos2dx 3.13 etc1 ClippingNode Bug 修正

void TrianglesCommand::useMaterial() const{        if(_stencl){                /*******[solyess] etc1 mask的支持*****************/        //Set texture        //GL::bindTexture2D(_textureID);                if (_alphaTextureID > 0)        { // ANDROID ETC1 ALPHA supports.            GL::bindTexture2D(_alphaTextureID);        }        else{            GL::bindTexture2D(_textureID);        }        //set blend mode        GL::blendFunc(_blendType.src, _blendType.dst);                _glProgramState->apply(_mv);        /*******[solyess]end etc1 mask的支持*****************/    }else{        //Set texture        GL::bindTexture2D(_textureID);                if (_alphaTextureID > 0)        { // ANDROID ETC1 ALPHA supports.            GL::bindTexture2DN(1, _alphaTextureID);        }        //set blend mode        GL::blendFunc(_blendType.src, _blendType.dst);                _glProgramState->apply(_mv);    }}

 

GLProgramState* GLProgramState::getOrCreateWithGLProgramName(const std::string& glProgramName, Texture2D* texture){    /*******[solyess] etc1 mask的支持*****************/    if (texture != nullptr && texture->getAlphaTextureName() != 0 && texture->getisStencl() == false) {        if (glProgramName == GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR) {            return GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_ETC1AS_POSITION_TEXTURE_COLOR);        }        else if (glProgramName == GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP) {            return GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_ETC1AS_POSITION_TEXTURE_COLOR_NO_MVP);        }        else if (glProgramName == GLProgram::SHADER_NAME_POSITION_GRAYSCALE) {            return GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_ETC1AS_POSITION_TEXTURE_GRAY_NO_MVP);        }    }    return GLProgramState::getOrCreateWithGLProgramName(glProgramName);}

 

cocos2dx 3.13 etc1 ClippingNode Bug 修正