Compiling irrlicht ogl-es branch for iphone (progress)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
biino
Posts: 7
Joined: Mon Apr 13, 2009 1:32 am

Post by biino »

ld: duplicate symbol _createDeviceEx in ../build/Release-iphonesimulator/libirrlichtsim.a(Irrlicht.o) and ../build/Release-iphonesimulator/libirrlichtsim.a(CIrrDeviceIPhone-D6E45659.o)
Probably not good advice. I commented out the createDeviceEx functions I didn't need.

Also, I'm not entirely confident in the simulator running an Opengles application. I recall reading it's not really supported. Not 100% sure however.

Bino
aka Borealis
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

i dont know what i did, I just unzipped the template a dozen times more and readded the includes to xCode, and built the library about 20 times more, tried older revisions of the branch in bewtween, and it went from duplicate symbol createDeviceEx to symbol not found.. but now I came back to the newest revision 2769. and no more linking errors. It even compiles FuzzYspo0N's template for the simulator, which unfortunately crashes unexpectedly...
Anyone know how to go about and sign the app so I can actually take a look on the device itself, rather than the simulator ?
EDIT:
According to apple the simulator supports both OGLES1.1 and 2 applications, which still doesn't mean irrlicht would run, so if anyone knows that more specific I'd love to know. My screen stays black in release and crashes in debug. I used GDB to step to the crashing line of code which unfortunately is:

Code: Select all

device = createDeviceEx((const SIrrlichtCreationParameters)params);
0x9290bc06 <+0025> cmp 0x30(%eax),%esi
EXC_BAD_ACCESS
EDIT2:
I think it thinks its a console device...
EDIT3:
compiling irrlicht without console device, I can step as far as device->run() before crashing.
EDIT4:
I started working with sio2, which is OK but slowly gets on my nerves. I am doing a basic x-wing shoot the lasers in a death star tunnel look alike star wars style game. See below. Sio2 is a freeware engine for iphone and ipod touch and is very close to GL, kind of rudimentary thing, very overviewable and extendable.. basically some inlined vector functions, a custom renderloop, a resource managment system and a plugin for blender to its custom file format .sio2... The documentation sucks, basically it a doxygen empty, no comments in no headers, not a single sentence nowhere. :lol: There's 2 forums, one empty, no questions getting answered and one full, which on register activate account returns 404 ! Really getting on my nerves.
The point is: I WANT TO USE IRRLICHT, so if anyone feels like debugging the whole thing a little more I guess it would be the engine of choice for quite many ppl...
Work on that is much appreciated...
...
EDIT5:
Concerning the simulator and signing I got a little wiser. The simulator should run all GLES content without a problem, of course things like the accelerometer wont work, but it'll be enough to get irrlicht running for anyone willing to download the sdk and invest some time. No hardware required if you have a mac or a hackintosh. I'm only guessing on compiler and linker errors and I'm clearly unqualified. If your phone is jailbroken you can ssh on it and sign the app with

Code: Select all

chmod 755 /Applications/Appname.app/Appname
ldid -S /Applications/Appname.app/Appname
For Xcode you can edit an XML file somwhere to allow building without code signing for OS3.1 otherwise use OS 2.0 where the option is free without editing any xml files in build options under code signing 'dont code sign'. Deployment OS should be 2.0 anyway, otherwise ldid wont sign it.
Last edited by zillion42 on Wed Nov 25, 2009 3:28 pm, edited 1 time in total.
digijohnny
Posts: 63
Joined: Sat Sep 12, 2009 6:08 pm
Contact:

Duplicate Symbol _createDevixeEx

Post by digijohnny »

[quote="zillion42"]trying to compile FuzzYspo0N's template I get linking errors:

Code: Select all

ld: duplicate symbol _createDeviceEx in ../build/Release-iphonesimulator/libirrlichtsim.a(Irrlicht.o) and ../build/Release-i



i am just finishing final touches on my first IRR App for the iphone
i hope to get it approved by Dec 1.

I have experienced this link error many times, it is usually due to multiple .a libs for irrlicht, i have had no problem with a simulator lib and a device lib for irr in my project, but if i try to add 2 libs for device i get this error (ie. trying to use a 3.0 device lib and a 3.1 device lib in the same project, same for sim libs) , there is probable a way to to do this in a single project if u use multiple targets,but im new to xcode,(only 2 months experience) 

