Snarkpit Articles


You?ve probably noticed how annoying it is to have such an obvious border between grass and any other solid material like concrete or pavement. The solution is simple, though: blending two textures (If you don?t know what the heck I?m talking about look-up a displacement tutorial and read about alpha masking).

Here?s what you have to do:

Create an empty notepad document, paste the following text in it (quotes and everything) and save the file as a .vmt.

"WorldVertexTransition"

{
"$basetexture" "nature/snowfloor001a"
"$basetexture2" "concrete/concretefloor037a"
"%tooltexture" "nature/snowfloor003a"
"%keywords" "blend"
}

In the example above, the main texture is ?nature/snowfloor001a? and ?concrete/concretefloor037a? is the alpha that will be applied to the base texture. In this case it means that you can paint a road on the snow surface. The ?snowfloor001a? texture comes with HL2DM but if you?re working with something else look up one of the non-blending grass textures that come with HL2 (like ?nature/grassfloor002a?).

The beauty of blending two materials that already come with the game you?re working for is that there is not need to create a .vtf (valve texture file) at all, the .vmt being enough to get the texture working.

The rest of the strings in there are somewhat optional. For example, ?%tooltexture? defines what the texture will look like in the editor?s texture browser so you can write any texture path you want as it really doesn?t matter. I even left it blank once and it still worked. Still, it might be a good idea to have one of the two blending textures as the tooltexture so that you?ll be able to find it faster. You might also want to give it a relevant keyword. The example?s keyword is ?blend? but there are many other textures with this keyword so giving it a unique one might prove more efficient.

That?s all you need to do. Complicated wasn?t it? For a minimal amount of effort and 20 spare seconds you can have very nice results. Here?s how the example texture looks:



Post ReplyView Topic
Discussion
0 starsPosted by $loth on Sat Sep 29th 2007 at 10:29am

Great tutorial, well written and a very nice example picture.

Nice one, it's a good thing this compiles into the BSP aswell.
0 starsPosted by Joshead on Sun Jun 3rd 2007 at 11:09am

0 starsPosted by Gwil on Fri Mar 24th 2006 at 12:49am

0 starsPosted by fishy on Thu Oct 13th 2005 at 11:53pm

You could even square off the illustration .jpg, and use it as the texture preview in hammer by pointing at it in the %tooltexture string.
i'm not sure if it needs to be a specific size, but the ones i made at 512x512 worked fine.

%tooltexture myblends/snowscene would tell hammer to look in materials/myblends for snowscene.jpg
[author]
Posted by Andrei on Fri Aug 19th 2005 at 9:17pm

Could be a million reasons. Best to take it to the editing forums.
0 starsPosted by Kellorian on Fri Aug 19th 2005 at 5:03pm

How come i get the pink and black checkered design no matter what textures i use together. i made sure they are both counter-strike textures, what am i missing?

- great tutorial btw
0 starsPosted by parakeet on Fri Aug 12th 2005 at 2:14pm

Cant you compile with the textures embedded in the map? .. or was this only for hl1 ? hm...
0 starsPosted by Vix on Sat Aug 6th 2005 at 11:54am

Cool smiley
0 starsPosted by DrGlass on Sat Aug 6th 2005 at 11:30am

Nice tut, its so easy!

(-2 for lack of texture folder info, should really edit that into the tut)

Rival whats to know if you have to zip the VMT with your map. I want to know how to make the texture thumb nail.
[author]
Posted by Andrei on Thu Aug 4th 2005 at 4:05pm

Erm...I have no idea what you're trying to say :x .
Post ReplyView Topic