[osg-users] [osgPlugins] Collada dae plugin for Android OSG

48 views
Skip to first unread message

Oren Fromberg

unread,
Sep 20, 2012, 8:38:20 AM9/20/12
to osg-...@lists.openscenegraph.org
Hey everyone,

I want to use the collada plugin for my Android app. So I started here:

http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/Collada

This page, which seems a bit outdated, pointed me to use the DOM project here (which is at version 2.2):

http://sourceforge.net/projects/collada-dom/files/Collada%20DOM/Collada%20DOM%202.2/

The problem is that this library has a directory with prebuilt binaries for almost every platform except Android. I suppose this means I would have to build these libraries for Android before I use this version of Collada...

However, over at https://android.googlesource.com/ there is a version of Collada that already has an Android.mk.

My question: What should I do? spend time on trying to build the prereq libs in Collada DOM and get the standard version working OR try to integrate the version of Collada DOM that is provided by the Android git repo's?

Thanks!

TL;DR: what is easier? trying to build prereq libs OR trying to integrate different lib into plugin?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50215#50215





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Jorge Izquierdo Ciges

unread,
Sep 21, 2012, 3:35:24 AM9/21/12
to osg-...@lists.openscenegraph.org
I can't recommend none of them, it's a specific case that wasn't in the things to do list. If there is already a version "ported" or prepared to be used in Android then maybe just for the sake of your own sanity  I would test it. If it works cool, if not... well look into other possibilities. In the root Android is a hyped/javaticed linux with a like for tough compilings but still compatible with the vast majority of the C/C++ source code of open libraries. In the end it's just a matter of time, work and study of the platform, except rare cases.  So... as some books say, Have a go hero!

And check out with the mail list with your results.

Good luck.

2012/9/20 Oren Fromberg <orenfr...@gmail.com>

Jan Ciger

unread,
Sep 21, 2012, 6:02:32 AM9/21/12
to OpenSceneGraph Users
On Fri, Sep 21, 2012 at 9:35 AM, Jorge Izquierdo Ciges <jor...@gmail.com> wrote:
I can't recommend none of them, it's a specific case that wasn't in the things to do list. If there is already a version "ported" or prepared to be used in Android then maybe just for the sake of your own sanity  I would test it. If it works cool, if not... well look into other possibilities. In the root Android is a hyped/javaticed linux with a like for tough compilings but still compatible with the vast majority of the C/C++ source code of open libraries. In the end it's just a matter of time, work and study of the platform, except rare cases.  So... as some books say, Have a go hero!

And check out with the mail list with your results.


While it should be possible to compile the COLLADA DOM for Android, I think Oren would be better off with using another data format. COLLADA is quite a mess of a format, intended for exchange of data between modelling tools, not as an "end-user" deployment format. You get huge XML files, not something I would want on a mobile device.

Use COLLADA to export your stuff from 3DS Max/Blender/Maya (native OSG exporters are better, though) and convert it to e.g. .ive or .osgb for use on the mobile. Smaller files, everything included (textures, shaders, etc.), faster loading - a win-win situation.

Regards,

Jan

Jorge Izquierdo Ciges

unread,
Sep 21, 2012, 9:02:39 AM9/21/12
to OpenSceneGraph Users
Jan I agree totally with you. For mobile devices, Android specifically binary file formats tend to work a lot better than plain text derivates that's one of the reason collada was not in my to do list whe we worked on making OSG work in Android. Still, there are projects where you can't take smart optimal decisions and would be cool to know that "teorical" is "works" xD

Happy weekend!.

2012/9/21 Jan Ciger <jan....@gmail.com>

Oren Fromberg

unread,
Sep 21, 2012, 9:15:16 AM9/21/12
to osg-...@lists.openscenegraph.org
Dear Jorge and Jan,

Thanks for your replies... Coincidentally, I initially argued the same point you are both making to my software lead (who is monitoring this thread) that it would be better to export assets to OpenSceneGraph's native data format. He argued in turn that it is important for our platform to be able to load Collada files so that 3rd parties can easily load their own assets without having to export them to .ive or .osgb.

Hope you both enjoy the weekend.

Oren


Jorge Izquierdo Ciges wrote:
> Jan I agree totally with you. For mobile devices, Android specifically binary file formats tend to work a lot better than plain text derivates that's one of the reason collada was not in my to do list whe we worked on making OSG work in Android. Still, there are projects where you can't take smart optimal decisions and would be cool to know that "teorical" is "works" xD
>
> Happy weekend!.
>

