Company of Heroes Model Exporter
Creating a texture
Even if you already have a texture ready for your model, follow these steps through. Create
a 512x512 or 1024x1024 image using a program that can create PSDs (eg. Photoshop or The GIMP).
Add 3 additional layers to the image, and name the layers "12345678DIFFUSE", "12345678ALPHA",
"12345678GLOSSINESS" and "12345678SPECULAR" (any eight characters should do before the useful
name part; or it may be a result of using The GIMP for PSD creation that the eight are needed
in the first place). It is probably a good idea to fill the alpha layer with white, the glossiness
and specular layers black and to put a few squiggles onto the diffuse layer:
Save the image as a PSD file in the same folder as Reference.max:
Applying texture to model
Press the yellow hexagon button on the CoH tools toolbar labelled 'Creates Shaders for COH
Models'. A popup should appear. Press the 'Select Proxy Map' button, and choose the PSD you
just saved. Next press the 'Create Proxy Material' button and then the 'Generate Shell
Material' button. Pressing the second will trigger a file selector dialog asking for a shader.
Navigate to the 'DataSrc\Engine\Shaders' folder and choose dx9_unit_soldier: (Opening an
RGM into Mod Studio will list the shader / DX name it uses, so if unsure about which
shader to use, load an RGM of a similar object into Mod Studio)
Open the Material Editor by pressing M or going to Rendering -> Material Editor. The newly
created shader/texture should be selected. In the 'Shell Material Parameters' group, there
should be a button below the 'Baked Material' line which ends in 'DirectX 9 Shader'. Click
it. If max isn't set to use DirectX9, this will not work. You should see that the diffuse
texture is set to a TGA file. If it isn't, or if the gloss map or specular map are still
set to the PSD, create TGA files from the layers of your PSD file and set the material to
use them by clicking on the button for that texture (put the TGAs in the same folder as the
PSD is) . At this point, you may want to edit
the TGAs to be the actual textures you want your model to use:
Be sure to apply the texture to the various parts of your model which want it.