Graphics stops drawing after a certain number of calls
See original GitHub issueExpected Behavior
Graphics should be able to draw as much as requested.
Current Behavior
Graphics stops after a certain number of calls.
Possible Solution
Split the calls into a number of graphics calls.
Steps to Reproduce
- create a new Graphics object
- in a loop, draw thousands of rectangles
- notice that Graphics stops drawing new rectangles after a certain number of calls (i think this depends on your hardware)
Environment
pixi.js
version: _e.g. 5.0.3- Browser & Version: _e.g. Chrome 80
- OS & Version: OSX 10.14.6
- Running Example: https://codepen.io/ferguillaume/pen/pmdKVw (found in this issue)
I’m trying to build a hexagonal grid tilemap with overlapping tilesets. After abandoning a sprite-per-hex approach, I tried to implement chunking with Graphics using beginTextureFill but then I realized that I wouldn’t be able to have overlaping tiles outside of each chunk since each chunk would be its own texture (Unity seems to have this issue too, which makes me think chunking is impossible for this use case). This means I have to have a single Graphics call for the entire map. But I discovered that there’s an undocumented maximum call limit.
I tried sharing GraphicsGeometry instance across multiple Graphics objects, but that had no effect on this limit.
Is there a way around the limit?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
No, this will be in v5.3.0. If you need a hack, use this.
@eranimo this was added #6417 and should be in v5.3.x
https://jsfiddle.net/bigtimebuddy/chtdkz29/