bw logo

Chapter 34. .texformat

Located under various folders under the <res> tree, texture_detail_levels.xml and .texformat files are divided into filename matching criteria, and conversion rules.

For more details, see the document Client Programming Guide's section 3D Engine (Moo) Textures Texture detail levels/compression.

For details on how SpeedTree uses .texformat files to implement LOD, see the document Third-Party Integrations's section SpeedTree Level of detail.

The grammar for the texture detail level configuration file is described below:

<root>
  +<detailLevel>
     *<prefix>         string      </prefix>
     *<postfix>        string      </postfix>
     *<contains>       string      </contains>
     ?<maxDim>         integer     </maxDim>
     ?<minDim>         integer     </minDim>
     ?<reduceDim>      integer     </reduceDim>
     ?<format>         string      </format>
     ?<mipCount>       integer     </mipCount>
     ?<horizontalMips> true|false  </horizontalMips>
     ?<noFilter>       true|false  </noFilter>
     ?<mipSize>        integer     <mipSize>
     ?<lodMode>        integer     <lodMode>
   </detailLvel>
</root>

Grammar of texture detail level configuration file

The list below describes the tags in the texture detail level configuration file:

  • contains

    Filename match criterion.

    Filename substring that must be matched to apply the conversion rule.

  • detailLevel

    Tag for detail level conversion rules.

  • format

    Conversion rule.

    Indicates is mipmaps are stored along the horizontal axis. If set to true and mipCount is non-zero, then mipmaps are stored along the horizontal axis of the texture; otherwise, they are stored along vertical axis.

  • horizontalMips

    Conversion rule.

    Indicates is mipmaps are stored along the horizontal axis.

    If set to true and mipCount is non-zero, then mipmaps are stored along the horizontal axis of the texture; otherwise, they are stored along vertical axis.

  • maxDim

    Conversion rule.

    The maximum width/height dimension that the converted texture might have.

  • minDim

    Conversion rule.

    The minimum width/height dimension that the converted texture might have.

  • mipCount

    Conversion rule.

    Number of mipmaps stored when precomputed mipmaps are stored in a single source texture.

  • mipSize

    Conversion rule.

    Size of the topmost level of the mipmap, along the axis determined by the horizontalMips value.

  • noFilter

    Instructs Moo what filter to use when auto-generating mipmaps: if true, then point filtering will be used; if false, then box filtering will be used.

  • postfix

    Filename match criterion.

    Filename postfix that must be matched for the conversion rule to be applied.

  • prefix

    Filename match criterion.

    Path/filename prefix that must be matched to apply the conversion rule.

  • reduceDim

    Conversion rule.

    The number of times to halve the dimensions of the texture.

  • lodMode

    Texture Quality Setting Modifier.

    This modifier tweaks how the texture responds to the texture quality setting which varies from 0 (highest) to 2 (lowest). How this modifier tweaks the quality setting is described in the following table.

                                   texture quality setting
            lodMode                  0       1       2
            0 (disabled)             0       0       0
            1 (normal)               0       1       2
            2 (low bias)             0       1       1
            3 (high bias)            0       0       1