Skip to content

Extracting a texture before dispose #12

@wwwtyro

Description

@wwwtyro

I have a use case where I want to render to a texture for later use, but I don't need the fbo object to stick around. Since dispose also wipes the texture, I've been doing this:

var texture = fbo.color[0];
fbo.color = [];
fbo.dispose();

This allows me to keep the texture object and still call dispose on the fbo, but is a little hacky. Is there a better pattern for this? If not, what would an acceptable API for this behavior be? Something like the following?

var texture = fbo.color[0];
fbo.dispose({preserveColor: true});

I'm happy to make a PR if we can find consensus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions