Jump to content
  • Advertisement
Sign in to follow this  
danromeo

XNA 4 Instanced Modeling Sample problem

This topic is 1997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!