Jump to content

glDrawElements: range out of bounds for buffer


Hachi
 Share

Recommended Posts

I get the following error:
[.Offscreen-For-WebGL-000001AC0475EBB0]GL ERROR :GL_INVALID_OPERATION : glDrawElements: range out of bounds for buffer

This happens when the map I have is zoomed out / scaled to big enough size (scale less than 0.5) and I use drawRect of drawRoundedRect on graphics object. It does not occur if I use drawCircle. Also the size or position of the rectangle doesn't matter drawRect(10000, 10000, 1, 1) gives the same error as anything else).

This change occured in PIXI versions 4.1.1 -> 4.2.1 and seems to be present still in the 4.5.2 version. E.g. this version: http://flatworld.level7.fi/manualStressTest.html works fine, but when I update the PIXI to 4.2.1+, it breaks down. It occurs when the map is moved so that the whole canvas area is covered by objects + a little outside the browser. Seems to be related to the amount of objects on the stage / container, but not sure.

So if I comment this command away:
FoWOverlay.drawRect(coordinates.x, coordinates.y, coordinates.width, coordinates.height);
it does not throw the error. Also the rectangle can be of any size and it still throws the error.

It is kinda hard to isolate the issue from the code as I don't really know what specifically causes it and I suspect it has something to do with the other parts / sprites on the map (for what ever reason).

So if you have an idea what could cause that in this case or what change in 4.1.1 -> 4.2.1 could cause this, I'm happy to receive ideas :). I will happily investigate further.

Otherwise, I'll setup a "working" faulty example for you later on. I only have the working example. Basically same codebase (https://github.com/Hachitus/FlaTWorld/), but with different PIXI-version.

EDIT: I updated the PIXI version to the url: https://github.com/Hachitus/FlaTWorld/ , so that is the faulty one now. The PIXI version is 4.2.1, though the same issues occur with 4.5.2 also (just rather keep lower version and introduce as little changes as possible to the mix).

EDIT2: I traced it down to being related to being combination of the drawRect and particleContainer. If I use a normal container the error does not occur. There was another thread about the same error, where particle container was also used, so I thought it might be related:

 

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.

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

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...