Repository navigation
fix: 修复贴图预载导致的Cubism 2立绘显示错乱问题 - #1039
Merged
MakinoharaShoko merged 2 commits intoSep 27, 2026
Merged
Conversation
MakinoharaShoko
approved these changes
Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pixi-live2d-display-webgal#14
问题
在下游项目WebGAL启用资源预加载后,4.6.5版本测试发现Live2D Cubism 2模型全部出现了严重的显示错乱问题。
经调查确认,Cubism 2的贴图v轴是翻转的,因而上游项目Pixi Live2D Display在加载立绘前通过gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true)标记了贴图文件的垂直翻转。但由于WebGL加载到GPU中的纹理对象是独一的、重复加载时不会创建新对象,因而造成了两点后果:
如果第一次载入是Cubism2模型加载,则后续再次载入该贴图时得到的只会是一张垂直翻转的贴图。
如果第一次载入不是Cubism2模型加载,则后续再次载入该贴图时是正向的,但Cubism 2载入时没能翻转贴图,导致显示错误。
修复
理论上,上游修复后,无需本PR也可恢复Cubism 2立绘的正常显示,但会导致Cubism 2立绘的贴图并未真正预载到WebGL之中。该改动使其恢复完整预载效果。在上游修复未合并的情况下,本PR无法单独修复问题。