Home Technical Talk

The ultimate be-all end-all Parallax mapping thread

polycounter lvl 12
Offline / Send Message
McBradd polycounter lvl 12
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

  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    I'm sure my advice is far from "be all/end all," but I'll give it a shot!


    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.
  • Eric Chadwick
  • Mark Dygert
    Before we can call this a "be-all end-all" thread, we need at least 3 pages of bickering before actually answering the question at hand. Damn your efficiency Ryan =P
  • McBradd
    Offline / Send Message
    McBradd polycounter lvl 12
    Thank you so much Ryan. Like Vig suggested, I thought it was going to take pages and pages to answer those questions! It's the End-all Post rather than Thread ;)
  • obeyjohnny
    Offline / Send Message
    obeyjohnny polycounter lvl 11
    "It's super effective!!"
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    You can make a parallax map in 3DS max from hipoly geometry. To do this setup your projection onto your lowpoly as usual. Now in the 'normalsMap' element in the render to texture dialog there are two checkboxes called:

    "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.
  • Archvilell
    I have a noobish question, one that nobody ever talks about it because everyone seems to know it, but how do I make a parallax map? All the places I've read say a parallax map is a normal map with a height map in the alpha channel, but I swear I've seen a parallax map as a separate map with yellow, orange, and I think green in it. I'm assuming it's the former, but I'd just like clarification.

    Thanks
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Parallax mapping uses a grayscale heightmap.

    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.
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    Way to go Ryan, thats the best way to sell your software! ;) hehehehe. JK, CrazyBump is totally amazing.
  • ivars
    Offline / Send Message
    ivars polycounter lvl 17
    Archvilell: I think you're confusing it with a object-space normal map. That would probably have those kind of colors.
  • Eric Chadwick
    I hope you guys don't mind, I went ahead and added your parallax tips to the wiki.
    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.
  • Jonathan
    In its current state, I don't think parallax mapping is all that useful. Crysis' parallax occlusion mapping is quite nice, but even still, you have to be careful how to use it.
    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.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    The technique can be very useful, but it requires more subtlety than that. You've got WAY too much parallax going on in that picture. Bricks aren't supposed to stick out that much. Try lowering the contrast on your heightmap. A lot.

    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.
  • Jonathan
    Indeed. That's an old/quick example used to show someone how to get the effect.

    Thanks for the advice. :)
  • Peris
    Offline / Send Message
    Peris polycounter lvl 17
    i think it's pointless to parallax map bricks, the geometry on it is way too small and it always ends up looking exaggerated. I don't know why bricks are always used to show of paralax mapping =).
    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!
  • Eric Chadwick
  • TheSplash
    here are the staircases peris was talking about. Indeed a very interesting use of the effect, although they could have gotten some more detail out of it to justify using it.

    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
  • Rob Galanakis
    Parallax/Offset mapping can look quite nice, as has been stated, if used correctly.

    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.
  • Xenobond
    Offline / Send Message
    Xenobond polycounter lvl 18
    One thing to keep in mind when having separate textures being used with parallax mapping. Make sure the lo/mid/hi points all have the same values, or you'll run into some ugly seams as one texture might be sitting further below another with the value on the parallax map.

    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.
  • EarthQuake
    A REALLY good use for parrallax is using them on concreate decals, either large decals for variation or wall hit decals, its really satisfiyng to shoot up a wall and have it look like actual chunks of the wall are missing(fear did a nice job of this).

    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.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    @Xenobond

    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.
  • Ben Apuna
    Thread Rise From Your Grave!

    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.
  • metalliandy
    Offline / Send Message
    metalliandy interpolator
    I did a few simple tests with Parallax on my fountain a while back, so i figured that i would release the test files in the hope that it might help someone out :)

    Parallax_Test_PC.jpg

    UDK Package Only
    UDK Package+Asset files (includes Decimated HP mesh, LP .obj and .ase, UDK Package, Diffuse, AO, Heightmap and Normal)
  • Lindsay4410
    Hey parallax peoples.
    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.
  • Angry Beaver
    Offline / Send Message
    Angry Beaver polycounter lvl 7
    While this is quite the necro and possibly the wrong place. To me it looks like his major change is in regards to the u/v of the thing. simply multiply your u/v by 2 before plugging it into your texture.
Sign In or Register to comment.