简体   繁体   English

xtk renderer3D的pick()在启用webgl2的浏览器中产生错误

[英]xtk renderer3D's pick() produce errors in webgl2 enabled browsers

Has anyone used xtk with webgl2 to do the pick() call? 有没有人使用xtk和webgl2进行pick()调用? specifically renderer3d's. 特别是renderer3d的。

Error: WebGL: drawArrays: Feedback loop detected...renderer3D.js:1977:7 错误:WebGL:drawArrays:检测到反馈循环... renderer3D.js:1977:7

Error: WebGL: readPixels: Out-of-bounds reads with readPixels are deprecated, and may be slow. 错误:WebGL:readPixels:不建议使用readPixels进行越界读取,并且读取速度可能很慢。 renderer3D.js:1445:5 renderer3D.js:1445:5

For the first error, feedback loops have always been invalid and an error in WebGL. 对于第一个错误,反馈循环始终无效,并且是WebGL中的错误。 From the WebGL 1 spec section 6.26 WebGL 1规范第6.26节

6.26 Feedback Loops Between Textures and the Framebuffer 6.26纹理和帧缓冲区之间的反馈循环

In the OpenGL ES 2.0 API, it's possible to make calls that both write to and read from the same texture, creating a feedback loop. 在OpenGL ES 2.0 API中,可以进行写入和读取相同纹理的调用,从而创建反馈循环。 It specifies that where these feedback loops exist, undefined behavior results. 它指定存在这些反馈循环的位置会导致未定义的行为。

In the WebGL API, such operations that would cause such feedback loops (by the definitions in the OpenGL ES 2.0 spec) will instead generate an INVALID_OPERATION error. 在WebGL API中,将导致此类反馈循环(根据OpenGL ES 2.0规范中的定义)的此类操作将生成INVALID_OPERATION错误。

As for the 2nd error that's not a valid WebGL error. 至于第二个错误,这不是有效的WebGL错误。 Which version of which browser is generating that error? 哪个浏览器版本会产生该错误?

Here's the WebGL conformance test to make sure you can read out of bounds 这是WebGL一致性测试,以确保您可以越界阅读

https://www.khronos.org/registry/webgl/sdk/tests/conformance/reading/read-pixels-test.html?webglVersion=1&quiet=0 https://www.khronos.org/registry/webgl/sdk/tests/conformance/reading/read-pixels-test.html?webglVersion=1&quiet=0

And here's a snippet showing reading out of bounds does not generate an error. 这是一个片段,显示超出范围的读取不会产生错误。

 ['webgl', 'webgl2'].forEach(check); function check(version) { log(`checking ${version}`); const gl = document.createElement("canvas").getContext(version); if (!gl) { log(`${version} not supported`); return; } const pixel = new Uint8Array(4); // read off the left bottom gl.readPixels(-10, -10, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); // read off the right top gl.readPixels(400, 300, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); // const error = gl.getError(); log(error ? `error was ${error} reading out of bounds` : "there were no errors reading out of bounds"); } function log(...args) { const elem = document.createElement("pre"); elem.textContent = [...args].join(); document.body.appendChild(elem); } 

Maybe file bugs with xtk ? 也许是XTK的文件错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM