V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
deepkolos
V2EX  ›  分享发现

原来 THREE.JS 是这样 readPixels,有大佬知道具体原因么?

  •  
  •   deepkolos · 2021-01-23 23:47:32 +08:00 · 1051 次点击
    这是一个创建于 1189 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js#L1903

    翻 three 的代码发现,readPixels 之前需要检查 frameBuffer 是否完成了

    有大佬知道具体原因么?

    no1xsyzy
        1
    no1xsyzy  
       2021-01-24 00:28:41 +08:00
    https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels#exceptions

    A gl.INVALID_FRAMEBUFFER_OPERATION error is thrown if the currently bound framebuffer is not framebuffer complete.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   956 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.