[]TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext'
使用1.7.15或16,在项目总增加如下几句,在layaAir内测试可以正常(以下资源是拷贝自GitHub上官网的范例包下的资源:
// 创建天空盒
var skyBox:Laya.SkyBox = new Laya.SkyBox();
//清除标记,使用天空(必须设置,否则无法显示天空)
camera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
//绑定天空盒对象到摄像机
camera.sky = skyBox;
//为天空盒加载贴图文件
skyBox.textureCube = Laya.TextureCube.load("res/skyBox1/skyCube.ltc");
但发布到微信小游戏时,启动报错,请问是什么问题:
gameThirdScriptError
Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.
TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.
at TextureCube.__proto._createWebGlTexture (http://127.0.0.1:55942/game/code.js:89560:6)
at TextureCube.__proto.recreateResource (http://127.0.0.1:55942/game/code.js:89603:8)
at TextureCube.__proto.activeResource (http://127.0.0.1:55942/game/code.js:13972:9)
at TextureCube.<anonymous> (http://127.0.0.1:55942/game/code.js:75718:8)
at Shader3D.__proto._uniform_samplerCube (http://127.0.0.1:55942/game/code.js:83267:20)
at Shader3D.__proto.uploadMaterialUniforms (http://127.0.0.1:55942/game/code.js:83399:25)
at SkyBox.__proto._render (http://127.0.0.1:55942/game/code.js:74089:17)
at Scene.__proto._renderScene (http://127.0.0.1:55942/game/code.js:81177:9)
at Camera.__proto._renderCamera (http://127.0.0.1:55942/game/code.js:91842:9)
at Scene.__proto.renderSubmit (http://127.0.0.1:55942/game/code.js:81631:42)
console.error
errorReport @ WAGame.js:3
thirdErrorReport @ WAGame.js:3
(anonymous) @ WAGame.js:3
(anonymous) @ WAGame.js:8
(anonymous) @ WAGame.js:4
a @ gamePage.html:1
window.onerror
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
Render @ code.js:5368
Laya.init @ code.js:388
Laya3D.init @ code.js:70796
LayaAir3D @ code.js:94656
(anonymous) @ code.js:94704
require @ WAGame.js:11
(anonymous) @ WAGame.js:11
(anonymous) @ game.js? [sm]:2
require @ WAGame.js:11
(anonymous) @ gamePage.html:155
// 创建天空盒
var skyBox:Laya.SkyBox = new Laya.SkyBox();
//清除标记,使用天空(必须设置,否则无法显示天空)
camera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
//绑定天空盒对象到摄像机
camera.sky = skyBox;
//为天空盒加载贴图文件
skyBox.textureCube = Laya.TextureCube.load("res/skyBox1/skyCube.ltc");
但发布到微信小游戏时,启动报错,请问是什么问题:
gameThirdScriptError
Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.
TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.
at TextureCube.__proto._createWebGlTexture (http://127.0.0.1:55942/game/code.js:89560:6)
at TextureCube.__proto.recreateResource (http://127.0.0.1:55942/game/code.js:89603:8)
at TextureCube.__proto.activeResource (http://127.0.0.1:55942/game/code.js:13972:9)
at TextureCube.<anonymous> (http://127.0.0.1:55942/game/code.js:75718:8)
at Shader3D.__proto._uniform_samplerCube (http://127.0.0.1:55942/game/code.js:83267:20)
at Shader3D.__proto.uploadMaterialUniforms (http://127.0.0.1:55942/game/code.js:83399:25)
at SkyBox.__proto._render (http://127.0.0.1:55942/game/code.js:74089:17)
at Scene.__proto._renderScene (http://127.0.0.1:55942/game/code.js:81177:9)
at Camera.__proto._renderCamera (http://127.0.0.1:55942/game/code.js:91842:9)
at Scene.__proto.renderSubmit (http://127.0.0.1:55942/game/code.js:81631:42)
console.error
errorReport @ WAGame.js:3
thirdErrorReport @ WAGame.js:3
(anonymous) @ WAGame.js:3
(anonymous) @ WAGame.js:8
(anonymous) @ WAGame.js:4
a @ gamePage.html:1
window.onerror
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
loop @ code.js:5371
requestAnimationFrame (async)
wxRequestAnimationFrame @ gamePage.html:31
Render @ code.js:5368
Laya.init @ code.js:388
Laya3D.init @ code.js:70796
LayaAir3D @ code.js:94656
(anonymous) @ code.js:94704
require @ WAGame.js:11
(anonymous) @ WAGame.js:11
(anonymous) @ game.js? [sm]:2
require @ WAGame.js:11
(anonymous) @ gamePage.html:155
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
qian
赞同来自:
llc
赞同来自: