Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


XNA 4 Instanced Modeling Sample problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 danromeo   Members   -  Reputation: 237

Like
0Likes
Like

Posted 01 January 2013 - 07:19 PM

Can somebody tell me why when I replace the model in the XNA 4 Instanced Modeling sample with the attached model the model doesn't draw when in Hardware Instancing mode? 

 

This is a sample model that I borrowed, not my own creation.  It has a single part and appears to be properly rigged for XNA.  It works fine in any of the other modes.  The Instanced Model sample works fine in all modes with the model that is included with the sample.  For testing purposes I changed the pixel shader to output float4(1,0,0,1) to rule out any problems with the texture.  All I get is a cornflower blue background.  I'm using the Instanced Model sample here: http://xbox.create.msdn.com/en-US/education/catalog/sample/mesh_instancing, the only changes being replacing the model and the pixel shader output mentioned above.  I am using the Instanced Model content processor included with the sample to process the model.   

 

The model that I'm testing with and the texture that it links to are here:

 

 
 
THANKS!


Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1551

Like
0Likes
Like

Posted 01 January 2013 - 07:27 PM

Can you check the number of bits used for storing indices (16 or 32) and see if the model perhaps has more indices than this amount allows?



#3 danromeo   Members   -  Reputation: 237

Like
0Likes
Like

Posted 01 January 2013 - 08:53 PM

YUP!  Good call.

 

16 bit IndexElementSize with 188,000 indices.  Of course the short answer is to use simpler models and this test model is gross overkill for instancing.  Wondering though, Is there a way to change the IndexElementSize after creation of the buffer?  Otherwise a 32 bit size would require rewriting the MeshPart class??  Or is this a function of the modeling app (Blender)???

 

Thanks Steve.



#4 danromeo   Members   -  Reputation: 237

Like
0Likes
Like

Posted 03 January 2013 - 03:22 PM

Postmortem: Steve was right that my model had too many indices, but even a simpler model still wouldn't render in Hardware Instancing mode.  

 

It turns out I was exporting the model armature in Blender, which I found after comparing a working model with a non-working model.  In Blender, select all objects EXCEPT the armatures, then in the .FBX export check "Selected Objects" and then export.  Model now works in the MS Hardware Instancing sample. 






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS