Page 4 of 4

Re: How to decrease texture loading time?

Posted: Thu May 30, 2013 1:01 am
by mongoose7
I don't think sscanf has anything to do with it. You should notice that there are no calls to the driver (DirectX?). There are no symbols for these calls so the time is reported under the next symbol above in the symbol table.

The WaitForMultipleObjects seems to suggest multiple threads.

Re: How to decrease texture loading time?

Posted: Sun Jun 02, 2013 11:07 am
by CuteAlien
Now that makes more sense. You can't do much to avoid the copy32BitMipMap unless you don't need mipmaps for all materials in which case you could disable them for some materials. I think it's also the one that costs most time in my project right now.

The other one looks like you have really huge mesh in your file (or many small ones - anyway - lots of mesh-loading going on). Which seems to be so big that it costs more time than all the texture-loading. Although it's a little surprising only sscanf shows up that much. Also surprising it's even used at that place - it's certainly not optimal. Still - first take a look at your mesh-sizes, maybe those are not really realtime meshes in which case you will have trouble anyway.

DebugSetLevel is confusing - are you using debug libraries for directX?

Re: How to decrease texture loading time?

Posted: Sun Jun 02, 2013 11:24 am
by ibax
CuteAlien wrote:The other one looks like you have really huge mesh in your file (or many small ones - anyway - lots of mesh-loading going on). Which seems to be so big that it costs more time than all the texture-loading. Although it's a little surprising only sscanf shows up that much. Also surprising it's even used at that place - it's certainly not optimal. Still - first take a look at your mesh-sizes, maybe those are not really realtime meshes in which case you will have trouble anyway.
I have one obj file, converted to .irrmesh format, this is loaded. But it is loaded only after all the textures are loaded. Only that time irrlicht loads the .irrmesh model. The size of irrmesh file is 57MB.
CuteAlien wrote:DebugSetLevel is confusing - are you using debug libraries for directX?
I didn't set up anythink in directx debugging, I just downloaded the required SDK when setting up the irrlicht development environment. I did not made anything else...

Re: How to decrease texture loading time?

Posted: Sun Jun 02, 2013 5:58 pm
by CuteAlien
57 MB sound extremely huge for a model file. I did a quick check and the largest model (obj format) in my current project is 3MB and that has already over 35000 triangles.

Re: How to decrease texture loading time?

Posted: Sun Jun 02, 2013 6:18 pm
by ent1ty
isn't .irrmesh ascii though, that would explain both the size and the loading time

Re: How to decrease texture loading time?

Posted: Sun Jun 02, 2013 7:40 pm
by ibax
ent1ty wrote:isn't .irrmesh ascii though, that would explain both the size and the loading time
can somebody explain this please? from the console I see, that first the textures are loading. and the last one, which is loaded, is the .irrmesh file
(of course everything is inside one .irr file)

Re: How to decrease texture loading time?

Posted: Mon Jun 03, 2013 12:22 am
by CuteAlien
ent1ty wrote:isn't .irrmesh ascii though, that would explain both the size and the loading time
So is the .obj format.

Re: How to decrease texture loading time?

Posted: Fri Nov 15, 2013 9:36 am
by ibax
Hi,

I'm still dealing with this stuff...

So the initial conditions are the following: I have an .irr file, an .irrmesh file (size is approx. 50 MB), an .obj file and an .mtl file.

house.irrmesh 58,824,784 bytes
house.obj 23,417,887 bytes
house.irr 1,433,932 bytes
house.mtl 24,396 bytes

The problem is, that the texture loading time of the 154 jpg textures is more than one minute. Size of the directory is 40 MB.

I tried out, what happens, if I load the textures into memory as a very first step in the main() function:

Code: Select all

IImage* ThreadTexture = 0;
device->getVideoDriver()->addTexture ( "pictures\\recorder_texture_512.jpg" ,  ThreadTexture , 0 );
device->getVideoDriver()->addTexture ( "pictures\\bookshelve1.jpg" ,  ThreadTexture , 0 );
device->getVideoDriver()->addTexture ( "pictures\\bookshelve2.jpg" ,  ThreadTexture , 0 );
...(+151 more lines)
 
device->getVideoDriver()->getTexture ( "pictures\\recorder_texture_512.jpg");
device->getVideoDriver()->getTexture ( "pictures\\bookshelve1.jpg");
device->getVideoDriver()->getTexture ( "pictures\\bookshelve2.jpg");
...(+151 more lines)
 
When I execute my app, I can see, that the textures are loading much faster, when loading from the original place (via .irr file). But, when the code reaches the .irr file loading part, my application crashes without any informative window...

I thought, that with this method, I can include some kind of multithreading to this texture loading part, and if the textures will be in memory in the beginning of my application quickly, than the .irr file loading process will not load them once again.

Experts, please comment.

Thanks!

Re: How to decrease texture loading time?

Posted: Fri Nov 15, 2013 9:50 am
by mongoose7
OpenGL is not thread-safe. You should only use one thread to load textures.

Re: How to decrease texture loading time?

Posted: Fri Nov 15, 2013 9:53 am
by ibax
I'm using Direct3D only.