If geeks love it, we’re on it

3D Jargon Sucks! Mapping techniques explained

3D Jargon Sucks! Mapping techniques explained

What I need is a way to emit caustic photons from an object with incandescence.

…what?

If you’re confused, don’t panic.  The world of computer graphics has enough bizarre terminology that you’d swear most of it was just made up with the purpose of confusing people.  As graphics technology in gaming becomes more and more complex, you’re bound to hear terms like those above used frequently regarding a new engine or technique.

Icrontic wants to help you become a wordsmith of the graphics type, so that’s why I’m beginning a series on explaining high level graphics terminology for the layman.  You’re exposed to these graphics techniques every time you load up and play a game, this will be you chance to grasp an understanding of those techniques.

Before any journey into the unknown, one must start with a map.  That is exactly where we start this journey, focusing on maps.  There are many different types of maps used in computer graphics, and collectively they make up a very large portion of the visuals you see in a game.  Texture maps, specular maps, shadow maps, shader-based maps, the list goes on.  We’re going to focus on the shader-based, specifically bump, parallax, and displacement maps.

It’s important to understand the concept of layering textures before we continue.  Whenever you see a ‘depth effect’ in a game, you’re looking at two textures.  A base texture that gives us the visual elements (like a rocky wall or smooth marble) and a second texture that serves as the depth displacement map.  These two layers work in tandem to create visual complexity.  It’s how the renderer deals with the second layer that determines what kind of map it is.

You’ve most definitely heard the word “bump map” used within the gaming industry.  It’s a technique that has become a defacto standard for rendering graphics in games because it simulates surface depth without greatly effecting render time.  It’s simple and lightweight, yet adds much complexity and realism to a scene.  Much of today’s graphics in games are achieved with bump maps.

A bump map simulates depth by changing the shading on a surface based on light location and intensity without drawing extra polygons.  What this means is that a bumpy surface, a rough ground surface for instance, can appear to be very uneven with the higher points casting ‘shadow’ all the while the actual surface is a flat polygon.  The bump map does all the work at a shader level, creating the illusion of depth to the player.

Though certainly not the first to implement, Doom 3 brought the technique to the forefront by using  bump maps on a large scale.  Almost all of the surfaces are flat in that game, yet thanks to the use of bump maps they were able to create things like faux round surfaces and bumpy rivets in metal objects.  Half-Life 2 and FarCry also featured the technology, both using it to falsify complex looking surfaces without adversely effecting the amount of time to render a scene.

So how does this technology work?  A bump map is simply a grayscale height map that tells the pixel shader which points are high and which points are low on a surface, and shades individual pixels accordingly.  The surface remains exactly the same, but visually looks far more complex.  Shading adjusts in real-time as light sources move around the surface.  No additional geometry is created, making the technique very lightweight at render time.

Bump mapping is fine and all, but the illusion is broken when the player looks at a surface in parallel.  The surface is still completely flat, and the bump map loses its effect the closer you come to a parallel point of view.  How do you up the ante of believable complexity without breaking the hardware resource bank?  Meet the bump map’s bigger brother, parallax maps.

Parallax mapping is actually an extension of bump mapping – an extended technique of bump mapping if you will.  These maps achieve an even more convincing image than bump maps while continuing with the same low-overhead rendering effects.  Parallax mapping was introduced in 2001 and has slowly been making it’s way into the gaming world.

These maps operate on the same method that bump maps do.  A grayscale height map supplies the information on the surface and the pixel shader does the rest of the work.  The difference is in how parallax maps handle player perspective according to the surface.  Depending on available light and the player’s position, the map actually adjusts coordinates for points on a texture along it’s current polygon to virtualize actual depth.  This is known as a parallax effect.  It creates a very realistic ‘bumpy’ surface, but in reality is only stretching the texture appropriately.

