Skip to content
import ManagedFBO from "@arcgis/core/views/3d/webgl/ManagedFBO.js";
Inheritance:
ManagedFBOManagedFBOResource
Since
ArcGIS Maps SDK for JavaScript 4.29

ManagedFBO is an interface to represent a framebuffer object resource of the SceneView. ManagedFBO are used in custom RenderNodes to access current render states of the frame as well as return modified frame states to the render pipeline.

Important guidelines

This interface is experimental. Please read the following information carefully before using it in a product: It is not possible to shield users of this interface from SceneView internal implementation details. Therefore, this interface should be considered not stable and subject to changes in upcoming minor releases of the ArcGIS Maps SDK for JavaScript. Because of the complex nature of WebGL and hardware-accelerated 3D rendering, this interface is targeting expert developers that are experienced with WebGL or OpenGL.

  • Improper use of WebGL might not only break the custom rendering, but also the rendering of SceneView itself.
  • Esri does not provide any support for issues related to WebGL rendering in custom rendering code, or for issues that arise in SceneView rendering while using custom rendering code. Integration with third-party libraries is only possible under certain conditions. Specifically, the third-party library has to be capable of working on the same WebGL context as SceneView, and able to set the relevant parts of the WebGL state in every frame.

Properties

PropertyTypeClass
name
readonly

name

readonly Property
Type
RenderNodeInput

The name of the managed fbo target

Methods

MethodSignatureClass
acquireColor(attachment: number): ManagedFBO
acquireDepth(): ManagedFBO
attachColor(color: ManagedColorAttachment, attachment: number): ManagedFBO
attachDepth(depth: ManagedDepthAttachment | null | undefined): ManagedFBO
getAttachment(attachment?: number): ManagedColorAttachment | ManagedDepthAttachment | null | undefined
getTexture(attachment?: number): FBOTexture | null | undefined
obtainDepthTexture(): any | null | undefined
release(): boolean
retain(): void

acquireColor

Method
Signature
acquireColor (attachment: number): ManagedFBO

Acquire and attach a new color texture to this framebuffer.

The attached texture has a gl.PixelFormat.RGBA pixel format.

Parameters
ParameterTypeDescriptionRequired
attachment

the WebGL color attachment point for the texture

Returns
ManagedFBO

acquireDepth

Method
Signature
acquireDepth (): ManagedFBO

Acquire and attach a new depth buffer to this framebuffer. The attached texture has a gl.PixelFormat.DEPTH_STENCIL pixel format.

Returns
ManagedFBO

attachColor

Method
Signature
attachColor (color: ManagedColorAttachment, attachment: number): ManagedFBO

Attach a color buffer texture to this framebuffer.

A previously attached color texture at the given attachment point will be released. The newly attached texture will be retained. This function automatically binds the framebuffer of this ManagedFBO.

Parameters
ParameterTypeDescriptionRequired
color

the color texture to attach.

attachment

the gl.ColorFormat attachment point.

Returns
ManagedFBO

attachDepth

Method
Signature
attachDepth (depth: ManagedDepthAttachment | null | undefined): ManagedFBO

Attach a depth buffer texture to this framebuffer. This function will automatically bind the framebuffer of this ManagedFBO if necessary.

A previously attached depth texture will be released. The newly attached texture will be retained. This function automatically binds the framebuffer of this ManagedFBO.

Parameters
ParameterTypeDescriptionRequired
depth

the depth buffer texture to attach.

Returns
ManagedFBO

getAttachment

Method
Signature
getAttachment (attachment?: number): ManagedColorAttachment | ManagedDepthAttachment | null | undefined

Returns a managed color attachment linked to this framebuffer object.

Parameters
ParameterTypeDescriptionRequired
attachment

the WebGL color attachment point.

Returns
ManagedColorAttachment | ManagedDepthAttachment | null | undefined

getTexture

Method
Signature
getTexture (attachment?: number): FBOTexture | null | undefined

Return the texture for a given color or depth attachment.

Parameters
ParameterTypeDescriptionRequired
attachment

a WebGL color or depth attachment point.

Returns
FBOTexture | null | undefined

obtainDepthTexture

Method
Signature
obtainDepthTexture (): any | null | undefined

Detach the attached depth buffer texture and return ownership to the caller.

Returns
any | null | undefined

release

Method
Signature
release (): boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Release this managed framebuffer.

If more than one reference exists this will not have an effect.

Returns
boolean

retain

Method
Signature
retain (): void
Since
ArcGIS Maps SDK for JavaScript 5.0

Increase reference counting on this managed framebuffer.

You can use this functionality to hold framebuffer contents for several frames and then release the framebuffer.

Returns
void

Type definitions

FBOTexture

Type definition

Encapsulates a WebGL texture.