Search
Username:
Password:

Register or Reset Password

SUBMISSIONS
Counter Strike
   New Maps
   New Tutorials
   New Skins
   New GUI's
   New Sounds
   New Threads
Other
   Media
   Gamers
   Clans
   Studios
 
 
Search Tutorials:           Advanced
 
 
 
Parallax Mapping
Difficulty: Advanced
Category: CS:S > MappingAuthor(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
Parallax Mapping
Added by...
Brought to you by...
Images





Studio Profile
 
This tutorial was brought to you by Studio Danger Zone Studios. Join a Studio.
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
Tutorial Stats
Statistics on tutorial releases by Danger Zone Studios
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
Favorite Category: CS:S > Mapping (5 releases)
The members of Danger Zone Studios.
Statistics
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
New Tutorials: Mapping
More tuts in this category.
Flowing Water
Difficulty: Advanced
Very Useful Info On Models
Difficulty: Beginner
Hammer Editor Hotkey Reference
Difficulty: Beginner
Custom Map Textures
Difficulty: Intermediate
Share It!
Get HTML Code
Get BBCode
Tell a Friend
Assessment
The community's verdict.
9.8/10
Clarity
9.8
Detail
9.8
Originality
10
Simplicity
9.3
Usefulness
10
Stamps
This tutorial in a nutshell...
No stamps recorded
Assess Tutorial
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.
Stamp Tutorial
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.
Messages
Provide constructive feedback. What is "constructive"?
Page of 3   1 2 3 Next Page
ivar .
kniforz mapmaker | Y2M
Posted 9 days ago
Hey, one more thing, I don't understand the greyscale and hightmap thing... Can you pelase explain it to me in steps, I reallt like it:)
- kniforz mapmaker
.
Professional Triangulist | Y2M
Posted 9 days ago
Posted by ivar

Posted by Misto

Posted by Klifsnider

Is this possible with a bad video card - the minimum requirements for source, one without Pixelshader 2.0?


It might be, the author said "no RADEON 9x00 and geForce 5xxx and lower!" so if your graphic card is one of those it probably won't work. Sorry.


And if it doesn't work, will they crash? or will they just play without this speciality. 1 mopre question, does this get the ping down and fps down? or will everything stay the same?


FPS will drop, the more textures that use this, the more it will drop. Ping is won't be affected by this. And whether it will crash or not, I'm not sure of.
ivar .
kniforz mapmaker | Y2M
Posted 10 days ago
Posted by Misto

Posted by Klifsnider

Is this possible with a bad video card - the minimum requirements for source, one without Pixelshader 2.0?


It might be, the author said "no RADEON 9x00 and geForce 5xxx and lower!" so if your graphic card is one of those it probably won't work. Sorry.


And if it doesn't work, will they crash? or will they just play without this speciality. 1 mopre question, does this get the ping down and fps down? or will everything stay the same?
- kniforz mapmaker
.
Professional Triangulist | Y2M
Posted 14 days ago
Posted by Xblah

Is there an example map? And what source engines support this? Can I put it in any mod?


According to the author of the code, this will work with any mod, including custom made ones. Also it does come with an example map. I played it in CS:S, but should work with any mod.
Xblah .
Level Designs | Y2M
Posted 14 days ago
Is there an example map? And what source engines support this? Can I put it in any mod?
.
Professional Triangulist | Y2M
Posted 15 days ago
Posted by Klifsnider

Is this possible with a bad video card - the minimum requirements for source, one without Pixelshader 2.0?


It might be, the author said "no RADEON 9x00 and geForce 5xxx and lower!" so if your graphic card is one of those it probably won't work. Sorry.
Klifsnider .
? | Y2M
Posted 15 days ago
Is this possible with a bad video card - the minimum requirements for source, one without Pixelshader 2.0?
.
Professional Triangulist | Y2M
Posted 15 days ago
Posted by B0T

Can i use this on a model... like a gun or a player?


Actually, yes, but there is a separate code, that you have to get. The model version actually works with HDR too. Look Here for it.
B0T .
purple shirted and sexy... | Y2M
Posted 15 days ago
Can i use this on a model... like a gun or a player?
.
Professional Triangulist | Y2M
Posted 15 days ago
Posted by black sheep

Hi again
I just wanted to know what I would pakrat into the the map say if i wanted this in a map?
Do I have to pakrat all of those shaders or just the materials and the heightmaps Etc


Good question. I'm not sure how it would work with the shaders. You know what, once I get my other PC back (it's being repaired), I'll test out what needs to be packed into the map file. It might be smart to just include the folders though, since using pakrat to include the shaders would make the map file really big.
Page of 3   1 2 3 Next Page
Add Message
You must login or register to access this!