As mentioned in Decals: When Will You Grow Up? F.E.A.R. uses this technique for damage decals.  This made an environment torn by combat look much more convincing.  It was a great example of a proper usage of parallax maps.  Any surface that requires small details and great range of depth benefits from the use of these maps.  The Elder Scrolls IV: Oblivion and Unreal Tournament 3 are two other games utilizing this technique.

We’re looking rather convincing now, but enough faking it, how about some true depth on a surface!  Bump and parallax maps cheat to produce the effect of depth.  What’s it going to take to create actual depth that accounts for true occlusion, shadowing, and perspective?  Allow me to introduce the displacement map.

Displacement maps, like it’s two aforementioned cousins, uses a grayscale map to determine the gradation of depth.  Newer techniques allow the creation of procedural textures that supply the information, in which case remove the need for an actual map, but for simplicity sake we’ll ignore that bit for now.  How displacement differers is in how it creates depth.  According to the map, points on the mesh will actually be displaced along the perpendicular dimension from the polygon known as the surface normal.  This creates actual depth on the surface, depth which can cast and receive true shadow, and can account for occlusion as the player moves.  This method generates a great sense of depth and detail.  Unlike the other two methods, displacement maps create additional geometry, and is very taxing at render time as a result.

Displacement maps have yet to make a very big splash in the gaming industry, at least not at an interactive level.  An ideal use would be to have procedural displacement in use for user-initiated changes, like damage from an explosive device.  Due to the technique’s intensive nature, it’s more widely used in non-realtime applications, such as high level 3D packages.  Until hardware catches up, video games are content to cheat graphics to maintain the lighting quick performance that gamers crave.

The use of maps in graphics techniques goes further than the three mentioned here.  As far as gaming is concerned, those are the most notable techniques.  The idea is to increase visual complexity while keeping render times low.  Newer advanced techniques are generally ruled out until hardware catches up.  As long as cheating produces more convincing visuals then everyone wins.

Lesson one is now in the books.  Add Bump, Parallax, and Displacement mapping to your vocabulary.  Go forth now, dear Icrontian, and discuss game engines with a  newfound confidence!  You’re on track to gaining a more robust understanding of computer graphics and it’s seemingly endless list of confusing terminology.

Comments

  1. Cyclonite
  2. BuddyJ
  3. mas0n
    mas0n That poor bird...

    Also, awesome writeup. Keep 'em coming.
  4. UPSLynx
    UPSLynx That bird had it coming! Shouldn't have walked into my shot..
  5. chrisWhite
    chrisWhite Nice work Lynx, I think you nailed it. Are you going to explain normal maps?
  6. UPSLynx
    UPSLynx I thought about diving into normal maps. When it came down to it, normal and bump maps were too similar to necessitate an added explanation. Sure computationally there is a lot more going on with a normal map, but to a regular gamer they're not going to notice much of a difference between the two. So I omitted it in favor of simplifying the article and keeping it a bit shorter.

    But I do find normal maps fascinating... The methods of baking and perturbing normals, it's a pretty sweet technique. I wouldn't mind digging more into it.
  7. DrLiam
    DrLiam Great article! I learned a lot and like everyone else I had a good laugh at the bird sequence. Nice shot btw! You didn't even aim!
  8. wahay Thanks for taking the time to make this. I guess "parallax mapping" is pretty self-explanatory, so I found myself not overwhelmed today.

    It's a good reminder that I paid attention in class!
  9. UPSLynx
    UPSLynx DrLiam - I may not always have outstanding aim, but when it comes to shooting NPC fowl, I nail it.

    Wahay, WELCOME to Icrontic my man! I also feel I should take this time to remind you that I hate you for having access to a 3D art class at IWU D:
  10. chrisWhite
    chrisWhite Yeah, you're right, normal maps are very similar to bump maps as far as a gamer is concerned, but I do think it's something gamers will hear about a lot. Plus, it's such an interesting format since it isn't a simple gradient distance map.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!