Maximum OpenGL FrameBuffer Object size limit?
Asked Answered
K

2

6

I am working on an OpenGL application on my laptop. My app shows lots of black and white unrecognizable patterns when I try to display a monochrome image (quite large). I have a hunch that it could be that my old Geforce Go 7950 GTX (512 MB) is too old for my app, and thinking the problem was due to framebuffer object size limit - is there a way to find out what the largest FBO can be?

Kylstra answered 11/7, 2011 at 20:12 Comment(1)
You can use gDebugger (it's free) to debug such problems.Written
A
9

There is no maximum limit to framebuffer size in OpenGL. The limit is the largest texture or renderbuffer that you can attach to it.

There is however a maximum viewport size, get it using GL_MAX_VIEWPORT_DIMS, however according to the OpenGL specs, the viewport is silently clamped the max size anyway and shouldn't cause glitches. https://www.opengl.org/sdk/docs/man/html/glViewport.xhtml

Averil answered 11/7, 2011 at 20:37 Comment(1)
as a size note: the value of GL_MAX_VIEWPORT_DIMS doesn't have to be POT (it usually is on desktop devices, but e.g. I got 3839 x 3839 on NVIDIA Tegra 3), yet on some platforms (OpenGL ES on mobiles mostly) using NPOT textures (or even non-square POT textures) can and will cause trouble - as such I'd advise to get the nearest POT value lower than of the bigger of the two (max H/W, e.g. for T3 it'd be 2048) and use it as an upper bound of both H&W of the FBO being created. This fixed an obscure GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error I was getting.Setzer
A
3
GLuint dims[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &dims[0]);

That gives you the maximum width/height of a viewport.

Anachronous answered 11/7, 2011 at 20:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.