cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

Feature Request: Texture Atlas Polygon Support

Open Ronsku opened this issue 6 years ago • 11 comments

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.

Ronsku avatar Oct 04 '19 10:10 Ronsku

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?

SantyWang avatar Oct 18 '19 03:10 SantyWang

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.

Ronsku avatar Apr 06 '20 19:04 Ronsku

Hi, it should be supported (I can't find exact version). Just set the Sprite type to MESH! Sorry for late reply...

jareguo avatar Aug 01 '20 17:08 jareguo

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

mikecoker avatar Sep 05 '21 18:09 mikecoker

Thanks for the investigation @mikecoker! @jareguo anything you can help with? I think this would be very beneficial for Cocos to support :)

Ronsku avatar Sep 18 '21 18:09 Ronsku

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.

Skroopa avatar Oct 28 '23 10:10 Skroopa

Sorry for the mistake, it's true that it's not supported at the moment

jareguo avatar Oct 30 '23 05:10 jareguo

@jareguo could this issue be picked up by Cocos team any time soon?

Skroopa avatar Nov 03 '23 11:11 Skroopa

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!

jareguo avatar Nov 07 '23 06:11 jareguo

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.

Skroopa avatar Nov 07 '23 14:11 Skroopa

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! 💪

Ronsku avatar Feb 19 '24 16:02 Ronsku