import ManagedFBO from "@arcgis/core/views/3d/webgl/ManagedFBO.js";const ManagedFBO = await $arcgis.import("@arcgis/core/views/3d/webgl/ManagedFBO.js");- Inheritance:
- ManagedFBO→
ManagedFBOResource
- 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
| Property | Type | Class |
|---|---|---|
name readonly | |
Methods
| Method | Signature | Class |
|---|---|---|
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
- 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
| Parameter | Type | Description | Required |
|---|---|---|---|
| attachment | the WebGL color attachment point for the texture | |
- Returns
- ManagedFBO
acquireDepth
- 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
- 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
| Parameter | Type | Description | Required |
|---|---|---|---|
| color | the color texture to attach. | | |
| attachment | the gl.ColorFormat attachment point. | |
- Returns
- ManagedFBO
attachDepth
- 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
| Parameter | Type | Description | Required |
|---|---|---|---|
| depth | the depth buffer texture to attach. | |
- Returns
- ManagedFBO
getAttachment
- Signature
-
getAttachment (attachment?: number): ManagedColorAttachment | ManagedDepthAttachment | null | undefined
Returns a managed color attachment linked to this framebuffer object.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| attachment | the WebGL color attachment point. | |
- Returns
- ManagedColorAttachment | ManagedDepthAttachment | null | undefined
getTexture
- Signature
-
getTexture (attachment?: number): FBOTexture | null | undefined
Return the texture for a given color or depth attachment.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| attachment | a WebGL color or depth attachment point. | |
- Returns
- FBOTexture | null | undefined
release
- 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
- 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