{"id":412,"date":"2009-11-23T19:34:41","date_gmt":"2009-11-23T10:34:41","guid":{"rendered":"http:\/\/www.codedojo.com\/?p=412"},"modified":"2009-11-23T22:14:56","modified_gmt":"2009-11-23T13:14:56","slug":"development-diary-irrlicht-and-flite-tts-on-the-iphone","status":"publish","type":"post","link":"https:\/\/www.codedojo.com\/?p=412","title":{"rendered":"Development Diary &#8211; Irrlicht and Flite TTS on the iPhone"},"content":{"rendered":"<p>So being between projects means I get to play around with random technology!<\/p>\n<p>For some upcoming secret projects I&#8217;ve setup Flite TTS and Irrlicht as plugins in my iPhone engine to test out.<\/p>\n<h2><strong><a href=\"http:\/\/www.speech.cs.cmu.edu\/flite\/\">Flite<\/a><\/strong><\/h2>\n<p>It&#8217;s a text to speech thingie that lets you make the iPhone talk.\u00a0\u00a0 It&#8217;s uh&#8230; well, I actually don&#8217;t really have a problem with it except I&#8217;m having a hard time controlling pitch and inflection.\u00a0 Does anybody know of a better library?\u00a0 Here&#8217;s a <a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/flite_test.mp3\">sample I made of Flite<\/a> using the Kal 16kz voice. (Flite 1.3)<\/p>\n<p>First, I&#8217;m sorry about the content of the audio.\u00a0\u00a0 Second, there is a problem where raising the pitch for the (loosely) female voice causes clipping.\u00a0 Maybe I shouldn&#8217;t be using &#8220;Kal&#8221; for that.<\/p>\n<h2><strong><a href=\"http:\/\/irrlicht.sourceforge.net\/\">Irrlicht<\/a><\/strong><\/h2>\n<p>This is a solid 3D engine that has been around forever but truly became appetizing after it went with the zlib license.<\/p>\n<p>My tests on the iPhone have been a bit underwhelming, check these screenshots to see the FPS.<\/p>\n<div id=\"attachment_414\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_md2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-414\" class=\"size-medium wp-image-414 \" title=\"iphone_irrlicht_md2\" src=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_md2-300x200.jpg\" alt=\"A single md2 model.  Disabling frame interpolation gave 45 fps.\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_md2-300x200.jpg 300w, https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_md2.jpg 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-414\" class=\"wp-caption-text\">Sydney.md2 from irrlicht media.  Disabling frame interpolation gave 45 fps.<\/p><\/div>\n<div id=\"attachment_415\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_dwarf_skinned.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-415\" class=\"size-medium wp-image-415\" title=\"iphone_irrlicht_dwarf_skinned\" src=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_dwarf_skinned-300x200.jpg\" alt=\"Skinned dwarf from the irrlicht media.  Bout the same speed as the md2!\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_dwarf_skinned-300x200.jpg 300w, https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_dwarf_skinned.jpg 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-415\" class=\"wp-caption-text\">Skinned dwarf from the irrlicht media.  Bout the same speed as the md2!<\/p><\/div>\n<div id=\"attachment_416\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_terrain.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-416\" class=\"size-medium wp-image-416\" title=\"iphone_irrlicht_terrain\" src=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_terrain-300x200.jpg\" alt=\"Slightly tweaked version of the Irrlicht geomipmapping terrain demo.\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_terrain-300x200.jpg 300w, https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_terrain.jpg 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-416\" class=\"wp-caption-text\">Slightly tweaked version of the Irrlicht geomipmapping terrain demo with coldet. REALLY slow to load.<\/p><\/div>\n<div id=\"attachment_417\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_skinning.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-417\" class=\"size-medium wp-image-417 \" title=\"iphone_irrlicht_skinning\" src=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_skinning-300x200.jpg\" alt=\"Two skinned squirrels exported with the Panda (.x format) from 3dsmax.  Slow!  One gets about 30 fps.\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_skinning-300x200.jpg 300w, https:\/\/www.codedojo.com\/wp-content\/uploads\/2009\/11\/iphone_irrlicht_skinning.jpg 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-417\" class=\"wp-caption-text\">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.<\/p><\/div>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>So.. yeah, slow.<\/p>\n<p>Is anybody getting better speed than this?\u00a0 Am I doing something wrong?<\/p>\n<p>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.<\/p>\n<p>I have to say though, I really like how Irrlicht is laid out &#8211; it&#8217;s a great way to steal &lt;ahem, borrow&gt; a ton of easy to plug-in functionality.\u00a0 It can load nearly everything! (Except animated Collada..)<\/p>\n<h2><strong>Random thoughts<\/strong><\/h2>\n<p>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,\u00a0 should be way faster than even the .md2 renderer.\u00a0 (So, mem\/filespace exchanged for rendering speed.. could even avoid frame interpolation if you output the anim with enough frames maybe)<\/p>\n<p>On the 3GS you could probably do a skinned mesh shader and just fly, not sure.\u00a0 But I don&#8217;t even have a 3GS yet!\u00a0 Meh!<\/p>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So being between projects means I get to play around with random technology! For some upcoming secret projects I&#8217;ve setup Flite TTS and Irrlicht as plugins in my iPhone engine to test out. Flite It&#8217;s a text to speech thingie that lets you make the iPhone talk.\u00a0\u00a0 It&#8217;s uh&#8230; well, I actually don&#8217;t really have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-development","category-tech-tips"],"_links":{"self":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412"}],"version-history":[{"count":22,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}