On Sun, Mar 20, 2011 at 1:09 PM, Michael Mc Donnell michael@mcdonnell.dk wrote:
I would like implement some of the missing mesh functions in Wine's D3DX9 for Google Summer of Code 2011. I would like to implement the following functions: - CloneMesh - CloneMeshFVF - ConvertPointRepsToAdjacency - ConvertAdjacencyToPointReps - GenerateAdjacency
Hi Michael,
Sorry for not noticing your before, but it seems as if some work that I have been doing as some overlap with your proposed Google Summer of Code project. I have implemented GenerateAdjacency, and partially implemented CloneMesh{,FVF} for the basic case where the vertex formats are exactly the same, but I am still trying to incrementally submit my work to wine-patches.
I have actually been working on the D3DXLoadMeshFromX and D3DXLoadMeshHierarchyFromX functions. However, D3DXLoadMeshHierarchyFromX is given a set of callbacks that is called with the adjacency for the mesh (ID3DXAllocateMeshHierarchy::CreateMeshContainer). It is for this reason that I implemented GenerateAdjacency, since it wasn't possible to detect whether the adjacency information would be used by the user provided callback in order to create a partial implementation.
I also provided a partial implementation of Optimize{,Inplace} since it seemed like the load mesh functions were sorting the faces by the attribute values (i.e. D3DXMESHOPT_ATTRSORT). I had Optimize use CloneMesh with the same vertex format in order to call OptimizeInplace, which does the actual optimization work.
The relevant patches are in my development repository (http://dylansmith.ca/git) in the loadmesh branch. I am trying to send in my patches, but currently I am waiting on the review of my latest patch to generate rmxftmpl.h, which is a re-requisite for load mesh patches. I'll try to avoid stepping on your toes in future.
Summary of ID3DXMesh methods I have implemented: - LockAttributeBuffer - UnlockAttributeBuffer - GetAttributeTable - SetAttributeTable - DrawSubset - GenerateAdjacency
Partially implemented: OptimizeInplace: unimplemented support for D3DXMESHOPT_VERTEXCACHE, D3DXMESHOPT_STRIPREORDER CloneMesh: unimplemented support for vertex buffer conversion
Completely unimplemented: - ConvertPointRepsToAdjacency - ConvertAdjacencyToPointReps - UpdateSemantics
There are also plenty of other functions. Just try `grep stub d3dx9_36.spec | grep Mesh` for Mesh related functions. There are also some unimplemented functions to create meshes for certain shapes (e.g. D3DXCreateTorus, D3DXCreatePolygon).