【发布时间】:2015-10-21 03:32:54
【问题描述】:
所以这个问题与https://gamedev.stackexchange.com/questions/38829/webgl-texture-appears-as-black上的一篇帖子有关
我在渲染纹理 http://www.html5canvastutorials.com/cookbook/ch9/1369_09_06/crate.jpg 时遇到问题,这是 2 的偶数幂(尽管在上一篇文章中推荐了更改)
我在JSFiddle 上放了一个叉子,在玩弄了几张图像之后,似乎有些纹理渲染而有些则没有。具体这在代码中有详细说明
image.src = 'https://lh4.googleusercontent.com/-Y2gO2Ex8Q10/T588LBJKq7I/AAAAAAAAgzc/XKpph-vQWiw/s686/_DSC4127+-+Version+2.jpg';
// The original texture runs fine
image.src = 'http://webglfundamentals.org/webgl/resources/f-texture.png'
// As does this texure from WebGLFundamentals
image.src = 'http://www.html5canvastutorials.com/cookbook/ch9/1369_09_06/crate.jpg';
// But the crate texture does not want to show
image.src = 'https://dev.opera.com/articles/raw-webgl-part-2-simple-shader/figure3.png'
// Neither does this Red-Green-Yellow gradient
我在 JSFiddle 代码术语中缺少什么能够正确渲染纹理?
我知道这不是图像的问题,它必须是某个地方的设置,因为它在位于 http://www.html5canvastutorials.com/cookbook/ch9/1369_09_06/ 的页面上正常工作
任何帮助将不胜感激!
谢谢。
【问题讨论】:
标签: javascript opengl-es textures webgl