Skip to main content

Abstract Class: Framebuffer

Defined in: modules/core/src/adapter/resources/framebuffer.ts:27

Create new textures with correct size for all attachments.

Note​

resize() destroys existing textures (if size has changed).

Extends​

Constructors​

Constructor​

new Framebuffer(device, props?): Framebuffer

Defined in: modules/core/src/adapter/resources/framebuffer.ts:41

Parameters​

device​

Device

props?​

FramebufferProps = {}

Returns​

Framebuffer

Overrides​

Resource.constructor

Properties​

colorAttachments​

abstract colorAttachments: TextureView[]

Defined in: modules/core/src/adapter/resources/framebuffer.ts:37

Color attachments


depthStencilAttachment​

abstract depthStencilAttachment: TextureView | null

Defined in: modules/core/src/adapter/resources/framebuffer.ts:39

Depth-stencil attachment, if provided


destroyed​

destroyed: boolean = false

Defined in: modules/core/src/adapter/resources/resource.ts:131

Whether this resource has been destroyed

Inherited from​

Resource.destroyed


device​

abstract readonly device: Device

Defined in: modules/core/src/adapter/resources/resource.ts:124

The device that this resource is associated with

Inherited from​

Resource.device


handle​

abstract readonly handle: unknown

Defined in: modules/core/src/adapter/resources/resource.ts:126

The handle for the underlying resource, e.g. WebGL object or WebGPU handle

Inherited from​

Resource.handle


height​

height: number

Defined in: modules/core/src/adapter/resources/framebuffer.ts:35

Height of all attachments in this framebuffer


id​

id: string

Defined in: modules/core/src/adapter/resources/resource.ts:118

props.id, for debugging.

Inherited from​

Resource.id


props​

readonly props: Required<Props>

Defined in: modules/core/src/adapter/resources/resource.ts:120

The props that this resource was created with

Inherited from​

Resource.props


userData​

readonly userData: Record<string, unknown> = {}

Defined in: modules/core/src/adapter/resources/resource.ts:122

User data object, reserved for the application

Inherited from​

Resource.userData


width​

width: number

Defined in: modules/core/src/adapter/resources/framebuffer.ts:33

Width of all attachments in this framebuffer


defaultProps​

static defaultProps: Required<FramebufferProps>

Defined in: modules/core/src/adapter/resources/framebuffer.ts:180

Default properties for resource

Overrides​

Resource.defaultProps

Accessors​

[toStringTag]​

Get Signature​

get [toStringTag](): string

Defined in: modules/core/src/adapter/resources/framebuffer.ts:28

Returns​

string

Overrides​

Resource.[toStringTag]


isHandleBorrowed​

Get Signature​

get isHandleBorrowed(): boolean

Defined in: modules/core/src/adapter/resources/resource.ts:147

Whether luma.gl may only reference the opaque externally owned resource handle.

Returns​

boolean

Inherited from​

Resource.isHandleBorrowed


ownsHandle​

Get Signature​

get ownsHandle(): boolean

Defined in: modules/core/src/adapter/resources/resource.ts:140

Whether luma.gl created and owns the underlying resource handle.

Returns​

boolean

Inherited from​

Resource.ownsHandle

Methods​

attachResource()​

attachResource(resource): void

Defined in: modules/core/src/adapter/resources/resource.ts:200

Attaches a resource. Attached resources are auto destroyed when this resource is destroyed Called automatically when sub resources are auto created but can be called by application

Parameters​

resource​

Resource<ResourceProps>

Returns​

void

Inherited from​

Resource.attachResource


clone()​

clone(size?): Framebuffer

Defined in: modules/core/src/adapter/resources/framebuffer.ts:51

Create a copy of this framebuffer with new attached textures, with same props but of the specified size.

Parameters​

size?​
height​

number

width​

number

Returns​

Framebuffer

Note​

Does not copy contents of the attached textures.


delete()​

delete(): this

Defined in: modules/core/src/adapter/resources/resource.ts:181

Returns​

this

Deprecated​

Use destroy()

Inherited from​

Resource.delete


destroy()​

destroy(): void

Defined in: modules/core/src/adapter/resources/resource.ts:173

destroy can be called on any resource to release it before it is garbage collected.

Returns​

void

Inherited from​

Resource.destroy


destroyAttachedResource()​

destroyAttachedResource(resource): void

Defined in: modules/core/src/adapter/resources/resource.ts:214

Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.

Parameters​

resource​

Resource<ResourceProps>

Returns​

void

Inherited from​

Resource.destroyAttachedResource


destroyAttachedResources()​

destroyAttachedResources(): void

Defined in: modules/core/src/adapter/resources/resource.ts:221

Destroy all owned resources. Make sure the resources are no longer needed before calling.

Returns​

void

Inherited from​

Resource.destroyAttachedResources


detachResource()​

detachResource(resource): void

Defined in: modules/core/src/adapter/resources/resource.ts:207

Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.

Parameters​

resource​

Resource<ResourceProps>

Returns​

void

Inherited from​

Resource.detachResource


getProps()​

getProps(): object

Defined in: modules/core/src/adapter/resources/resource.ts:190

Combines a map of user props and default props, only including props from defaultProps

Returns​

object

returns a map of overridden default props

Inherited from​

Resource.getProps


resize()​

Call Signature​

resize(size): void

Defined in: modules/core/src/adapter/resources/framebuffer.ts:72

Resizes all attachments

Parameters​
size​
height​

number

width​

number

Returns​

void

Note​

resize() destroys existing textures (if size has changed).

Deprecated​

Use framebuffer.clone()

Call Signature​

resize(size): void

Defined in: modules/core/src/adapter/resources/framebuffer.ts:73

Resizes all attachments

Parameters​
size​

[number, number]

Returns​

void

Note​

resize() destroys existing textures (if size has changed).

Deprecated​

Use framebuffer.clone()

Call Signature​

resize(): void

Defined in: modules/core/src/adapter/resources/framebuffer.ts:74

Resizes all attachments

Returns​

void

Note​

resize() destroys existing textures (if size has changed).

Deprecated​

Use framebuffer.clone()


toJSON()​

toJSON(): string

Defined in: modules/core/src/adapter/resources/resource.ts:113

Compact serialization for assertion diffs and structured debug logs.

Returns​

string

Inherited from​

Resource.toJSON


toString()​

toString(): string

Defined in: modules/core/src/adapter/resources/resource.ts:108

Returns​

string

Inherited from​

Resource.toString