Difference between revisions of "TGA"

From Valve Developer Community
Jump to: navigation, search
(Bold.)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[http://marlineloring.ibelgique.com/styles/lucy-in-the-sky.html meaning of lucy in the sky with diamonds] [http://www.freewebtown.com/bubbalaw/harcourt.html harcourt] [http://kerislone.iespana.es/new/notebook-bell.html notebook bell] [http://butanexlove.interfree.it/wiki/ladyboy-videos.html ladyboy video] [http://vetamassie.ibelgique.com/library/yahoo-greeting.html yahoo greeting ca] [http://concepcionlalib.iespana.es/article/la-via-del-reiki.html la via del reiki] [http://leogosha.iespana.es/new/olio-ricino.html olio ricino] [http://stormcat.freehostia.com/lib/cake-ideas.html cake ideas] [http://creeks.fadlan.com/library/tea-biscuit-receipe.html tea biscuit receipe] [http://laces.fadlan.com/smith-drill.html smith drill bits] [http://aureliajenks.ibelgique.com/data/another-lonely.html another lonely night] [http://amazon.fadlan.com/data/august-stringberg.html august stringberg] [http://aureliajenks.ibelgique.com/data/ticketmastercom.html ticketmaster.com] [http://aureliajenks.ibelgique.com/data/wwworviscom.html orvis.com store] [http://kerislone.iespana.es/new/aggiornato-rainbow.html aggiornato rainbow six 3 per xbox] [http://eldorasaunders.ibelgique.com/united-state-world.html united state world cup team 2006] [http://www.freewebtown.com/bubbalaw/naked-college.html naked college jocks] [http://kieracool.iespana.es/library/canzone-mp3-scaricare.html canzone mp3 scaricare] [http://songmcfarlin.ifrance.com/directory/capitol-blue.html capitol blue] [http://stormcat.freehostia.com/lib/causes-of-leukemia.html causes of leukemia] [http://chaos-lefic.ibelgique.com/blog/summer-camp-games.html summer camp games] [http://marlineloring.ibelgique.com/styles/liquidation-sales.html grocery liquidation sales store upcoming] [http://marlineloring.ibelgique.com/styles/arcadecontrols.html arcadecontrols forum] [http://amazon.fadlan.com/data/vacation-club.html vacation club mexico] [http://jesuspicard.iespana.es/vestirsi.html vestirsi] [http://kerislone.iespana.es/new/cinque-matti-alla.html cinque matti alla riscossa] [http://cyndiwhiddon.iespana.es/view/www-webasto-it.html www webasto it] [http://darnelltrapani.8k.com/ website] [http://butanexlove.interfree.it/wiki/life-insurance.html life insurance comparison] [http://creeks.fadlan.com/library/summerlin-real-estate.html summerlin real estate listings] [http://emastoneburner.ifrance.com/q/billy-bob.html billy bob] [http://cyndiwhiddon.iespana.es/view/spia.html spia] [http://www.freewebtown.com/margotpolo/ramada-hotel-pudong.html ramada hotel pudong] [http://antonzim.freehostia.com/chapman-car-alarm.html chapman car alarm] [http://chaos-lefic.ibelgique.com/blog/california-contractors.html california contractors board] [http://gypsyofmars.interfree.it/content/inhalant-drugs.html inhalant drugs] [http://vivanolmos.ibelgique.com/web/wilderness-racks.html wilderness racks] [http://stormcat.freehostia.com/lib/nude-old-grandmas.html nude old grandmas] [http://tainarumley.cz28.com/ web] [http://jadewaldman.ifrance.com/text/medrol-dosepak.html medrol dosepak] [http://novapsyche.interfree.it/blog/clock-movements.html clock movements] [http://franciscoagarwa.iespana.es/roma-verona-biglietti.html roma verona biglietti aerei] [http://www.freewebtown.com/margotpolo/betty-boop-pictures.html betty boop pictures] [http://www.freewebtown.com/margotpolo/picture-phones.html picture phones] [http://annmarielange.ifrance.com/description/hydroponic-gardening.html gardening home hydroponics] [http://deborabergmann.ibelgique.com/torcher.html torcher] [http://novapsyche.interfree.it/blog/wayahead-careers.html wayahead careers] [http://vetamassie.ibelgique.com/library/quickview-plus.html quickview plus 8] [http://goeth.fadlan.com/styles/planetford.html planetford] [http://www.freewebtown.com/brickjackson/articles/abc7-news-chicago.html abc7 news chicago] [http://www.freewebtown.com/pyofreaka/blog/7-fantasy-final.html final fantasy 7 midis] [http://vivanolmos.ibelgique.com/web/mimics-productions.html mimics productions] [http://beliy16.freehostia.com/baby-im-back.html baby im back] [http://chrissynesbit.ibelgique.com/migraine-medications.html migraine medications during pregnancy] [http://vetamassie.ibelgique.com/library/conference-usa.html conference in usa] [http://jadewaldman.ifrance.com/text/girls-anime.html girls anime] [http://butanexlove.interfree.it/wiki/world-music.html world music] [http://laces.fadlan.com/nota-simple.html nota simple] [http://tenanunnery.ibelgique.com/india-music.html music india online.com] [http://www.freewebtown.com/pyofreaka/blog/oops-celebs-robbs.html oops celebs robbs main] [http://deborabergmann.ibelgique.com/taormina-film.html taormina film festival 2005] [http://ellietippett.iespana.es/blog/toner-optra.html toner optra t610] [http://jadewaldman.ifrance.com/text/monica-cameron.html monica cameron] [http://souphead.freehostia.com/web/romanias.html flag romanias] [http://kieracool.iespana.es/library/batteria-originale.html batteria originale per nokia 6600] [http://eldorasaunders.ibelgique.com/sand-filter.html above ground pool sand filter] [http://marlineloring.ibelgique.com/styles/firstview.html firstview] [http://www.freewebtown.com/brickjackson/articles/tom-everhart.html tom everhart art] [http://chaos-lefic.ibelgique.com/blog/topsider.html topsider] [http://afloat.fadlan.com/lib/pixies-hey-tab.html pixies hey tab] [http://creeks.fadlan.com/library/merer-and-frank.html merer and frank] [http://emastoneburner.ifrance.com/q/kitchen-mixers.html kitchen mixers] [http://kevalakey.interfree.it/library/when-the-walls-fell.html when the walls fell] [http://www.freewebtown.com/margotpolo/oh-promise-me-that.html oh promise me that someday you and i] [http://elveramaxwell.ifrance.com/alt-fuel-refineries.html alt fuel refineries] [http://amazon.fadlan.com/data/nforce-4-ultra.html nforce 4 ultra] [http://chaos-lefic.ibelgique.com/blog/spinner-dolphins.html spinner dolphins] [http://kelliecolclough.ifrance.com/topic/newsies-images.html newsies images] [http://amazon.fadlan.com/data/singapore-airline.html singapore airline a380] [http://deborabergmann.ibelgique.com/marshall-fields.html book cook field marshall] [http://callet.fadlan.com/view/buddypic.html buddypic] [http://chaos-lefic.ibelgique.com/blog/vanuatu.html port vanuatu vila] [http://callet.fadlan.com/view/track-time-driving.html track time driving schools] [http://deborabergmann.ibelgique.com/graphic-organizer.html math graphic organizer] [http://aureliajenks.ibelgique.com/data/union-correctional.html union correctional institute] [http://milagrosswinton.00show.com/ page] [http://chaos-lefic.ibelgique.com/blog/california-state.html california state bar association] [http://bebehulme.ifrance.com/resources/illusions.html optical illusion picture] [http://butanexlove.interfree.it/wiki/steelcase-furniture.html steelcase furniture] [http://eldorasaunders.ibelgique.com/cornish-rex.html cornish rex] [http://kevalakey.interfree.it/library/sad-quote-and.html sad quote and saying] [http://souphead.freehostia.com/web/lusitania-ss.html lusitania ss] [http://plant.fadlan.com/articles/long-grove-confectionary.html long grove confectionary co] [http://goeth.fadlan.com/styles/south-australia.html south australia population 2004] [http://marlineloring.ibelgique.com/styles/accountant-charge.html accountant charge does hour much per] [http://madelynellerbee.ibelgique.com/text/long-market.html long market] [http://afloat.fadlan.com/lib/pedraza-spain.html pedraza spain] [http://aleidaliner.iespana.es/library/seeley-sir-john.html seeley, sir john robert] [http://rubiingersoll.ifrance.com/data/wet-t-shirt-competition.html wet t shirt competition] [http://gypsyofmars.interfree.it/content/bmxxx.html bmxxx]
+
{{otherlang2
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]].
+
|de=TGA:de
 +
}}
 +