> 2012/9/21 Jan Ciger < ()>


>
> >
> > On Fri, Sep 21, 2012 at 9:35 AM, Jorge Izquierdo Ciges < ()> wrote:
> >
> > > I can't recommend none of them, it's a specific case that wasn't in the things to do list. If there is already a version "ported" or prepared to be used in Android then maybe just for the sake of your own sanity  I would test it. If it works cool, if not... well look into other possibilities. In the root Android is a hyped/javaticed linux with a like for tough compilings but still compatible with the vast majority of the C/C++ source code of open libraries. In the end it's just a matter of time, work and study of the platform, except rare cases.  So... as some books say, Have a go hero!
> > >
> > > And check out with the mail list with your results.
> > >
> > >
> > >
> >
> >
> > While it should be possible to compile the COLLADA DOM for Android, I think Oren would be better off with using another data format. COLLADA is quite a mess of a format, intended for exchange of data between modelling tools, not as an "end-user" deployment format. You get huge XML files, not something I would want on a mobile device.
> >
> > Use COLLADA to export your stuff from 3DS Max/Blender/Maya (native OSG exporters are better, though) and convert it to e.g. .ive or .osgb for use on the mobile. Smaller files, everything included (textures, shaders, etc.), faster loading - a win-win situation.
> >
> > Regards,
> >
> > Jan
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list

> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
> >
>
>
> ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=50235#50235

Jorge Izquierdo Ciges

unread,
Sep 21, 2012, 10:44:52 AM9/21/12
to osg-...@lists.openscenegraph.org
Oren, truth to be told, your end users don't need to use the osgt/osgb/ive formats. The plugin format has a very wide arrange of other more friendly/lighter models. And in my experience you don't need to link all the plugins statically as in the examples i've tested and it's possible to deploy an application with the osg core compiled in static and load plugins that are compiled as shared libraries. It's tricky and obtuse and you have to rely in the java part of android framework to do it but it can be done. Your boss has a very good point about not using them to avoid the need of conversors, still if you are gonna save the entire scene data it will be better.

From my experience in Collada, before losing some precious work time in trying to compile OSG with it in Android, CHECK if the collada models you have in mind are well represented in a desktop environment of OSG with the collada plugin. I've had enough bad days in other libraries because the fairly generic collada approach was not treated properly. Just generate some sample models or get some sample models in blender/3ds/maya/whatever and test if their collada exports make a file that OSG can represent. Maybe it seems paranoid but later you are gonna have some troubles here and there with the OpenGL ES 1/2 implementation so better check that works in desktop first.

Anyway. what i have said to you in the first mail still applies. If there's a port of the library needed for the collada plugin then try it first. It will reduce your time lost in pointless headaches. If not then you'll have to compile it by yourself... which if i don't recall badly needs two or three libraries... Boost one of them. Boost can be compiled for android (but not strightforward if they haven't changed the source). well I'm sure you know how it goes.

Anyway i wish you good luck and keep the mail list up to date of your experience.

J.Izquierdo.

2012/9/21 Oren Fromberg <orenfr...@gmail.com>

Jan Ciger

unread,
Sep 21, 2012, 12:52:48 PM9/21/12
to osg-...@lists.openscenegraph.org
On Fri, Sep 21, 2012 at 3:15 PM, Oren Fromberg <orenfr...@gmail.com> wrote:
Thanks for your replies... Coincidentally, I initially argued the same point you are both making to my software lead (who is monitoring this thread)  that it would be better to export assets to OpenSceneGraph's native data format. He argued in turn that it is important for our platform to be able to load Collada files so that 3rd parties can easily load their own assets without having to export them to .ive or .osgb.

Being able to load own assets doesn't mean that the mobile device needs to support every format natively. Provide a dedicated desktop tool that will do the conversion from Collada to the in-house format (doesn't need to be just .ive or .osgb) used on the device. You probably want that anyway, because e.g. OpenGL/ES devices don't like models with non-triangular faces, you may have to set up materials differently, decimate the meshes, etc. E.g. Unity does this as well - you prepare your content using their tools on the desktop and only a compiled file gets uploaded to the device.

With Collada you are only setting yourself up for support nightmare, because your customers need to be very careful of directory structure, file names (upper/lower case matters on Android!), etc.

Jan


Reply all
Reply to author
Forward
0 new messages