Valve Texture Format:fr

From Valve Developer Community
Jump to: navigation, search
English (en)Français (fr)Русский (ru)
... Icon-Important.png

Le VTF est un [format] propriétaire de Vavle utilisé par le Moteur Source. Il sont assigné à une surface et contrôler par un VMT. Bien souvent on utilises plusieurs VTF pour une surface, par exemple pour un sol rugueux on utilise la texture de base plus une texture de Bump, soit deux VTF.

Les fichier VTF peuvent être converties à partir de TGA, un bon format pour travaillé. Il est recommandé d'utiliser VTFEdit pour la conversion, ce logiciel possède une interface contrairement à Vtex, et peut crée les VMT facilement. Il vous faudra ensuite choisir une compressions.

Comme dans tous moteur de jeux il est important de mettre pour vos textures une résolutions en multiple de 2. Par exemple 512*512 ou 1024*512 sont correct.

1
2
4
8
16
32
64
128
256
512
1024
2048
4096

Capacitée du format

Ce format peut stocker vos textures, mais aussi un environement map, des textures volumetriques ; et chacun peut avoir plusieurs frames. Frame? C'est une suites d'images dans le même VTF, par exemple pour réaliser une texture animée; l'eau est un belle exemple.


  • Une map d'environement est une texture en 6 face deplier pour pouvoir former un cubemap, ou elle peut être une simple face deformer pour s'ajuster sur une sphere. (mais cela est deconseiller).
  • Pour chaque image, le VTF contient votre texture de base, plus la même en differentes resolutions plus basse : le MIPMAP. Le moteur ajuste ainsi selon la distance quelle texture il prendra.
  • Le VTF peut aussi inclure des données comme :
    • Une clé pour indiquer le départ d'une animations
    • L'echelle du bumpmap
    • Les vecteur de reflexion
    • Une petite image pour la visualiser dans hammer

Compressions d'image

Vous pouvez choisir un format de compression avec pertes (DXT) ou non compresser, mais les fichier images seront volumineux.

Compression supportée

Format Red Bits Green Bits Blue Bits Alpha Bits Total Bits Compressed Supported Comment
A8 0 0 0 8 8 False True
ABGR8888 8 8 8 8 32 False True
ARGB8888 8 8 8 8 32 False True
BGR565 5 6 5 0 16 False True
BGR888 8 8 8 0 24 False True
BGR888_BLUESCREEN 8 8 8 0 24 False True
BGRA4444 4 4 4 4 16 False True
BGRA5551 5 5 5 1 16 False True
BGRA8888 8 8 8 8 32 False True
BGRX5551 5 5 5 0 16 False True
BGRX8888 8 8 8 0 32 False True
DXT1 N/A N/A F:ru&action=edit&redlink=1N/A 0 4 True True
DXT1_ONEBITALPHA N/A N/A N/A 1 4 True True
DXT3 N/A N/A N/A 4 8 True True Uninterpolated Alpha
DXT5 N/A N/A N/A 4 8 True True Interpolated Alpha
I8 N/A N/A N/A N/A 8 False True Luminance (Grayscale)
IA88 N/A N/A N/A 8 16 False True Luminance (Grayscale)
P8 N/A N/A N/A N/A 8 False False Paletted
RGB565 5 6 5 0 16 False True
RGB888 8 8 8 0 24 False True
RGB888_BLUESCREEN 8 8 8 0 24 False True
RGBA16161616 16 16 16 16 64 False True HDR Format
RGBA16161616F 16 16 16 16 64 False True Floating Point HDR Format
RGBA8888 8 8 8 8 32 False True
UV88 N/A N/A N/A N/A 16 False True
UVLX8888 N/A N/A N/A N/A 32 False True
UVWQ8888 N/A N/A N/A N/A 32 False True
Comparison of how DXTn compression affects different types of images

Choix de la compression

