3ds Max GMT file UVW Export

The way UV is exported from 3ds Max to GMT files can be a little bit confusing. So to help with this here is a dedicated page to explain the situation.

3ds Max UV Channels vs GMT UV Channels

The first thing to note is nomenclature to make explaining this easier.

3ds Max UV

In 3ds Max, as you should know you can have many many UV channels. -2 is assigned to Vertex Alpha, -1 to Vertex Illumination and 0 to Vertex Colour. After this you can assign as many as you please.

It is also worth noting that the data stored in UV channels is just a number of upto 3 values. The structure of the UV can also be different to that of underlying mesh. It is possible for the same vert on different faces to have a different value for example!

GMT Files UV 

When setting up a gMaterial, you may assign a different UV channel to each gTexture. However not all gTextures export UV. Usually upto the first 4 assignments are exported into the GMT file.

To make things clearer let's label the exported UV as follows:

  • A: UVW Configured in the first gTexture slot.
  • B: UVW Configured in the second gTexture slot.
  • C: UVW Configured in the third gTexture slot.
  • D: UVW Configured in the fourth gTexture slot.

Other things to note are:

  • For each of these 4 exported sets of UV you can assign any mapping channel you wish. You can assign channel 1 to all 4 of A,B,C and D.  Or you can assign channel 99 to A, 54 to B, 2 to C and 1 to D. It really makes no difference.
  • The UV is exported with two channels of data only. In the UV editor it is possible to set the W value of UV. In each gTexture under the Coordinates rollout you can set if UV, VW or WU is exported.
  • You may assign the same channel of UV to different gMotorTextures but then add scalars in the gMotorTexture coordinates rollout, meaning you only need to maintain a single set of UV if you just desire different versions of the same scaling.
  • Finally, you need to check the documentation for each individual shader to know what it does with these sets of UV. The shader may have configuration options meaning you can adjust which set of UV is loaded for a map. Or it may even use the data for something altogether different.

GMT Files Vertex Colour & Alpha

Vertex Illumination is not currently exported at all

Vertex Colour and Alpha are both exported by the plugins. However it is necessary to ensure that both the channels are set with data before export though, or you may encounter unpredictable results. You can check this by looking at the Channel Info data. It is possible to set them by setting an arbitrary value in Edit Poly somewhere and resetting to white /  1.0. Or there are modifier scripts that you can use.

Vertex illumination is not currently exported at all.

Complicated UV Structures

It is important to note that if you bake information into UVW, or edit the UVW Unwrap in such a way that it results in more verts than in the physical size of the underlying mesh, this will increase the file size of the exported GMT file. The exporter shows the number of actual verts exported. This can be an issue when working on large files, and may push you over some limits in the game code. Such as collision meshes, derivable surfaces or real road calculations.