Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Parallax"

From TWC Wiki
Jump to navigationJump to search
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
Parallax mapping is a convoluted and confusing topic.  There are a number of different types of bump mapping, and parallax is one.  There is a slightly linear progression of better to worse, but once we hit the higher-end, things get basically very similar to each other, and this is what leads to confusionSo, let's imagine a bunch of programmers are sitting around a table, explaining their new techniques, beginning with the simplest and ending with the most complex.
+
Parallax mapping is a convoluted and confusing topic.  There are a number of different types of bump mapping, and parallax is one.  The development of the methods is not quite iterative and not at all linearIts damn confusing, actually.  I'll give a quick run-down of all the methods, so that you can sound graphically sophisticated when you're discussing next-gen shader rendering techniques at parties.
  
 
==The start of the road==
 
==The start of the road==
''These techniques have been around for years now, and they are common place and relatively cheap.  Also, there was a somewhat linear development of the techniques, in contrast to the later "Occlusion" techniques.
+
''These techniques have been around for years now, and they are common place and relatively cheap.  Also, there was a somewhat linear development of the techniques, in contrast to the later "Occlusion" techniques.''
  
 
===Normal Mapping===
 
===Normal Mapping===
I've created a technique that reads the normal for a surface from a texture, instead of the geometry.  This allows a flat surface to take the lighting information of a much more complex surface.  It is also a relatively cheap technique.
+
Normal mapping reads the normal for a surface from a texture, instead of the geometry.  This allows a flat surface to take the lighting information of a much more complex surface.  It is also a relatively cheap technique.  See my [[Shaders]] article.
  
 
===Parallax/Offset/Virtual Displacement Mapping===
 
===Parallax/Offset/Virtual Displacement Mapping===
 
(Unreal Engine 3)
 
(Unreal Engine 3)
Your technique is great, but let me improve it some.  I will use a heightmap that will alter the UV's of a surface depending on the height and the the eye vector (the line from the camera to the pixel).  Lower areas will squish together, higher areas will spread out some, and the result will look like the texture is occluded.  This technique is relatively cheap, as well, it is just a few instructions added to a normal mapping shader.
+
This uses a heightmap that will alter the UV's of a surface depending on the height and the the eye vector (the line from the camera to the pixel).  Lower areas will squish together, higher areas will spread out some, and the result will look like the texture is occluded.  This technique is relatively cheap, as well, it is just a few instructions added to a normal mapping shader.
  
 
===Parallax with Offset Limiting===
 
===Parallax with Offset Limiting===
 
(FEAR)
 
(FEAR)
Wow that is cool!  However, at glancing angles, the texture appears to "swim," a great deal.  The pixels are all a mess.  If we limit how much the pixels can move, we can avoid this; it is an easy fix.
+
At glancing angles, the texture appears to "swim" a great deal with regular Parallax mapping.  The pixels are all a mess.  So applying a limit to the movement largely solves this.
 +
 
 +
===Iterative Parallax Mapping===
 +
http://www.cescg.org/CESCG-2006/papers/TUBudapest-Premecz-Matyas.pdf
 +
 
 +
One of the more interesting Parallax implementations, which never really caught on.  It uses the ideas learned later, with the Occlusion mapping types, in order to find a more exact Parallax via iterations of the offset.
  
 
==The fork in the road==
 
==The fork in the road==
 
''Here we have a paradigm shift.  All the techniques up to now are "hacks" are far as the occlusion goes.  The following techniques are all similar in a couple ways; they use a raytrace to test for occlusion; they actually perform occlusion of pixels, and are not "hacks" like the above techniques.  There is "true" occlusion.  The difference is mainly in how the raytrace is performed, with regards to accuracy, performance, etc.  The paradigm shift is also that none of these are feasible on current hardware.  You won't see use of these techniques until DirectX 10 hardware is common, even though the techniques have been around for a few years now.''
 
''Here we have a paradigm shift.  All the techniques up to now are "hacks" are far as the occlusion goes.  The following techniques are all similar in a couple ways; they use a raytrace to test for occlusion; they actually perform occlusion of pixels, and are not "hacks" like the above techniques.  There is "true" occlusion.  The difference is mainly in how the raytrace is performed, with regards to accuracy, performance, etc.  The paradigm shift is also that none of these are feasible on current hardware.  You won't see use of these techniques until DirectX 10 hardware is common, even though the techniques have been around for a few years now.''
  
===Steep Parallax===
+
===Relief Mapping===
 +
http://fabio.policarpo.nom.br/relief/index.htm
  
===Relief Mapping===
+
This uses a binary search.  It was one of the really groundbreaking Parallax papers, and he's referenced in nearly every Occlusion shader paper.  It is a good and usable Occlusion solution (clocks at 69 pixel shader instructions in Policarpo's implementation).  The main drawback is that that it uses hard-edged shadows.
  
 
===Cone Mapping===
 
===Cone Mapping===
 +
http://www.lonesock.net/files/ConeStepMapping.pdf
 +
 +
This focuses on creating a better method of finding the ray intersection between the view and the heightfield.  Other methods have to balance number of searches with efficiency... this does things differently, but as I haven't analyzed the shader code, I'm not sure how (it has to do with cone volumes or some such).  On the other Occlusion methods, you can see linear artifacts at glancing angles, created by the lowered concentration of intersection checks.
  
 
===Parallax Occlusion===
 
===Parallax Occlusion===
(Crysis)
+
http://ati.amd.com/developer/i3d2006/I3D2006-Tatarchuk-POM.pdf
 +
 
 +
