Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB
My Carrier: Virgin Mobile

OBJ (Wavefront) Parsing tips?

Hi,

I'm currently writing a game for the playbook and having trouble with my 3D model (wavefront OBJ) file loading and parsing.

I starting using the OBJ wavefront format because it was nice and easy to sort and parse since it is ASCII based (which is obviously a major factor in it's performance/speed).

It currently takes about 1 to 2 seconds to load 50 Frames worth of OBJ files and then sort the vertices, normals and tex coords in to separate arrays in the correct order so OpenGL can build faces from them, and also load the texture for the object.

I was thinking maybe use two threads to load different parts of each map.

I dont plan on using too many models in my project and trying to keep assets to a minimum.

 

How else could I speed up loading performance? (apart from switching from ASCII to a binary based Model file because I have no idea how I'd write a blender exporter plug-in).

 

Thanks,

Mike.

 

Note:
I ported the project over in to Visual Studio so I could test the performance on my (crappy) laptop for comparison (which has a similar performance to the playbook). It took almost exactly the same amount of time and noticed that my CPU usage was constantly 100% on only one core so clearly it would make sense to utilise another core and try and cut the load times.

Please use plain text.
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB
My Carrier: Virgin Mobile

Re: OBJ (Wavefront) Parsing tips?

wow, ok just found the solution!

 

Tried running in release mode instead of debugging mode an the load is virtually instant! 

So even though when i'm debugging on the playbook I presume release will be ok.

Would it still be wise to run through two thread or stay simple and just use one?

Please use plain text.