Loading OBJs causes massive slowdown

Software: Away3D 4.x

Mr Margaret Scratcher, Sr. Member
Posted: 23 May 2012 02:51 AM   Total Posts: 344

Hi, I have a project which loads a number of OBJs, and whilst doing so the framerate drops dramatically (like right down to 1-2 fps..)

Is there anything I can do to improve this?

Currently it is cycling through a list of objs to be loaded and I guess trying to load them all at the same time, I’m guessing that this isn’t helping..

Would I be be better off using some other type of loader class?

   

Richard Olsson, Administrator
Posted: 16 June 2012 02:22 PM   Total Posts: 1192   [ # 1 ]

This is an interesting issue. The loading framework tries to make sure that it doesn’t hang while loading large files, but if you try to load several large files at the same time it may still bump into troubles.

It would be great if you could file this as an issue over at http://github.com/away3d/away3d-core-fp11/issues and reference this thread. If you can provide one of your heavy test models that would be great.

   

ASWC, Member
Posted: 18 June 2012 11:45 AM   Total Posts: 76   [ # 2 ]

You should sequence the loading of your files (load and parse one then load the next and so on) that should get you back a few fps. The internal parsing of Away3D might take some time depending on how much data there’s to parse and it might drop your fps until that parsing is over. A sequenced code execution update in Away3D could be a solution for this. Here is an example of that principle:
http://www.senocular.com/flash/tutorials/asyncoperations/

   

Richard Olsson, Administrator
Posted: 18 June 2012 12:42 PM   Total Posts: 1192   [ # 3 ]

ASWC: You’re correct. That’s what I was referring to. I’ve filed a ticket to track this optimization, and will hopefully be able to do it before the stable (“gold”) 4.0 release in July.

Ticket here: https://github.com/away3d/away3d-core-fp11/issues/295

   

Mr Margaret Scratcher, Sr. Member
Posted: 19 June 2012 01:05 PM   Total Posts: 344   [ # 4 ]

Here’s the project:
http://www.margaretscratcher.co.uk/projects/CustomBike/index.html

Right now how it loads all the various .objs is literally a function which is

loadObj (path,container)

and I rip through a FOR loop for all of them, relentlessly.. poor old flash..

I’ll have a go right now at modifying the code slightly to step through one at a time instead…

   

Mr Margaret Scratcher, Sr. Member
Posted: 20 June 2012 01:34 AM   Total Posts: 344   [ # 5 ]

Okay, so what I’ve done is basically addded all the objs to be loaded into an array, and then stepped through the array..

Here’s the result, which is *much* better:

http://www.margaretscratcher.co.uk/projects/CustomBike/index.html

Still a slight slowdown, but still….

   

Ivan Moreno, Newbie
Posted: 20 June 2012 01:07 PM   Total Posts: 22   [ # 6 ]

Hello,

I got a stream error (#2032) of the mtl of the OBJ files in my debugger and in the player takes too long to load for what the model is. I assume the low frame rate is related with that (large size files loading at the same time) and/or even if all the vertices of the model are loaded, the loader class still is trying to catch the materials data of the model file (this is another reason why is loading and performing slow).

Are you using the Loader3D or the AssetLoader to load your models? why just not try AWD or 3DS files? the improvements in loading and parsing time are much higher than using OBJ or DAE (Try to go with AWD). If you want to keep using OBJ then you should delete the material data from the modeling software so the loader will not require the AssetLoaderContext and you will have more freedom to modify the materials in runtime among other benefits, like performance improvements or stream errors like this one.

Best.

   

Avatar
Fabrice Closier, Administrator
Posted: 20 June 2012 01:56 PM   Total Posts: 1265   [ # 7 ]

and if you embed, why not use AS3?

   

Mr Margaret Scratcher, Sr. Member
Posted: 20 June 2012 03:28 PM   Total Posts: 344   [ # 8 ]

I’ve decided not to embed, as I like the way that (now I’ve sorted loading sequentially at least) the way the various components drops down works as a more visually interesting than usual preloader.

I’m going to look into converting the .obj files, in order to make them smaller. Currently the whole bunch runs to about 7mb…

   
   
‹‹ performance test

X

Away3D Forum

Member Login

Username

Password

Remember_me



X