What other file formats would you like libgdx to support?

Anything libgdx related goes here!

What other file formats would you like libgdx to support?

Postby davedx » Wed Dec 22, 2010 4:37 pm

Currently libgdx has two loaders for 3D assets:

.obj (Wavefront) - ascii, suitable for static geometry
.md5 (Doom 3) - ascii, used for skinned geometry

Both of these are kind of slow to parse as they're stored in text format. I've got a .obj binary serializer that's semi-complete which is nice to store assets for final release, but I'm also interested in exploring alternatives and implementing them for libgdx. My first thought is .x (DirectX, binary or ascii) would be a nice one as it's commonly used. Does anyone have any other suggestions? :)
Developer of Discretion, a 3D RPG for Android. (Twitter, Facebook)
davedx
 
Posts: 86
Joined: Thu Oct 14, 2010 10:59 am
Location: The Netherlands

Re: What other file formats would you like libgdx to support

Postby mzechner » Wed Dec 22, 2010 4:56 pm

- MD2
- Orgre3D could be worth a look as well
- 3DS, maybe
- ASC, maybe

However, i believe we should do something else entirely: create a custom binary and XML format and provide a converter for the above formats. The binary format would be mostly used for the runtime, the xml format could be used for writting plugins for Blender and the like.

The benefit of this approach is that it forces us to come up with a unified API for all kinds of models. It's a little more work upfront but should pay off in the long term. The converter should probably be an extension. It could also be responsible for keyframe baking. It would make for a lightweight API in the core and we could do anything we want in the extension itself, being a desktop app most likely. It also allows us to focus our optimization efforts on a single type of model instead of having optimized code paths for all sorts of models (e.g. MD2, MD5 etc.). Best of all: others can simply write their own format and convert to ours without any problems.

I also found this for skeletal animation. It's a port of the Ardor3D animation system currently used in jPTC. It looks decent enough, maybe we can check what it has to offer and rip it apart for libgdx :)
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: What other file formats would you like libgdx to support

Postby davedx » Wed Dec 22, 2010 7:45 pm

I have a working binary format in my engine at the moment. It basically serializes from libgdx Meshes, and works nicely with my .obj levels (reduced loading time from minutes to seconds). It should be trivial to serialize keyframed and skinned models too as they all use the same basic underlying Mesh/Material classes.

Like you say though I think it's definitely worth making sure our geometry architecture is right before we go too far with binary serialization. For what it's worth though, I'm generally fairly happy with the existing classes. I know you have plans for Material though ;)
Developer of Discretion, a 3D RPG for Android. (Twitter, Facebook)
davedx
 
Posts: 86
Joined: Thu Oct 14, 2010 10:59 am
Location: The Netherlands

Re: What other file formats would you like libgdx to support

Postby mzechner » Wed Dec 22, 2010 8:00 pm

Yeah, i saw your serialization code, it's good for now. However, we'll want to have a more flexible format so we can add additional features in the future without breaking binary compatibility. I have ideas on how to make this work, shouldn't be a big problem.

What do you think of the converter idea? I can imagine that some people would find it more convenient to "just" load a MD5 or ASC file at runtime. However, that will result in terrible performance as you mentioned. It will also add a lot of code to the core API which is not really needed since all loaders should return their data in a unified object model anyways.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: What other file formats would you like libgdx to support

Postby BurningHand » Wed Dec 22, 2010 9:10 pm

I kind of feel the same way about the Tiled loader.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: What other file formats would you like libgdx to support

Postby mechacthulhu » Wed Dec 22, 2010 9:44 pm

What Mario said is exactly what I was hoping for. I also had my eye on bones.

How feasible would it be to save the 3d scene graph or portions of it in the same interchangeable format? Have nodes that could be loaded from binary or xml.


What i want to start with is not scene graph serialization. That's a step above what we are discussing here imo. We are primarily concerned about loading models into a unified format. This includes the mesh data as well as material data. This data will be potentially shared by nodes in a scene graph (think RTS). Let's start with that first before jumping into scene graph territory :)
Last edited by mechacthulhu on Wed Dec 22, 2010 10:08 pm, edited 1 time in total.
mechacthulhu
 
Posts: 20
Joined: Wed Sep 15, 2010 11:22 pm

Re: What other file formats would you like libgdx to support

Postby aksarfevad » Wed Dec 22, 2010 9:48 pm

BurningHand wrote:I kind of feel the same way about the Tiled loader.


I don't think we really need a binary format for the Tiled loader. It takes a few hundred mS on my Droid to load a map as it is. 99% of cases have 1 map per level, and a little time loading is acceptable. It is not worth the added work/coding time to reformat the map. If there is a format out there that is popular other than Tiled it might be worth looking at combining them into a unified format.

Now, back to the 3D models since I don't want to hijack this thread. I think a binary format makes sense here since models tend to take longer to load, and often require complicated calculations in doing so. Also, many models will be loaded leading to seconds of loading time, which starts to become annoying.
aksarfevad
 
Posts: 275
Joined: Fri Nov 19, 2010 4:19 am

Re: What other file formats would you like libgdx to support

Postby mechacthulhu » Wed Dec 22, 2010 10:42 pm

Weird, It looks like you replied as me and replaced my post? (see attached)
Attachments
Capture.PNG
Capture.PNG (45.16 KiB) Viewed 9197 times
mechacthulhu
 
Posts: 20
Joined: Wed Sep 15, 2010 11:22 pm

Re: What other file formats would you like libgdx to support

Postby mzechner » Wed Dec 22, 2010 11:13 pm

oh crap i clicked the edit button instead of the quote button. wtf? and here i was wondering why the quote tag wasn't inserted :/

Sorry!
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: What other file formats would you like libgdx to support

Postby mechacthulhu » Thu Dec 23, 2010 12:24 am

It tripped me out for a while, I am fighting a cold. ;)

When I see your user name I keep thinking it's my last name which is Michener.

Anyways you should check out the two open source engines I referenced:

horde3d - xml scene graph
horde3d docs

"One special feature of Horde3D is that all 3D models, static and articulated ones, are also represented as SceneGraph files. This makes it possible to access the components of a model like meshes and joints using the scene graph API and avoids the need for additional specific functions. "

blendelf - example exporter for Blender 2.54
mechacthulhu
 
Posts: 20
Joined: Wed Sep 15, 2010 11:22 pm

Next

Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest