An object that stores the framebuffer's depth data.
Each framebuffer uses a WebGLTexture object internally to store its depth data. The myBuffer.depth
property makes it possible to pass this data directly to other functions. For example, calling texture(myBuffer.depth)
or myShader.setUniform('depthTexture', myBuffer.depth)
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!