Loading additional data in realtime?

Discussion about everything. New games, 3d math, development tips...
Post Reply
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Loading additional data in realtime?

Post by r2d2 »

Hi,
It's again me... i know ^^
I tried to load additional data into my Irrlicht application with the pthreads lib while the mine thread displays a landscape and while the camera is just moving a little bit... nothing very complicated... when trying to load additional data... i get a really heavy performance impact (FPS at 0 from around 100) so my question is... how are the pros managing that... are they loading everything into memory before the game starts? I am especially referring to games like Far Cry... I think everyone knows the huge islands... or swg... when you run around in the nature you normally don't notice any loading...
Thanks in advance for any hints... R2
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

which driver are you using ?
and what kind of data are you tryingo to load (i assume models/textures but want to make sure) ?
and how do you synchronize the loading thread to the main-thread (if at all) ?
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

Post by AlexL »

I'm not sure I completely understand what exactly your trying to do with loading the data. But you may want to take a look at the source from the Feburary 2005 GDM, it contains an article on late-binding data and from reading the article over again it might be what your trying to do. You can find the source for it here :: http://www.gdmag.com/code.htm :: Hope this helps you :)
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

Yes mm765 i want to load especially models. I don't synchronize it because i didn't think that it's necessary for such a small example.
I will have a look at it AlexL
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

...double post
Last edited by mm765 on Wed May 18, 2005 2:14 pm, edited 1 time in total.
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

hmm...too bad you didnt say which driver you are using because with what you wrote im a bit confused.
using the pthread-lib hints at linux but then if you would use opengl your app would prolly crash if you try to load something with a texture while youre rendering because the loading thread couldnt use the same opengl-context if you didnt change your irrlicht-lib to make it a shared context and so on.

but you could also use pthread-win32 and use directx which then would probably halt the rendering if a texture gets loaded while rendering until the texture is fully loaded (which would explain your 0 fps).

and of course it could be you made it so that your loading thread only runs while youre not rendering (which i meant with synchronizing) which would make using threads quite senseless :)

soo..which one is it ?
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

Sorry... i totally forgot to mention it... i am using Direct X 9.0...
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

the problem then is the texture locking which is hard to work around in directx with irrlicht. it is easier for opengl (a solution for opengl is included in nx) .
so if you can live with using opengl id suggest using it.

if you need directx then you need to change the dx-texture-class so that it holds a buffer with the image and doesnt directly upload the texture upon loading from disk but at the point it is used.
Post Reply