Displacement Shader
   HOME

TheInfoList



OR:

Displacement mapping is an alternative computer graphics technique in contrast to
bump Bump or Bumps may refer to: * A collision or impact * A raised protrusion on the skin such as a pimple, goose bump, prayer bump, lie bumps, etc. Infrastructure and industry * Coal mine bump, a seismic jolt occurring within a mine * Bump (uni ...
,
normal Normal(s) or The Normal(s) may refer to: Film and television * ''Normal'' (2003 film), starring Jessica Lange and Tom Wilkinson * ''Normal'' (2007 film), starring Carrie-Anne Moss, Kevin Zegers, Callum Keith Rennie, and Andrew Airlie * ''Norma ...
, and
parallax Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight and is measured by the angle or semi-angle of inclination between those two lines. Due to foreshortening, nearby objects ...
mapping, using a
texture Texture may refer to: Science and technology * Surface texture, the texture means smoothness, roughness, or bumpiness of the surface of an object * Texture (roads), road surface characteristics with waves shorter than road roughness * Texture (c ...
or
height map In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics. A heightm ...
to cause an effect where the actual geometric position of points over the textured surface are ''displaced'', often along the
local Local may refer to: Geography and transportation * Local (train), a train serving local traffic demand * Local, Missouri, a community in the United States * Local government, a form of public administration, usually the lowest tier of administrat ...
surface normal In geometry, a normal is an object such as a line, ray, or vector that is perpendicular to a given object. For example, the normal line to a plane curve at a given point is the (infinite) line perpendicular to the tangent line to the curve at ...
, according to the value the texture function evaluates to at each point on the surface. It gives surfaces a great sense of depth and detail, permitting in particular self-occlusion,
self-shadowing Self-Shadowing is a computer graphics lighting effect, used in 3D rendering applications such as computer animation and video games. Self-shadowing allows non-static objects in the environment, such as game characters and interactive objects ...
and silhouettes; on the other hand, it is the most costly of this class of techniques owing to the large amount of additional geometry. For years, displacement mapping was a peculiarity of high-end rendering systems like
PhotoRealistic RenderMan Pixar RenderMan (formerly PhotoRealistic RenderMan) is proprietary photorealistic 3D rendering software produced by Pixar Animation Studios. Pixar uses RenderMan to render their in-house 3D animated movie productions and it is also available as ...
, while realtime APIs, like
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
and
DirectX Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct", ...
, were only starting to use this feature. One of the reasons for this is that the original implementation of displacement mapping required an adaptive
tessellation A tessellation or tiling is the covering of a surface, often a plane (mathematics), plane, using one or more geometric shapes, called ''tiles'', with no overlaps and no gaps. In mathematics, tessellation can be generalized to high-dimensional ...
of the surface in order to obtain enough
micropolygon In 3D computer graphics, a micropolygon (or μ-polygon) is a polygon that is very small relative to the image being rendered. Commonly, the size of a micropolygon is close to or even less than the area of a pixel. Micropolygons allow a renderer ...
s whose size matched the size of a pixel on the screen.


Meaning of the term in different contexts

Displacement mapping includes the term mapping which refers to a
texture map Texture mapping is a method for mapping a texture on a computer-generated graphic. Texture here can be high frequency detail, surface texture, or color. History The original technique was pioneered by Edwin Catmull in 1974. Texture mapping ...
being used to modulate the displacement strength. The displacement direction is usually the local surface normal. Today, many renderers allow programmable shading which can create high quality (multidimensional)
procedural texture In computer graphics, a procedural texture is a texture created using a mathematical description (i.e. an algorithm) rather than directly stored data. The advantage of this approach is low storage cost, unlimited texture resolution and easy textur ...
s and
patterns A pattern is a regularity in the world, in human-made design, or in abstract ideas. As such, the elements of a pattern repeat in a predictable manner. A geometric pattern is a kind of pattern formed of geometric shapes and typically repeated l ...
at arbitrarily high frequencies. The use of the term mapping becomes arguable then, as no texture map is involved anymore. Therefore, the broader term displacement is often used today to refer to a super concept that also includes displacement based on a texture map. Renderers using the REYES
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
, or similar approaches based on
micropolygon In 3D computer graphics, a micropolygon (or μ-polygon) is a polygon that is very small relative to the image being rendered. Commonly, the size of a micropolygon is close to or even less than the area of a pixel. Micropolygons allow a renderer ...
s, have allowed displacement mapping at arbitrary high frequencies since they became available almost 20 years ago. The first commercially available renderer to implement a micropolygon displacement mapping approach through REYES was
Pixar Pixar Animation Studios (commonly known as Pixar () and stylized as P I X A R) is an American computer animation studio known for its critically and commercially successful computer animated feature films. It is based in Emeryville, Californi ...
's
PhotoRealistic RenderMan Pixar RenderMan (formerly PhotoRealistic RenderMan) is proprietary photorealistic 3D rendering software produced by Pixar Animation Studios. Pixar uses RenderMan to render their in-house 3D animated movie productions and it is also available as ...
. Micropolygon renderers commonly tessellate geometry themselves at a granularity suitable for the image being rendered. That is: the modeling application delivers high-level primitives to the renderer. Examples include true
NURBS Non-uniform rational basis spline (NURBS) is a mathematical model using basis splines (B-splines) that is commonly used in computer graphics for representing curves and surfaces. It offers great flexibility and precision for handling both analyt ...
- or
subdivision surfaces In the field of 3D computer graphics, a subdivision surface (commonly shortened to SubD surface) is a curved surface represented by the specification of a coarser polygon mesh and produced by a recursive algorithmic method. The curved surface, t ...
. The renderer then tessellates this geometry into micropolygons at render time using view-based constraints derived from the image being rendered. Other renderers that require the modeling application to deliver objects pre-tessellated into arbitrary polygons or even triangles have defined the term displacement mapping as moving the vertices of these polygons. Often the displacement direction is also limited to the surface normal at the vertex. While conceptually similar, those polygons are usually a lot larger than micropolygons. The quality achieved from this approach is thus limited by the geometry's tessellation density a long time before the renderer gets access to it. This difference between displacement mapping in micropolygon renderers vs. displacement mapping in a non-tessellating (macro)polygon renderers can often lead to confusion in conversations between people whose exposure to each technology or implementation is limited. Even more so, as in recent years, many non-micropolygon renderers have added the ability to do displacement mapping of a quality similar to that which a micropolygon renderer is able to deliver naturally. To distinguish between the crude pre-tessellation-based displacement these renderers did before, the term sub-pixel displacement was introduced to describe this feature. Sub-pixel displacement commonly refers to finer re-tessellation of geometry that was already tessellated into polygons. This re-tessellation results in micropolygons or often microtriangles. The vertices of these then get moved along their normals to achieve the displacement mapping. True micropolygon renderers have always been able to do what sub-pixel-displacement achieved only recently, but at a higher quality and in arbitrary displacement directions. Recent developments seem to indicate that some of the renderers that use sub-pixel displacement move towards supporting higher level geometry too. As the vendors of these renderers are likely to keep using the term sub-pixel displacement, this will probably lead to more obfuscation of what displacement mapping really stands for, in
3D computer graphics 3D computer graphics, or “3D graphics,” sometimes called CGI, 3D-CGI or three-dimensional computer graphics are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for th ...
. In reference to Microsoft's proprietary
High Level Shader Language The High-Level Shader Language or High-Level Shading Language (HLSL) is a proprietary shading language developed by Microsoft for the Direct3D 9 API to augment the shader assembly language, and went on to become the required shading language f ...
, displacement mapping can be interpreted as a kind of "vertex-texture mapping" where the values of the
texture map Texture mapping is a method for mapping a texture on a computer-generated graphic. Texture here can be high frequency detail, surface texture, or color. History The original technique was pioneered by Edwin Catmull in 1974. Texture mapping ...
do not alter pixel colors (as is much more common), but instead change the position of vertices. Unlike bump, normal and parallax mapping, all of which can be said to "fake" the behavior of displacement mapping, in this way a genuinely ''rough'' surface can be produced from a texture. It has to be used in conjunction with adaptive
tessellation A tessellation or tiling is the covering of a surface, often a plane (mathematics), plane, using one or more geometric shapes, called ''tiles'', with no overlaps and no gaps. In mathematics, tessellation can be generalized to high-dimensional ...
techniques (that increases the number of rendered polygons according to current viewing settings) to produce highly detailed meshes.


See also

*
Heightmap In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics. A heightm ...
*
Sculpted prim ''Second Life'' is an online multimedia platform that allows people to create an avatar for themselves and then interact with other users and user created content within a multi player online virtual world. Developed and owned by the San Fra ...


Further reading


Blender Displacement MappingVray Displacement Mapping


website
Parallax Occlusion Mapping in GLSL on sunandblackcat.com

''Real-Time Relief Mapping on Arbitrary Polygonal Surfaces''
paper
''Relief Mapping of Non-Height-Field Surface Details''
paper *
State of the art of displacement mapping on the gpu
' paper {{Texture mapping techniques Texture mapping