Loading Resources Controlled / Seamless

Is there a way to control how much CPU goes into loading a resource? I could probably load textures / models individually over time to give a seamless feel, but each time it loads something there will be that little spike of lag. I figure that if you can tell a thread to load the resources in the background but give that thread only a fraction of the CPU power, that might achieve my goal.



I'd love to have a game that doesn't have any loading screen instead of the initial one.

Essentially I'd like to replicate the same tech as what you see in Grand Theft Auto, Dungeon Seige, or most MMO's for that matter…



I read somewhere that the loading of data between threads might not be that slow, even if it does take a little CPU, it'd be better than having the OpenGL thread load it all.





Due to the scale of GTA, they can't load everything up in the beginning. My game would hopefully be the same thing. I'm really just playing with the idea of seamless loading and a few other effects before I attempt another game. Perhaps if I make it work well, I'll release it so others can use it too. That is, if I can make work.

The problem is, that you have to pass over the OpenGL-context between the threads.

Splitting your loading-code into chunks and do everything OpenGL-related in one thread is much easier.

Depending on the content you could load everything at the beginning of your game.



Don

what do you mean by :



each time it loads something there will be that little spike of lag.



what do you mean by something?

you can set the priority of the thread if you load it threaded

j2ee.me - This website is for sale! - Java software Resources and Information.



if you do, you can also distribute the attaching of new geometry to the scene among several frames, thus distributing the calls to create something on your gfx card

something = Texture || Object



I think I'll play around with the priorities you mentioned. That with loading in another thread to do the IO calls, might provide me with the necessary loading that I'm trying to accomplish.

Hi all,



Some time ago I tryed some thread loading schema (not for games or jme, it was an enterprise project). I had problems trying to use thread priorities in linux. In order to make it work, you should run the app as root and use the parameter "-XX:ThreadPriorityPolicy=1" (it also didn't work as expected…). I think it was a jvm 1.4.X bug. I don't know if it's been solved. I'd tryed it before trusting thread priorities…



Otherwise, I'd like to know If you get it working :wink: