-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用metal替换cglayer #20
Comments
Its a big change, but pretty doable. Thanks to Gac itself handles the UI layer, its way easier than dealing with Cocoa friends without internal knowledge. You can easily get to hundreds of fps using Metal. CoreText layer is still required to get the Glyph bitmap. It won't be perfect (exactly the same as macOS text rendering due to some missing APIs in CG / CT). Or maybe keep the NSTextStorage stuff and render to offline texture & blit (much slower though). Or switch to something like Freetype but then text will look very different from what macOS renders natively. |
我感觉CoreText是肯定要保留的,不然整个Glyph都要重新做,不太现实。换freetype的话不知道能不能通过苹果商店的审核呢。我先用metal试试渲染coretext。目前想到几个方案,得做做看才知道用哪个合适。 |
FT没啥问题,游戏以前FT的多。但是效果看着差别就大了 |
用ft的原因是不是保留coretext计算字符位置之类东西还要借助cpu,只是将计算出来后的位图可以用gpu来显示?如果是这样那可能没啥加速效果,不知道理解得对不对。 |
本质上他们是类似的,但是FT少很多东西。 |
用sdf试了一下,英文字符倒还可以,中文就不行了。主要还是因为缺失和Glyph信息相关的api吧,所以目前还有比sdf更合适处理这个问题的办法吗? |
目前渲染使用的cglayer,苹果的高性能位图处理库。可以替换为新一代的metal进一步提高渲染性能
The text was updated successfully, but these errors were encountered: