feat(atlas): 引入 SmartRectsBinPack 并支持多纹理打包输出#13
Open
cptbtptpbcptdtptp wants to merge 3 commits intogalacean:mainfrom
Open
feat(atlas): 引入 SmartRectsBinPack 并支持多纹理打包输出#13cptbtptpbcptdtptp wants to merge 3 commits intogalacean:mainfrom
cptbtptpbcptdtptp wants to merge 3 commits intogalacean:mainfrom
Conversation
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.
背景
为提升图集打包稳定性与空间利用率,本次将默认打包实现切换到
SmartRectsBinPack,并补齐浏览器端多纹理(multi-atlas)输出能力。主要改动
SmartRectsBinPack,并抽象IMaxRectsBinPack接口,保持与旧实现一致的调用形态(init/insert/insert2)。SmartRectsBinPack(保留原有 maxrects method 参数能力)。imageFiles[],并在info.atlasItems[]中记录每张子图集及 sprite 信息。依赖与版本
maxrects-packer@2.7.3@galacean/tools-atlas-algorithm->1.6.0-beta.0@galacean/tools-atlas-browser->1.6.0-beta.0验证
pnpm -C packages/atlas-algorithm testBestLongSideFit + no-rotate与BestAreaFit + rotate两组场景)风险与兼容性说明
atlas-browser的PackingOutput结构与默认参数存在行为变化(输出字段从单图产物演进为多图产物;默认宽高/padding 也有调整),调用方若依赖旧字段需同步适配。