How to add Textures to The Dark Mod: Difference between revisions
Line 75: | Line 75: | ||
== Upload the Textures == | == Upload the Textures == | ||
Once, you have checked your texture in-game (and are pleased with the results), you'll need to upload the files to our SVN repository: | Once, you have checked your texture in-game (and are pleased with the results), you'll need to upload the files to our SVN repository. Additional to the textures needed for the engine and editor (diffuse/normal/specular/editorimage) you're encouraged to upload the uncompressed textures to the hires repository. | ||
The hires repository is located at '''https://<InsertDarkmodServerHere>/svn/darkmod_hires/trunk/tga_backup/'''. As only diffuse/speculars are compressed in DDS format, these are the only two that need to be uploaded in TGA format. The TGA files should be named just like the DDS versions and should be located in the analogous folder than they are in the main repository, but below the tga_backup/ folder. For instance tga_backup/textures/darkmod/stone/etc. | |||
The hires TGA can be RLE-compressed to save some space, but this is not too important. Uncompressed TGAs are only important for the textures used by the engine itself. | |||
As last part, it would be nice to have the actual working versions (Photoshop/Gimp source files) stored on the server too. This is of course a large upload, but having the source files is very valuable. For this purpose, there is another repository '''texture_src''' installed at '''https://<InsertDarkmodServerHere>/svn/texture_src/'''. | |||
<div style="background-color: #EFEFEF; border: 1px solid #CCCCCC; padding: 5px; padding-top: 0px"> | |||
=== Things to remember === | |||
* Upload the diffuse, normal, (specular,) and editor image to the regular darkmod SVN. | * Upload the diffuse, normal, (specular,) and editor image to the regular darkmod SVN. | ||
* Upload the | * Upload the (RLE-compressed) diffusemap and specularmap (in TGA format) to the darkmod_hires SVN repository (into the '''tga_backup''' subfolder). | ||
* Upload the working source file (PSD/Gimp) to the '''texture_src''' repository. | |||
</div> | |||
{{tutorial-textures}} | {{tutorial-textures}} |
Revision as of 01:52, 30 October 2007
Create your texture
This is mostly artwork. Be sure to start off with useful raw material with a reasonably high resolution. Where possible, work from photo-references. A basic guide can be found here: Texture Creation - Basic Tutorial.
A few things to remember: Make sure your texture dimensions are a power of 2 (eg, 128, 256, 512, 1024, etc). Other common mistakes can be found here: Common Texture Mistakes
Things to remember
- Use good source material
- Avoid lighting baked into the diffusemap
- Keep your PSD/Gimp working version safe!
Save your Texture in the correct Format
Save the diffusemap, the normalmap and an optional specularmap to a TGA file. The Texture Guidelines will help you choosing the correct resolution. A TGA version of your diffusemap is supposed to be uploaded to our hi-res repository for future reference (see below).
Once your TGA file is saved, you will have to create DDS files for the diffuse and specular (not the normalmap) as well. These are smaller in size and can be loaded faster by the engine. Follow the DDS creation guide to learn how to create the DDS files in the correct formats.
Also, create an editor image out of your diffusemap. The editor image dimension should be 256x256 pixels and the file should be saved in the JPG format. Add the _ed postfix to the filename name (like mytexture_ed.jpg
).
When you upload textures, be sure to upload the files to the right spot. The .dds diffuse and specular go in the dds/textures/ folder structure. The .tga normalmap goes in the textures/ folder structure. The .tga of the diffuse and specular is needed as well in case we ever want to make modifications to the texture or new textures based on the old. Opening and resaving .dds files results in loss of detail, so all new versions of textures should be made from the .tga files. Save the diffuse and specular .tgas to the hires repository (they can optionally be RLE-compressed).
Things to remember
- Most textures don't need speculars
- Create DDS for your diffusemap and specularmap.
- Keep TGA version of your diffusemap and specularmap.
- Create a TGA version of your normalmap (uncompressed, no RLE).
- Create a JPG editor image (max. 256px)
Name your Texture
You should give your texture a descriptive name, usually three words, like "rough_dark_flagstones01.tga". Try to think about what mappers might want to know when looking for your texture. If the name is really distinctive, then a number is probably not necessary, but for other names a number might be appropriate.
If your texture tiles only in one direction, include the phrase "tiling_1d" at the end of the name. If your texture does not tile (repeat) at all, add the phrase "nontiling".
Diffusemaps should have no extension to their name. Normalmaps should have a "_local" extension at the end of their name. Specular maps should have a "_s" extension, the editor images go with an "_ed" extension.
Things to remember
- Choose descriptive names for your texture
- Diffusemap: mytexture.dds (note the lowercase)
- Normalmap: mytexture_local.tga
- Editor image: mytexture_ed.jpg (max. 256 pixels in size)
- (Optional) Specularmap: mytexture_s.dds
Move the Texture to the right Location
The Texture Folder Structure can help you finding the right folder for your texture. Be sure to rename all your DDS file extensions to a lowercase .dds (the Compressonator always creates files with uppercase extension, TDM requires them to be lowercase).
For nontiling textures and those which are tiling in one direction only, there is another thing to remember: the filename should contain the suffix tiling_1d (for one-dimensional tiling) or nontiling for textures that don't tile at all. So, basing on the filename examples in the previous section, a normalmap would be stored in dds/textures/darkmod/stone/flat/concrete_dirt01_tiling1d_local.dds.
Note that there is a peculiarity of the Doom 3 engine not being able to load DDS textures that are more than five folders deep. The deepest level allowed would be something along the lines of dds/textures/darkmod/door/metal/. This is something to be watched out for.
Things to remember
- Add the suffix tiling_1d/nontiling to the filename where appropriate.
- Move the DDS textures into the dds/textures/... tree.
- Move the TGA textures into the textures/... tree.
- Don't save DDS files into folders more than 5 levels deep.
Name your Material Entry
Your material entry should be added to the .mtr file that has the same name as the folder your texture is saved in. For example, the material entry for a texture saved in "textures/darkmod/wood/panels" should be saved in the .mtr file, "tdm_wood_panels.mtr".
You should name your material entry the same name as your diffuse texture, including the folder path structure (eg, "textures/darkmod/wood/panels/rectangle_oak_face"). (Do not add .tga or .dds to the end.)
The only exception is when multiple shaders are using the same diffusemap, or when your texture doesn't tile (or tiles in only one direction). In the latter case, you would add /nontiling/ or "/tiling_1d/ to the end of the shader folder (a 'virtual' folder, essentially). (The textures used to be separated like that in the actual folder structure, but due to D3's inability to read .dds files five folders deep, they had to be moved.)
Things to remember
- Create your shader in the correct file (tdm_xxx_yyy.mtr)
- The shader name for tiling textures is the same as the diffusemap
- Nontiling/tiling_1d textures go into a "virtual" subfolder nontiling/ or tiling_1d/
Upload the Textures
Once, you have checked your texture in-game (and are pleased with the results), you'll need to upload the files to our SVN repository. Additional to the textures needed for the engine and editor (diffuse/normal/specular/editorimage) you're encouraged to upload the uncompressed textures to the hires repository.
The hires repository is located at https://<InsertDarkmodServerHere>/svn/darkmod_hires/trunk/tga_backup/. As only diffuse/speculars are compressed in DDS format, these are the only two that need to be uploaded in TGA format. The TGA files should be named just like the DDS versions and should be located in the analogous folder than they are in the main repository, but below the tga_backup/ folder. For instance tga_backup/textures/darkmod/stone/etc.
The hires TGA can be RLE-compressed to save some space, but this is not too important. Uncompressed TGAs are only important for the textures used by the engine itself.
As last part, it would be nice to have the actual working versions (Photoshop/Gimp source files) stored on the server too. This is of course a large upload, but having the source files is very valuable. For this purpose, there is another repository texture_src installed at https://<InsertDarkmodServerHere>/svn/texture_src/.
Things to remember
- Upload the diffuse, normal, (specular,) and editor image to the regular darkmod SVN.
- Upload the (RLE-compressed) diffusemap and specularmap (in TGA format) to the darkmod_hires SVN repository (into the tga_backup subfolder).
- Upload the working source file (PSD/Gimp) to the texture_src repository.