DirectX Exporter Help

Options

  • Scene Root:

    The default root node. You can rename the node name.

  • Tangent / Binormal:

    Computes the tangent vectors which can be used in normal mapping.

  • Key frames:

    Export only the keys if possible.

  • Weight Fix:

    The maximum compensation value for weights when incorrect skin detected. Set to 1.0 if you need normaized weights, this process may take more exporting time because it will search ajacent vertices and rebuild skin links for non-skinned vertices.

  • Scale:

    Use it to scale your models, much like the Unit Scale in 3ds Max.

  • Right-handed:

    The Z axis will be backward when the Y axis is up, just like WebGL and OpenGL coordinate system. Direct3D also support Right-Handed system but many D3D applications and game engines such as Unreal Engine 4 use Left-Handed system

  • X-Rot, Z-Rot:

    WebGL, OpenGL and DirectX use the Y axis as up, but often modelers like 3ds Max, Maya and Blender will use the Z axis up. Set the X-Rot to 90 if you need switch between Y-up and Z-up just like switch between Front View and Top View in 3ds Max, if you need switch between Front View, Left View and Right View, simply set the Z-Rot to 90 or -90.

  • Remove Duplicates:

    Delete unneeded uv sets when a mesh has multiple textures but using the same uv sets.

  • Texture convert:

    Auto convert all texture format to dds, jpg, tga, png, bmp.

  • Procedural Texture Size:

    Control the size of procedural texture, such as Noise, Dent, Marble, Smoke, Mix, etc.

  • Inline:

    Use it when you don't want to export materials in global space.

  • SRT:

    Export animation keys as Scale, Rotation( quaternion ) and Translation.

  • Keys Optimize:

    Use level 3 (less decimal digits of precision) you can get smaller file size while use level 1 (more decimal digits of precision) you can get more accurate results but much larger file size.

  • Timeline:

    If you choose 3ds Max then it will use the default ticks rate 4800. You can use the custom option to control animation speed, the larger the slower, the smaller the faster. If your engine needs sequential key times (frame number) you must set the custom value to 1, otherwise the animation will be very slow.

  • Vertex Duplication:

    The VertexDuplicationIndices hold information about which vertices in the mesh are duplicates of each other. It is often used in mesh simplification or polygon reduction algorithm.

  • World Space:

    If checked, every node and animation will be in world space (NOT in its parent local space). That means the frames hierarchy system will be converted into a flat system. This is very useful for those users who want to use world space animation operations to do some special effect because they can dynamically add/remove a node with animatioin and never affect other nodes. Users can also use this option to export a mesh with no frames.

  • Create Shader (.fx):

    Generate a sample shader to demonstrate the vertex input layout when a mesh has multiple UV sets.

  • Normal map:

    Generate sample code for tangent space normal mapping. A simple example can be found on the download page

Tips

  • Skin or Physique modifier should be the last in modifier stack. For example, if you use Skin and TurboSmooth, MeshSmooth or ProOptimizer modifier then you should drag these modifiers under the Skin modifier.
  • For keyframes, ensure you have a keyframe every 90 degrees or less of rotation.
  • Bone Affect Limit is set to 20 by default in Skin modifier. You may change it if your engine supports 4 bones maximum per vertex. If you use physique modifier, on the Physique --> Reinitialize --> Vertex-Link Assignment rollout the default number of links is set to N Links, you can change it to 2, 3, or 4, depending on your choice. Choose one of these options if your game engine support of blending is limited.
  • MeshNormals and MeshTextureCoords are replaced by DeclData which can hold more per-vertex information: Normal, Tangent, Binormal, VertexColor, UV sets( TexCoord0 ~ TexCoord10 ). If your loader cannot parse DeclData correctly you can uncheck the option "Vertex Elements in DeclData" then the exporter will use old templates to hold Normal, UV set etc. For further details about templates please refer to X File Templates or the DirectX File Format Specification
  • Shaders will be exported in fx files and use SAS( Standard Annotations and Semantics ) which is convenient to preview in DxViewer, you can delete it or replace it with your own shader.

Load X files with 3d engines

Irrlicht is an open source cross-platform graphics engine which enable X files to be used in both DirectX and OpenGL applications. This engine provides a class CXMeshFileLoader to load X files without D3DX. It supports text and binary X file format from version 1.1, normals and texcoords in DeclData from version 1.5 but up to version 1.8.4 the loader has a bug on parsing DeclData which may cause engine failed to load a binary X file.
My solution is open CXMeshFileLoader.cpp and insert readHeadOfDataObject() at the beginning of the if block in CXMeshFileLoader::parseDataObjectMesh

    if (objectName == "DeclData")
    {
       if (!readHeadOfDataObject())  //Add this
         return false;
       ...
    }