cocos-engine
cocos-engine copied to clipboard
Feature Request: Texture Atlas Polygon Support
Creator version?(版本号)
2.1.3
Affected platform?(受影响的平台)
Both Mac & Windows
How to reproduce?(如何重现)
Create with Texture Packer or any other tool a Polygon Texture Atlas and apply them into a Sprite in Cocos Creator 2.1.3.
If you need any additional information about how Polygon Texture Atlases work, please ask.
I've understood that this works in cocos-2d-x C++ version, but doesn't work in Cocos Creator sadly.
This would be very useful to be able to optimize games properly.
Thanks for your advices and sorry for my late reply,Could you please talk about Polygon Texture Atlases in detail or give us some references? What is major difference between Polygon Texture Atlases and Normal Atlases? How would Polygon Texture Atlases optimize games?
Hi @holycanvas,
Sorry for the super late response! Here is a couple of references for Polygon atlases. For example Texture Packer supports this, also for Cocos 2d-x https://www.codeandweb.com/texturepacker/tutorials/cocos2d-x-performance-optimization https://www.codeandweb.com/texturepacker/documentation/texture-settings
The best packing algorithm for non-rectangular sprites. Tries to find a tight packing for polygon sprite outlines. As sprite bounding boxes might overlap, this packing algorithm can only be used if your framework supports import of mesh vertices.
Hi, it should be supported (I can't find exact version). Just set the Sprite type to MESH! Sorry for late reply...
Where does Sprite type MESH exist? I see SIMPLE, SLICED, TILED, FILLED only. The editor does not properly display polygon sprites that I can tell. Edit: Actually I see it is commented out now. // /** // * @en The mesh type. // * @zh 以 Mesh 三角形组成的类型 // */ // MESH: 4
Thanks for the investigation @mikecoker! @jareguo anything you can help with? I think this would be very beneficial for Cocos to support :)
any updates for Cocos Creator 3.8? It still doesn't support MESH type! JFYI this type is significant for achieving best performance on mobiles.
Sorry for the mistake, it's true that it's not supported at the moment
@jareguo could this issue be picked up by Cocos team any time soon?
Sorry we don't have the manpower to follow up on this at the moment, we will try to release the documentation so that you can customize it freely!
Yes, I understand, thanks for replying, @jareguo.
I hope this issue will be taken as priority at some point for 2D, especially because it was supported in CC 2.4.17. I abandoned Unity month ago and was quite surprised that polygon meshes are not supported. About the lack of other features I don't complain, CC is still pretty good (or could live without it), but, for more complex games, performance could be a problem.
As a temporary workaround (didn't do stress tests or whatever) you could use Spine. You can create meshes for your sprites and, surprisingly, CC imports meshes from there. Hopefully, this will help someone.
As a temporary workaround (didn't do stress tests or whatever) you could use Spine. You can create meshes for your sprites and, surprisingly, CC imports meshes from there. Hopefully, this will help someone.
Since spine atlases are separate from Cocos Creator auto-atlases they probably have in the Spine framework support for this, while Cocos Creator's auto-atlases doesn't support it.
Hope we can get support for this in the near future! 🙏 Hehe, I just noticed that I requested this in 2019 😂, oh well, one day hopefully! 💪