首页 > 代码库 > 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 修正
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。