CompressonatorCompressonator is a set of tools to allow artists and developers to more easily create compressed texture assets or model mesh optimizations and easily visualize the quality impact of various compression and rendering technologies.
Creating textures is not an intuitive process, but not an overly difficult task either. Unlike modern engines, there is no “ drag and drop, and it just works” here, you must do most of the work yourself.The Story of the VTF and the VMTTextures are split into two files: the VTF ( Valve Texture Format), a file containing the image data, the pixels of your texture, and the VMT ( Valve Material Type), a file containing metadata and shader details about the texture.
Both are used together when displaying a texture in the games. The VTFA VTF (.vtf) file contains all the pixel data, alpha maps and mipmaps that a texture can use.They are created by converting an existing image file using a special program.
The internal data is organised in a way which is most efficient for rendering, this is why normal.jpgs/.pngs can’t be used without conversion. The most important factor is that the dimensions of the image must be a power of 2, (i.e. 64×64, 128×128, 256×256, 1024×1024 and so on)A detailed technical analysis of the VTF implementation can be found on the.
The VMTA VMT (.vmf) file is a plain text file which defines metadata about the texture.It includes information such as:. Is the texture translucent?. Is it animated?.
Does it have normal/bump maps?. What noise should it make when hit?You can have more than one VMT file pointing to the same VTF image, but with different properties defined, which will make Hammer and the game treat the image as separate textures. Other advanced VMT features that make a texture more realistic will be covered in a future tutorial.A more detailed technical analysis of the VMT implementation can be found on the.Texture CreationLet’s get down to it. I will be using the to make a texture from.The circular logo is surrounded by transparency, but we will deal with that later. The image size is a whopping 1418×1418 pixels, which I resized to a power of 2 of 1024×1024. In reality you would want to use the smallest possible size, and only use textures this big for important stuff. Images of 512×512 pixels are a good basis for most textures.To get our image from a normal format to a VTF, we need to use a program to convert it.
Valve include one called with their games, it’s a basic command line tool that can only convert from TARGA (.tga) files. Logitech scanman 256 manual pdf. There is a much better alternative, which works with most image files and has many more features, including a straight forward user interface. File TypesVTFEdit can open.bmp,.jpg,.gif,.png,.tga.If you are unfamiliar with the types of image formats, all you really need to know is:. PNG, GIF & TGA support transparency,. GIF supports animation (but has to be split it into frames to import them). JPG is recommended for everything else. Don’t touch BMPPNG-8 vs PNG-2424-bit PNG files support variable transparency, so for variable transparency we must use TGA.
TARGA (.tga) ImagesTARGA is an old weird image format, it has plenty of nice features, but has been mainly overtaken in most industries by PSD or PNG files. The primary issue that you will have with it is trying to find a program that can output/edit them. As you may have guessed, Photoshop is the weapon of choice for this. VTFEdit/VTEX love TARGAs, so if you are experiencing any import issues, converting to a TGA file might be your solution. Importing into VTFEditAt this point I assume you have your source image ready to roll. FileImport your image.Firstly you will be greeted with this menu.
Custom Textures in HammerBing Bang boom, your new texture is in game.Creating Textures with Transparency. Make sure your source image has transparency/Alpha Channel (TGA works best here). Use a compression that supports Alpha (the default DXT5 is fine).
Add this to your VMT: “ $translucent 1“. And that should be it.Creating Animated TexturesMost of the work in creating animated textures is before the import process, as the frames of the animation needs to be in separate image files. This can be a pain, but. Custom Texture ResultThe bottom left texture is an animated texture, the top texture is static, but is using some magic in the VMT file to achieve animation. This will be covered in a future tutorial, but have a look at the source in the included download at the bottom of the page.Packing Textures into Your MapThings get a little game specific here.
If you are wanting to distribute your map with custom textures online, then the best way to do this is to pack the textures into the BSP file.For Garry’s Mod addons, you don’t have to do this, as the GMA addon structure preserves file hierarchy. However, if you want people to host your map on their servers and you don’t want them to bug you with “your map sux it has missing textures” messages, then you better just pack your textures into the map file anyway. This happens as people will always decompile your GMA file, so they can use rather than workshop to host their server files.So how do you pack files into a map? You use.Pakrat is a program that allows you to open up a BSP map file and modify the information stored inside. BSP files are containers (like.zip files), they can hold multiple files within themselves, usually the map data, light data, cubemap textures and any custom content you want to ship your map with. PakratThe next step is rather straightforward, open your compiled map, press “Add” and add your textures.Pay attention to the Path column, it should be something like “ materials/yoursubfolder/“.Save the map, and you’re done. For testing rember to remove your textures from the games materials folder to see if the files included in the bsp actually work, or better yet, test it on another computer.Useful Notes.
Check the console if you are having issues, it may give you some insight into why a texture isn’t working correctly. Source caches texture data, so a “reload” command won’t show any changes you have made, load another map and then load back, or restart the game to see any changes.
Valve Source Sdk
This is also true for hammer, but only a restart can cause an update, thankfully hammer is fast to load. Check the VTF version when importing into VTFEdit, different games only support some versions, 7.2 is a well supported (but old) version.Download Tutorial FilesYou can download all the source images from this tutorial, and the output files to play about with.More Source Mapping TutorialsAbout this Article.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |