VTF Shell Extensions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Tweaking: typos)
Line 32: Line 32:
Both extensions are written in Visual Studio .NET 7.1 and use ATL 7.
Both extensions are written in Visual Studio .NET 7.1 and use ATL 7.


The thumbnail attempts to be a little "smart" in how it chooses to display various types of [[VTF]] file. In all cases it initially only reads the header from the VTF file (64 bytes) and using the data in it, calculates where in the [[VTF]] file the data it wants resides. Regardless of the actual [[VTF]] images dimension, it only attempts to read the [[MIP]] image equal or nearest to 256 x 256 pixels. This is done to save memory and processing time. Once it know where this data is, it goes direct to that location in the file, reads only the data it needs, converts the image format back into 32-bit and renders it as a thumbnail.
The thumbnail attempts to be a little "smart" in how it chooses to display various types of [[VTF]] file. In all cases it initially only reads the header from the VTF file (64 bytes) and using the data in it, calculates where in the [[VTF]] file the data it wants resides. Regardless of the actual [[VTF]] images dimension, it only attempts to read the [[MIP]] image equal or nearest to 256 x 256 pixels. This is done to save memory and processing time. Once it knows where this data is, it goes direct to that location in the file, reads only the data it needs, converts the image format back into 32-bit and renders it as a thumbnail.


Currently, the shell extension supports all published image storage formats published in the [[VTF]] specification '''except''' for ''IMAGE_FORMAT_P8''. 16bpp(bits per pixel) textures are downsampled to 8bpp before display.
Currently, the shell extension supports all published image storage formats published in the [[VTF]] specification '''except''' for ''IMAGE_FORMAT_P8''. 16bpp(bits per pixel) textures are downsampled to 8bpp before display.

Revision as of 13:09, 21 September 2005

Extension in Windows XP displaying thumbnails for a folder full of VTF format images.
Info Columns extension adding extra details about VTF files in a folder

VTF Shell Extensions are two DLL plug-ins which, when installed, extend the Windows 2000/XP folder view to add support for Valves VTF texture format files.

The two DLLs each deal with a seperate aspect - the first adds thumbnail support for VTF textures, allowing you to preview a texture without converting it or opening it in another application. The second adds additional information columns in detail view, giving you access to information about file dimensions, storage format, header flags, etc.

Installation

The extensions come with their own installer which handles copying of the DLLs to your system folder and registering them as shell extensions. It also provides an entry in the start menu so you can easily uninstall them too. This option is recommended for most users.

If you are an "expert" user and wish to install them by hand, you can download the DLLs in a seperate ZIP file and add them to your system yourself using RegSvr32 command.

Notes for Users

The thumbnail extension will show a thumbnail up to 256 x 256 pixels. If your image is smaller than this or one side is smaller (e.g. 256 x 128) the texture will not be stretched or scaled to fit the thumbnail window. For example, if you set your thumbnails to display at 128 x 128 a VTF image of 64 x 64 would display in the centre with a white border around it.

If the VTF texture is animated, the thumbnail will be made from the first frame in the animation. If the texture is an environment map (cube map), it will first check to see if the texture contains a pre-rendered spheremap and show that and if not, show the first face in the map (CUBEMAP_FACE_RIGHT).

For the info columns extension, the data in the columns is shown as it's text or numerical value. The status of a header flag is shown as a simple Yes/No with yes indicating that the flag is set and vice-versa. However in the case of the filter flags (TEXTUREFLAGS_POINTSAMPLE, TEXTUREFLAGS_TRILINEAR and TEXTUREFLAGS_ANISOTROPIC) these are combined into a single column with the word Bilinear, Trilinear or Anisotropic indicating which flag is set. For the TEXTUREFLAGS_CLAMPS and TEXTUREFLAGS_CLAMPT pair, the colum will show S, T or S/T to indicate which ones are set.

For cases where the values in the header would be meaninless, the value show for a file is left blank. A good example of this is if a texture has no low-res image. In this case the column for the low-res image dimensions and format will show nothing.

Tweaking

It's possible to tweak the thumbnail extension to show larger or smaller thumbnails as you desire. There are two ways of doing this:

  • By using Microsoft's TweakUI tool.
  • By manually setting a registry value.

For the first method, download and install TweakUI. Under the 'Explorer' option you'll find a sub-section entitled 'Thumbnails'. Selecting this will bring up a configuration screen which will let you alter the relative quality of the thumbnails and their dimensions in pixels. The maxium is 256 x 256 pixel.

For the second method, using RegEdit find HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer. Make a new DWORD value named ThumbnailSize. Double click the value and type in a number in decimal anywhere from 32 to 256 representing the thumbnail size in pixels you desire.

Technical Info

Both extensions are written in Visual Studio .NET 7.1 and use ATL 7.

The thumbnail attempts to be a little "smart" in how it chooses to display various types of VTF file. In all cases it initially only reads the header from the VTF file (64 bytes) and using the data in it, calculates where in the VTF file the data it wants resides. Regardless of the actual VTF images dimension, it only attempts to read the MIP image equal or nearest to 256 x 256 pixels. This is done to save memory and processing time. Once it knows where this data is, it goes direct to that location in the file, reads only the data it needs, converts the image format back into 32-bit and renders it as a thumbnail.

Currently, the shell extension supports all published image storage formats published in the VTF specification except for IMAGE_FORMAT_P8. 16bpp(bits per pixel) textures are downsampled to 8bpp before display.

Revision History

Version 1.0.1

  • Updated to VS.NET/ATL7
  • Added support for all listed image storage formats (except 8-bit paletted)
  • Limit image used in thumbnail generation to 256x256.
  • Fixed problem with animated textures not showing properly.
  • Fixed problem with cubemaps not showing properly.
  • Added additional info columns.

Version 1.0.0

  • Initial release

See also

External Links