3DModels:Textures: Difference between revisions

From Spring
Jump to navigationJump to search
mNo edit summary
Bruski (talk | contribs)
No edit summary
Line 1: Line 1:
Textures are stored in the <b>UnitTextures\tatex</b> subdirectory. They may be Windows .BMP format at 24 bit color depth, or a Targa .TGA file in 32 bit (alpha layer) color depth.
Textures are stored in the <b>UnitTextures</b> directory. They may be Windows .BMP format at 24 bit color depth, or a Targa .TGA file in 32 bit (alpha layer) color depth.


==Rules for textures==
==Rules for textures==
Spring only has support for 2048x2048 pixels worth of textures installed at any given time. However, the game sorts the textures on this sheet (which only exists while the game is loaded) very well, so if you follow a few simple rules the texture limit will be no problem:
Ota style one texture per face has only 2048x2048 pixels of space for all the textures to be stored which can caues problems for mods with a large number of different textures.
However there is unlimited space for s3o style textures which can be upto 2048x2048 pixels each, although you will probably only need this much for the most detailed units, 512x512 or 1024x1024 would normally suffice.


*Keep textures limited to dimensions that are base-2 numbers, such as 8x8, 16x16, 32x32, or 64x64. They may also be oblong, 64x32 for example.
The UV mapped textures can be named what you want but need to be linked to the s3o file by loading it in UpSpring.
*Keep your textures as small as possible while still looking good. You can use a texture which is 256x256 pixels, for example, but a set of those would quickly eat up the available space.
*Don't make "shaded" textures like Cavedog did for Total Annihilation; let Spring handle the shading instead.
 
For Spring to read your textures, they must also be named properly. For example, if you use the texture "MetalTexture1" on your 3do file, the texture must be named "MetalTexture100.bmp".


==Logo Textures==
==Logo Textures==
Line 14: Line 11:


==Reflections==
==Reflections==
<b>Unknown value in spring, edit later</b>
To make a texture reflect its environment, you must create a Targa file with an alpha layer with a program such as the [http://gimp-win.sourceforge.net/stable.html GIMP] or [http://www.adobe.com/products/tryadobe/main.jsp#product=39 Photoshop]. Targa textures follow the same rules above as bitmaps, however, Spring will display reflections on the texture in game if the user has that graphics option enabled and available to him. In the alpha layer itself, a darker shade will reflect less, whereas a lighter shade will reflect more.
To make a texture reflect its environment, you must create a Targa file with an alpha layer with a program such as the [http://gimp-win.sourceforge.net/stable.html GIMP] or [http://www.adobe.com/products/tryadobe/main.jsp#product=39 Photoshop]. Targa textures follow the same rules above as bitmaps, however, Spring will display reflections on the texture in game if the user has that graphics option enabled and available to him. In the alpha layer itself, a darker shade will reflect less, whereas a lighter shade will reflect more.
<b>End unknown value</b>
It should be noted that some image editors have trouble setting alpha layers to 100% and cause Spring to display the image as completely black, hence it is suggested you make it about 99%.


==Conversion from .gaf==
==Conversion from .gaf==

Revision as of 10:05, 12 March 2006

Textures are stored in the UnitTextures directory. They may be Windows .BMP format at 24 bit color depth, or a Targa .TGA file in 32 bit (alpha layer) color depth.

Rules for textures

Ota style one texture per face has only 2048x2048 pixels of space for all the textures to be stored which can caues problems for mods with a large number of different textures. However there is unlimited space for s3o style textures which can be upto 2048x2048 pixels each, although you will probably only need this much for the most detailed units, 512x512 or 1024x1024 would normally suffice.

The UV mapped textures can be named what you want but need to be linked to the s3o file by loading it in UpSpring.

Logo Textures

In the case of logo textures, you must edit the file teamtex.txt in the UnitTextures/tatex directory. It is easy to understand. Just add the name of your texture to the list, without the "00" as previously detailed. For example, if you wanted to add ArmLogo00.bmp to the team color list, you would put ArmLogo in the teamtex.txt file. As team colors are sequential, you must have a file for each different color. If you have ArmLogo00.bmp, there must also be an ArmLogo01.bmp, ArmLogo02.bmp, etc which match the colors of the other team textures available (it would look weird if the paint job was blue but the logo was red!).

Reflections

Unknown value in spring, edit later To make a texture reflect its environment, you must create a Targa file with an alpha layer with a program such as the GIMP or Photoshop. Targa textures follow the same rules above as bitmaps, however, Spring will display reflections on the texture in game if the user has that graphics option enabled and available to him. In the alpha layer itself, a darker shade will reflect less, whereas a lighter shade will reflect more. End unknown value

It should be noted that some image editors have trouble setting alpha layers to 100% and cause Spring to display the image as completely black, hence it is suggested you make it about 99%.

Conversion from .gaf

In Total Annihilation textures were stored in /Textures/*.gaf. If you're porting an old TA mods, there will be hundreds of textures to convert to Spring format. There is an easy way to automatically extract all the texture from all the .gaf into well named .bmp : Download GAF Dump. Then run GAFDump.exe, from inside the folder your textures are, and with the -b commandline option.