   [MDX] D3DX.Mesh question !
  Hello,I need some advices to handle a scene with something like 1000 completely different meshes define inside .X files but using the same texture/materials.After some reading I think I will go into one big Static VB and IB.But I have a question concerning specificaly the D3DX.Mesh class.How will you load those data inside the "big" VB and IB ?I was thinking of loading the .X file through the D3DX.Mesh.Fromfile(...) method, one at a time, then use the automaticaly created VertexBuffer and IndexBuffer from those Meshes to creation the big common VB and IB.How will you proceed to send the VB and IB from the meshes into the Big VB and IB ? (Lock/unlock every mesh.VB and mesh.IB ?)When I load a .X file into a Mesh, is the VB and IB from this Mesh object already send to the Vram ? If it's to case, how can I avoid it , as the VertexBuffer and IndexBuffer from the Meshes is only use for "loading, and storing capacity" ?Tx you !   
Quote:Original post by SeeMeWhen I load a .X file into a Mesh, is the VB and IB from this Mesh object already send to the Vram ? If it's to case, how can I avoid it , as the VertexBuffer and IndexBuffer from the Meshes is only use for "loading, and storing capacity" ?You can specify the SystemMem flag when you load the file. This tells DX to use buffers in system memory. This would make them faster for locking to read and write to, but they wouldn't be useful for drawing in their current state. You could copy the data from them to the big buffer, and this would likely work much faster than not specifying the flag.Hope this helps.   ;  Tx you for the quick answer !In this type of scene is it the recommended type of approach ?If my object meshes are moving, I will have to rebuild my Global VB and IB every frame.Won't it be a performance problem ? (Merged 1000 VB, IB after transformation, sorting, ...) ?   