Home | | Computer Aided Design | Hidden surface removal (HSR)

Chapter: Mechanical : Computer Aided Design : Visual Realism

Hidden surface removal (HSR)

The hidden surface removal is the procedure used to find which surfaces are not visible from a certain view.

Hidden surface removal

 

 

The hidden surface removal is the procedure used to find which surfaces are not visible from a certain view. A hidden surface removal algorithm is a solution to the visibility issue, which was one of the first key issues in the field of three dimensional graphics. The procedure of hidden surface identification is called as hiding, and such an algorithm is called a ‘hider’.Hidden surface identification is essential to render a 3D image properly, so that one cannot see through walls in virtual reality.

 

Hidden surface identification is a method by which surfaces which should not be visible to the user are prohibited from being rendered. In spite of benefits in hardware potential there is still a requirement for difficult rendering algorithms. The accountability of a rendering engine is to permit for bigger world spaces and as the world’ssize approaches infinity the rendering engine should not slow down but maintain at constant speed.

 

There are many methods for hidden surface identification. They are basically a work out in sorting, and generally vary in the order in which the sort is executed and how the problem is subdivided. Sorting more values of graphics primitives is generally done by divide.

  

1. Z - buffer algorithm

 


Fig.3.3. Z- buffer algorithm

 

In Z-buffering, the depth of ‘Z’value is verified against available depth value. If the present pixel is behind the pixel in the Z-buffer, the pixel is eliminated, or else it is shaded and its depth value changes the one in the Z-buffer. Z-buffering helps dynamic visuals easily, and is presently introduced effectively in graphics hardware.

 

 

·        Depth buffering is one of the easiest hidden surface algorithms

·        It keeps follow of the space to nearest object at every pixel position.

 

·       Initialized to most negative z value.

 

·        when image being drawn, if its z coordinate at a position is higher than z buffer value, it is drawn, and new z coordinate value is stored; or else, it is not drawn

 

·        If a line in three dimensional is being drawn, then the middle z values are interpolated: linear interpolation for polygons, and can calculate z for more difficult surfaces.

 

 

Algorithm: loop on y;

 

loop on x;

 

zbuf[x,y] = infinity;

 

loop on objects

 

{

 

loop on y within y range of this object

 

{

 

loop on x within x range of this scan line of this object

 

{

 

if z(x,y) < zbuf[x,y] compute z of this object at this pixel & test zbuf[x,y] = z(x,y) update z-buffer

 

image[x,y] = shade(x,y) update image (typically RGB)

 

}

 

}

 

}

 

Basic operations:

  

1.    compute y range of an object

 

2.    compute x range of a given scan line of an object

 

3.    Calculate intersection point of a object with ray through pixel position (x,y).

 

 

 

2.Painter’salgorithm

 

The painter's algorithm is called as a priority fill, is one of the easiest results to the visibility issue in three dimensional graphics. When projecting a 3D view onto a 2D screen, it is essential at various points to be finalized which polygons are visible, and which polygons are hidden.


Fig.3.4. Painter’salgorithm

 

The ‘painter's algorithm’shows to the method employed by most of the painters of painting remote parts of a scene before parts which are close thereby hiding some areas of distant parts. The painter's algorithm arranges all the polygons in a view by their depth and then paints them in this order, extreme to closest. It will paint over the existing parts that are usually not visible hence solving the visibility issue at the cost of having painted invisible areas of distant objects. The ordering used by the algorithm is referred a 'depth order', and does not have to respect the distances to the parts of the scene: the important characteristics of this ordering is, somewhat, that if one object has ambiguous part of another then the first object is painted after the object that it is ambiguous. Thus, a suitable ordering can be explained as a topological ordering of a directed acyclic graph showing between objects.

 

 

Algorithm:

 

sort objects by depth, splitting if necessary to handle intersections; loop on objects (drawing from back to front)

 

{

 

loop on y within y range of this object

 

{

 

loop on x within x range of this scan line of this object

 

{

 

image[x,y] = shade(x,y);

 

}

 

}

 

}

 

Basic operations:

 

1.     compute ‘y’range of an object

 

2.     compute ‘x’range of a given scan line of an object

3.     compute intersection point of  a given object with ray via pixel point (x,y).

 

4.     evaluate depth of two objects, determine if A is in front of B, or B is in front of A, if they don’t overlap in xy, or if they intersect

 

5.     divide one object by another object

 

 

Advantage of painter's algorithm is the inner loops are quite easy and limitation is sorting

 

operation.


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Mechanical : Computer Aided Design : Visual Realism : Hidden surface removal (HSR) |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.