Clipping (computer graphics)

Clipping (computer graphics)

Any procedure which identifies that portion of a picture which is either inside or outside a picture is referred to as a clipping algorithm or clipping.

The region against which an object is to be clipped is called clipping window.

Contents

Examples

In 2D graphics for example, if the user of an image editing program is modifying an image and has "zoomed in" the view to display only the top half of the image, there is no need for the program to spend any CPU time doing any of the calculations or memory moves needed to display the bottom half. By clipping the bottom half of the image and avoiding these calculations, the program runs faster.

In 3D graphics, in a city street scene the computer may have model, texture, and shader data in memory for every building in the city; but since the camera viewing the scene only sees things within, say, a 90° angle, or field of view, the computer does not need to transform, texture, and shade the buildings that are behind the camera, nor those which are far enough to the side that they are off the screen. The clipping algorithm lets the rendering code skip all consideration of those buildings, and the program runs faster.

Non-triviality

Clipping is non-trivial, especially for 3D animations: if the objects are built up of polygons, a routine is needed that determines for each polygon whether it is visible within the viewport (i.e. the part of the 3D "world" displayed) or cut off the borders. Special care is needed for the case of polygons intersected by the viewport border as their shape has to be adjusted.

While the term "clipping" is generally used to mean avoiding the drawing of things outside the camera's field of view, a related technique is occlusion culling, in which polygons within the field of view are not drawn if they would be occluded by other polygons. For example, there is no need to render the polygons composing the side of a building facing away from the observer; they are all completely occluded by the front of the building. Hence the software can save significant rendering time by doing a back-face culling pass before deciding which polygons to draw.

The clipping, back-face and occlusion culling optimizations both present interesting problems in scenes with a reflective surface visible. For example, problems would ensue if the 3D scene contained a mirror that showed the reflection of a building that had been clipped because the building was behind the camera. To deal with 'true' reflective surfaces (as opposed to the 'fake' reflections of environment maps), the clipper might do a clipping and rendering pass from the point of view of the mirror, and then the normal clipping pass for the camera.

Importance of clipping in video games

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.

To maximize the game's visual quality, developers prefer to establish the highest possible polygon budget; therefore, every optimization of the graphics pipeline benefits the polygon budget and therefore the game.

In video games, then, clipping is a critically important optimization that speeds up the rendering of the current scene, and therefore allows the developer to increase the renderer's polygon budget. Programmers often devise clever heuristics to speed up the clipper, as it would be computationally prohibitive to use line casting or ray tracing to determine with 100% accuracy which polygons are and are not within the camera's field of view. One of the most popular methods for optimization is the use of octrees to partition scenes into rendered and non-rendered areas.

The clipping problems introduced by reflective surfaces are generally avoided in games as of 2005 by simulating reflections without actually doing all the calculations that would be necessary for accurate reflections.

Due to the use of the term 'no clipping' to refer to turning off collision detection, the two are often confused.

Algorithms

Several clipping algorithms have been devised.


  • Circle and B-Splines clipping algorithms;
  • Polygon clipping algorithms:
    • Sutherland–Hodgman
    • Weiler–Atherton
    • Vatti

See also

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Clipping — may refer to: Contents 1 Words 2 Science and technology 3 Animals 4 Sports 5 See also …   Wikipedia

  • Graphics pipeline — In 3D computer graphics, the terms graphics pipeline or rendering pipeline most commonly refers to the current state of the art method of rasterization based rendering as supported by commodity graphics hardware[1]. The graphics pipeline… …   Wikipedia

  • Clipping path — A clipping path (or deep etch [1]) is a closed vector path, or shape, used to cut out a 2D image in image editing software. Anything inside the path will be included after the clipping path is applied; anything outside the path will be omitted… …   Wikipedia

  • Graphics processing unit — GPU redirects here. For other uses, see GPU (disambiguation). GeForce 6600GT (NV43) GPU A graphics processing unit or GPU (also occasionally called visual processing unit or VPU) is a specialized circuit designed to rapidly manipulate and alter… …   Wikipedia

  • Clipping (Computergrafik) — Als Clipping oder Abschneiden (englisch to clip = „abschneiden“, „kappen“) bezeichnet man in der Computergrafik das Abschneiden von Grundobjekten am Rand eines gewünschten Bildschirmausschnittes oder Fensters. Ein Fenster kann dabei ein… …   Deutsch Wikipedia

  • Line clipping — In computer graphics, line clipping is the process of removing lines or portions of lines outside of an area of interest. Typically, any line or part thereof which is outside of the viewing area is removed.There are two common algorithms for line …   Wikipedia

  • Computer-supported collaboration — (CSC) research focuses on technology that affects groups, organizations, communities and societies, e.g., voice mail and text chat. It grew from cooperative work study of supporting people s work activities and working relationships. As net… …   Wikipedia

  • Scalable Vector Graphics — Infobox file format name = Scalable Vector Graphics icon = caption = extension = .svg, .svgz mime = image/svg+xml [ [http://www.w3.org/TR/SVGMobile12/mimereg.html M Media Type registration for image/svg+xml] ] type code = uniform type = magic =… …   Wikipedia

  • Transform, clipping, and lighting — (T L or sometimes TCL) is a term used in computer graphics. DescriptionTransform is the task of converting spatial coordinates, which in this case involves moving three dimensional objects in a virtual world and converting the coordinates to a… …   Wikipedia

  • Weiler-Atherton clipping algorithm — used in computer graphics.It allows clipping of a subject polygon by an arbitrarily shaped clip polygon . It is generally applicable only in 2D. Description The algorithm requires polygons to be clockwise and not reentrant (self intersecting).… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”