参考 color

color

An object that stores the framebuffer's color data.

Each framebuffer uses a WebGLTexture object internally to store its color data. The myBuffer.color property makes it possible to pass this data directly to other functions. For example, calling texture(myBuffer.color) or myShader.setUniform('colorTexture', myBuffer.color) may be helpful for advanced use cases.

Note: By default, a framebuffer's y-coordinates are flipped compared to images and videos. It's easy to flip a framebuffer's y-coordinates as needed when applying it as a texture. For example, calling plane(myBuffer.width, -myBuffer.height) will flip the framebuffer.

示例

Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/p5.Framebuffer.js and open a pull request!

相关参考