Mais heureusement seul quelque-un vont nous servir :

  • BGR888: Utiliser celui-ci pour une texture sans canal alpha et avec des dégradé très fins.(bump ou halo pour les lumières).
  • BGRA8888: Utiliser celui-ci pour une texture sans canal alpha et avec des dégradé très fins.(bump ou halo pour les lumières).
  • DXT1: Pour une utilisation courante sans canal alpha.
  • DXT3: Pour une utilisation courante avec canal alpha et avec dégrader net.
  • DXT5: Pour une utilisation courante avec canal alpha et avec dégrader lisse.
  • I8: Pour une txture noir et blanc sans canal alpha et avec des dégradé très fins (halo pour les lumières).
  • IA88: Pour une txture noir et blanc avec canal alpha et avec des dégradé très fins (fumé ou halo).
  • RGBA16161616F: Pour HDR.
  • UV88: Pour DuDv.

Image flags

A VTF file can contain the following flags:

Flag Value Comment
Point Sampling 0x0001 Low quality texture filtering.
Trilinear Sampling 0x0002 Medium quality texture filtering.
Clamp S 0x0004 Clamp S coordinates.
Clamp T 0x0008 Clamp T coordinates.
Anisotropic Sampling 0x0010 High quality texture filtering.
Hint DXT5 0x0020 Used in skyboxes. Makes sure edges are seamless.
No Compress 0x0040 No DXT compression used.
NORMAL 0x0080 Texture is a normal map.
No Mipmaps 0x0100 Render largest mipmap only.
No LOD 0x0200 Use largest mipmap set, even on old hardware.
Min Mipmap 0x0400
Procedural 0x0800 Texture is an procedural texture (code can modify it).
One Bit Alpha 0x1000 One bit alpha channel used.
Eight Bit Alpha 0x2000 Eight bit alpha channel used.
Environment Map 0x4000 Texture is an environment map.
Render Target 0x8000 Texture is a render target.
Depth Render Target 0x10000 Texture is a depth render target.
No Debug Override 0x20000
Single Copy 0x40000
One Over Mipmap Level In Alpha 0x80000 Fill the alpha channel with 1/Mipmap Level. (Internal to VTEX?)
Premultiply Color By One Over Mipmap Level 0x100000 (Internal to VTEX?)
Normal To DuDv 0x200000 Texture is a DuDv map. (Internal to VTEX?)
Alpha Test Mipmap Generation 0x400000 (Internal to VTEX?)
No Depth Buffer 0x800000
Nice Filtered 0x1000000 Use NICE filtering to generate mipmaps. (Internal to VTEX?)
Clamp U 0x2000000 Clamp U coordinates (for volumetric textures).


Version history

v7.4

  • Released October 10th, 2007 as part of The Orange Box.
  • Bitwise equivalent to v7.3.
  • Addresses issues related to how gamma-correction is performed on textures for TV-output on XBOX 360 combined with hunting down OS Paged Pool Memory.

v7.3

  • Added an extensible resource orientated structure.
  • Added CRC, Texture LOD Control and Sheet resources, along with backwards compatible Image and Low Resolution Image resources.
  • Added several vendor specific depth-stencil formats (for internal engine use), along with normal map formats and linear uncompressed formats.
  • Released September 18th, 2007 as part of the Team Fortress 2 beta.

v7.2

  • Added volumetric texture support.
  • Released September 23rd, 2005 as a Steam engine update.

v7.1

  • Added spheremap support to environment maps. (This was intended for DirectX 6 support which was later cut.)

v7.0

  • Initial release. (Internal release only, however, some v7.0 textures made it to the published title.)

Implementation

An example Steam independent implementation of the VTF image file format can be found in the LGPL C/C++ library VTFLib.

Utilities

3DSMax VTF plugin
3D Studio Max 6/7/8 VTF Plug-in.
IrfanView
General purpose image viewer with optional VTF support (see PlugIns section).
Paint.NET Plug-in
Paint.NET VTF Plug-in.
Photoshop Plug-in
Photoshop 6 (and up) VTF Plug-in.
Shell Extension
Windows XP/2000 VTF shell extension.
VTFTool
Windows based VTEX and VTF2TGA replacement.
VTFCmd
VTF and VMT command line editing tool (VTEX clone).
VTFEdit
VTF and VMT viewer and editing GUI.
VTF Explorer
VTF and VMT viewer\explorer GUI. Easy and extensible VMT creation. Can browse GCF files.
studiocompiler
includes VTF and VMT compile & decompile GUI.