Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / .Obj format load time is 33 times longer than .x format load time

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th May 2020 00:04
See the attached project

Attachments

Login to view attachments
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 17th May 2020 07:08
It's only 18.4x on my System., but that isn't surprising.
Remember .X (like it's modern equivalent glTF, which it's odd AppGameKit doesn't support) was designed specifically to be quite optimised with performance in mind., where-as OBJ was designed as a Scene Format.
Still the load times typically aren't quite *this* noticeable, rather I think the pronounced difference has a lot to do with the fact that AGK's roots are with DBv3; so a lot of the Backend is still heavily designed around optimised DirectX, even though it's using OpenGL/Vulkan.

I mean look at how Mesh Memblocks are structured... they're not inline with OpenGL Vertex Buffer Objects but they are inline with DirectX Vertex Cache., just like Dark Basic (and the DBO Format) were.
Oh as a note., you can use MeshConvert.exe (found in the Windows SDK) to convert ASCII .X to Binary .X Format; it substantially reduces the file footprint and improved load times more; plus will be compatible with the .X Importer Plug-in for Blender.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th May 2020 10:04 Edited at: 17th May 2020 10:05
.3ds and .fbx also load fast. It seems to be just the .obj format that takes the time
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th May 2020 23:07 Edited at: 17th May 2020 23:46
Here's some results


Firstly, my load speeds for .obj files are only 3-4 times slower then the .x file you also had, so its not a huge change in my case.

You can load much much faster using other formats though. All the examples in the image above are the same 3d model (Yours) simply changed to different formats. They have same number of vertices and triangles etc...

The results show that .OBJ is pretty one of the slowest formats. That is for quite a few reasons which i've listed below!

A few important points regarding file formats:

1) Dont use TEXT based files! .OBJ is text based (you can open it in notepad or another text editor). A number of 3d file formats can be saved as text readable files (notably .OBJ, .X and .3DS and a few others) - note 3ds and .x can be optionally saved as binary too - its up to the user. TEXT based files are nice if you want to manually edit the files in notepad, but they are generally a terrible idea for a lot of reasons. You should not be using them IMHO. They massively increase the file size and they slow down loading as the loader needs to parse the file and turn all the string values into binary values to use them.

2) Binary files are smaller so they load quicker. Smaller file equals faster load but with the same exact data and final result. Smaller files also make your game download smaller.

3) Typically binary files already store the data in the way that AppGameKit and the GPU wants it. Ie...a 3 float vertex list for positions and normals etc rather than a load of multi-byte float values in text and values placed all over the place and highly indexed making parsing slow and painful.

4) Importantly: AppGameKit uses ASSIMP to load all 3d files with the exception of .OBJ and .AGO. With these 2 formats it uses a separate loader function which is frankly a bit slow. It does this for .OBJ as it allows us to load multiple UV's per vertex as someobody probably once asked for it years ago even though its not too common. Just another reason not to use it.


So long story short... there are much better formats which make the file smaller AND the load quicker without loss of detail. Typically FBX, 3DS or LWO are a better alternative.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th May 2020 04:00
Are you using studio or classic?

I just ran the test in classic and the results are;


When i run it in studio the results are



Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 18th May 2020 08:10 Edited at: 18th May 2020 08:28
No matter which one i run it on... OBJ is much slower then everything else.

Classic: 3.9x slower
Studio: 18x slower (no matte which renderer is used)

It does seem a lot slower on studio... Another reason not to use studio.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th May 2020 09:56
I wonder why there is such variation between my machine and yours

Login to post a reply

Server time is: 2024-04-25 16:15:21
Your offset time is: 2024-04-25 16:15:21