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.
उदाहरण
This page is generated from the comments in src/webgl/p5.Framebuffer.js . Please feel free to edit it and submit a pull request!