четверг, 3 мая 2012 г.

My Stage3D 2D :)

Hi everyone. I want to show some tests that I made recently. It's simple 2D engine that use the power of Stage3D API from Adobe.




The first test is displaying massive amount of sprites. It was a nice surprise when I saw 16000 moving sprites on 30FPS despite the fact that all transformation is done on the CPU. And it sadly that API have a limit of 0x10000 vertices per buffer. But of cource it's possible to use several buffers and I think that 16K is not a limit.

Here the result:



For second test I took a warrior character from our game Mana. Every animation have 19 parts. As you can see this test is much slower than first. I think it's because of use of texture (in first test there was no texture - only colors passed as vertex attribute) and because of hierarchy - i.e. each animation have children that positions need to be recalculated every update.

Here the second one:



And the last test uses hierarchy. Each chunk contains parent->child ierarchy, i.e. first sprite contains child, then child contains another child and so on. There 10 spritest total in chunk (more sprites need more computation and will work slowly).



P.S.: remember - there will be exception if there too many vertices.

2 комментария:

  1. You can publish the source code of your 2d engine?

    ОтветитьУдалить
  2. Well, it's not an engine actually. Moreover, I don't like engines. It's just simple demo that shows that it's possible to achieve better performance than starling and others just because it's not all purpose engines, but just code that runs speifically for some problem. Here all stuff (some parts are changed, some not, so it won't work, but you can investigate it) http://code.google.com/p/personal-lib/source/browse/#svn%2Ftrunk%2Fru%2Fvolgogradetzzz%2Fdisplay

    ОтветитьУдалить