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! 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.