Fbo format samples

I want to clear texture to Fbo without samples and use format.samples() after.
Idea is to load image, draw foreground and save image recursively without bad quality !

Is it possible ?

Thanks to share !


Hi Colin.

I’m not sure I understand exactly what you are trying to achieve. The .samples() configuration in the Format specifies how many multisamples to use when drawing in to the Fbo to get smooth lines etc with Multi Sample Anti Aliasing (MSAA).

I think you can only set the samples on the Fbo at creation (using the format object) so trying to clear an Fbo without any MSAA samples and then recreating it with samples doesn’t sound like it will be useful to you.

if you want to save the contents of an fbo to disk you can use something like this (from memory so untested):

const auto savePath = getSaveFilePath();    // Remember to add .png or .jpg to the filename
writeImage(savePath, mFbo->getColorTexture()->createSource());

Could you elaborate a bit more on what exactly you are trying to do?

1 Like