V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
deepkolos

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

  •  
  •   deepkolos · Jan 23, 2021 · 1593 views
    This topic created in 1925 days ago, the information mentioned may be changed or developed.

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

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

    有大佬知道具体原因么?

    no1xsyzy
        1
    no1xsyzy  
       Jan 24, 2021
    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.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2504 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 06:43 · PVG 14:43 · LAX 23:43 · JFK 02:43
    ♥ Do have faith in what you're doing.