I’m using ionic 3 framework to build an Android and Electron Application.
Now I’ve to add Three.js (the version in use is the r110) in the app and I have no experience in WebGL nor three.js.
When I run the application with Electron all seems fine, but when I run the app in an android emulator with Android API 28 this error happens “Failed to execute ‘texImage2D’ on ‘WebGLRenderingContext’: No function was found that matched the signature provided.”
I think the problem is that the version of chrome used by Android is “Chrome/69.0.3497.100”, while in Electron is “Chrome/76.0.3809.146”.
This is the part of code that use the texImage2D function
private loadCollada() {
const loader = new ColladaLoader();
loader.load('assets/edo/model/model.dae', (collada) => {
this.dae = collada.scene;
this.dae.scale.x = this.dae.scale.y = this.dae.scale.z = 1;
this.dae.updateMatrix();
this.scene.add(this.dae);
});
}
I found in three.js library that the error is logged in three.module.js
function texImage2D() {
try {
gl.texImage2D.apply( gl, arguments );
} catch ( error ) {
console.error( 'THREE.WebGLState:', error );
}
}
I don’t know if it might be useful but I have also this message in my console printed so many times.
[.WebGL-0xcba04400]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. [file:///android_asset/www/index.html]
There is a workaround or a way to fix this problem?