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.
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
disposealso wipes the texture, I've been doing this: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?
I'm happy to make a PR if we can find consensus.