Alik
28-01-2010 09:44:44
Hello,
Just getting up to speed with Mogre; liking it so far, though it took a long time to figure out debugging and getting the right call stacks and all that. Anyway, I am writing an extension of the MeshBuilderHelper class from the wiki to make it support multiple submeshes and materials. I ran into an issue that flummoxed me for a while, and it was this: I was creating one VertexDeclaration, and then setting mSubMesh.vertexData.vertexDeclaration = commonVertexDeclaration for each submesh. From .NET, this would seem to work, as queries to mSubMesh.vertexData.vertexDeclaration would return all the expected values. However, it would *sometimes* crash upon rendering or upon finishing the mesh, especially if shadows were enabled. Turns out I needed to leave mSubMesh.vertexData.vertexDeclaration as it was and re-add the elements to the declaration for each submesh. So, I think maybe vertexData.vertexDeclaration should be made a get-only accessor, to prevent this mistake in future.
BTW, one more thing that almost certainly is a bug: when I add a watch to mSubMesh.vertexData.vertexBufferBinding.NextIndex, every time the watch refreshes (e.g. if I add more watches of the same variable) the number increments, or goes to some wild number. (I assume that these weird numbers are also being returned if you use them in the code.) This should not be happening.
Also, is this the right forum for a post like this? Thanks,
Alec
Just getting up to speed with Mogre; liking it so far, though it took a long time to figure out debugging and getting the right call stacks and all that. Anyway, I am writing an extension of the MeshBuilderHelper class from the wiki to make it support multiple submeshes and materials. I ran into an issue that flummoxed me for a while, and it was this: I was creating one VertexDeclaration, and then setting mSubMesh.vertexData.vertexDeclaration = commonVertexDeclaration for each submesh. From .NET, this would seem to work, as queries to mSubMesh.vertexData.vertexDeclaration would return all the expected values. However, it would *sometimes* crash upon rendering or upon finishing the mesh, especially if shadows were enabled. Turns out I needed to leave mSubMesh.vertexData.vertexDeclaration as it was and re-add the elements to the declaration for each submesh. So, I think maybe vertexData.vertexDeclaration should be made a get-only accessor, to prevent this mistake in future.
BTW, one more thing that almost certainly is a bug: when I add a watch to mSubMesh.vertexData.vertexBufferBinding.NextIndex, every time the watch refreshes (e.g. if I add more watches of the same variable) the number increments, or goes to some wild number. (I assume that these weird numbers are also being returned if you use them in the code.) This should not be happening.
Also, is this the right forum for a post like this? Thanks,
Alec