Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

[Feature request] Add an easy way to batch multiple object using a custom Painer #968

Open b005t3r opened 7 years ago

b005t3r commented 7 years ago

In 1.x there was a flatten() method for easy batching of static objects together (on one or multiple batches). There's no such thing currently, but it looks like that if there was a custom Painter implementation all that needed to be done would be this:

obj.render(customPainer);
var batches:Vector<MeshBatch> = customPainter.getBatches();

Do you think you'd be able to add something like that?

PrimaryFeather commented 7 years ago

When I removed flatten, this was my emergency plan to be able to add that again in the future, yes. But I haven't evaluated it in more detail yet, or decided if I should do that or rather look into other ways to speed up rendering.

In any case, it's good to have that idea as an issue here so that I don't forget about it, and so people can vote for this feature — thanks!