The renderer this WebGLFramebuffer belongs to.
The color textures where the color pixels are written. If empty, the canvas will be used as the color attachment. Only the first color attachment is used in default WebGL1.
OptionaladdStencilBuffer: booleanWhether to add a stencil buffer to the framebuffer. If the canvas is used as the color attachment, this will be ignored. Default false.
OptionaladdDepthBuffer: booleanWhether to add a depth buffer to the framebuffer. If depth and stencil are both provided, they will be combined into a single depth-stencil buffer. If the canvas is used as the color attachment, this will be ignored. Default false.
Attachments to the framebuffer. These contain data such as the width, height, and renderbuffer or texture.
Height of the depth stencil.
The WebGLRenderer this WebGLFramebuffer belongs to.
The color texture where the color pixels are written.
This will be null if the canvas is used as the color attachment.
It is the first color attachment on the framebuffer.
Whether to use the canvas as the color attachment. If this is true, a framebuffer will not be created. This is useful for the main framebuffer, which is created by the browser.
The WebGLFramebuffer being wrapped by this class.
This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.
If the FrameBuffer is using the canvas as the color attachment,
this property will be null.
Width of the depth stencil.
Creates a WebGLFramebuffer from the given parameters.
This is called automatically by the constructor. It may also be called again if the WebGLFramebuffer needs re-creating.
Destroys this WebGLFramebufferWrapper.
Resizes the attachments of this WebGLFramebufferWrapper.
The new width of the framebuffer.
The new height of the framebuffer.
Wrapper for a WebGL frame buffer, containing all the information that was used to create it.
A WebGLFramebuffer should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLFramebufferWrapper instead.
This also manages the attachments to the framebuffer, including renderbuffer life cycle.