Hersir Posted June 15, 2017 Share Posted June 15, 2017 Hi, Got error on android device when createInstance is used ,PG. Device: Galaxy Tab 3 WebGl: renderer:"PowerVR SGX 544MP2", vendor:"Imagination Technologies", version:"WebGL 1.0 (OpenGL ES 2.0 Chromium)" Android: 4.4.2 Error: Uncaught TypeError: this._gl.vertexAttribDivisor is not a function at n._bindVertexBuffersAttributes (babylon.js:5) at n.recordVertexArrayObject (babylon.js:5) at t._bind (babylon.js:15) at r._renderWithInstances (babylon.js:12) at r._processRendering (babylon.js:12) at r.render (babylon.js:12) at t.render (babylon.js:13) at t.renderUnsorted (babylon.js:9) at t.render (babylon.js:9) at t.render (babylon.js:8) [.Offscreen-For-WebGL-0x6f7cfc20]GL ERROR :GL_INVALID_ENUM : GetIntegerv: <- error from previous GL command [.Offscreen-For-WebGL-0x6c2ab010]GL ERROR :GL_INVALID_ENUM : GLES2DecoderImpl::ClearWorkaround: <- error from previous GL command Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 You should not be able to see the vertexAttribDivisor on webGL1 unless there is an extension to support it This seems REALLY suspicious to me Are you using chrome? Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 16, 2017 Author Share Posted June 16, 2017 @Deltakosh Yes I use chrome, I can check also native browser but I doubt it supports webgl in that version Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 16, 2017 Author Share Posted June 16, 2017 Chrome version: 58.0.3029.83 Quote Link to comment Share on other sites More sharing options...
JohnK Posted June 16, 2017 Share Posted June 16, 2017 Same Android version same Chrome on an old Galaxy 4 mini and no problem. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2017 Share Posted June 16, 2017 Tested on s8 and no problem Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 21, 2017 Author Share Posted June 21, 2017 Same error on Galaxy S2+ Device: Galaxy S2+, OS: Android 4.2.2 Chrome: 58.0.3029.83 Object {vendor: "Broadcom", renderer: "VideoCore IV HW", version: "WebGL 1.0 (OpenGL ES 2.0 Chromium)"} Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 21, 2017 Author Share Posted June 21, 2017 Removed template tags from example PG Same error: Galaxy Tab 3: 4.2.2 Chrome: 56.0.2924.87 {vendor: "ARM", renderer: "Mali-400 MP", version: "WebGL 1.0 (OpenGL ES 2.0 Chromium)"} Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2017 Share Posted June 21, 2017 It seems that the system reports support for instances but does not support them actually I'm afraid you will have to rely on clones on these systems Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 if (this._webGLVersion > 1) { this._caps.instancedArrays = true; } else { var instanceExtension = this._gl.getExtension('ANGLE_instanced_arrays'); if (instanceExtension != null) { this._caps.instancedArrays = true; this._gl.drawArraysInstanced = instanceExtension.drawArraysInstancedANGLE.bind(instanceExtension); this._gl.drawElementsInstanced = instanceExtension.drawElementsInstancedANGLE.bind(instanceExtension); this._gl.vertexAttribDivisor = instanceExtension.vertexAttribDivisorANGLE.bind(instanceExtension); } else { this._caps.instancedArrays = false; } } Here is this check it sets this._caps.instancedArrays to false, so it detects correct that extension doesn't exist Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 @Deltakosh I think I found what is wrong, inside Mesh -> render function there is check "var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) ..... " but "engine.getCaps().instancedArrays" is never null its true/false. Will check if there are other places where it is used. Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 Yes this error is repeated in many places Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 I will make MR Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 Created Pull request Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 22, 2017 Share Posted June 22, 2017 Thanks for this one!! This is cool. I merged and published the change Hersir 1 Quote Link to comment Share on other sites More sharing options...
Paradine Posted June 22, 2017 Share Posted June 22, 2017 Thank You! Solved also problems for older Windows Mobile phones to. Hersir 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.