I'm a junior 3D artist, and I've found "
The ultimate be-all end-all normal mapping thread" by Per128 incredibly useful.
Regarding Parallax maps, I've been searching through the forums, and while there is a lot of info here, it's all just scattered fragments.
I'm hoping some of the veterans can take a moment and flesh out this thread to include:
1) A Breakdown of the theory behind Parallax mapping
2) Examples of how and when to use Parallax mapping correctly and efficiently
3) When not to use Parallax mapping
4) Links to, or brief tutorials on generating Parallax maps.
Thanks
Replies
1) A Breakdown of the theory behind Parallax mapping
Parallax mapping is a technique for real-time approximation of displacement mapping.
Each pixel's texture coordinates are adjusted at render-time to create an illusion of depth as the viewer's eye moves across a scene.
The virtue of parallax mapping is efficiency. It is the cheapest real-time technique for displacement mapping.
The drawback is image quality. Parallax mapping doesn't look as nice as more expensive techniques such as "parallax occlusion mapping" and "relief mapping." Those techniques are similar to parallax mapping, but provide better image quality at a cost of additional texture lookups.
2) Examples of how and when to use Parallax mapping correctly and efficiently
As a rule, parallax mapping looks good on walls and floors. Any mesh with a relatively large surface viewed from non-oblique angles could be a decent candidate for parallax mapping.
In your heightmap, try to avoid sharp/steep edges and tall high-frequency details. Those can cause texture-stretching and rendering artifacts.
3) When not to use Parallax mapping
Use sparingly on any surface that is not relatively large. Be especially careful where the edges of a mesh are visible. Parallax mapping doesn't extend past the visible edges of a mesh. That can look weird. You may want to augment your parallax map with actual geometry at visible edges. (eg. bricks on the corner of a building might use actual geometry while the other bricks can be created by parallax mapping.)
4) Links to, or brief tutorials on generating Parallax maps.
Method 1: Using CrazyBump to generate a parallax map from a normal map:
0. If necessary, grab the CrazyBump demo from www.crazybump.com
1. Make sure that CrazyBump's axis orientation preferences are set correctly for your normal map.
2. Open your normal map in CrazyBump.
3. Make sure that "parallax displacement" is turned on in CrazyBump's preview window.
4. Select the "displacement" tab from CrazyBump's user interface.
5. Adjust the "displacement map" sliders until your model has the desired appearance.
6. If you notice shimmering artifacts, try increasing the "soften" slider.
7. You're all done! Save the displacement map, and use it for parallax in your game engine.
Method 2: Using CrazyBump to generate a parallax map from a photograph:
Check out this here video: http://www.crazybump.com/video/
Other Methods:
I have heard rumors that it may be possible to create a parallax map without using CrazyBump.
I can neither confirm nor deny these rumors.
"Output into normal Bump"
and
"render Height map to alpha channel"
I check the last of these two and it outputs a height map to the alpha channel of the normal map. You can use this as a parallax map.
Thanks
Exactly where it goes will depend on your specific game engine, but it's pretty common to put it in the alpha channel of the normal map. Check the documentation for your engine to make sure.
If your engine expects height in the alpha channel of the normal map, CrazyBump has a toggle for that on the preferences page. Just turn on the setting, open your normal map, and re-save it.
http://wiki.polycount.net/Parallax_Map
If you'd like me to take anything out, or re-write completely, I could certainly do that as well, just let me know.
Gears of War uses it some, and I guess UT3 uses it some too, but I haven't seen any Epic maps that use it.
To really see the value of parallax, try a different texture. Parallax works well for smooth curves, like rocks and carvings.
It's not good for steep edges like those bricks have. Distortion appears in that case.
Thanks for the advice.
My favorite useful example of parallax maps: the staircases in mass effect. Pretty much every staircase in that game was just a flat surface with a parallax map on it!
http://www.elderscrolls.com/images/art/ob_pc/obliv06B.jpg
Crysis.
http://www.crysis-online.com/Media/Screenshots/Screenshots/crytek_parallax_occlusion_mapping.jpg
http://xbox360media.ign.com/xbox360/image/article/767/767200/mass-effect-20070223004224640.jpg
http://image.com.com/gamespot/images/2007/059/930279_20070301_screen005.jpg
There are more than a half-dozen versions of 'virtual displacement mapping', parallax, whatever. Off the top of my head: offset (and offset with limiting, both are your basic parallax mappings), POM, relief, cone step, steep parallax, pyramidal displacement, iterative parallax, and I'm sure there are more. All except 'offset' and iterative use a more advanced rendering, only now becoming feasible on current-gen hardware.
If anyone is looking for a good rendering cost/visual effect tradeoff, look at iterative parallax, it is probably your best bet. Newer versions of POM and cone mapping provide the best visual fidelity. And for the cheapest, parallax mapping is a couple extra instructions and a texture channel, almost negligible nowadays.
I am not sure (and have not done tests or research for anything approaching certainty) but my guess about the mass effect staircases is that they are a specific parallax shader written for them. I don't think a generic parallax mapping solution would give as believable an effect. Still very cool what you can do, though.
Saw this happen on a lot of the Imperator assets. For what perceived detail it was supposed to give, getting good results was a time sink. Either that, or someone just didn't care enough to get it right.
Generally when i use them they're pretty subtle, and if you have high-contrast areas(like very accurate bricks, rendered from highres) you really need to blur you map a bit, as its always going to give you bad artifacts when you have hard cuts. I find sometimes small scale things like rivets and other similar details on metal objects can look really nice as well, again they generally have to be blured a little if its too detailed of a shape. And its definately nice to add some large scale detail to things like wood planks, you can get a little more shape out of just a flat polygon. I've seen in some games where they add all this high-frequency detail to wood flanks(lol stalker) but thats really the opposite of what you want to do with wood, as the small wood grain is not indented 5 inches, but you can actually make the boards themselfs look bent.
The way parallax works (adjusting UV coordinates at runtime) means that it can't work across a seam.
All you can do is to paint both edges at a flat height, and make sure to bleed a good amount over the seam in both directions.
It's easiest to use parallax for things like terrain meshes, where you don't have to worry about seams.
I've been getting more and more interested in shader programming lately and found an interesting real time demo that displays many different parallax/displacement methods. This thread seemed a good place to post about it.
[ame]http://www.youtube.com/watch?v=n3U0SDFl-WU[/ame]
Grab the demo here if you're interested:
http://www.brunoevangelista.com/projects/
It comes with source textures and a .fx file for further analysis.
UDK Package Only
UDK Package+Asset files (includes Decimated HP mesh, LP .obj and .ase, UDK Package, Diffuse, AO, Heightmap and Normal)
So I have been using a bump offset in UDK to create the illusion of something being outside a window for an environment (you're inside, looking out). What I'm trying to do is get the same image to be seen across four windows, so when you look out window one, you have a different "view" of the skyline texture than window 4. I'm 90% sure there is a way to do this (i have seen it done) but I'm not sure how to do it.
In this tutorial: [ame="http://www.youtube.com/watch?v=ONIztGNEpYE"]How to Create a Building Material in UDK - YouTube[/ame]
Linh goes over how to make a window look like there is something inside, but each window has the same image (when he builds it, by the end of the tutorial). However, at the BEGINNING of the tutorial, the material is doing exactly what I want it to do -- one image, four windows.
I've posted on the video asking how to do this, but I know the guy personally and he is very busy and may not be able to get back to me. Does anyone know how this could be accomplished?
Thanks everyone, you're fabulous.