![](/img/trans.png)
[英]Three.js: Setting `texture.needsUpdate = true` is very slow
[英]Three.js: video Texture NeedsUpdate stop rendering
我嘗試將視頻作為紋理放在網格上,為此,我測試了2種不同的示例:
http://jeromeetienne.github.io/threex.videotexture/examples/videotexture.html
和
http://stemkoski.github.io/Three.js/Video.html
兩者都可以在網絡上按預期工作,但是如果我從本地的github下載它們,它們什么也不會顯示。
如果我放
videoTexture.needsUpdate = false;
然后顯示樓層和屏幕。 視頻可以正常播放,因為我可以聽到背后的聲音,但沒有圖像顯示。
任何想法如何解決這個問題?
(我已經使用Firefox和Chrome進行了測試)。
編輯:在Firefox的控制台中,我有這個
SecurityError: The operation is insecure. Three.js:25696:0
Error: WebGL: The canvas used as source for texImage2D here is tainted (write-only). It is forbidden to load a WebGL texture from a tainted canvas. A Canvas becomes tainted for example when a cross-domain image is drawn on it. See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures
這個問題與我所想的完全不同。
當我從本地文件夾而不是本地服務器運行文件時,出現了“ 同源策略問題”。
如此答案中的解釋: https : //stackoverflow.com/a/24042463/1224782
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.