Issue loading large textures

Hi all. I’m having some issues loading large textures. I’m building a zoomable panorama viewer (texturing a sphere, changing the camera fov to zoom) and I’m trying to use a high res image as the texture. It works fine at 12,800x6,400 (66MB jpg), but fails at 25,600x12,800 (227MB jpg) with the following:

PanoViewerDebug(25036,0xa15bf1a8) malloc: *** mach_vm_map(size=981659648) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc

Seems like it can’t load it into memory, so I thought maybe switching to 64bit would help. I tried using @NickHardeman’s 0.8.0 64bit build, and it seems to load ok but draws as a white rect. Not sure where to go from here… I’m currently running on OS X 10.9.4 on a 15"MBP a 2GB GeForce GT 750M video card. Tomorrow I’ll give it a shot on a Mac Pro with more video memory and see if that’s it. Any pointers would be super helpful!



Sounds like you’re out of memory! Note that a 227MB jpg doesn’t mean you need 227MB of graphics memory, you need way more (in order to store the uncompressed image as a texture).

you are probably hitting the max texture size for your hardware in OpenGL.

int maxSize = 0;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize);

this should report how big can a texture be for your hardware…

There’s an add-on in to load larger images through tiling.

Definitely hitting MAX_TEXTURE_SIZE, the NVIDIA GeForce GT 750M 2048 MB has a max texture size of 16384x 16384 as per the OpenGL Capabilities Tables. Sadly the FirePro D700 isn’t on the chart, but searching around a bit seems to suggest it has the same maximum texture size.

Thanks everyone!