lean / phaser-es6-webpack

A bootstrap project for create games with Phaser + ES6 + Webpack.
MIT License
1.28k stars 314 forks source link

WebGL: INVALID_VALUE: vertexAttribPointer: index out of range #18

Closed stathismor closed 7 years ago

stathismor commented 7 years ago

When I run npm, I see these warnings on browser's console (sorry for awful format):

pixi.js:5102WebGL: INVALID_VALUE: vertexAttribPointer: index out of rangePIXI.WebGLSpriteBatch.flush @ pixi.js:5102PIXI.WebGLSpriteBatch.render @ pixi.js:4768PIXI.Sprite._renderWebGL @ pixi.js:1900PIXI.DisplayObjectContainer._renderWebGL @ pixi.js:1394PIXI.WebGLRenderer.renderDisplayObject @ pixi.js:3688PIXI.WebGLRenderer.render @ pixi.js:3654updateRender @ phaser-split.js:13829update @ phaser-split.js:13671updateRAF @ phaser-split.js:41333_onLoop @ phaser-split.js:41316
5pixi.js:5102WebGL: INVALID_VALUE: vertexAttribPointer: index out of rangePIXI.WebGLSpriteBatch.flush @ pixi.js:5102PIXI.WebGLSpriteBatch.render @ pixi.js:4768PIXI.Sprite._renderWebGL @ pixi.js:1900PIXI.DisplayObjectContainer._renderWebGL @ pixi.js:1394PIXI.WebGLRenderer.renderDisplayObject @ pixi.js:3688PIXI.WebGLRenderer.render @ pixi.js:3654updateRender @ phaser-split.js:13829update @ phaser-split.js:13750updateRAF @ phaser-split.js:41333_onLoop @ phaser-split.js:41316

I assume these happen on a render() there are loads of them. (WebGL: too many errors, no more errors will be reported to the console for this context.)

My browser is Chrome, Version 54.0.2840.59 (64-bit), on Ubuntu 16.10.

lean commented 7 years ago

Are you testing it with the initial setup?

stathismor commented 7 years ago

Thanks for responding to this! Yes, I am testing with the initial setup. I just tried now, cloned the repo again just in case. I also checked Firefox, and I get this:

Error: WebGL: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. vendor.bundle.js:5421:10
Error: WebGL: texImage2D: Incurred CPU-side conversion, which is very slow.  vendor.bundle.js:4127:6
Error: WebGL: texImage2D: Incurred CPU pixel conversion, which is very slow.  vendor.bundle.js:4127:6
Error: WebGL: texImage2D: Chosen format/type incurred an expensive reformat: 0x1908/0x1401  vendor.bundle.js:4127:6
Error: WebGL: texImage2D: Incurred CPU-side conversion, which is very slow.  vendor.bundle.js:4127:6
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings)

I am not sure if it's related to that, but the movement of the mushroom is a bit inconsistent, not very smooth.

lean commented 7 years ago

Oh the issue is with the operating system. WebGL is not enabled by default in Ubuntu. Try this: http://askubuntu.com/questions/299345/how-to-enable-webgl-in-chrome-on-ubuntu Or you could move to Canvas renderer: http://phaser.io/docs/2.6.2/Phaser.Game.html

stathismor commented 7 years ago

Thanks a lot! I have now fully enabled WebGL, but I still get these errors. I can correctly see this cube. I do not get the erros when I switch to CANVAS though. And I think it's a bit smoother that way.

Feel free to close this issue if you think it's just just platform/browser related.