i have also created a template, incuding accelerometer and multitouch, with a simple  GUI class  for button,sliders,fonts(u can convert ttf to this class)  ,also P2P using  gamekit  ,i plan to make this public as soon as my app is approved, and i have time to clean up the code. eta DEC '09
digijohnny
Posts: 63
Joined: Sat Sep 12, 2009 6:08 pm
Contact:

Post by digijohnny »

P.S
as for the accelerometer in the simulator....
check out this free app
SimRemote
you will also need the server app, download from
http://www.bunsentech.com/products/simremote

with this you can use your real device to send accel and gps to the sim via tcip,
if you dont have an iphone , just an ipod touch you may have to remove the gps functions form the .H & .M files for this, which i did , but oddly enough i still occasionally get correct log/lat info with this app . if you need i can email the mods i made for this lib for the Itouch
tonic
Posts: 69
Joined: Mon Dec 10, 2007 6:18 pm
Contact:

Post by tonic »

We just got first version of Stair Dismount for iPhone & iPod touch ready (for Apple approval, so just not yet available for purchase). We used the irrlicht opengl es branch for that, although we integrated it with our own low-level platform basecode even before the irr iphone device became available.

So, although some seem to have various problems trying to use irrlicht with the iPhone SDK, hopefully this is something to motivate you further.. showing there's one more game which is using the engine. :)

http://stairdismount.com

edit: now there's also a video on the site.
tonic
Posts: 69
Joined: Mon Dec 10, 2007 6:18 pm
Contact:

Post by tonic »

Here's a library which might be very helpful in upgrading the OpenGL ES branch to support v2.0 as well: (for iPhone 3GS etc)

http://code.google.com/p/gles2-bc/
digijohnny
Posts: 63
Joined: Sat Sep 12, 2009 6:08 pm
Contact:

ogles2

Post by digijohnny »

thanks for the link tonic , looks very helpfull.that answers my next question to this forum

what about opengl2 support?



i just submited my app for approval
if anyone would like a free copy when released, pm me, i can email you a voucher
i hope to make my touch, accel and gui class available soon[/img]
SethRobinson
Posts: 7
Joined: Mon Nov 23, 2009 10:49 am
Location: Japan
Contact:

Post by SethRobinson »

I have an existing iPhone engine so I implemented Irrlicht as a sort of plugin, it seems to happily coexists with my own rendering stuff when enabled.

In case anybody is doing something similar, here is the method I used:

* Started with the GLES branch using the iPhone device with the GLES renderer
* Kept my own GL ES init stuff and commented out the Irrlicht side of it (I didn't want to mess with the objC side of my existing engine at all, only the C++ side)
* Modified the iPhone device to compile under Windows (this is where I do my iPhone development and debugging and simplified the portability for me, since I handle all input/etc elsewhere in the engine already)
* Under Win, using the PVR GL ES libraries, although with few macros could probably make the GL ES renderer work for normal GL as well (minus the pvrtc textures support), at least that's what I do with my own engine

Posted a few screenshots with FPS findings here: http://www.codedojo.com/?p=412
Seth A. Robinson
www.rtsoft.com
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

What kind of performance are you guys seeing?

Today I downloaded the opengl-es branch from SF as well as Spoon's template. Instead of building the irrlicht.a library using a non-existent OpenGLES xcode project (I'd love to see this added to the opengles branch) I simply added the necessary H, .MM and .CPP files to Spoon's template.

I then set up the Game class to display 9 animated nodes all using ninja.b3d found in Spoon's template. On the Simulator I see 60fps, naturally, but the phone gives me 4 fps. I see 20 fps if only one ninja is animated.

Nothing else is in my scene manager-- are these numbers accurate, or did I build/do something wrong?

EDIT: before anyone asks, yes I was using Thumb compilation, but removing that only increases FPS from 4 to 6 in the case of 9 ninjas.
a screen cap is worth 0x100000 DWORDS
Arcoroc
Posts: 51
Joined: Wed Oct 01, 2008 11:40 pm
Location: Canada

Post by Arcoroc »

keless wrote:What kind of performance are you guys seeing?

