Importing Custom Textures

From NS2 community wiki

Jump to: navigation, search


Contents

Getting Started

The Spark Engine supports importing your own custom textures to use. You can find an introductory video tutorial to the Spark Engine SDK here.

Saving

When saving your textures, there are a few rules they must meet in order for the Builder application to process them. These rules include file types .tga/psd, dimensions, and image modes. Popular texture dimensions include 256x256, 512x512, 1024x1024, and so on. Your textures must also be saved in the 8-bits/Channel mode in order to work.

When your texture is ready to be saved, it goes into the specified source directory.

Building

Building is done in one of two ways. "Build" is the option to compile any custom textures or models from the source directory into the output directory. It will only look for new files and updated files. "Rebuild" functions the same way, except it will compile everything again. "Verbose" is a toggle option that will give additional details about the compiling process, such as percentage complete. It can be an invaluable tool when you run into trouble.

The Builder application will sometimes skip a custom texture or model. This is because something about the texture or model does not meet the requirements to be compiled.

Creating ".material" Files

Once your textures have been compiled by the Builder, they are still not ready to be used just yet. You must first go to the output directory and create a ".material" file for each of your custom textures. The easiest method to do this is by copying an existing ".material" file, and pasting it in the same folder as your own textures. The ".material" file must be named respectively for each custom. So if your texture is named "metaltile.dds" the material file must be named "metaltile.material".

Once you have your material file pasted and renamed, open it up with a text editor. It will look similar to this:


   <material>
       <maps>
             <map type="texture" value="materials/refinery/metaltile01.dds" />
             <map type="bump" value="materials/refinery/metaltile01_normal.dds" />
             <map type="specular" value="materials/refinery/metaltile01_spec.dds" />
       </maps>
   </material>

Each map has it's own directory inside the material file. You must change these accordingly to your output directory. Some map types are incompatible with others. Incorrect usage can result in your texture failing to work appropriately. If you don't have a bump map or a specular map, don't include those lines. The map types are as follow:

       <map type="texture" value="materials/mapdirectory/texture.dds" />
       <map type="bump" value="materials/mapdirectory/texture_normal.dds" />
       <map type="specular" value="materials/mapdirectory/texture_spec.dds" />
       <map type="emissive" value="materials/mapdirectory/texture_illum.dds" />
       <map type="opacity" value="materials/mapdirectory/texture_opac.dds" />


Each texture can also have it's own surface type specified by adding the properties tag. This tells the Engine the material type of the surface so that the correct Particle Effects and Sound Effects can be created if it is for example shot at or walked on, If this property is not specified then a generic effect will be used by default that may not suit your texture.

       <properties>
               <property type="surface" value="thin_metal" />
       </properties>

With the extra option specified your file should look like this:

   <material>
       <maps>
             <map type="texture" value="materials/refinery/metaltile01.dds" />
             <map type="bump" value="materials/refinery/metaltile01_normal.dds" />
             <map type="specular" value="materials/refinery/metaltile01_spec.dds" />
       </maps>
       <properties>
               <property type="surface" value="thin_metal" />
       </properties>
   </material>

The current know property types are:

   metal
   thin_metal
   rock
   organic


Once you've edited your material file appropriately, save it! After that, it should be fully functioning inside the editor. If not, read below for a solution.

Troubleshooting

nothing,yet

Personal tools