Jump to content

Limit to number of circles drawn in a mask


Recommended Posts

Hi all.

I'm trying to mask a container using a large number of circles, but seem to be coming up against a limit on the number of circles I can draw in a mask on WebGL.

Demo here: http://codepen.io/acatcalledfrank/pen/ZQXWBL - it draws 250 x circle and numbered text labels in rows; you can see that while the labels carry on the circles stop at 160/161.

Am I coming up against some kind of hard limit with the renderer here, or is there a way around it? 

In the actual project the circles are moving and masking a gradient, which is why I can't just use a sprite for the circles. As far as I can tell, PIXI doesn't support gradient fills yet either. If I switch to the canvas renderer there's no limit, but performance is much worse in IE and FF. Yay!

Any ideas, anyone?

Thanks in advance!


Link to comment
Share on other sites

I don't sure but most of this errors come to editors :

try to use one html file not http://codepen.io

Use webdevelopment tool like Firebug can help to see the your script into browser, see:

var renderer = PIXI.autoDetectRenderer(2000, 2000, {
    backgroundColor: 16777215,
    antialias: true
var stage = new PIXI.Container();
stage.interactive = true;
var graphics = new PIXI.Graphics();
graphics.moveTo(0, 0);
graphics.lineTo(1500, 0);
graphics.lineTo(1500, 1500);
graphics.lineTo(0, 1500);
graphics.lineTo(0, 0);
var mask = new PIXI.Graphics();
var size = 30, rows = 20;
for (var i = 0; i < 250; i++) {
    if (window.CP.shouldStopExecution(1)) {
    mask.drawCircle(i % 10 * size * 2.5, Math.floor(i / 10) * size * 2.5, size);
graphics.mask = mask;
var text = new PIXI.Graphics();
var t;
for (var i = 0; i < 250; i++) {
    if (window.CP.shouldStopExecution(2)) {
    t = text.addChild(new PIXI.Text(i, { fill: 255 }));
    t.x = i % 10 * size * 2.5;
    t.y = Math.floor(i / 10) * size * 2.5;
//# sourceURL=pen.js


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.

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...