<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Game Algorithms</title><link>http://forums.xna.com/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/229255.aspx</link><pubDate>Tue, 22 Sep 2009 08:50:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:229255</guid><dc:creator>Stainless</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/229255.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=229255</wfw:commentRss><description>Honestly I had it working on an iPaq, the trick is getting the textures from your art package in a painless way. After that it&amp;#39;s trivial.&lt;br /&gt;
&lt;br /&gt;
I was lucky, the application took a photo of a person (taken by a digital camara attached to the iPaq) emailed it to a company in the US that returned a 3D mesh in a standard format.&lt;br /&gt;
&lt;br /&gt;
The 3D mesh was morphed to match the photo, so you got a 3d mesh of the target.&lt;br /&gt;
&lt;br /&gt;
Since it was in a standard format, I could build the expression textures before hand and just apply them to the mesh.&lt;br /&gt;
&lt;br /&gt;
It was very easy, but very impressive.&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/229075.aspx</link><pubDate>Mon, 21 Sep 2009 23:02:31 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:229075</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/229075.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=229075</wfw:commentRss><description>&lt;span style="font-size:13px;"&gt;
&lt;p&gt;Charles: That sounds like a smart way of doing things, particulary exporting the animations as XAF files. My system is a little different (okay, heck, it&amp;#39;s a lot different) in that the morph meshes aren&amp;#39;t actually recognisable meshes, they&amp;#39;re a series of delta-positions (positions representing the distance each vertex moves when morphed). This, along with the animation data, is extracted directly from the FBX file during an intermediate step (between exporting from MAX and importing to XNA).&lt;/p&gt;
&lt;p&gt;I love the idea of making the face a seperate rigid object attached to the head-bone: it makes way more sense than trying to build a combination skin-morph system (given that I&amp;#39;m morphing in the shader, it&amp;#39;s more of an issue for me than you), and as you said keeps the # of morphed vertices down.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m kind of regretting the delta-position choise at the moment, because apparently exporting to FBX doesn&amp;#39;t maintain normal-morphs, which may affect lighting (my vertex positions will be morphed, but my normals will not, and I don&amp;#39;t know any way to re-generate them). I don&amp;#39;t yet know if this will be hugely apparent or if I can afford to write it off.&lt;/p&gt;
&lt;p&gt;Stainless: That&amp;#39;s not a bad idea. A texture would be an excellent way to import large quantities of morph data without hurting the # of shader constants, and you could even mix them in XNA before bringing them into HLSL. Hmm... [mind working]&lt;/p&gt;
&lt;p&gt;Gregoroamin: Well, I was going to say because I&amp;#39;ve got an artist who refuses point blank to use bones for facial animation, because morph targets are a whole world easier. But Stainless has a point: direct vertex manipuilation is a much faster option than using a load of different face bones.&lt;/p&gt;
&lt;/span&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/228356.aspx</link><pubDate>Sun, 20 Sep 2009 09:32:40 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:228356</guid><dc:creator>Stainless</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/228356.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=228356</wfw:commentRss><description>Speed.&lt;br /&gt;
&lt;br /&gt;
Doing all the morphing in a vertex shader is a lot faster than doing it on the cpu in c#, especially when you want to mix several morph targets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/228134.aspx</link><pubDate>Sat, 19 Sep 2009 17:10:43 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:228134</guid><dc:creator>Gregoroamin</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/228134.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=228134</wfw:commentRss><description>Why use totally unsupported morph targets when bones are supported? Its more work up front but a face can be rigged for every phoneme.   Then do bone blending in code.</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/226929.aspx</link><pubDate>Wed, 16 Sep 2009 09:09:24 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:226929</guid><dc:creator>Stainless</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/226929.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=226929</wfw:commentRss><description>This is probably way too late but I thought I would stick my idea down here in case it is of use to anyone.&lt;br /&gt;
&lt;br /&gt;
Store the morph targets as textures.&lt;br /&gt;
&lt;br /&gt;
It would be fairly easy to use the fbx api to extract the morph targets from a file and store them as textures.&lt;br /&gt;
&lt;br /&gt;
Then export the base mesh and import it into XNA as a model.&lt;br /&gt;
&lt;br /&gt;
In HLSL you could take the base mesh and any number of textures and mix them in the vertex shader. So you could have 10% happy, 25% sad, 55% angry, 10% frown.&lt;br /&gt;
&lt;br /&gt;
Just an idea, but I know it works as I did almost the same thing a few years ago to animate a talking 3d head using a text to speech system as the input.&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/226644.aspx</link><pubDate>Tue, 15 Sep 2009 17:00:02 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:226644</guid><dc:creator>CharlesXna</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/226644.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=226644</wfw:commentRss><description>We do the models and morphing meshes in 3DS Max and export in FBX as usual.&amp;nbsp; Since the importer does not import the morph modifiers, we simply name the meshes appropriately so our content processor can detect them when we load.&amp;nbsp; As an example, we might have a face mesh and four emotion meshes for smile, frown, anger, sad.&amp;nbsp; The face mesh will be named:&amp;nbsp; Morph Target Face in 3DS Max.&amp;nbsp; Each of the morphing meshes will be, in turn named:&amp;nbsp; Morph Face smile, Morph Face frown, Morph Face anger, Morph Face sad.&amp;nbsp; We set up the normal Morph modifier in 3DS Max and create animations.&amp;nbsp; We export the animations as XAF files.&amp;nbsp; We have a custom importer and processor for XAF files that detects the animations for the morph modifier and renamed them so they apply to the correct avar.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
The biggest thing we&amp;#39;ve learned in XNA is that you can pass a lot of information from 3DS Max or Maya to XNA in the naming convention you use.&amp;nbsp; We use this to pass collision zones, camera zones, cameras, hotspots, doors, and all kinds of other things.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
I have combined the morph with the skinned animation, be we don&amp;#39;t in the any of the models in our game.&amp;nbsp; Since the only things we morph are faces, we cut the face from the body mesh and just make it a child of the head bone.&amp;nbsp; This keeps the number of morphed vertices relatively small.&amp;nbsp; (We are also morphing another specific part of the male anatomy, but, that&amp;#39;s a different story).&amp;nbsp; We do the morphing on the processor side rather than the shader, so there&amp;#39;s not really an issue to combine them.&amp;nbsp; &lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/224828.aspx</link><pubDate>Wed, 09 Sep 2009 23:28:20 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:224828</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/224828.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=224828</wfw:commentRss><description>Hey Charles.&lt;br /&gt;
&lt;br /&gt;
I haven&amp;#39;t made any further progress on this, mostly because the system isn&amp;#39;t vital until my artist actually comes up with some morphed models.&lt;br /&gt;
&lt;br /&gt;
Your system sounds very impressive. I do the animation in the shader, and the limit is still a back-of-mind worry, but I haven&amp;#39;t pressed any further with it so I figure I&amp;#39;ll deal with it when I have to. How do you generate and export/import your animation? My system allows the artist to do this in 3ds MAX, which is handy.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m not exactly at a release stage yet, but I plan to get it there when I&amp;#39;ve got a pressing reason to work on it. I&amp;#39;d love to compare notes, too.&lt;br /&gt;
&lt;br /&gt;
Also, have you combined it with skinned animation at all?</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/221517.aspx</link><pubDate>Tue, 01 Sep 2009 03:41:08 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:221517</guid><dc:creator>CharlesXna</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/221517.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=221517</wfw:commentRss><description>I&amp;#39;m curious as to if you got this working or not?&amp;nbsp; We have morph targets and full lipsync animation working in XNA in our game engine.&amp;nbsp; I&amp;#39;ll try to get around to making a standalone demonstration sometime soon.&amp;nbsp; I would like to have it for my class, anyway.&amp;nbsp; I have custom content processing, but not a custom importer.&amp;nbsp; I import from FBX.&amp;nbsp; I use mesh names to tell the processor what to do.&amp;nbsp; A morph target is named something like Morph Target Face.&amp;nbsp; Then a morphing mesh is named something like Morph Face Smile.&amp;nbsp; We do the actual vertex morph (vertices and normals) in XNA, not in the shader. We have custom importers for the Autodesk xaf format since FBX does not export morph animations and we have a custom importer for Magpie files. I&amp;#39;ve seen the demos where they use the shader to morph, but that only works if you have a small number of morph meshes.&amp;nbsp; We have about a dozen for lip sync and expressions.&amp;nbsp; We&amp;#39;ve had no problem with performance with usually 2 - 4 characters on screen.&amp;nbsp; It is very sensitive to anything you may do to the mesh in 3DS Max.&amp;nbsp; Doing a Reset XForm will cause all kinds of problems.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
We&amp;#39;ve had this theory for a while that we&amp;#39;re the only one&amp;#39;s to get morphing actually working in XNA (about 750 lines of lip-synced dialog no less).&amp;nbsp; I&amp;#39;d love to hear from anyone else who&amp;#39;s done it and compare notes. &lt;br /&gt;
&lt;br /&gt;
Charles&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/193542.aspx</link><pubDate>Fri, 26 Jun 2009 02:27:30 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:193542</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/193542.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=193542</wfw:commentRss><description>Okay, I&amp;#39;ve been working on upgrading both the extractor and importer for the raw animation data. This turned out to be a whole heap more trouble than I expected: the FBX format isn&amp;#39;t all that logical when it comes to storing keyframes... &lt;br /&gt;
&lt;br /&gt;
It stores it in a solid block of comma delimeted values, with no marker between the end of an old keyframe and the start of a new. Each keyframe appears to have either 9 values if you export as automatic curves, or 7 values if you add special curve properties (in which case, it exports a key-frame for every frame). &lt;br /&gt;
&lt;br /&gt;
My artist has infomed me that for the most part, he&amp;#39;ll be using frame-by-frame animation for facial expressions. This makes things nice and simple: all I need do is import the data and interpolate between them (probably as a Catmull-Rom curve) &lt;br /&gt;
&lt;br /&gt;
After extracting the few nuggets of goodness from this bloated flub of weird data to my new MTA animation file, which consists entirely of: &lt;br /&gt;
&lt;div style="border:#7f9db9 1px solid;font-family:courier new;background-color:white;"&gt;
&lt;table style="border-top-width:0px;border-left-width:0px;margin:2px 0px;width:99%;border-bottom:#eee 0px solid;border-collapse:collapse;background-color:#fff;border-right-width:0px;" cellspacing="0" cellpadding="0"&gt;
    
    
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="font-size:11px;"&gt;~meshname~   &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;    *morphname*   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;        :time, weight:   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;        :time, weight:   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;        :time, weight:   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;    *morphname*   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;        :time, weight:   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;        :time, weight:   &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;        etc...  &lt;/td&gt;
        &lt;/tr&gt;
    
&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I went to work on an importer for the file. To cut a long and unexpectedly painful story short, that is done: I now have the data in a MorphModelAnimationData object, which has a list of MorphMeshAnimationData objects, each of which has a list of MorphAnimationChannel objects, each of which has a list of MorphKeyframe objects. &lt;br /&gt;
&lt;br /&gt;
All that remains is decoding this data into a list of morph weights, which I can hand to my wonderful shader as an array of floats. &lt;br /&gt;
&lt;br /&gt;
The number of morphs is still hardcoded: I see no way around this at present, and suspect I will just have to make a seperate shader for each character with a different number of morphs. I&amp;#39;m not too concerned. &lt;br /&gt;
&lt;br /&gt;
I am a little worried about the normal thing, though: morphing still only affects position, not normals. Our character model will eventually be normal-mapped, and I have absolutely no idea what effect this will have on lighting. As always, any suggestions, criticism or help is appreciated: if not, I guess I&amp;#39;ll just keep doing what I&amp;#39;ve been doing and get the darn thing functional, over the weekend or early next week at the latest. &lt;br /&gt;
&lt;br /&gt;
Cheers, &lt;br /&gt;
Quasar.</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/190799.aspx</link><pubDate>Wed, 17 Jun 2009 21:51:59 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190799</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190799.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=190799</wfw:commentRss><description>&lt;em&gt;Progress, made, it has been.&lt;/em&gt; [/Yoda]&lt;br /&gt;
&lt;br /&gt;
I have sucessfully imported a morph! The content processor was fairly easy to make, and after that it was almost entirely a HLSL matter. Not that there weren&amp;#39;t a few hiccups along the way, including discovering that the importer simply can&amp;#39;t handle a massive string of comma-delimited vertices without a single return, but it&amp;#39;s all good now: I can use O and P to morph between the base mesh (a teapot) and the morphed version (a spherified teapot: I call it the BubblePot&lt;sup&gt;TM&lt;/sup&gt;! :D ).&lt;br /&gt;
&lt;br /&gt;
Of course, it&amp;#39;s not scalable at all at the moment: &lt;br /&gt;
 ~ The number of morphs (1) is hardcoded in the shader (a problem I&amp;#39;m not sure how to fix: I guess I just make a seperate shader for each character with a different number of morphs?),&lt;br /&gt;
 ~ The system is standalone at the moment (not combined with skinning) &lt;br /&gt;
 ~ I&amp;#39;ve not tested it with multiple meshes (although by all accounts it &lt;em&gt;should&lt;/em&gt; work). &lt;br /&gt;
 ~ I&amp;#39;m also wondering how I can get morphed normals through: I don&amp;#39;t think they&amp;#39;re even exported in the first place! But I&amp;#39;ll be rather disappointed if the lighting on their face suffers because I can&amp;#39;t generate morphed normals... any ideas?&lt;br /&gt;
&lt;br /&gt;
PS: Something just occured to me: this system should be perfectly compatible with exporting the morphs manually, rather than using the convertor! If the user names the morphed mesh: &amp;quot;[Basename]_[Morphname]_MT&amp;quot; then the export result should be almost identical to the same thing made with the convertor! I&amp;#39;ll have to test this theory out... :)</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/190420.aspx</link><pubDate>Tue, 16 Jun 2009 00:16:44 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190420</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190420.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=190420</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://forums.xna.com//Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;jwatte:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Note that vertices will be split based on material, UV and normal discontinuities. That&amp;#39;s why you have to use the exact same materials/UVs/smoothing groups/topology in the morphs as you do in the original mesh -- I think I mentioned that above, but perhaps not the reason why.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;
&lt;br /&gt;
Hmm, that gives me an idea. After conversion, the morph meshes are 90% a copy/paste of the original mesh, with the extra 10% being names, positions and normals. So far, I&amp;#39;ve never seen anything at all stored in morph normals: they end up as a list of zero&amp;#39;s no matter what I export. If I was to copy the original meshes normals into each morph mesh, then I might just get away with it: each vertex mesh would be split identically. Maybe.&lt;br /&gt;
&lt;br /&gt;
Easy enough to test, and if it doesn&amp;#39;t work I&amp;#39;ll try setting up a seperate index channel system... maybe I can use the normals for that too? :)</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/190403.aspx</link><pubDate>Mon, 15 Jun 2009 23:24:55 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190403</guid><dc:creator>jwatte</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190403.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=190403</wfw:commentRss><description>Note that vertices will be split based on material, UV and normal discontinuities. That&amp;#39;s why you have to use the exact same materials/UVs/smoothing groups/topology in the morphs as you do in the original mesh -- I think I mentioned that above, but perhaps not the reason why.&lt;br /&gt;
&lt;br /&gt;
One trick is to export the mesh with a separate vertex channel for &amp;quot;vertex number,&amp;quot; which is simply a channel that numbers the vertices based on the source mesh. You can then use this to see which split verts belong to which original verts. You can, for example, enter this into an unused UV channel.&lt;br /&gt;
(Hmm... would be cool if kW X-port could do that for you... must add that to &amp;quot;the list&amp;quot;)&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/190380.aspx</link><pubDate>Mon, 15 Jun 2009 22:19:15 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190380</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190380.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=190380</wfw:commentRss><description>Thanks for your help! I&amp;#39;m still working my way through it: haven&amp;#39;t reached runtime code yet, but the convertor is finished. It takes Morphs and turns them into what I&amp;#39;ve been calling &amp;#39;delta meshes,&amp;#39; where the morph deltas are stored as positions, as well as extracting the animation data as a series of keyframes and storing it in a second file.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve started writing the content processor, and have run into a problem mentioned &lt;a href="http://forums.xna.com/forums/p/10551/62087.aspx#62087"&gt;here&lt;/a&gt;: &lt;br /&gt;
&lt;br /&gt;
&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://forums.xna.com//Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;&lt;a href="https://profile.xna.com/profile.aspx?crn=CharlesXna"&gt;&lt;span style="color:#e16d2e;"&gt;CharlesXna&lt;/span&gt;&lt;/a&gt;:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Just a warning from someone who implemented this:  the normal model processor sorts vertices for efficient application on the graphics cards.  So, if you load multiple meshes don&amp;#39;t count on the vertices corresponding.  I had to write my own custom importer to get morph targets to work that really is doing the same thing as the normal importer with an extra bit of code that will it to not so that sort on morph targets and morphing meshes.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;
&lt;br /&gt;
Despite the test file having 26 vertices in both meshes (it&amp;#39;s a cube, split once along each side), by the time it reaches a NodeContent object I&amp;#39;ve got 54 vertices in my base mesh and 48 in my morph mesh. (I think) I&amp;#39;m trying to work out a solution, but it&amp;#39;s slow going.</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/188830.aspx</link><pubDate>Thu, 11 Jun 2009 20:54:09 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188830</guid><dc:creator>jwatte</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188830.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=188830</wfw:commentRss><description>There is a limit to the number of vertex streams that a vertex shader can read at the same time. There may also be a limit to the number of indices you can define per semantic. I don&amp;#39;t know what the limit is -- it might be as low as, say, 16. (The D3DVERTEXDECLARATION9 struct runs out at 63 + termination element). If you have a large number of morphs, you pretty much need to do it on the CPU, unless you have floating point render targets and render target type casting (&amp;quot;render to vertex buffer&amp;quot;) -- which you don&amp;#39;t in XNA.&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Re: Facial Animation and Morph Targets</title><link>http://forums.xna.com/forums/thread/188498.aspx</link><pubDate>Thu, 11 Jun 2009 06:08:42 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188498</guid><dc:creator>Qu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188498.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=188498</wfw:commentRss><description>Jwatte: thanks for your post! I already had a general idea of what I was going to do, but your post went into enough specifics to give me a really good idea of where I&amp;#39;m headed!&lt;br /&gt;
&lt;br /&gt;
In essense, exporting as seperate meshes is precisely what I&amp;#39;m already trying to do, except that I make the seperate instances from the morph data iself during the whole &amp;#39;conversion&amp;#39; thing, rather than making the artist do it manually. Combined with extracting the animation data from the same file, it&amp;#39;s really easy to use on their end: very nearly a WYSIWYG animation system. It&amp;#39;s more work for me, but less for them, and when I try to explain it to them it makes them think I&amp;#39;m an epic programmer. ;-) Plus it means I can skip the &amp;quot;calculate the delta values&amp;quot; step.&lt;br /&gt;
&lt;br /&gt;
I really like your content processor idea: I was going to use vertex streams, indexing into a seperate Buffer for each morph-weight value, but adding all the morph data to a single meshes vertex format sounds a whole lot easier. What happens if we have &amp;gt;4 morphs, though? I&amp;#39;m still a newbie when it comes to vertex streams, but I&amp;#39;m assuming that I would create a second one with another 4 position values, and then another if we&amp;#39;ve got &amp;gt;8, etc?&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m enjoying this! Thanks for the continued help guys! :)</description></item></channel></rss>