Jump to content

Awful frame rates under all browsers


hexdecks
 Share

Recommended Posts

Hi Guys,

 

I'm drawing an isometric grid with mouse-over hit area detection over each tile. It works but the frame rates are awful. Any idea what is bringing the frame-rates down so much? Surely, webGL is capable of attaining better FPS than this? What am I doing that is particularly taxing for the browser?

 

There are no moving sprites (only diamond-shapes PIXI.Graphics) drawn to the screen. ps. I can get about 45,000 moving sprites on bunnymark at 30fps.

 

http://178.79.155.146/pc

 

Cheers,

Jordan

Link to comment
Share on other sites

 

Graphics objects are not that fast, use sprites instead. You can create sprites from Graphics this way:

tileTexture  = myTileGraphics.generateTexture();..................tileSprite = new PIXI.Sprite(tileTexture); 

 

Interesting, thanks for this. Out of interest - do you know why this is? Are sprites drawn in a different way to graphics objects?

(Probably more of a webGL issue possibly?)

Link to comment
Share on other sites

With primitives we have to draw them to the stencil buffer each frame, then render that to the render buffer. With a sprite it is a single draw call to show the texture. If you have many sprites with the same texture we can batch them all together in a single draw call (we can't do that with Graphics).

 

That is the short version.

Link to comment
Share on other sites

With primitives we have to draw them to the stencil buffer each frame, then render that to the render buffer. With a sprite it is a single draw call to show the texture. If you have many sprites with the same texture we can batch them all together in a single draw call (we can't do that with Graphics).

 

That is the short version.

 

 

 

Really useful guys, thank-you.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...