TGA: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Size = Dimensions (I like that word better.))
(Moved info from Material.)
Line 1: Line 1:
Truevision Graphics Adapter (TGA), commonly referred to as "targa" (Truevision Advanced Raster Graphics Adapter), is a non-proprietary image format from Truevision that is favoured by [[Valve]]. ''.tga'' is also the file extension of that format. It is the base format for [[VTF|Valve Texture Files (.vtf)]], and used to store images used by the [[:Category:Steam|Steam client]].
Truevision Graphics Adapter (TGA), commonly referred to as "targa" (Truevision Advanced Raster Graphics Adapter), is a non-proprietary image format from Truevision that is favoured by [[Valve]]. ''.tga'' is also the file extension of that format. It is the base format for [[VTF|Valve Texture Files (.vtf)]], and used to store images used by the [[:Category:Steam|Steam client]].


[[TGA]] files can be saved with a fourth channel, called the [[Alpha channel]], which usually defines the transparency. (The three basic channels define red, blue, and green content of the image.)  However, [[VMF]] shaders can use the [[alpha channel]] for other information.
Beside the three basic channels (that define the red, green and blue content of the image), targa files can also contain a fourth channel, called the [[alpha channel]], containing information that the [[VMF]] shaders can use for effects such as transparency or specularity.
 




Line 14: Line 15:
* RLE compression is optional, but should be avoided due to occational convertion troubles.
* RLE compression is optional, but should be avoided due to occational convertion troubles.


=== Scale ===
The default texture scale in Hammer is <code>.25</code>. This means that 4 pixels (in an image) = 1 Hammer unit = 1 inch (in game).


For textures that appear on large surfaces a good scale is 512 pixels for 128 [[Dimensions|Hammer-units]]. This is the default scale at which Hammer will apply textures and equals about 10 feet or about 3 meters in the game.
For textures that appear on large surfaces a good scale is 512 pixels for 128 [[Dimensions|Hammer-units]]. This is the default scale at which Hammer will apply textures and equals about 10 feet or about 3 meters in the game.
The image can also contain an [[alpha|alpha channel]] to be used with effects such as transparency or specularity.





Revision as of 10:41, 29 August 2007

Truevision Graphics Adapter (TGA), commonly referred to as "targa" (Truevision Advanced Raster Graphics Adapter), is a non-proprietary image format from Truevision that is favoured by Valve. .tga is also the file extension of that format. It is the base format for Valve Texture Files (.vtf), and used to store images used by the Steam client.

Beside the three basic channels (that define the red, green and blue content of the image), targa files can also contain a fourth channel, called the alpha channel, containing information that the VMF shaders can use for effects such as transparency or specularity.


Valid targa format for Vtex

For a targa image to be recognized as valid by Vtex, it must meet the following criteria:

  • It must be 24 or 32 bits/pixel in depth. (16 bits/pixel is not recognized.)
  • Its dimensions (height and width) must have a pixel size equal to a power of 2. (i.e. 16, 32, 64, 128, 256, 512, etc.)
  • Its dimensions can not be bigger than 2048 pixels.
  • The height and width doesn't need to be the same - 64x128, 256x512 works fine - but square images are preferred by the Source engine, so use them whenever possible, even when it doesn't seem like the best way to go.
  • RLE compression is optional, but should be avoided due to occational convertion troubles.


Scale

The default texture scale in Hammer is .25. This means that 4 pixels (in an image) = 1 Hammer unit = 1 inch (in game).

For textures that appear on large surfaces a good scale is 512 pixels for 128 Hammer-units. This is the default scale at which Hammer will apply textures and equals about 10 feet or about 3 meters in the game.


See also