Search code examples
c#renderingdirectxdirect3d

Direct3D Rendering Cookbook, CMO 3D Models?


Okay so i got the book "Direct3D Rendering Cookbook" and it's great,

But now when i wanted to import my custom models, I saw it needs to be a CMO file?

What is that format, and can I somehow convert my fbx or obj to it?

I tried:

  • Exporting in blender
  • Just renaming the file lol
  • Googling

None of which worked :<

Cheers!


Solution

  • In Visual Studio 2012 or later, it has a "Content Processing Pipeline" that will convert WaveFront OBJ or Autodesk FBX into CMO files.

    See Microsoft Docs.

    The meshconvert tool which is part of the DirectXMesh project on GitHub will also produce CMO files.

    Other content types produced by Visual Studio:

    • DDS files can be generated from various file formats using the Image Content Pipeline. This makes use of a version of DirectXTex.

    • CSO files are generated from HLSL files using the HLSL compiler (FXC.EXE for Shader Model 1 - 5, DXC.EXE for Shader Model 6).

    CMO files (a.k.a. Compiled Mesh Objects) are covered in detail as part of the Visual Studio Starter Kit sample. I support them in the DirectX Tool Kit along with SDKMESH files. See this C++ source.