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

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

  •  
  •   deepkolos · Jan 23, 2021 · 1604 views
    This topic created in 1932 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   ·   3067 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:57 · PVG 20:57 · LAX 05:57 · JFK 08:57
    ♥ Do have faith in what you're doing.