(Crysis) The main addition here is soft-shadowing.  This is an extremely expensive implementation, but its what you'll be seeing on next-gen hardware, most likely.  Tartarchuk's big improvement is the sampling method, using more samples for steeper viewing angles (decreasing the linear artifacts while maximizing efficiency).
 +
 
 +
===Steep Parallax===
 +
http://graphics.cs.brown.edu/games/SteepParallax/index.html
 +
 
 +
Developed by the Computer Science Department at Brown University.  This is better for fine surface details, such as the illusion of hair.
  
 +
==Conclusions==
 +
There isn't really a "best" method.  Normal mapping is the simplest, and Parallax Occlusion with Soft Shadows the best.  But lots of people like Normal Mapping because it doesn't have any texture swimming, and Parallx Occlusion isn't usable.  Better methods are more expensive, and sometimes require properly designed assets, meaning they are not compatible.  For example, to maximize a relief mapped wall you may put extra detail (such as a vine) in the texture; however, if you were just using Parallax you'd probably want to model the vine with polygons.  Its important also to note that the Occlusion techniques aren't really usable in games today.  This is merely meant as a extremely brief and simplistic overview of the different Parallax techniques, because, as we can see, there are at least 7 of them.  I hope this cleared things up, and I hope you add your own findings and elaborate on mine on this page.
 
[[Category:3D Modelling]]
 
[[Category:3D Modelling]]

Revision as of 14:26, 3 June 2007

Introduction

Parallax mapping is a convoluted and confusing topic. There are a number of different types of bump mapping, and parallax is one. The development of the methods is not quite iterative and not at all linear. Its damn confusing, actually. I'll give a quick run-down of all the methods, so that you can sound graphically sophisticated when you're discussing next-gen shader rendering techniques at parties.

The start of the road

These techniques have been around for years now, and they are common place and relatively cheap. Also, there was a somewhat linear development of the techniques, in contrast to the later "Occlusion" techniques.

Normal Mapping

Normal mapping reads the normal for a surface from a texture, instead of the geometry. This allows a flat surface to take the lighting information of a much more complex surface. It is also a relatively cheap technique. See my Shaders article.

Parallax/Offset/Virtual Displacement Mapping

(Unreal Engine 3) This uses a heightmap that will alter the UV's of a surface depending on the height and the the eye vector (the line from the camera to the pixel). Lower areas will squish together, higher areas will spread out some, and the result will look like the texture is occluded. This technique is relatively cheap, as well, it is just a few instructions added to a normal mapping shader.

Parallax with Offset Limiting

(FEAR) At glancing angles, the texture appears to "swim" a great deal with regular Parallax mapping. The pixels are all a mess. So applying a limit to the movement largely solves this.

Iterative Parallax Mapping

http://www.cescg.org/CESCG-2006/papers/TUBudapest-Premecz-Matyas.pdf

One of the more interesting Parallax implementations, which never really caught on. It uses the ideas learned later, with the Occlusion mapping types, in order to find a more exact Parallax via iterations of the offset.

The fork in the road

Here we have a paradigm shift. All the techniques up to now are "hacks" are far as the occlusion goes. The following techniques are all similar in a couple ways; they use a raytrace to test for occlusion; they actually perform occlusion of pixels, and are not "hacks" like the above techniques. There is "true" occlusion. The difference is mainly in how the raytrace is performed, with regards to accuracy, performance, etc. The paradigm shift is also that none of these are feasible on current hardware. You won't see use of these techniques until DirectX 10 hardware is common, even though the techniques have been around for a few years now.

Relief Mapping

http://fabio.policarpo.nom.br/relief/index.htm

This uses a binary search. It was one of the really groundbreaking Parallax papers, and he's referenced in nearly every Occlusion shader paper. It is a good and usable Occlusion solution (clocks at 69 pixel shader instructions in Policarpo's implementation). The main drawback is that that it uses hard-edged shadows.

Cone Mapping

http://www.lonesock.net/files/ConeStepMapping.pdf

This focuses on creating a better method of finding the ray intersection between the view and the heightfield. Other methods have to balance number of searches with efficiency... this does things differently, but as I haven't analyzed the shader code, I'm not sure how (it has to do with cone volumes or some such). On the other Occlusion methods, you can see linear artifacts at glancing angles, created by the lowered concentration of intersection checks.

Parallax Occlusion

http://ati.amd.com/developer/i3d2006/I3D2006-Tatarchuk-POM.pdf

(Crysis) The main addition here is soft-shadowing. This is an extremely expensive implementation, but its what you'll be seeing on next-gen hardware, most likely. Tartarchuk's big improvement is the sampling method, using more samples for steeper viewing angles (decreasing the linear artifacts while maximizing efficiency).

Steep Parallax

http://graphics.cs.brown.edu/games/SteepParallax/index.html

Developed by the Computer Science Department at Brown University. This is better for fine surface details, such as the illusion of hair.

Conclusions

There isn't really a "best" method. Normal mapping is the simplest, and Parallax Occlusion with Soft Shadows the best. But lots of people like Normal Mapping because it doesn't have any texture swimming, and Parallx Occlusion isn't usable. Better methods are more expensive, and sometimes require properly designed assets, meaning they are not compatible. For example, to maximize a relief mapped wall you may put extra detail (such as a vine) in the texture; however, if you were just using Parallax you'd probably want to model the vine with polygons. Its important also to note that the Occlusion techniques aren't really usable in games today. This is merely meant as a extremely brief and simplistic overview of the different Parallax techniques, because, as we can see, there are at least 7 of them. I hope this cleared things up, and I hope you add your own findings and elaborate on mine on this page.