Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Parallax Mapping - A Tutorial for Source Engine

Parallax mapping is a technique that puts certain pixels above or below others to give the texture a 3D look and feel to the player in game. Before you get started, know that this is a tedious process since every texture that you want to use this technique needs a heightmap and (although optional, I recommend it) normal maps. Also Special Thanks to MihailNajdenov for writing the code for this to work. Because of issues with Source and the custom code, this method does not work with HDR lighting. The author is working on an updated version to fix this but until it is released, you will have to use LDR.
Programs you need
  • First, you need THIS. That is the custom code you need to get all of this to work correctly. Also included are some custom textures and a text map so you can see how it looks in game. I will also take the screenshots from this map to save some time.
  • An image editing program. I used Photoshop CS1, but almost any will work. You only need a very basic knowledge, so don't worry if you don't know any advance techniques.
  • Here is also the VTF plugin for Photoshop which is very helpful. If you are not using Photoshop or a program that this works with, you will need to find another way to convert to VTF format.
  • You may want THIS as well if you plan to use Source standard textures.
  • I AM NOT GOING TO COVER NORMAL MAP CREATION. However, you can look HERE if you are curious.
Installation Once the Parallax Occlusion Shader file is done downloading, unzip it to a folder that is easy to access. Then copy all the folders (bin, maps, materials, models, and shaders) to the folder for the game you want to use this in. Counter-Strike Source would be *Drive Letter*\\Steam\steamapps\common\counter-strike source\cstrike, Half Life 2 would be *Drive Letter*\\Steam\steamapps\common\half-life 2\hl2, etc.
Heightmaps 1) Ok, now we will start to prepare the texture files needed to create this effect. First open up your image editing program. 2) Then open the vtf of the texture you want to have the parallax effect. All you have to do here is change the vtf to greyscale and discard the color information. Since vtf files can't be greyscale, save it as a tga file. See Screenshot A with what the two should look like. 3) Then open up the tga and change it back to RGB. Since you discarded the color information, the image will still appear to be in greyscale, and will allow you to save as a vtf. Also when saving the new heightmap, I recommend putting "_height" in the file name to distinguish between your heightmap and regular texture. That is all for the creation of the heightmap. Just remember that you have to make one for every texture that you use in your map.
VMTs and Map Compiling This is were it gets tricky. 1) Open your VMT of the texture you want to use. Under where is has "Lightmappedgeneric", type
//"MN_PrlxLightmappedGeneric"
2) Inside of the brackets, type
"$heightmap" "texture name"
So if you had a texture named wall1 and the heightmap named wall1_height, (wall1_normal would be the normal file, if you have one) you would have this as a vmt:
"LightmappedGeneric"
//"MN_PrlxLightmappedGeneric"
{
    "$basetexture"	"*path*/wall1"
    "$surfaceprop"	"brick"
    "$bumpmap"		"*path*/wall1_normal"
    "$heightmap"	"*path*/wall1_height"
}
3) You may also want to include "$heightscale" and a number between 0 and 1.
"$heightscale" 0.5
This defines the depth of the texture. If not manually set, it will default at 0.4. 4) When you are ready to compile your map in Hammer, comment out the second line in the vmt by putting two "//" in front. So it would look like this
"LightmappedGeneric"
//"MN_PrlxLightmappedGeneric"
This is (as claimed by the author) a way to get around a bug in Source SDK. 5) Anyway, once the map is compiled, open the vmt's again and comment out the first line and uncomment the second line, so it looks like this:
//"LightmappedGeneric"
"MN_PrlxLightmappedGeneric"
Now, you can go and run your map to test it. Look at Screenshot B as an example of a VMT. Remember, you must change each and every VMT file for each texture you use every time you compile and run your game.
And now you know how to use parallax mapping in your Source maps or mods. The last few screenshots are what it looks like in game. Enjoy!
1-10 of 46
1
Pages
Go to page:
  • Anonymous
    10y
    > **Posted by Uraxz** > Such a shame :[ > So will there be a Orange box ver, if possible?? I want OB version to
    URL to post:
  • ashleylesnie avatar
    ashleylesnie Joined 11y ago
    Offline
    11y
    Hi, I'm having a big problem. I tried to work the maps with the parallax textures in HL2, EP1, and EP2 and none works. I done it step by step all. (Only was copy and paste in the folder), but don't works. Maybe is needed a dll update, or something else? If you can help me I would be very grateful. I'd like can how make that textures, are awesome. Thanks in advance :)
    Bananite
    URL to post:
  • Misto avatar
    Misto Joined 14y ago
    Offline
    41,354 points Ranked 114th
    25 medals 4 legendary 6 rare
    • 10 years a member Medal icon
    • Submitted 15 Tools Medal icon
    • Submitted 100 WiPs Medal icon
    • Submitted 50 Maps Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    11y
    Not in the near future as far as I know. However I'm sure if someone has the know-how and the motivation it is possible eventually.
    ... avatar
    Mantra
    ...
    URL to post:
  • Uraxz avatar
    Uraxz username pic Joined 12y ago
    Offline
    719 points Ranked 46,832nd
    11 medals 1 rare
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    11y
    Such a shame :[ So will there be a Orange box ver, if possible??
    Abnormal
    URL to post:
  • Misto avatar
    Misto Joined 14y ago
    Offline
    41,354 points Ranked 114th
    25 medals 4 legendary 6 rare
    • 10 years a member Medal icon
    • Submitted 15 Tools Medal icon
    • Submitted 100 WiPs Medal icon
    • Submitted 50 Maps Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    11y
    Yes I think it does. Apparently these do not work for Orange Box games. The shader stuff hasnt been released publicly either so no one can seem to create a new shader.
    ... avatar
    Mantra
    ...
    URL to post:
  • Uraxz avatar
    Uraxz username pic Joined 12y ago
    Offline
    719 points Ranked 46,832nd
    11 medals 1 rare
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    11y
    Heya' I fallowed everything: - The bin and shad files - makeing normal and heightmap - Vmt codeing - changeing after compile with the "//" (and no HDR) but it seems the texture gets invis. Dont know if it has to do with the Cs:s updates?
    Abnormal
    URL to post:
  • Misto avatar
    Misto Joined 14y ago
    Offline
    41,354 points Ranked 114th
    25 medals 4 legendary 6 rare
    • 10 years a member Medal icon
    • Submitted 15 Tools Medal icon
    • Submitted 100 WiPs Medal icon
    • Submitted 50 Maps Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    12y
    Posted by FROGMAN181 Shader download is not working! Post new link PLEASE!!!!!
    Posted by iamoctavian Your 1st link http://files.filefront.com/error.php?errno=320 is a broken link. So I can't get past the 1st step.
    Everyone, I managed to find the files for the parallax shaders. Link is HERE
    ... avatar
    Mantra
    ...
    URL to post:
  • Misto avatar
    Misto Joined 14y ago
    Offline
    41,354 points Ranked 114th
    25 medals 4 legendary 6 rare
    • 10 years a member Medal icon
    • Submitted 15 Tools Medal icon
    • Submitted 100 WiPs Medal icon
    • Submitted 50 Maps Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    12y
    Ok, for everyone that wanted the shaders. I have good news. While the original fileplanet link no longer exists, I managed to find the .rar file buried deep within my external hard drive!!! So I'll upload it tomorrow sometime so everyone can use this again. This time I'll upload it on FPSB since I know it's reliable and will be up a long time.
    ... avatar
    Mantra
    ...
    URL to post:
  • Misto avatar
    Misto Joined 14y ago
    Offline
    41,354 points Ranked 114th
    25 medals 4 legendary 6 rare
    • 10 years a member Medal icon
    • Submitted 15 Tools Medal icon
    • Submitted 100 WiPs Medal icon
    • Submitted 50 Maps Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    12y
    Posted by FROGMAN181 Shader download is not working! Post new link PLEASE!!!!!
    Please read my last post. I can't contact the author and I don't have access to the files myself right now. So until I can get the files there is nothing I can do.
    ... avatar
    Mantra
    ...
    URL to post:
  • FROGMAN181 avatar
    FROGMAN181 Joined 13y ago
    Offline
    460 points Ranked 52,329th
    12y
    Shader download is not working! Post new link PLEASE!!!!!
    Bananite
    URL to post: