Left 4 Dead 2
Оценок: 36
VTF-File - Create a Texture
От Floh
Create your own Textures - a description of the tool VTFEdit
   
Наградить
В избранное
В избранном
Удалить
Converting to Texture
Images must be converted to the Valve Texture Format (*.vtf) before the Source Engine can use them. The third-party tool for this is VTFEdit. It provides a graphical user interface, allows you to change a texture's properties without re-compiling it, accepts a wide range of image formats, and doesn't require the creation of script files for each and every texture.

VTF files are generally referenced in a Material instead of being accessed directly, which allows re-use in different ways.

Both textures and materials are stored in subfolders of game_dir/materials/.
Basics
Any image file can be used as a texture, so long as both of its dimensions (height and width) are a power of two: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 and so on. To decide which to use, examine existing textures that fill the same role as yours. Higher resolutions lower performance but make an image sharper when viewed up close.

Different classes of object have different standard resolutions (e.g. character models' are very high). Check Valve's choices in source materials (VPK-Files) with GCFScape if you are ever confused.

Texture source files should be saved in a lossless format like TGA pre-compile, to prevent unnecessary loss in quality.

It is recommended that you save them in TIFF format before importing to VTFedit. As PNG transparency tends to have problems.

Tool VTFEdit
Start up the tool VTFEdit:




and import an image
File --> Import (or press Ctrl+I) --> Select your image

The import screen open:




Index card: General Settings

These settings are the most important

General
1. Normal Format (see appendix: VTF Image Formats)
The color/compression format that should be used if the texture is opaque.

2. Alpha Format (see appendix: VTF Image Formats)
The color/compression format that should be used if the texture has an alpha channel.

3. Texture Type
If you imported more than one image, this determines what they will be used as (animation frames/cubemap faces/depth slices).

NOTE: If you're making a plain and simple world texture you won't need to change any of these. If you're making a texture with fine gradient detail however, you'll need to choose a non-lossy compression mode.


Mipmap Settings
Mipmaps are low-resolution versions of a texture that swap in when a surface is far away from the camera. Mips are required for texture LOD to work. A series of mipmaps used for rendering the texture over varying distances

NOTE: Textures that will appear in the 3D world should have mipmaps. To conserve memory, textures that will only be used in a 2D interface should not.



Click on "OK" and a VTF-File will be created automaticly.




save the VTF-File:
File --> Save As ...

Appendix: VTF Image Formats
The uncompressed formats are not lossy and the compressed (DXT) formats are.

The following formats are the most important:
  • BGR888
    use this format for textures with no alpha channel and very fine gradients (i.e. normal maps or light halos)

  • BGRA8888
    use this format for textures with an alpha channel and very fine gradients (i.e. normal maps or light halos). It can also be used to produce Very High quality textures.

  • DXT1
    use this format for typical textures with no alpha channel

  • DXT3
    use this format for typical textures with an alpha channel with sharp gradients

  • DXT5
    use this format for typical textures with an alpha channel with smooth gradients

  • I8
    use this format for black and white textures with no alpha channel and very fine gradients (i.e. light halos)

  • IA88
    use this format for black and white textures with an alpha channel and very fine gradients (i.e. smoke or light halos)

  • RGBA16161616F
    use this format for HDR textures

  • UV88
    use this format for DuDv maps.
Комментариев: 18
она 10/10 но маленьк 24 мая. 2022 г. в 8:28 
where I can download it?
-=SF=- Ye Old Duck 6 фев. 2021 г. в 12:42 
can this be done with out vtfedit?
a random dude 1 ноя. 2020 г. в 22:38 
Hey im using vtfedit but i cant open the file in vtx. It always said error loading image. Someone helps me
Rammit Inmah Ashol 11 июн. 2018 г. в 13:48 
@Floh Nvm, I was using an older version of 1.2.5 instead of the latest one which is 1.3.3. That's why I couldn't get better resolution as I see other skins having better quality.
Floh  [создатель] 9 июн. 2018 г. в 23:39 
@Rammit Inmah Ashol
maybe the vtf-file get to big - try a smaller resolution
Rammit Inmah Ashol 9 июн. 2018 г. в 8:43 
@Floh I'm trying to import a skin I am making as a 4096 size into VTFedit but keeps popping up
Error creating VTF texture: Error: nvDXTcompress[] crashed.
Floh  [создатель] 19 мар. 2017 г. в 16:25 
@JSSC
if you use a format with alpha channel safe your pictures as psd-files and add an black alpha-channel.


mybutt 19 мар. 2017 г. в 15:07 
@Floh Yeah, I'm not sure what to do. I'm using PS7. I thought all I had to do was convert the .vtf source file (in this case: mechanic_body_color.vtf) in vtfedit to .tga, take it to PS, do my edits for logos and such, save again as .tga, open it back up in vtfedit and re-save as a .vtf so I can recompile it with the folders to repack it as a .vpk and that would be that. But apparently it's more complicated than that.
Floh  [создатель] 19 мар. 2017 г. в 14:35 
@JSSC
proof the alpha-chanel of your picture or normal-map
mybutt 19 мар. 2017 г. в 13:05 
I think I'm saving my files in VTF incorrectly. Anything I create and pull up in-game shows up with a much heavier glossy-like quality. Almost learthery looking. What normal and alpha format is specific to head and body textures?