World Library  
Flag as Inappropriate
Email this Article

Clipping (computer graphics)

Article Id: WHEBN0001932701
Reproduction Date:

Title: Clipping (computer graphics)  
Author: World Heritage Encyclopedia
Language: English
Subject: List of Sega arcade system boards, Hidden surface determination, Clipmap, Guard-band clipping, Reference desk/Archives/Computing/2015 January 2
Collection: Clipping (Computer Graphics), Computer Graphics
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Clipping (computer graphics)

Clipping, in the context of computer graphics, is a method to selectively enable or disable rendering operations within a defined region of interest. Mathematically, clipping can be described using the terminology of constructive geometry. A rendering algorithm only draws pixels in the intersection between the clip region and the scene model. Lines and surfaces outside the view volume are removed.[1]

Clip regions are commonly specified to improve render performance. A well-chosen clip allows the renderer to save time and energy by skipping calculations related to pixels that the user cannot see. Pixels that will be drawn are said to be within the clip region. Pixels that will not be drawn are outside the clip region. More informally, pixels that will not be drawn are said to be "clipped."

Contents

  • Clipping in 2D graphics 1
  • Clipping in 3D graphics 2
    • Occlusion clipping (Z- or depth clipping) 2.1
  • Importance of clipping in video games 3
  • Algorithms 4
  • See also 5
  • Further reading 6
  • References 7

Clipping in 2D graphics

In two-dimensional graphics, a clip region may be defined so that pixels are only drawn within the boundaries of a window or frame. Clip regions can also be used to selectively control pixel rendering for aesthetic or artistic purposes. In many implementations, the final clip region is the composite (or intersection) of one or more application-defined shapes, as well as any system hardware constraints

In one example application, consider an image editing program. A user application may render the image into a viewport. As the user zooms and scrolls to view a smaller portion of the image, the application can set a clip boundary so that pixels outside the viewport are not rendered. In addition, GUI widgets, overlays, and other windows or frames may obscure some pixels from the original image. In this sense, the clip region is the composite of the application-defined "user clip" and the "device clip" enforced by the system's software and hardware implementation.[2] Application software can take advantage of this clip information to save computation time, energy, and memory, avoiding work related to pixels that aren't visible.

Clipping in 3D graphics

A view frustum, with near- and far- clip planes. Only the shaded volume is rendered.

In three-dimensional graphics, the terminology of clipping can be used to describe many related features. Typically, "clipping" refers to operations in the plane that work with rectangular shapes, and "culling" refers to more general methods to selectively process scene model elements. This terminology is not rigid, and exact usage varies among many sources.

Scene model elements include geometric primitives: points or vertices; line segments or edges; polygons or faces; and more abstract model objects such as curves, splines, surfaces, and even text. In complicated scene models, individual elements may be selectively disabled (clipped) for reasons including visibility within the viewport (frustum culling); orientation (backface culling), obscuration by other scene or model elements (occlusion culling, depth- or "z" clipping). Sophisticated algorithms exist to efficiently detect and perform such clipping. Many optimized clipping methods rely on specific hardware acceleration logic provided by a graphics processing unit (GPU).

The concept of clipping can be extended to higher dimensionality using methods of abstract algebraic geometry.

Occlusion clipping (Z- or depth clipping)

In 3D computer graphics, "Z" often refers to the depth axis in the system of coordinates centered at the viewport origin: "Z" is used interchangeably with "depth", and conceptually corresponds to the distance "into the virtual screen." In this coordinate system, "X" and "Y" therefore refer to a conventional cartesian coordinate system laid out on the user's screen or viewport. This viewport is defined by the geometry of the viewing frustum, and parameterizes the field of view.

Z-clipping, or depth clipping, refers to techniques that selectively render certain scene objects based on their depth relative to the screen. Most graphics toolkits allow the programmer to specify a "near" and "far" clip depth, and only portions of objects between those two planes are displayed. A creative application programmer can use this method to render visualizations of the interior of a 3D object in the scene. For example, a

  1. ^ Bertoline, Gary; Wiebe, Eric (2002). Fundamentals of Graphics Communication (3rd ed.). McGraw-Hill. p. G-3.  
  2. ^ a b "java.awt.Graphics.clipRect". Oracle. 2014. 
  3. ^ a b c Sekulic, Dean (2004). "Efficient Occlusion Culling". GPU Gems. Pearson. Retrieved 2015-01-02. 
  4. ^ Paul Martz (2001). "Clipping, Culling, and Visibility Testing". OpenGL.org. Retrieved 2015-01-02. 

References

  • GPU Gems: Efficient Occlusion Culling [3]
  • Clipping in Java AWT: JavaDocjava.awt.Graphics.clipRect [2]
  • Clipping in UIKit for iOS (2D): UIRectClip
  • Clipping in SceneKit for iOS (3D): (Adjusting Camera Perspective) SCNCamera
  • Clipping in OpenGL: Clipping, Culling, and Visibility TestingOpenGL Technical FAQs: [4]

Further reading

See also

Algorithms

For historical reasons, some video games used collision detection optimizations with identical logic and hardware acceleration as the occlusion test. The terminology "clip" (and its antonym "no clipping") has sometimes been used to refer to collision detection. "Clip through" may refer to the situation in which part of a model passes through part of another in an unnatural manner, like a leg passing through a cape when running.

Occlusion optimizations based on viewpoint geometry may introduce artifacts if the scene contains reflective surfaces. A common technique, reflection mapping, can optionally use existing occlusion estimates from the viewpoint of the main view frustum; or, if performance allows, a new occlusion map can be computed from a separate camera position.

Clipping optimization can speed up the rendering of the current scene, economizing the use of renderer time and memory within the hardware's capability. Programmers often devise clever heuristics to speed up the clipper, as it is sometimes computationally prohibitive to use line casting or ray tracing to determine with 100% accuracy which polygons are not within the camera's field of view. Spatially aware data structures, such as octrees and R* trees can be used to partition scenes into rendered and non-rendered areas.

To maximize the game's visual quality, developers prefer to let aesthetic choices, rather than hardware limitation, dictate the polygon budget. Optimizations that save performance therefore or take advantage of graphics pipeline acceleration improve the player's experience.

Good clipping strategy is important in the development of video games in order to maximize the game's frame rate and visual quality. Despite GPU chips that are faster every year, it remains computationally expensive to transform, texture, and shade polygons, especially with the multiple texture and shading passes common today. Hence, game developers must live within a certain "budget" of polygons that can be drawn each video frame.

Importance of clipping in video games

[3] For example, a tall wall or building that occludes other game entities can save GPU time that would otherwise be spent transforming and texturing items in the rear areas of the scene; and a tightly integrated software program can use this same information to save CPU time by optimizing out game logic for objects that aren't seen by the player.[3]

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.