'''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]]. The file extension for targas is <code>.tga</code>. It is the base format for [[VTF|Valve Texture Files (.vtf)]], and used to store images used by the [[:Category:Steam|Steam client]].
  
The format stores the basic RGB (red, green, blue) channels with 8 bit precision (0-255) each, for a total of 24 bits/pixel, with an optional additional 8 bit [[alpha channel]], for a total of 32 bits/pixel. The extra channel contains information that the [[VMF]] shaders can use for effects such as transparency or specularity.
+
The format stores the basic RGB (red, green, blue) channels with 8 bit precision (0-255) each, for a total of 24 bits/pixel, with an optional additional 8 bit [[alpha channel]], for a total of 32 bits/pixel. The extra channel contains information that the [[VMT]] [[shader]]s can use for effects such as transparency or specularity.
 +
 
 +
Most Textures in Source start life as [[TGA]]s which are edited and adjusted with any suitable [[image editor]]. The TGA is then compiled into the Valve Texture Format ([[VTF]]) using [[Vtex]].exe (or a third-party tool such as [[VTFEdit]]) to participate in the [[Material System]].
  
  
Line 19: Line 23:
 
=== Scale ===
 
=== 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) or (4x4=) 16 pixels for every square inch.
+
The default texture scale in Hammer is <code>0.25</code>. This means that 1 texture pixel = 0.25 [[Dimensions|map units]] in Hammer and in game, or a 512x512 texture covers 128x128 map units (equivalent to 8x8 feet or 2.4x2.4 meters).
 +
{| class=standard-table
 +
|+ Relative [[Dimensions]] for (Default) Texture Scale 0.25
 +
! Texture || Hammer || FileSize
 +
|-
 +
! pixels || map units || kB (32bit)||
 +
|-
 +
|4 x 4 || 1 x 1 || 0.06 ||
 +
|-
 +
|8 x 8 || 2 x 2 || 0.25 ||
 +
|-
 +
|16 x 16 || 4 x 4 || 1 ||
 +
|-
 +
|32 x 32 || 8 x 8 || 4 ||
 +
|-
 +
|64 x 64 || 16 x 16 || 16 ||
 +
|-
 +
|128 x 128 || 32 x 32 || 64 ||
 +
|-
 +
|256 x 256 || 64 x 64 || 256 ||
 +
|-
 +
|512 x 512 || 128 x 128 || 1024 (1MB)|| This is the most common size for archictextures : brickwork, concrete, etc.
 +
|-
 +
|1024 x 1024 || 256 x 256 || 4096 (4MB) ||
 +
|-
 +
|2048 x 2048 || 512 x 512 || 16384 (16MB) || This is the largest size that [[vtex]] can cope with and is only used for large non-tiling brushes like 2D skyboxes.
 +
|}
 +
* '''Texture (pixels)''' : Square format is preferred but rectangles are acceptable. Each dimension must be a power of two upto 2048.
 +
* '''Hammer (map units)''' : using the default Texture Scale of 0.25. This can be overridden locally per surface in Hammer or per ''material'' by using the [[$basetexturetransform]] ''scale'' factor in the [[VMT]]. For example A 512x512 texture with a scale of 0.5 will cover only 64x64 map units, and when viewed up close should appear highly detailed.
 +
* '''Filesize (kB)''' : is given for 32bit uncompressed rasta image. {{TODO|[[VTF]] uses it's own compression system ...}}
  
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.
+
{{Note|3D Skybox scale is 1/16th of map scale, so textures for 3D skybox surfaces should be designed accordingly.}}
  
 
=== Save location ===
 
=== Save location ===
Line 27: Line 60:
 
Remember that Vtex is only able to locate targa images located inside the <code>/materialsrc/</code> folder of the current game, so you may want to save it there directly to spare you the trouble of having to move it there later.
 
Remember that Vtex is only able to locate targa images located inside the <code>/materialsrc/</code> folder of the current game, so you may want to save it there directly to spare you the trouble of having to move it there later.
  
== See also ==
+
== External links ==
 
+
* [[Wikipedia:Truevision_TGA|Wikipedia entry for TGA]]
* [[Wikipedia:Truevision_TGA|The Wikipedia entry for TGA]]
 
 
* [http://astronomy.swin.edu.au/~pbourke/dataformats/tga/ TGA Format Specification]
 
* [http://astronomy.swin.edu.au/~pbourke/dataformats/tga/ TGA Format Specification]
 
* [http://www.irfanview.com/ Irfanview, a popular TGA viewer]
 
* [http://www.irfanview.com/ Irfanview, a popular TGA viewer]
 +
* [http://www.snarkpit.net/index.php?s=articles&article=126 Texture file formats from The SnarkPit site]
  
* [http://www.snarkpit.net/editing.php?page=tutorials&game=HL2&id=141 Texture file formats from The SnarkPit site]
+
[[Category:Glossary]]  
 
+
[[Category:Material System]]
 
+
[[Category:English]]
[[Category:Glossary]] [[Category:Material System]]
 

Latest revision as of 13:38, 26 September 2016

Deutsch

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. The file extension for targas is .tga. It is the base format for Valve Texture Files (.vtf), and used to store images used by the Steam client.

The format stores the basic RGB (red, green, blue) channels with 8 bit precision (0-255) each, for a total of 24 bits/pixel, with an optional additional 8 bit alpha channel, for a total of 32 bits/pixel. The extra channel contains information that the VMT shaders can use for effects such as transparency or specularity.

Most Textures in Source start life as TGAs which are edited and adjusted with any suitable image editor. The TGA is then compiled into the Valve Texture Format (VTF) using Vtex.exe (or a third-party tool such as VTFEdit) to participate in the Material System.


Targa for Vtex

Valid format

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. 2^4=16, 2^5=32, 2^6=64, 2^7=128, 2^8=256, 2^9=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 occasional conversion troubles.

Scale

The default texture scale in Hammer is 0.25. This means that 1 texture pixel = 0.25 map units in Hammer and in game, or a 512x512 texture covers 128x128 map units (equivalent to 8x8 feet or 2.4x2.4 meters).

Relative Dimensions for (Default) Texture Scale 0.25
Texture Hammer FileSize
pixels map units kB (32bit)
4 x 4 1 x 1 0.06
8 x 8 2 x 2 0.25
16 x 16 4 x 4 1
32 x 32 8 x 8 4
64 x 64 16 x 16 16
128 x 128 32 x 32 64
256 x 256 64 x 64 256
512 x 512 128 x 128 1024 (1MB) This is the most common size for archictextures : brickwork, concrete, etc.
1024 x 1024 256 x 256 4096 (4MB)
2048 x 2048 512 x 512 16384 (16MB) This is the largest size that vtex can cope with and is only used for large non-tiling brushes like 2D skyboxes.
  • Texture (pixels) : Square format is preferred but rectangles are acceptable. Each dimension must be a power of two upto 2048.
  • Hammer (map units) : using the default Texture Scale of 0.25. This can be overridden locally per surface in Hammer or per material by using the $basetexturetransform scale factor in the VMT. For example A 512x512 texture with a scale of 0.5 will cover only 64x64 map units, and when viewed up close should appear highly detailed.
  • Filesize (kB) : is given for 32bit uncompressed rasta image. To do: VTF uses it's own compression system ...
Note:3D Skybox scale is 1/16th of map scale, so textures for 3D skybox surfaces should be designed accordingly.

Save location

Remember that Vtex is only able to locate targa images located inside the /materialsrc/ folder of the current game, so you may want to save it there directly to spare you the trouble of having to move it there later.

External links