Jump to content

Rendering millions of 'points'

Recommended Posts


I am working on a proof of concept application that requires rendering many ~2 million data points on screen. I am using phaser in this POC to harness the power of WebGL. I am a newbie, so I am just wondering if what I am doing is the most efficient way to do this. Basically, at this point I'm just trying to draw many, many circles on screen by doing this: 

// Create single graphic to make a texture to re-use on sprites for efficiency
const circle = game.add.graphics(0,0);
circle.beginFill(0x2b908f, 1);
circle.drawCircle(0, 0, 2);

// save the texture to re-use it 
const texture = circle.generateTexture();

and then later I'm re-using this texture many times over and over again with something like this (x and y are set to some presumably sane coordinates): 

game.add.sprite(x, y, texture);

Can anyone please let me know if there are more efficient ways to do something like this in phaser and/or point me to an example if so? 

Thanks very much! 

Link to post
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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...