I then set up the Game class to display 9 animated nodes all using ninja.b3d found in Spoon's template. On the Simulator I see 60fps, naturally, but the phone gives me 4 fps. I see 20 fps if only one ninja is animated.

Nothing else is in my scene manager-- are these numbers accurate, or did I build/do something wrong?

EDIT: before anyone asks, yes I was using Thumb compilation, but removing that only increases FPS from 4 to 6 in the case of 9 ninjas.
I get similar performance, 8 fps with an animated mesh slightly heavier. With no mesh, adding a few particle emitters instances on screen eats about 20fps each on my 3G iphone.

Btw, does spoon template contain an EAGL view that you are loading from the xib? Irrlicht device creates a view already so the former is unnecessary. It might give a few fps back.
L/
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

skinned meshes and particles are probably the most CPU consuming parts of Irrlicht, maybe you should render some static VBOs to get significant FPS with more geometry.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

hybrid wrote:skinned meshes and particles are probably the most CPU consuming parts of Irrlicht, maybe you should render some static VBOs to get significant FPS with more geometry.
I know what VBOs are in an OGL/DX sense, but how do I take advantage of them in Irrlicht? For instance, with a giant level mesh, or various static objects in the level.

Furthermore, if Irrlicht is to be useful for me on iPhone, I'm going to need animated models (even if I have to limit it do low poly and only 5 models at a time)-- however, I need to support OGL ES 1.x for first gen phones so vertex shader bone skinning isnt an option. What is going to be an efficient solution for Irrlicht iPhone?
Arcoroc wrote:Btw, does spoon template contain an EAGL view that you are loading from the xib? Irrlicht device creates a view already so the former is unnecessary. It might give a few fps back.
I do see a UIWindow named "Window" in the XIB, and the following code:

Code: Select all

bool IrrlichtApplication::InitApplication() {
//...snip
params.WindowId   = appDelegate.window;
//...snip
device = createDeviceEx((const SIrrlichtCreationParameters)params);
The "window" object has Irrlicht App Delegate as a referencing outlet. I'm not 100% but I assume that means that its simply loading that UIWindow and either using the default window.view or else replacing it with their own EAGLView. This should _not_ result in slower frame rate (just slightly slower load time).

However, if they're adding a layer on top of the window's view, then it might be drawing the blank window under the EAGL view-- I doubt it though.

EDIT: okay, I lied, they are adding (look in CIrrDeviceIPhone.mm -displayCreateInWindow:Width:Height:). I think a simple solution might be to nuke the window's default view before or after adding the IrrIPhoneView? Not sure if this would result in a noticed performance change anyway though since the view is full screen and the default view should just exit.
Last edited by keless on Thu Jan 07, 2010 6:30 pm, edited 1 time in total.
a screen cap is worth 0x100000 DWORDS
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

md2 is an animated low-poly format. Also, make sure you restict your skinned meshes to only a few bones/joints to reduce the amount of matrices being multiplied each frame.
VBOs can be used by setting the hardware mapping hint of a mesh/node. Either static or dynamic, while the latter often does not do anything.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

hybrid wrote:md2 is an animated low-poly format. Also, make sure you restict your skinned meshes to only a few bones/joints to reduce the amount of matrices being multiplied each frame.

I'm not sure MD2 works for me-- as I recall, its basically the proprietary format of Quake2 and allows for separately animated "upper" and "lower" body sections (so as to "fake" animation blending so you can run in one direction while shooting/looking in another). Problem being that (a) I don't need animation blending and more importantly (b) how do I get an artist to create an MD2? I don't think its supported by Maya/Blender/whatever.

The first title I'll be required to make at work is probably something like an adventure platformer (think crash bandicoot, ratchet and clank, etc though obviously boiled down and low-poly). I need something with basic animation that runs fast on the iPhone and has a well-supported tool chain.
hybrid wrote:VBOs can be used by setting the hardware mapping hint of a mesh/node. Either static or dynamic, while the latter often does not do anything.
I'll look into this, thanks.
a screen cap is worth 0x100000 DWORDS
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Keep in mind its a cellphone, too.

Performance is plenty available, its just a fine balance working to the best of the hardwares abilities (for example, destroying the CPU with 9 ninjas :P)
Post Reply