Parallax Mapping Difficulty: Advanced
Category: CS:S > Mapping Author(s): Misto
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\*Username*\counter-strike source\cstrike , Half Life 2 would be *Drive Letter*\\Steam\steamapps\*Username*\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!
Added: 18 days agoTags: parallax , mapping , texture , heightmaps
Added by...
Brought to you by...
Danger Zone Studios Mapping Your Favourite Danger Zone...
Membership: Invite Only
Primary Skills: Coding/Scripting, Compiling, Concept Art, Mapping, Modelling, Project Management, Sound Effects & Music, Texturing, Web Development, Video Production
Danger Zone Studios is a studio that is dedicated to bringing the highest quality content possible, as quickly as possible. Unlike most studios, we do not believe in producing large amounts of absolute rubbish. Instead, we are a small, yet organized group, that are to trying to concentrate on bringing every technique known to man into the creation of our work.
Check us out on:
STEAM COMMUNITY
Inception: 11 months ago
Submissions: 15
Total Views: 21,401 (21st)
Total Feedback: 134 posts
Average Rating: 9.4/10 (59th)
Unrated Tutorials: 9
Total Favs: 20 (29th)
First Submission: 10 months ago
Latest Submission: 18 days ago
This tut's scores and traffic.
Rating: 9.8/10
Skill Band: Expert (9.0 to 10)
Assessments: 7
Views: 1,281
Favorites: 12
Feedback: 33
More tuts in this category.
Share It!
This tutorial in a nutshell...
No stamps recorded
Tutorials are
community moderated .
You cannot assess yet! Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure.
To vote on this submission
register or login.
How would you describe this tutorial in a few words?
You cannot stamp yet! Stamps let you apply characteristics to submissions to help others understand them.
To stamp this submission
register or login.
Add Message
You must login or register to access this!