first let me tell you, I just discovered this project and it is amazing. Great job!
I started playing with it and discovered a potential problem with XMeshes with alpha enabled materials. I loaded an XMesh I made earlier which has 6 materials, with the second and third having an alpha value (e.g. the propeller).
When setting the RenderState to
myObject.RenderStates.AlphaBlending = BrumeRenderParams.ALPHABLENDING_INVERTSOURCE;
I got an IndexOutOfRangeException in BruceMainRenderer.StoreHierarchyAlphas on the line newPos = geo.positions[isub].
The cause is that the positions array is always initialized to length 1, while the renderer checks at the position of the subset. So I changed the lines
- Code: Select all
geometry.positions = new BrumeVector[1];
geometry.positions[0] = new BrumeVector(0, 0, 0);
in BruceXMesh.CreateMeshContainer to
- Code: Select all
geometry.positions = new BrumeVector[materials.Length];
for (int i = 0; i < materials.Length; i++)
geometry.positions[i] = new BrumeVector(0, 0, 0);
and now it works fine!
PS. if you want to test, the mesh and texture can be downloaded from
http://playinginthedark.net/downloads/extra300s.x and
http://playinginthedark.net/downloads/extra.jpg.