Hidden Surface Removal
Hidden Surface Removal
Fig. a
Fig. b
3. RAY TRACING
Ray tracing is a technique for generating an image by tracing the path of light through
pixels in an image plane and simulating the effects of its encounters with virtual objects. The
technique is capable of producing a very high degree of visual realism, usually higher than that
of typical scan line rendering methods, but at a greater computational cost. Although not a
hidden surface removal algorithm as such, it implicitly solves the hidden surface
removal problem by finding the nearest surface along each view-ray. Effectively this
is equivalent to sorting all the geometry on a per pixel basis.
4. WARNOCK ALGORITHM
The Warnock algorithm is a hidden surface algorithm invented by John Warnock that
is typically used in the field of computer graphics. It solves the problem of rendering a
complicated image by recursive subdivision of a scene until areas are obtained that is trivial to
compute. In other words, if the scene is simple enough to compute efficiently then it is rendered;
otherwise it is divided into smaller parts which are likewise tested for simplicity. The inputs are a
list of polygons and a viewport. The best case is that if the list of polygons is simple, and then
draws the polygons in the viewport. Simple is defined as one polygon (then the polygon or its
part is drawn in appropriate part of a viewport) or a viewport that is one pixel in size (then that
pixel gets a color of the polygon closest to the observer). The continuous step is to split the
viewport into 4 equally sized quadrants and to recursively call the algorithm for each quadrant,
with a polygon list modified such that it only contains polygons that are visible in that quadrant
4. Painter's algorithm
The idea behind the Painter's algorithm is to draw polygons far away from the eye first, followed
by drawing those that are close to the eye. Hidden surfaces will be written over in the image as
the surfaces that obscure them are drawn.
The concept is to map the objects of our scene from the world model to the screen somewhat like
an artist creating an oil painting. First she paints the entire canvas with a background colour.
Next, she adds the more distant objects such as mountains, fields, and trees. Finally, she creates
the foreground with "near" objects to complete the painting. Our approach will be identical. First
we sort the polygons according to their z-depth and then paint them to the screen, starting with
the far faces and finishing with the near faces.
The algorithm initially sorts the faces in the object into back to front order. The faces are then
scan converted in this order onto the screen. Thus a face near the front will obscure a face at the
back by overwriting it at any points where their projections overlap. This accomplishes hiddensurface removal without any complex intersection calculations between the two projected faces.
The algorithm is a hybrid algorithm in that it sorts in object space and does the final rendering in
image space.
The basic algorithm :
1. Sort all polygons in ascending order of maximum z-values.
2. Resolve any ambiguities in this ordering.
3. Scan convert each polygon in the order generated by steps (1) and (2).
The necessity for step (2) can be seen in the simple case shown in Figure 1.1
1. If the x-extents of P and Q do not overlap then the polygons do not overlap, hence their
ordering is immaterial.
2. If the y-extents of P and Q do not overlap then the polygons do not overlap, hence their
ordering is immaterial.
SHADING
Shading refers to the process of altering the color of an object/surface/polygon in the 3D
scene, based on its angle to lights and its distance from lights to create a photorealistic.
In
simple polygonal mesh models, the surface is represented by constant shading. To introduce
more realistic shading, incremental shading is necessary. Types of shading are,
i. Flat shading
ii. Smooth shading
FLAT SHADING
Flat shading is a lighting technique used in 3D computer graphics to shade each
polygon of an object based on the angle between the polygon's surface normal and the direction
of the light source, their respective colors and the intensity of the light source. It is usually used
for high speed rendering where more advanced shading techniques are too computationally
expensive. As a result of flat shading all of the polygon's vertices are colored with one color,
allowing differentiation between adjacent polygons. Specular highlights are rendered poorly with
flat shading: If there happens to be a large specular component at the representative vertex, that
brightness is drawn uniformly over the entire face. If a specular highlight doesnt fall on the
representative point, it is missed entirely. Consequently, the specular reflection component is
usually not included in flat shading computation
SMOOTH SHADING
In contrast to flat shading with smooth shading the color changes from pixel to pixel. It
assumes that the surfaces are curved and uses interpolation techniques to calculate the values of
pixels between the vertices of the polygons.
Types of smooth shading include:
Gouraud shading
Phong shading
GAURAUD SHADING
Gauraud Shading involves bilinear intensity interpolation over a polygon mesh. It is
restricted to diffuse component of the reflection model. The technique first calculates the
intensity at each vertex, assuming that the light source is at infinity. The intensity of the light
reflected over the polygonal surface can then be obtained by integrating the interpolation process
with the scan conversion process. The intensities at the edge of each scan line are calculated from
the vertex intensities and intensities along the scan line from these.
PHONG TECHNIQUE
Phong model overcomes some of the deficiencies of Gauraud technique and incorporates
specular reflection. The important feature of the Phong model is:
i. Vertex normals instead of vertex intensities are calculated by averaging normal vectors of the
surface that share the vertex.
ii. Bilinear interpolation is used for incremental interpolation of points interior to polygons.
iii. A separate intensity is evaluated for each pixel from the interpolated normals.
REFERENCES
[1] CAD CAM CIM text book -P. Radhakrishnan, S Subramanyan
[2] James Blinn, "Fractional Invisibility", IEEE Computer Graphics and Applications, Nov.
1988, pp. 77-84