gigbig Posted April 23, 2015 Share Posted April 23, 2015 Hi guys!I am testing the rotating bunny sample, and the result is not so good: package;import pixi.core.display.Container;import pixi.core.textures.Texture;import pixi.core.renderers.SystemRenderer;import pixi.core.renderers.Detector;import pixi.core.sprites.Sprite;import js.Browser;class Main { var _bunny : Sprite; var _renderer : SystemRenderer; var _stage : Container; public function new() { // Rendering options usage sample var options: RenderingOptions = {}; options.backgroundColor = 0xffff00; options.resolution = 1; _stage = new Container(); _renderer = Detector.autoDetectRenderer(640, 480, options); _bunny = new Sprite(Texture.fromImage("assets/basics/bunny.png")); _bunny.anchor.set(0.5, 0.5); _bunny.position.set(200, 150); _stage.addChild(_bunny); Browser.document.body.appendChild(_renderer.view); Browser.window.requestAnimationFrame(cast _animate); } function _animate() { Browser.window.requestAnimationFrame(cast _animate); _bunny.rotation += 0.1; _renderer.render(_stage); } static function main() { new Main(); }} I have run it with a stage resolution of 640x480, and the animation is fluid.When changing resolution to 800x600, 1280x720, 1920x1080 the fluidity drops down to a dull level, at 1280 the rotation speed is about half. This happens in Chrome.In Firefox rotation speed is more than double at 1920x1080, but still lower than 640x480. Anyway at 640x480 is still faster than in Chrome. Why do I obtain these bad performances? I have a very small rotating PNG, what should I expect by animating 30 bigger objects? A system crash? When running the bunnymark test in FF I obtain 13fps with 30000 bounching bunnies (in Chrome it shows the stats, the counter but not the bunnies), so Pixi is doing its job, but it is also true that bunnymark is not rendering scene through _renderer.render(_stage); It looks a totally different thing. What's wrong with the rotating bunny test?!And why can't I see anything in Chrome when running bunnymark? gigbig 1 Quote Link to comment Share on other sites More sharing options...
hannyajin Posted April 29, 2015 Share Posted April 29, 2015 The Canvas (renderer) size has a huge impact on performance - not the image size. The bunnymark works for me in chrome. Quote Link to comment Share on other sites More sharing options...
gigbig Posted April 29, 2015 Author Share Posted April 29, 2015 Yes, I had to recompile it because Chrome needs FlashDevelop webserver ( . . . damn Chrome . . . ). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.