Development Diary – Irrlicht and Flite TTS on the iPhone

So being between projects means I get to play around with random technology!

For some upcoming secret projects I’ve setup Flite TTS and Irrlicht as plugins in my iPhone engine to test out.

Flite

It’s a text to speech thingie that lets you make the iPhone talk.   It’s uh… well, I actually don’t really have a problem with it except I’m having a hard time controlling pitch and inflection.  Does anybody know of a better library?  Here’s a sample I made of Flite using the Kal 16kz voice. (Flite 1.3)

First, I’m sorry about the content of the audio.   Second, there is a problem where raising the pitch for the (loosely) female voice causes clipping.  Maybe I shouldn’t be using “Kal” for that.

Irrlicht

This is a solid 3D engine that has been around forever but truly became appetizing after it went with the zlib license.

My tests on the iPhone have been a bit underwhelming, check these screenshots to see the FPS.

A single md2 model.  Disabling frame interpolation gave 45 fps.

Sydney.md2 from irrlicht media. Disabling frame interpolation gave 45 fps.

Skinned dwarf from the irrlicht media.  Bout the same speed as the md2!

Skinned dwarf from the irrlicht media. Bout the same speed as the md2!

Slightly tweaked version of the Irrlicht geomipmapping terrain demo.

Slightly tweaked version of the Irrlicht geomipmapping terrain demo with coldet. REALLY slow to load.

Two skinned squirrels exported with the Panda (.x format) from 3dsmax.  Slow!  One gets about 30 fps.

Two skinned squirrels exported with the Panda (.x format) from 3dsmax. (Akiko made these for Teenage Lawnmower back in the day) Slow! One gets about 30 fps.

Conclusion

So.. yeah, slow.

Is anybody getting better speed than this?  Am I doing something wrong?

If I export say, a squirrel as a solid mesh (no animation) I get 60 fps, so I guess the real bottleneck is in the animation math, not the triangles/texturing.

I have to say though, I really like how Irrlicht is laid out – it’s a great way to steal <ahem, borrow> a ton of easy to plug-in functionality.  It can load nearly everything! (Except animated Collada..)

Random thoughts

I can think of some ways to speed this up, for instance, one way would be to write an irrlicht program that converts skinned mesh anims to a morph/frame based one, then optimize the renderer for the iPhone,  should be way faster than even the .md2 renderer.  (So, mem/filespace exchanged for rendering speed.. could even avoid frame interpolation if you output the anim with enough frames maybe)

On the 3GS you could probably do a skinned mesh shader and just fly, not sure.  But I don’t even have a 3GS yet!  Meh!

Could probably drop the geomipmapping for the terrain and just dynamically create the render list based on terrain sectors in the players view and do a fog thing to hide the edges and see a big performance improvement for iPhone.

2 thoughts on “Development Diary – Irrlicht and Flite TTS on the iPhone

  1. jetro

    We’re using Irrlicht on iPhone in this:
    http://stairdismount.com/

    Like you say, the slowness is probably something which just comes from running skinned stuff. We are just animating position/rotation of nodes, with little exception of some dynamically generated effects (which have quite low triangle counts though).

    Even though we have currently a bit too much draw calls (from many separate nodes + custom drawing), I think the speed is quite reasonable with a scene of few thousand triangles running 30-60 fps depending on type of device, even with the fullscreen vignetting layer. That slows down a bit when the physics are enabled though, but that’s a different story.

    If you absolutely need skinning or vertex animation, I think optimizing that part with VFP (older devices) and NEON (3GS) could give quite a clear speed boost…

Leave a Reply

Your email address will not be published.