Some of you are familiar with this tutorial http://www.interlopers.net/tutorials/19882 where the author guides you through the process of using a water texture as a means of achieving those sexy, awesome reflective floors that you see in real life in museums, banks, malls etc. Give it a read-through if you haven’t already, because this mini tutorial builds onto that.
**There are a couple potential problems with that method. One is that by adding “$alpha” 0.7 to the texture’s VMT file, you’re telling the ENTIRE texture to be semi-transparent. But what if that texture has some areas where it’s not meant to be reflective? It’s going to look fairly odd seeing a non-reflective area in the texture be just as shiny and reflective as the rest of it.
The other problem is that you can’t use its reflective/specular map as another VTF by adding it in the VMT as
So now you’re either stuck with having the entire texture semi-transparent, or you’re forced to use the ugly cubemap reflections that are static in the texture, meaning the reflection’s perspective doesn’t change no matter where you move on it or look.
**But wait, there’s hope! ** Since that sexy reflection tutorial only works by messing with the texture’s alpha amount, why not use the reflection/specularity map as the alpha mask? This way, cracks in tiles or parts that shouldn’t be reflective are kept at maximum alpha while the reflective areas are darker in the texture map.
With the VMT set to simply alter the entire’s texture alpha:
With the VMT set to look at the texture’s alpha map:
I’ll show you to achieve just that, and you need just a few things to get started:
VTFEdit - http://nemesis.thewavelength.net/index.php?c=178
Photoshop (Just about every version from 7 and up should work)
Diffuse/color texture map
Reflection/specularity texture map
Okay, so here I have both of the maps open in Photoshop, diffuse on the left, specular on the right:
On the right, click on the Channels tab (it doesn’t matter which texture you do it for):
When you do it while having the specular map selected, it’ll show up as:
Now, all you have to do, is click and drag the Grayscale CHANNEL (not the image) onto the color/diffuse IMAGE (not channel tab) and voila! An exact transfer!:
Note: If it tells you that the target image is a different depth, just transfer it over anyways, don’t worry.*
At this point, you can close out of the specularity/reflection texture. We’re just focusing on the diffuse/color texture now. Now in the channels tab for your color/diffuse texture, you’re going to see an Alpha channel added to the list of channels, and that’s what we want:
We’re just about done with the Photoshop part, but here comes the potentially tricky part. The alpha or opacity of the map is based upon how white it is, so:
Pure white = completely opaque/visible/no reflection
Pure black = completely transparent/invisible/total reflection
So right now, all those solid black parts are going to be completely invisible and we don’t want that. We want them just slightly transparent, so we need to brighten them up. So, disable all the channels except the alpha channel, and in the menu above, go to Image > Adjustments > Replace Color.
With the Eyedropper tool selected, in the preview image, click on any black squares to select the almost solid black. Now try out Fuzziness: 120 and Lightness: +70.
This boosts up the alpha of the black sections considerably, and leaves some black speckles for small spots of 100% reflectivity. Remember, we want it just SLIGHTLY transparent, but if you want it more or less, feel free to alter the values.
Now, enable all channels in the Channels tab. Go to File > Save As. Make sure that the filetype is Targa (TGA) and make sure it’s 32-bits/pixel resolution.
Okay, all done with Photoshop! You’re welcome to close it all out when you’re done. Now, you need to open up VTFEdit.**
Go to File > Import > and find your TGA file. Just say OK when it comes up with the prompt.
Then, simply go to File > Save As > and save it inside a folder in your materials folder for the game you’re using. For example, for Episode 2, \username\half-life 2 episode two\ep2\materials\mysupercooltexturefolder. Now, go to Tools > Create VMT file.
Click on the Options Tab, and click on the Translucent checkbox. What does that do? Having $translucent “1” in your VMT means that the texture will be transparent depending on its alpha amount, and this is the key for what we’re trying to do.
You can set the Surface to whatever you want, that’s simply for how the game will interpret gibs or footstep sounds.
Now you can close VTFEdit, and fire up Hammer.
NOTE: The remainder of this tutorial assumes you read the Interlopers tutorial on how to do the reflective floor, but if you’re too lazy, you can just download their example map, which I did for this tutorial (Not that I’m lazy, well for right now at least). You can get the example map here: http://www.interlopers.net/images/hl2tutorials/reflective_floor/example_map.zip
Simply click on the Texture tool and click on the floor:
Locate your texture wherever you put it and select it, and simply apply it:
Don’t worry, mine’s only 0.05 x 0.05 since it’s a freaking massive texture. But that’s it, simply compile it and run your map!