Sunday, 12 December 2010

When I thought I'd finished converting to XNA 4

A few posts back I reported that I had finished converting everything to get my XNA 3.1 code to work in XNA 4.0.  Well I was close and everything worked on the PC but when I came to test on the Xbox I had some errors.  Proper game stopping exceptions.

It's taken a few hours on and off to narrow down the problem and it's fixed now.  The problem was code I had written to replace point sprites in one of my particle systems.  Point sprites are no longer available in XNA.  That is not a problem because triangle lists do the job just as well.  The trouble was that I did not fully understand how vertexBuffers work and that the Xbox cannot reuse vertices until the GPU has finished with them.

In my defence the posts I read to find out how to resolve my issues were posted by some well respected programmers who were also caught out by the Xbox behaviour.

If you want to know more the comments in the code for the particle system sample were useful:
As were the comments in the following old post:

Now at last I can get on with editing some models and creating some more animations for use in the game.

Saturday, 4 December 2010

Blender to XNA to be included in the next release of Blender

There is a good chance that the script I have just written to export from Blender to XNA will be included in the next release of Blender.  Apparently it has to be tested and approved by some of the Blender administrators but it is already on their SVN server.

The instructions are now on a Blender Wiki page: