[]worker.js 使用问题
开启后报错如下Uncaught TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.
at Texture2D.__proto._createWebGlTexture (laya.d3.js:33519)
at Texture2D.__proto.recreateResource (laya.d3.js:33562)
at Texture2D.__proto.activeResource (laya.core.js:13234)
at Texture2D.<anonymous> (laya.d3.js:21347)
at Shader3D.__proto._uniform_sampler2D (laya.d3.js:28631)
at Shader3D.__proto.uploadSpriteUniforms (laya.d3.js:28751)
at RenderQueue.__proto._render (laya.d3.js:4070)
at Scene.__proto._renderScene (laya.d3.js:26518)
at Camera.__proto._renderCamera (laya.d3.js:36269)
at Scene.__proto.renderSubmit (laya.d3.js:26982)
at Texture2D.__proto._createWebGlTexture (laya.d3.js:33519)
at Texture2D.__proto.recreateResource (laya.d3.js:33562)
at Texture2D.__proto.activeResource (laya.core.js:13234)
at Texture2D.<anonymous> (laya.d3.js:21347)
at Shader3D.__proto._uniform_sampler2D (laya.d3.js:28631)
at Shader3D.__proto.uploadSpriteUniforms (laya.d3.js:28751)
at RenderQueue.__proto._render (laya.d3.js:4070)
at Scene.__proto._renderScene (laya.d3.js:26518)
at Camera.__proto._renderCamera (laya.d3.js:36269)
at Scene.__proto.renderSubmit (laya.d3.js:26982)
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
ymsdandan
赞同来自:
Alex Huang
赞同来自:
__proto.imageLoaded=function(data){
if (!data.dataType || data.dataType !="imageBitmap"){
this.event(data.url,null);
return;
};
var bitmap;
var imageData=data.imageBitmap;
if (Render.isWebGL){
/*__JS__ */bitmap=HTMLImage.create(imageData.width,imageData.height,1);
/*__JS__ */bitmap.loadImageSource(imageData);
/*__JS__ */bitmap._setCreateURL(data.url);
} else {
bitmap = new HTMLCanvas(true);
var ctx=bitmap.source.getContext("2d");
switch (data.dataType){
case "imageBitmap":;
var imageData=data.imageBitmap;
bitmap.size(imageData.width,imageData.height);
ctx.drawImage(imageData,0,0);
break ;
}
console.log("load:",data.url);
}
this.event(data.url,bitmap);
}