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?
Maximum OpenGL FrameBuffer Object size limit?
Asked Answered
You can use gDebugger (it's free) to debug such problems. –
Written
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
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 GLuint dims[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &dims[0]);
That gives you the maximum width/height of a viewport.
© 2022 - 2024 — McMap. All rights reserved.