我是靠谱客的博主 体贴芝麻,最近开发中收集的这篇文章主要介绍Failed to execute 'texImage2D' on 'WebGLRenderingContext': Tainted canvases may not be loaded.,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

three.js:27461 DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': Tainted canvases may not be loaded.
    at THREE.WebGLState.texImage2D (file:///H:/3d_demo/demo6/js/three.js:27457:18)
    at uploadTexture (file:///H:/3d_demo/demo6/js/three.js:24063:11)
    at THREE.WebGLRenderer.setTexture (file:///H:/3d_demo/demo6/js/three.js:24099:4)
    at loadUniformsGeneric (file:///H:/3d_demo/demo6/js/three.js:23600:13)
    at setProgram (file:///H:/3d_demo/demo6/js/three.js:22985:4)
    at THREE.WebGLRenderer.renderBufferDirect (file:///H:/3d_demo/demo6/js/three.js:21955:17)
    at renderObjects (file:///H:/3d_demo/demo6/js/three.js:22610:11)
    at THREE.WebGLRenderer.render (file:///H:/3d_demo/demo6/js/three.js:22400:4)
    at animate (file:///H:/3d_demo/demo6/6-1.html:56:22)

解决办法:
在three.js中
loader.setCrossOrigin( this.crossOrigin );改为loader.setCrossOrigin( "Anonymous");即可。
在这里插入图片描述

最后

以上就是体贴芝麻为你收集整理的Failed to execute 'texImage2D' on 'WebGLRenderingContext': Tainted canvases may not be loaded.的全部内容,希望文章能够帮你解决Failed to execute 'texImage2D' on 'WebGLRenderingContext': Tainted canvases may not be loaded.所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部