I’ve been playing around with my terrain rendering code recently and come across some odd behaviour.
Quick summary: application loads a gray-scale image, generates a mesh, uploads to a VBO, renders with multiple textures to blend grass, rock, snow, etc. Nothing amazingly complex and it’s been working solid for quite some time. Recently I’ve been extending the code to handle multiple terrain ‘chunks’ and dynamically loading/trashing as the camera moves. Again it’s all working nicely (or at least seems to be).
Now I’ve downloaded some massive grey-scale images (of parts of Italy cos went there recently) which will be cut up into smaller chunks, but I thought I’d test the software with a much larger image just to see how well it coped (or not). Normally the chunks are 256x256 sized, the image I tried was 2100x2100 pixels. The software took some time to load and process this as you can imagine, and at the end I got - nothing.
Debugged the code but it seemed to be working correctly. So I bodged the terrain generator so that it did 500x500 (i.e. the top-left part) and it worked fine, ditto 1000x1000, ditto 1500x1500, but the full image still fails! No errors, just nothing being rendered. The frame-rate indicates that it’s basically rendering nothing. Very odd.
Is there some limit on the size of NIO buffers and/or VBOs? Or has anyone come across similar behaviour? By my calculations the 2100x2100 should be about 70Mb worth of vertex data.
Note that the same terrain image broken down into the normal 256x256 chunks with multiple VBOs also works fine. Obviously this isn’t a big deal as the ‘proper’ chunked solution works, but I’m just surprised that the big image failed but without any errors.
Any suggestions?
Cheers
- stride