Fbo not rendered with MSAA enabled

Hi all

I am using an Fbo to render a set of complex shapes and then draw it on screen. This works well, until I try to enable multisampling. This works well:

levelFbo.allocate(fboDimX, fboDimY, GL_RGBA);

This does not render anything at all (black screen):

levelFbo.allocate(fboDimX, fboDimY, GL_RGBA, 4);

I am on an NVIDIA GTX1080 and have checked its Fbo capabilities:

[verbose] ofFbo: GL frame buffer object supported
[verbose] ofFbo: checkGLSupport(): maxColorAttachments: 8, maxDrawBuffers: 8, maxSamples: 32

So in theory it should work.

Any ideas on what the issue could be?


I found a workaround by doing a manual oversampling of the fbo.

Still, would be interesting to know whether others have the same issue with MSAA using fbos. Is this working for you guys?

Try disabling at the FBO Settings, the depthStencilInternalFormat and the depthStencilAsTexture properties.

Also check the maximum number of MSAA samples that your graphic card supports. ofFbo::maxSamples()

Right now ofFbo Settings is really complex mostly cause it allows very different types of fbos and even with different syntaxes.

There’s also parameters that are incompatible with each other, for example if you have depth stencil as texture you can’t have multisampling.