FrameBuffer
The FrameBuffer class manages the main display frame buffer for rendering to-screen. It provides simple clear operations for the color and depth buffers.
Access through renderer.frameBuffer:
const fb = myRenderer.frameBuffer;fb.clear(); // Clear color and depth buffersConstructor
Section titled “Constructor”private constructor(renderer: Renderer)The frame buffer is created automatically when first accessed via renderer.frameBuffer (lazy instantiation).
clear() — Clear All Buffers
Section titled “clear() — Clear All Buffers”Clears the color and depth buffers (default behavior, same as clearAll()):
fb.clear(); // Equivalent to clear({ color: true, depth: true })clearColor() — Clear Color Only (with Depth)
Section titled “clearColor() — Clear Color Only (with Depth)”Clears the color buffer, leaving the depth buffer untouched:
fb.clearColor(); // Equivalent to clear({ color: true, depth: false })clearDepth() — Clear Depth Only (with Color)
Section titled “clearDepth() — Clear Depth Only (with Color)”Clears both the color and depth buffers:
fb.clearDepth(): void // Clear everything (color + depth)clearStencil() — Clear Stencil Only
Section titled “clearStencil() — Clear Stencil Only”Clears the stencil buffer:
fb.clearStencil(); // Clear just the stencil buffer