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.
Examples
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.