Write image with 32bit FBO

Hi,

I need export a 32bit image drawn into an FBO, I tried to export it as a tiff and as an exr, they both look
8bit.

gl::Fbo::Format format;
format.setColorTextureFormat( gl::Texture::Format().internalFormat(GL_RGB).dataType(GL_FLOAT) );
mFbo = gl::Fbo::create( 1920, 1680, format );


writeImage( getAppPath() / fs::path( "uv.tiff" ), mFbo->getColorTexture()->createSource(), ImageTarget::Options().quality(1.0f) );


writeImage( getAppPath() / fs::path("uv.exr"), mFbo->getColorTexture()->createSource(), cinder::ImageTarget::Options().quality(1.0f), "exr");

Hi Andrea,

Try changing the Fbo format like this:

` ``
format.setColorTextureFormat( gl::Texture::Format().internalFormat(GL_RGB32F) );

with `GL_RGB` you still get a 8-bit Fbo. With this modification the tiff will be 32-bit.

-Gabor
1 Like

That works thanks, what’s the dataType for then?

1 Like

I think dataType specifies the format of the pixel data in memory when you upload the texture to the gpu.

Texture::createStream sets the dataType based on the internalForrmat here: