Re: [osg-users] Android Development Plans
Hi, I made several fixes to make StatsHandler work with android and GLES2, file in attachment. Please let me know if this works for you (maybe someone already did that?). regards, Marcin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45901#45901 Attachments: http://forum.openscenegraph.org//files/statshandler_192.cpp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Looking at the code I seem to understand that statistics use only the fixed pipeline. At least this is what I see in osgViewer\StatsHandler.cpp in setUpScene(). If that is true, then the first step is to change that behavior so to use shaders instead. About the precision declaration, that is just one single line to add at the beginning of the fragment shader (something like precision mediump float;). It could be ifdef'ed to add it only when GLES2 is available. Luca -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42273#42273 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
That's the idea. 2011/8/27 Luca Vezzadini luca.vezzad...@gmail.com Looking at the code I seem to understand that statistics use only the fixed pipeline. At least this is what I see in osgViewer\StatsHandler.cpp in setUpScene(). If that is true, then the first step is to change that behavior so to use shaders instead. About the precision declaration, that is just one single line to add at the beginning of the fragment shader (something like precision mediump float;). It could be ifdef'ed to add it only when GLES2 is available. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Jorge Izquierdo Ciges wrote: Another issue is missing statistics, probably HUD shader is needed. No shaders - no hud. Hi, I see that the stats HUD does not work in GLES2 and I see this post a few months old. Did anything change in that area since then? If not, I will try to find a fix/workaround and let you know in case I succeed. Luca -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42257#42257 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
There's no upgrade to that. I usually get the statistics from the functions and get the values by myself withouth the auto stats screen. I don't know if it's possible to show them in pc withouth fixed pipeline if you can then it shoul be just a matter of fixing the automated shaders by adding a default precission mode. OSG makes that shaders GLSL compilant BUT Gles 2.0 states that they ALSO need a precission value thus not exactly conformant to GLSL. 2011/8/26 Luca Vezzadini luca.vezzad...@gmail.com Jorge Izquierdo Ciges wrote: Another issue is missing statistics, probably HUD shader is needed. No shaders - no hud. Hi, I see that the stats HUD does not work in GLES2 and I see this post a few months old. Did anything change in that area since then? If not, I will try to find a fix/workaround and let you know in case I succeed. Luca -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42257#42257 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi, I spent some time on refactoring osgViewerGLES1 example in order to work with GLES 2.0 under Android OS, for those of you interested in running example few comments/conclusions: I build OSG using cmake flags : -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=OFF -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF -DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL_LIBRARY_STATIC=ON This is almost the same as listed on OSG OpenGL 2.0 page, I added OSG_GL_LIBRARY_STATIC=ON which I presume is needed for static build, anyway it wasn't working without this flag enabled. After running example I noticed few disturbing outputs: I/com.android.osgViewerGLES2( 6136): ShaderComposer::~ShaderComposer() 0xc9408 D/com.android.osgViewerGLES2( 6136): Renderer::compile() W/com.android.osgViewerGLES2( 6136): Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile I/com.android.osgViewerGLES2( 6136): glVersion=0, isGlslSupported=YES, glslLanguageVersion=0 particularly opengl version and glsl version is alarming. I will look at this soon. Another issue is missing statistics, probably HUD shader is needed. Before running example you need to fix OSG_SDK path in jni/Android.mk and model file path in osgViewerGLES2.cpp. Cheers, Marcin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38449#38449 Attachments: http://forum.openscenegraph.org//files/osgviewergles2_137.jpg http://forum.openscenegraph.org//files/osgviewergles2_210.zip ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Nope glstatic flag is not needed. There's a patch pending revision to do a proper loading of gles 2 in Android because normal unix/linux loading is not enough. About errors. . . I/com.android.osgViewerGLES2( 6136): glVersion=0, isGlslSupported=YES, glslLanguageVersion=0 That's normal, the languaje opengl is not parsed correctly. I submited a patch for that also, but i think that i'll rewrite it to be more robust because the actual parsing fails very often when something changes. W/com.android.osgViewerGLES2( 6136): Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile That's normal. It depends on the example. If you use a enumerant that doesn't exist in gles 2. If that was with the cow i was thinking in including some extensions of gles2 that should do the fix. I/com.android.osgViewerGLES2( 6136): ShaderComposer::~ShaderComposer() 0xc9408 D/com.android.osgViewerGLES2( 6136): Renderer::compile() Those two come together often. Just look to the other Gles 2 thread is just that the prefab shaders of OSG don't work well with gles 2 in devices. I think that's because even if it is not specified there are some requirements that were not seen in emulators. Basically put your own shaders and that dissapears. Another issue is missing statistics, probably HUD shader is needed. No shaders - no hud. (That goes in hand with previus issue) The message rerouting to logcat is cool i didn't think of that because i had the stdout rerouted to logcat in my Archos. It's good to see some more people working with this ^__^ The Automatic Shader is something that i think Robert was going to change or so i think i readed in the mail list. The languaje version/shader i don't know if there's anything that uses it really. It didn't do any damage to my tests but as i said i sent some fix for gles. 2011/4/13 Marcin Hajder mhaj...@o2.pl I added OSG_GL_LIBRARY_STATIC=ON which I presume is needed for static build, anyway it wasn't working without this flag enabled ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Rafa, Jorge and all ;-) On Mon, Mar 7, 2011 at 11:53 AM, Rafa Gaitan rafa.gai...@gmail.com wrote: Finally Jorge and me have finished a first approach to build OSG under Android using the android NDK. Attached you will find all required code and cmake modifications (They are based on a previous submissions I sent last week). Many thanks for your efforts. I have now merged and checked in changes to OpenSceneGraph svn/trunk. I haven't tested the Android build at all yet, only the normal Linux build side. Would it be possible for you to put up a documentation page on the wiki to show how to set up to build the OSG on Android? Thanks, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Rafa, Great news of progress on the the Andoid front. I haven't reviewed your changes yet as I've been busy with client work, but I will get on to a full review in the next few days. W.r.t replacing .c++ with .cpp's, I'm more than happy to do this, as it's long been a pointless inconsitincy in our code base. I have now made this change and checked it into svn/trunk. Cheers, Robert. On Mon, Mar 7, 2011 at 11:53 AM, Rafa Gaitan rafa.gai...@gmail.com wrote: Hi, Finally Jorge and me have finished a first approach to build OSG under Android using the android NDK. Attached you will find all required code and cmake modifications (They are based on a previous submissions I sent last week). Some considerations: - Android implements a pthread version, we made some modifications in OpenThreads, but the most relevant are the renaming of .c++ extension to .cpp, Android NDK doesn't support build files with different extension (all .c++ or all .cpp but not mixing them), so we changed it to .cpp (svn move if you accept the submission). - In order to build against GLES1 we execute: $ mkdir build_android_gles1 $ cd build_android_gles1 $ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NDK=path_to_android_ndk/ -DOSG_GLES1_AVAILABLE=ON -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DJ=2 -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF $ make If all is correct you will have and static OSG inside: build_android_gles1/bin/ndk/local/armeabi. - GLES2 is not tested/proved, but I think it could be possible build it with the correct cmake flags. - The flag -DJ=2 is used to pass to the ndk-build the number of processors to speed up the building. - make install is not yet supported. I think Jorge has a more advanced example that I hope he submits this week. The submission credits goes for Jorge Izquierdo and Rafa Gaitán (me). Happy Android Testing. :) Rafa. 2011/3/2 Thomas Hogarth thomas.hoga...@gmail.com: Hi Jorge Downloaded the example apk 'OSG Viewer GLES1 example'. The triangle example runs fine and my single touch input is working to rotate the view. I also get a file saved.osgt on my sdcard containing the following #Ascii Scene #Version 71 #Generator OpenSceneGraph 2.9.11 I can't however get the cessna.osgt file to load. I converted the standard cessna.osg using osgconv to .osgt and placed on my sdcard (same location the saved.osgt file was written to), but doesn't seem to load it. Maybe I need to zoom out but can't? I'm running Archos 43 Android 2.2.1 Latest firmware (2.1.8 I think) All in all worked great, congrats on getting the demo out, lets hope the code release goes as smoothly :) Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Update: We are sending the Cmake/android to osg-submissions in two steps. As it is right now the Osg Cmake Script the code changes in the script made it hard to mantain so we decided to propose new OSG Cmake script which could be more cleaner and better in handling platform issues. If that is accepted then we will use it to make accesible in a second submission the Android macros. As for today we are publishing a note on the gvsig3d page and some videos of HTC Nexus One and Archos 70 IT runing my examples. Also we are publishing an apk for the people to test. It will be great to know issues on different kinds of devices. The example only has a triangle, and if you can put under //mnt//storage//sdcard// a file cessna.osgt (properly converted) you will see it visible. I'm working in an apk with file integration for better testing. Also i'm working in combining Android ui elements and the ndk code. Gvsig3D news post(youtube) http://gvsig3d.blogspot.com/2011/03/openscenegraph-running-on-android.html Test Apk http://www2.ai2.upv.es/difusion/OSG_Android/osgViewerGLES1.apk.zip 2011/2/26 Jorge Izquierdo Ciges jori...@gmail.com I'm not missing, just stupid fails in my testing have delayed my initial planning. If there are no more fails (I hope so) in no time i'll present the cmake and a modified viewer example for you to rip it and test it. 2011/2/21 Thomas Hogarth thomas.hoga...@gmail.com Hi Jorge The current Status is... aparently fully functional. Great news, well done to you and your team, I hadn't progressed far at all. I decided to make the jump to linux and then got rather side tracked :). I'd be more then happy to do some testing etc for you guys once you've finished your tidy pass Congrats again Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hello Jorge, As for today we are publishing a note on the gvsig3d page and some videos of HTC Nexus One and Archos 70 IT runing my examples. Also we are publishing an apk for the people to test. It will be great to know issues on different kinds of devices. This is really good news! I will try it out tonight as my USB cable is at home... Test Apk http://www2.ai2.upv.es/difusion/OSG_Android/osgViewerGLES1.apk.zip Will you be testing the OSG GLES2 path as well? I guess it should compile well once the initial bits are in place for GLES1... Thanks for all your hard work, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jean-Sébastien, 2011/3/1 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com: Hello Jorge, Will you be testing the OSG GLES2 path as well? I guess it should compile well once the initial bits are in place for GLES1... Yes of course :) but we first want to submit the changes so anyone can test other GLES paths! :). I made the first submission of cmake mods, I hope finish the cleanup job this week and submit the android support. Rafa. Thanks for all your hard work, J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jorge Downloaded the example apk 'OSG Viewer GLES1 example'. The triangle example runs fine and my single touch input is working to rotate the view. I also get a file saved.osgt on my sdcard containing the following #Ascii Scene #Version 71 #Generator OpenSceneGraph 2.9.11 I can't however get the cessna.osgt file to load. I converted the standard cessna.osg using osgconv to .osgt and placed on my sdcard (same location the saved.osgt file was written to), but doesn't seem to load it. Maybe I need to zoom out but can't? I'm running Archos 43 Android 2.2.1 Latest firmware (2.1.8 I think) All in all worked great, congrats on getting the demo out, lets hope the code release goes as smoothly :) Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jorge The current Status is... aparently fully functional. Great news, well done to you and your team, I hadn't progressed far at all. I decided to make the jump to linux and then got rather side tracked :). I'd be more then happy to do some testing etc for you guys once you've finished your tidy pass Congrats again Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
What i've not compiled is plugins (This weekend work was to make them compilable with searches for a 3rd party directory of android ports of some of them) I assume you mean plugins that require 3rd party dependencies... Did you build the .osg reader plugin? Or the new serializer plugins? I'll explain better: Src Directory Compiled: OpenThreads, osg osgAnimation osgDB osgFX osgGA osgManipulator osgParticle osgPresentation osgShadow osgSim osgTerrain osgText osgUtil osgViewer osgWidget Not Compiled: osgQt (although I've heard something about a port of Qt to Android) Src/osgWrappers/deprecated-dotosg None of those has been compiled. Src/osgWrappers/serializers Compiled: Everything Src/osgPlugins None of those has been compiled (this is my work for today) I was doing all this work to merge it in a project so I'm in the need of half the 3rd party dependency. pnj,jpg,gif,zlib,curl So expect at least that to be integrated in the Cmake script by the end of the day. The rest of dependencies will be a matter of test and try if someone is willing to look at them. We are using TrackballManipulator (but there is nothing wrong to change it, just lack of time to test) This begs the question, what does Android use for multi-touch? Would the support Stephan Maximilian Huber added for multi-touch be usable on Android? Android makes events that are captured (or not) by the Activity listeners. I didn't use the multitouch capabilities of Stephan because i didn't know how it was working. In The Android side all i can tell you is that you can't have more than two fingers at the same time prior to 2.0. Above 2.0 the limit is 256 but there are only a few devices that let you use more than two fingers (i.e. my archos 70 tablet) Here are some pictures to show the state (basically the first and second, the third and fourth ore for those that will say it's fake xD) Btw it's an Archos 70 Internet Tablet what we are using. Great work guys! Keep it up, but don't wait too long before getting your changes integrated, that way others can help too. We are still finishing the work and we like to clean the code it's a little bit messy because while changing scripts i've been suffering a lot of silly errors that make you change everything to see that it was just how ndk-build is supposed to work etc... By next week i'll have a full example written on Android 2.1 /Ndk r5b (I'm not planning a full native version, it needs 2.3 and i don't have a device. I really don't like Android Emulator) and the patches. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
On 02/03/2011 04:53 AM, Jorge Izquierdo Ciges wrote: I've been working with ndk r-5 and compiles without many changes. The main trouble i've seen so far it's that following ndk-build script, the library osg goes up to 36 mb (libosg.a). The worst thing it's that it seems that you cannot use a flag to strip unneded coded. Right now i'm playing a little with flags compiler to try to minimize the size, when Rafa and me compiled with the toolchain the filesize of libosg.a was about 9mb (big, but acceptable) latter i'll upload the files that i'm using right now. They can be used either with ndk r4 crystax or ndk r5 Jorge, have you managed to make any progress on this? --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
What a marvellous coincidence xD Yesterday we made some good progress and uploaded to the mail list but the screen pictures we took were too much and the mail list rejected it (4mb ... too much happines to see the weight of the pictures) The current Status is... aparently fully functional. (you know, you say that and it becomes unussable) The libraries were compiled with Ndk r-5 with google's ndk-build script makefiles. The makefiles are first generated in Cmake and later compiled by Googles ndk-build. (This need some polishment in the code to fully separate some dependancy that tries to compile things in normal Cxx (don't know why. I'm not a Cmake expert) The changes are minimal (except fot OpenThreads that needs more than 10 lines) and are Android guards in Cmake to make accesible some things like wstrings (like the Cygwin) and to make OsgViewer to do not use X11. What i've not compiled is plugins (This weekend work was to make them compilable with searches for a 3rd party directory of android ports of some of them) Now... we've done a OsgViewer (following the GL2Jni) but using GLES1 (probably GLES2 will work too). Our minim sdk target is 2.0/2.1. Geometry is represented (RGB triangle) We are using TrackballManipulator (but there is nothing wrong to change it, just lack of time to test) We haven't test illumination for the same reason (no time) And after a little bit of time i've been able to find ways to canalize the stout to LogCat (you have to set a file in device) Here are some pictures to show the state (basically the first and second, the third and fourth ore for those that will say it's fake xD) Btw it's an Archos 70 Internet Tablet what we are using. http://www.bandadeanna.com/portafolio/imagenes/viewer01.png http://www.bandadeanna.com/portafolio/imagenes/viewer02.png http://www.bandadeanna.com/portafolio/imagenes/viewer03.jpg http://www.bandadeanna.com/portafolio/imagenes/viewer04.jpg 2011/2/19 Jason Daly jd...@ist.ucf.edu On 02/03/2011 04:53 AM, Jorge Izquierdo Ciges wrote: I've been working with ndk r-5 and compiles without many changes. The main trouble i've seen so far it's that following ndk-build script, the library osg goes up to 36 mb (libosg.a). The worst thing it's that it seems that you cannot use a flag to strip unneded coded. Right now i'm playing a little with flags compiler to try to minimize the size, when Rafa and me compiled with the toolchain the filesize of libosg.a was about 9mb (big, but acceptable) latter i'll upload the files that i'm using right now. They can be used either with ndk r4 crystax or ndk r5 Jorge, have you managed to make any progress on this? --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jorge, Wow, great progress! I hope after a bit more testing you'll be able to package the changes required in a way that can be merged into the baseline OSG without interfering with other platforms, and I'll be able to start using OSG on my Nexus One! :-) The libraries were compiled with Ndk r-5 with google's ndk-build script makefiles. So you didn't need to use a modified NDK? That's excellent! (don't know why. I'm not a Cmake expert) Maybe if you send me what you needed to change and an explanation of what happened without the change I can help, I'm not a CMake expert either but I've seen and had to modify a lot of the OSG CMake config files over the last few years. What i've not compiled is plugins (This weekend work was to make them compilable with searches for a 3rd party directory of android ports of some of them) I assume you mean plugins that require 3rd party dependencies... Did you build the .osg reader plugin? Or the new serializer plugins? Now... we've done a OsgViewer (following the GL2Jni) but using GLES1 (probably GLES2 will work too). Our minim sdk target is 2.0/2.1. If you get your changes packaged up I can test the GLES2 target if you want. We are using TrackballManipulator (but there is nothing wrong to change it, just lack of time to test) This begs the question, what does Android use for multi-touch? Would the support Stephan Maximilian Huber added for multi-touch be usable on Android? Here are some pictures to show the state (basically the first and second, the third and fourth ore for those that will say it's fake xD) Btw it's an Archos 70 Internet Tablet what we are using. Great work guys! Keep it up, but don't wait too long before getting your changes integrated, that way others can help too. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Chuck Must have missed that info when I downloaded it, looks like I need to do a bit more reading :) Thanks for the heads up Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jason Yeah, I just downloaded and looked through it. There's an example without a single Java class in it. It just goes straight to EGL and GLES2 in the .c file. Very cool! I've looked through my samples and I can't find this. I've got the hello-gl2 sample but no other gl related ones, could you point me in the right direction?. I've spotted the stl sample though, which is nice :). Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi all, Yeah, I just downloaded and looked through it. There's an example without a single Java class in it. It just goes straight to EGL and GLES2 in the .c file. Very cool! Yeah, really nice. Anyone try to compile OSG with this NDK? I guess since they say it supports RTTI and has STLPort for the STL, it should work fine... Another step closer to getting an OSG app on Android. Though I hear debugging native Android code (as opposed to Java code running on Android's VM) is a bit hard... J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
On 01/28/2011 10:01 AM, Jean-Sébastien Guay wrote: Yeah, really nice. Anyone try to compile OSG with this NDK? I guess since they say it supports RTTI and has STLPort for the STL, it should work fine... Actually, there are four different C++ libraries available in NDK 5, and the only one that supports exceptions and RTTI is a static build of GNU libstdc++. There are both static and dynamic STLPort builds but neither supports RTTI or exceptions. They're working on a dynamic version of GNU libstdc++ for a future release. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jason Mines a little archos 43 tablet. Checked the site, no plans for a 2.3 release yet by the look of thing which is a shame. Well looks like there might have to be some forking in any port for now. Perhaps two types of viewer. One with native egl and one that requires a java template for setting up egl for you. The stl stuff is still a plus and I wounder what happens if I pull the egl header and .so files into my version 8 sdk :) Cheers Tom On 28 January 2011 15:31, Jason Daly jd...@ist.ucf.edu wrote: On 01/28/2011 05:26 AM, Thomas Hogarth wrote: Hi Jason Never mind found it in the native-activity example. I also found this thread http://groups.google.com/group/android-ndk/browse_thread/thread/3c6dd147547ce056/b9d27d086990d1b1 It says you need a 2.3 device, hope it's not true as mine is 2.2 :( Unfortunately, all the docs I've read seem to confirm that. You need an android-9 target for most of the new features. What phone do you have? We've got a couple of Nexus One phones here that are still 2.2, but from what we've read, a 2.3 update is in the works for them. I haven't heard of a hardware limitation in a 2.2 phone that would prevent it from being updated to 2.3 (just delays by the provider in getting the update out). --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi, Just as an FYI, it seems the new NDK r5 really targets graphical applications. Specifically games, and allows you to build the entire app without any java. From the Android Developers blog: In addition to fully native applications, the latest NDK lets you play sound from native code (via the OpenSL ES API, an open standard managed by Khronos, which also oversees OpenGL ES), handle common application events (life cycle, touch and key events, as well as sensors), control windows directly (including direct access to the window’s pixel buffer), manage EGL contexts, and read assets directly out of APK files. The latest NDK also comes with a prebuilt version of STLport, making it easier to bring STL-reliant applications to Android. Finally, r5 adds backwards-compatible support for RTTI, C++ exceptions, wchar_t, and includes improved debugging tools. Clearly, this release represents a large positive ∆awesome. We worked hard to increase the utility of the NDK for this release because you guys, the developers who are actually out there making the awesome applications, told us you needed it. This release is specifically designed to help game developers continue to rock; with Gingerbread and the NDK r5, it should now be very easy to bring games written entirely in C and C++ to Android with minimal modification. We expect the APIs exposed by r5 to also benefit a wide range of media applications; access to a native sound buffer and the ability to write directly to window surfaces makes it much easier for applications implementing their own audio and video codecs to achieve maximum performance. In short, this release addresses many of the requests we’ve received over the last year since the first version of the NDK was announced. Thank you! Cheers, Chuck[/quote] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36043#36043 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
On 01/27/2011 11:47 AM, Chuck Shaw wrote: Hi, Just as an FYI, it seems the new NDK r5 really targets graphical applications. Specifically games, and allows you to build the entire app without any java. Yeah, I just downloaded and looked through it. There's an example without a single Java class in it. It just goes straight to EGL and GLES2 in the .c file. Very cool! --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Guys So I've made a little progress, mainly in learning about the ndk. Think I've just got OpenCV building and think their method is defo the way to go. Rafa, thanks or the example code, would love to get hold of your osg version. i can offer some ftp space if you need it? Jason, like the sound of the new NDK supporting STL etc. Been wondering what the would happen if we tried using a non official NDK when subiting to the market place, but this could solve it. I'm gona stick with the Crystax version for now as I want to use OpenCV as a template. Perhaps trying to compile OpenCV with the new NDK would be worth a shot first. Cheers Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35779#35779 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jorge, I know little about the issues of Android platform, so read with interest in the various developments that yourself and others are working on, it does mean I can't yet contribute too pro-actively though. I'll will try and chip in where I can. On Mon, Jan 17, 2011 at 10:37 PM, Jorge Izquierdo Ciges jori...@gmail.com wrote: Pthreads. The Set functions are trivial and i don't think that could cause a very big damage. But pthread_cancel is something different, because i've seen that it's widely used. And we would need a suitable replacement to don't let the thread go on. With the OSG usage of threads I have implemented co-operative exit of the thread loops using done flags, instead of relying upon Thread::cancel(). Given this, not having cancel() working as before may well not be that critical. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi, I'm working with Jorge trying to get a native osg on Android. The main problem that we found was the migration of OpenThreads, it's not really complicated but there are some missing api in pthreads (pthread_cancel as mentioned before) and some changes (sleep returns void :O). We made the changes on CMake and OpenThreads to support this changes but when we tried to build against a desktop environment again then things didn't work :(. We wanted to send the modified files once things get working, but maybe is time that other eyes get a look to this. Jorge, could you attach to this thread a bundle with all the changes we made to get things compiling and working on android? I'm attaching a simple (and little ugly) example of a viewer for android, all made in native (except the minimal parts required in Java). Currently we got things building against crystax-ndk-r4. This example worked for my Samsung Galaxy S (android 2.1update1). The viewer starts, and shows the nice blue osg screen! :) but I wasn't be able to get draw any geometry (I built osg with gles2 support). To compile it, you need the crystax ndk r4, and osg compiled against this version. Then you need to modify the osgviewerandroid/jni/Android.mk file to change the path of required osg libraries for your system. To get the apk for android I do this things. android update project -p . -t 1 # -t is the target defined (android list devices to get the list) ndk-build ant debug If things work inside bin/ you will get the .apk Greets, Rafa. 2011/1/18 Robert Osfield robert.osfi...@gmail.com: Hi Jorge, I know little about the issues of Android platform, so read with interest in the various developments that yourself and others are working on, it does mean I can't yet contribute too pro-actively though. I'll will try and chip in where I can. On Mon, Jan 17, 2011 at 10:37 PM, Jorge Izquierdo Ciges jori...@gmail.com wrote: Pthreads. The Set functions are trivial and i don't think that could cause a very big damage. But pthread_cancel is something different, because i've seen that it's widely used. And we would need a suitable replacement to don't let the thread go on. With the OSG usage of threads I have implemented co-operative exit of the thread loops using done flags, instead of relying upon Thread::cancel(). Given this, not having cancel() working as before may well not be that critical. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia osgviewerandroid.tar.gz Description: GNU Zip compressed data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
On 01/17/2011 09:27 AM, Jean-Sébastien Guay wrote: I compiled OSG with the NDK, it was pretty easy. You'll need the modified NDK that has support for RTTI, exceptions and a more complete standard library, which you can find here: http://smartctl.net/android/ndk-r4.php Just curious, Has anybody tried a build with the NDK r5 yet? It's supposed to have an optional STL that supports RTTI, exceptions, etc. It'd be nice to not require a 3rd-party NDK to compile OSG. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Hi Jason, Has anybody tried a build with the NDK r5 yet? It's supposed to have an optional STL that supports RTTI, exceptions, etc. It'd be nice to not require a 3rd-party NDK to compile OSG. I haven't tried it yet. It was in my plans but Android development is not part of my normal job, just after-work-hobby-type-stuff, so I haven't gotten to it yet. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Big thanks for this J-S This will give me a massive head start, I'll get downloading your code and trying to compile. I successfully got the gl2jni example working on my device (your right, that sure is a long way round and yes very basic :) ) I'm keen to get this working as I too am loving the gl2 / gles2 compatibility of osg. Means I can develop tools and test environments on windows or osx and expect roughly the same result when I move to ios (and soon hopefully android). Essentially for the OGL stuff we can remove the need for an emulator or device for a large part of the work. I'll keep you up dated Tom On 17 January 2011 14:27, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Thomas, I've recently got my hands on a little android tablet capable of OpenGL ES 2.0, finally. The Archos 43, seems like it's comparable to an IPod touch 4th gen and pretty cheap (well compared to a Galaxy). I've got a Nexus One and am interested in compiling OSG on Android as well. I like the sound of the QT port as that could help lead to a Symbian port also. What progress if any has anybody made? I compiled OSG with the NDK, it was pretty easy. You'll need the modified NDK that has support for RTTI, exceptions and a more complete standard library, which you can find here: http://smartctl.net/android/ndk-r4.php If you turn on advanced options in CMake you will see the path it uses for C compiler, C++ compiler, linker, ar and so on, you can just change those to the paths of those in the NDK. Then you need to add at least -nostdlib to compile commands, and I also added a macro to help me conditionally compile some things (-DANDROID and -D__ANDROID__ since that's what some Android C/C++ code I've seen used). Apparently these things can be automated by using a toolchain file and making a new platform in cmake_prefix/share/cmake-version/Modules/Platform, but I haven't had any luck with that. Still, I've attached the files I tried to make (Android-toolchain.cmake and Android.cmake) in case it could be useful to you. This page might help you find out what I was doing wrong: http://www.cmake.org/Wiki/CMake_Cross_Compiling Essentially you're supposed to start cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=~/Android-toolchain.cmake .. and it should use the toolchain and Platform files to set compiler paths and options automatically, but in my case it didn't do anything and I have no idea why, so just to keep going I set these things manually. Then I disabled building almost everything, and just started with libosg and went from there. I followed the settings given on the OSG Wiki OpenGL ES page: http://www.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES which I'm sure you already know, having worked on the iOS port. I made it build statically even though the link time is much longer because I couldn't get the executable to find the dynamic libs (no idea how to manipulate LD_LIBRARY_PATH so it finds libs inside the Android app bundle). I had to make a few small modifications to make it compile, I've also included those as a patch, no idea how stale those changes are compared to current trunk, I haven't updated that checkout since late December. In that patch you'll also see where I had gotten as far as compiling OSG libraries, I think I had osg, osgDB, osgGA, osgUtil, osgViewer, osgText and the .osg/serializers for osg done. However, you may think I had gotten pretty far, but unfortunately, in making a small program that used basic functionality (just displaying a quad), the program always crashed at startup. Doing printf-debugging led me to a place where I call setCameraManipulator(new osgGA::TrackballManipulator). Seems it crashes in the constructor of that class. I've included the code of my test app in Android.zip. In src is the Java layer, in jni is the NDK code that should call OSG functions, and in src_x86 is a small test program that calls the same functions but which I compile on x86 to make sure they work. I've set up an alternate compile of OSG according to the Cmake settings for Emulating OpenGL ES 2.0 when you only have standard OpenGL available on the OSG OpenGL ES page, and that's what I use to test the code in src_x86. You'll also see in the code in jni, that you can compile 2 paths: with USE_OSG and without. The jni/Android.mk defines USE_OSG, but if you remove it, the jni code will basically be the same as the hellogl2 sample that comes with the NDK, and that works without crashing. I hope that's everything, and I especially hope you'll be able to go forward with this and succeed where I've failed :-) I was planning on getting back to this but haven't had time yet. I'd like to try and make this a public effort from the get go by setting up either a google code or github project (I like google code but I know github to be good for keeping up to date with osg trunk changes). I think the changes to
Re: [osg-users] Android Development Plans
Hello Thomas, I'll keep you up dated Thanks. One thing I just remembered, I don't know if you'll be using the Eclipse-based toolchain that Android provides, but I found sometimes when I changed the jni lib (and recompiled it from the command line) the Eclipse plugin wouldn't pick up on it being new, and when running or starting a debug session, it would just re-use the old app instead of uploading a new app with my changes to the device. So I found the most reliable way to make sure it was always using the most recent code (both java and jni) was to do Project - Clean with the Start a build immediately checkbox checked. That made sure everything was up to date, and then I could run or debug. Also this page may help: http://blog.sephiroth.it/2010/12/14/how-to-debug-native-code-with-android/ It has some instructions on how to debug native code on the Android device (you can debug the Java layer just fine in Eclipse, but debugging the native code is a bit harder). That's what I was trying when I had to move on to other things, to find out why it was crashing... Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
Looks like this is a useful read http://opencv.willowgarage.com/wiki/Android http://opencv.willowgarage.com/wiki/Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android Development Plans
OpenCV is Android port is more cleaner than the use of toolchain that we are using right now. Working with the Cmake toolchain there were some files that Cmake won't ever find, even if they were. With this other approach, this should not happen because you use Cmake to generate the Android Makefiles and let the Ndk toolchain do the trick. Right now i was working that way, trying to do what OpenCV fellows did in the first Android fork. That's make some Android makefiles for each piece of library, make them compile and so on. Just to be sure. For example i've been very worried by how treat correctly the differences of Pthreads. The Set functions are trivial and i don't think that could cause a very big damage. But pthread_cancel is something different, because i've seen that it's widely used. And we would need a suitable replacement to don't let the thread go on. 2011/1/17 Thomas Hogarth thomas.hoga...@gmail.com Looks like this is a useful read http://opencv.willowgarage.com/wiki/Android http://opencv.willowgarage.com/wiki/Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org