Pixi.JS vs my own code
Posted: Wed Nov 02, 2016 3:39 pm
For those not knowing it Pixi.JS is a really nice 2D library which uses WebGL for speeding up the rendering:
http://www.pixijs.com/
The demos are quite impressive and it offers really nice to have possibilities, like special effects, resize, rotation and more.
However, after checking carefully and doing some tests, I ended up with the following:
A simple test with Pixi:
https://www.dotworldmaker.com/pixi/
And now a test with my full engine (press the right key to scroll):
https://www.dotworldmaker.com/play.html ... ySpeedTest
With Pixi I get around 45 FPS and with my engine 60 FPS.
You may think that my code do less than Pixi... well yes and no, my code do render at each frame, even for the same image and it has to deal with the whole game engine, so it should be actually slower. Doesn't seems the case.
What do I do with Pixi? I have a single "container" which contains all the tile sprites, then change the position of the container. When the container is <= -32 I move all the items within the container, remove those which are out, and create new one. That would make more less how it would work with a map scrolling. I would need to add yet a lot more functions to replicate the full engine, however it should be mostly ok for the test.
I don't say I'm an expert of Pixi but it seems to me that I cannot switch to it for my purpose. It has it's pro to not switch => I have full control of how things are going, and I don't need to change my render function. However it seems I don't have so much room for improvements, where I was hoping to speed up a lot the rendering. Too bad
Any experience with Pixi?
http://www.pixijs.com/
The demos are quite impressive and it offers really nice to have possibilities, like special effects, resize, rotation and more.
However, after checking carefully and doing some tests, I ended up with the following:
A simple test with Pixi:
https://www.dotworldmaker.com/pixi/
And now a test with my full engine (press the right key to scroll):
https://www.dotworldmaker.com/play.html ... ySpeedTest
With Pixi I get around 45 FPS and with my engine 60 FPS.
You may think that my code do less than Pixi... well yes and no, my code do render at each frame, even for the same image and it has to deal with the whole game engine, so it should be actually slower. Doesn't seems the case.
What do I do with Pixi? I have a single "container" which contains all the tile sprites, then change the position of the container. When the container is <= -32 I move all the items within the container, remove those which are out, and create new one. That would make more less how it would work with a map scrolling. I would need to add yet a lot more functions to replicate the full engine, however it should be mostly ok for the test.
I don't say I'm an expert of Pixi but it seems to me that I cannot switch to it for my purpose. It has it's pro to not switch => I have full control of how things are going, and I don't need to change my render function. However it seems I don't have so much room for improvements, where I was hoping to speed up a lot the rendering. Too bad
Any experience with Pixi?