Opacity map

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m
 
(Some cleanup; added Category:Texture mapping.)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
An Opacity map is typically a gray scale or single color texture map. Opacity maps represent the '''alpha''' channel or '''A''' part of a diffuse color map.  The diffuse map contains the '''RGB''' '''(red, green, blue)''' components. Older versions of the Trainz game required an opacity map be present when an alpha channel was required.
+
An '''opacity map''' is typically a gray scale or single color texture map. Opacity maps represent the '''alpha''' channel or '''A''' part of a [[diffuse map]].  The diffuse map contains the '''RGB (red, green, blue)''' components. Older versions of the Trainz game required an opacity map be present when an alpha channel was required.
  
 
The opacity map was frequently just a reference to the same diffuse map as it already contained RGBA components. Almost all Trainz materials were once [[m.onetex]]. Now Trainz supports many materials, each requiring multiple texture maps, and each texture map potentially requiring an alpha channel.  As there was no way to specify opacity (alpha) maps for each texture, content creators were required to hand edit the [[.texture.txt Files|.texture.txt]] files and manually reference the opacity texture maps.  The current [[Max Exporters | exporter]] allows a single RGBA texture to be specified for any texture map and will generate an appropriate [[.texture.txt Files|.texture.txt]] file.
 
The opacity map was frequently just a reference to the same diffuse map as it already contained RGBA components. Almost all Trainz materials were once [[m.onetex]]. Now Trainz supports many materials, each requiring multiple texture maps, and each texture map potentially requiring an alpha channel.  As there was no way to specify opacity (alpha) maps for each texture, content creators were required to hand edit the [[.texture.txt Files|.texture.txt]] files and manually reference the opacity texture maps.  The current [[Max Exporters | exporter]] allows a single RGBA texture to be specified for any texture map and will generate an appropriate [[.texture.txt Files|.texture.txt]] file.
Line 9: Line 9:
 
* Almost all materials were once [[m.onetex]] and the 3ds Max Material Editor had plenty of free texture slots, the opacity channel chosen to specify the alpha channel.
 
* Almost all materials were once [[m.onetex]] and the 3ds Max Material Editor had plenty of free texture slots, the opacity channel chosen to specify the alpha channel.
  
With [[TS2009]] a separate opacity map is not needed or recommended.  Here are some recommendations and justifications:
+
With [[TS2009]], a separate opacity map is not needed or recommended.  Here are some recommendations and justifications:
 
* Textures should be 24bit (RGB) or 32bit (RGBA) .TGA files. 24bit RGB if opaque, 32bit RGBA if transparent or alpha channel is required. The TGA file format is not compressed, so no texture quality will be lost. When the texture is used in the game, it will have been compressed to an appropriate format depending on its type.
 
* Textures should be 24bit (RGB) or 32bit (RGBA) .TGA files. 24bit RGB if opaque, 32bit RGBA if transparent or alpha channel is required. The TGA file format is not compressed, so no texture quality will be lost. When the texture is used in the game, it will have been compressed to an appropriate format depending on its type.
 
* The presence of an alpha channel still determines if transparency is used. So if part of a mesh (ie. cabin windows) use transparency, use two different materials and textures, one for the opaque sections, the other for the transparent ones.
 
* The presence of an alpha channel still determines if transparency is used. So if part of a mesh (ie. cabin windows) use transparency, use two different materials and textures, one for the opaque sections, the other for the transparent ones.
 
* Specify transparent textures by selecting an RGBA texture and make sure the alpha channel is used as a source.  Refer to ''[[Exporting with 3D Studio Max]]'' for more details.
 
* Specify transparent textures by selecting an RGBA texture and make sure the alpha channel is used as a source.  Refer to ''[[Exporting with 3D Studio Max]]'' for more details.
 +
 +
[[Category:Texture mapping]]

Latest revision as of 12:01, 5 September 2011

An opacity map is typically a gray scale or single color texture map. Opacity maps represent the alpha channel or A part of a diffuse map. The diffuse map contains the RGB (red, green, blue) components. Older versions of the Trainz game required an opacity map be present when an alpha channel was required.

The opacity map was frequently just a reference to the same diffuse map as it already contained RGBA components. Almost all Trainz materials were once m.onetex. Now Trainz supports many materials, each requiring multiple texture maps, and each texture map potentially requiring an alpha channel. As there was no way to specify opacity (alpha) maps for each texture, content creators were required to hand edit the .texture.txt files and manually reference the opacity texture maps. The current exporter allows a single RGBA texture to be specified for any texture map and will generate an appropriate .texture.txt file.

There were several reasons for independantly specifying the opacity map:

  • Materials could determine if they were opaque or transparent based on the presence of an alpha channel in the material configuration.
  • The same texture could be shared between two logical materials, one part opaque the other transparent.
  • Classic .BMP and .JPG files, supporting 8 and 24 bit textures, could be used to specify a single 32bit texture.
  • Almost all materials were once m.onetex and the 3ds Max Material Editor had plenty of free texture slots, the opacity channel chosen to specify the alpha channel.

With TS2009, a separate opacity map is not needed or recommended. Here are some recommendations and justifications:

  • Textures should be 24bit (RGB) or 32bit (RGBA) .TGA files. 24bit RGB if opaque, 32bit RGBA if transparent or alpha channel is required. The TGA file format is not compressed, so no texture quality will be lost. When the texture is used in the game, it will have been compressed to an appropriate format depending on its type.
  • The presence of an alpha channel still determines if transparency is used. So if part of a mesh (ie. cabin windows) use transparency, use two different materials and textures, one for the opaque sections, the other for the transparent ones.
  • Specify transparent textures by selecting an RGBA texture and make sure the alpha channel is used as a source. Refer to Exporting with 3D Studio Max for more details.
Personal tools