First of all, I'm kind-of new to low-level Stage3D.
Basically in my experiment I'm drawing 1000 2D vector polygons using the custom DisplayObject "Polygon" approach referenced in Starling docs (http://wiki.starling-framework.org/manual/custom_display_objects).
Each Polygon calls drawTriangles() and i simply have a for loop that creates 1000 new Polygon objects which means that each frame it calls 1000 times drawTriangles() which is actually slow but the thing is that it is actually really slow the first time i draw them as it take few seconds on my macbook pro.
I read about batching and the fact that we must call drawTriangles() as little as possible.
In my experiment I have 3 different kind of shape to draw, and i would like to be able to draw "n" times each type of shape on screen.
Also i would like that when i roll over a shape its color changes so I can also experiment a bit with shaders and constant registers to add animations and/or interactivity.
Anyone have some advice to optimize the performance here and how to achieve it ?
I suppose that i can draw multiple distinct polygons with one drawTriangles() call. But i don't really get it .. I'm not sure how to achieve this?
Thanks a lot for your help