Android平台2D,3D混合渲染不能正常显示
尝试将界面HUD绘制到单独的Canvas(实际代码用PIXI.js创建Canvas), 然后将该Canvas作为纹理绘制到THREE.js 3D的Mesh中, 模拟器和iOS能正常显示纹理,Android显示为黑色,如果将getContext('webgl')改为getContext('2d')然后fillRect, 几种平台都能正常显示。 猜测,在Android下只能获取一个webgl Canvas var canvas = wx.createCanvas(); ... var gl = this.canvas.getContext('webgl', {}); gl.clearColor(1.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); ... var texture = new THREE.CanvasTexture(canvas); texture.minFilter = THREE.LinearFilter; var material = new THREE.MeshBasicMaterial({ map: texture, transparent: true }); var geometry = new THREE.PlaneGeometry(canvas.width / window.devicePixelRatio / PIXELS_PER_UNIT, canvas.height / window.devicePixelRatio / PIXELS_PER_UNIT); var sprite3D = new THREE.Mesh(geometry, material); ... scene3D.add(sprite3D); 测试问题机: 小米8,小米MIX