My question is, how do I load textures asynchronously, in the background?
A bit of background info: I am writing an app that is essentially Gigapan in Panda. It displays massive panoramic images by chopping them up into little pieces and then loading only the necessary pieces depending on which portion of the panoramic that the user is viewing. This streaming happens in the background while the user is panning and zooming around the panoramic.
All this works pretty well, but there’s significant stutter whenever the app has to load new pieces of the panoramic.
I know that loader.loadModel has a callback parameter, but loader.loadTexture has no such parameter.
I’ve also tried loading textures in separate threads, but this still produces a stutter whenever textures have to load. (Yes, I have compiled Panda with HAVE_THREADS. Yes, Thread.isThreadingSupported() returns 1.) Perhaps this has something to do with python’s GIL?
For the record, in my thread I’m loading the texture like this:
tex = Texture()
Any thoughts on how best to approach this problem?