Jump to content

Canvas2D is 100 items limit?


Recommended Posts

16 minutes ago, cx20 said:

I have just tried Canvas2D.


I was hoped to be made dot picture of 16x16 (= 256 items) in Canvas2D.

However, a square that can be displayed in Canvas2D was 100 items.

Is this a limit?

If usage is wrong, I'm sorry.

I'm on it, I'll tell you as soon as I know. This playground seem to work fine with a high count of primitives: http://babylonjs-playground.com/#OWCCR#8

But the bug you describe reminds me of an issue I got in the past and that I fixed, maybe it's still there.

Link to comment
Share on other sites

Ok, my bad...There's a bug, with such count of object I don't compute the Z-Order correctly, it's a limitation I was aware of, but still don't understand why the PG I mentioned above works and yours don't.

Anyway, there's a simple hack to make it work for you, I've fork you sample with the solution: http://jsdo.it/nockawa/IJ9p

rect.zOrder = 0.5;

Basically just override the Z of the prim (as they're all not overlapping, it's ok to do that), by setting a value like 0.5 (0 being displayed first, 1.0 being displayed on the top of everything).

It's a bug for me to fix, I'll do it asap, again, I was aware of it and should have communicate about it. Sorry for that.

Great stuff by the way!

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