How to check if multisampling is supported?

I’m trying to write to a multisampled buffer. While I’m able to build the buffer and glCheckFramebufferStatus() returns GL_FRAMEBUFFER_COMPLETE, none the less nothing is written to it. I’m wondering if it might be that my graphics card does not support multisampling. Is there a function I can call to see if multisampling is available?

Use glGetIntegerv or glGetFramebufferParameteriv (while the FBO is bound) to query the value of GL_SAMPLE_BUFFERS. If it’s non-zero you have a multi-sample framebuffer.

Does the code work if you use non-multisample textures/renderbuffers for the attachments?

After mucking around, I discovered that I could write to my multisample buffer after all - the problem was related to something else.

I would like this program to run in other environments, though. I found GL_MAX_COLOR_TEXTURE_SAMPLES and GL_MAX_DEPTH_TEXTURE_SAMPLES which seem to indicate my sample size. If multisampling is not supported, is the best way to determine this to query these and see if they return 0?

An implementation might support multisampling for the default framebuffer and/or renderbuffers but not textures. For renderbuffers, the limit is obtained by querying GL_MAX_SAMPLES. OpenGL 3.0 requires support for multisample renderbuffers with at least 4 samples, but multisample textures were added in 3.2.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.