Unit 4
Unit 4
CIE Chromaticity
1. The chromaticity diagram represents the spectral colours and their mixtures
based on the values of the primary colours(i.e Red, Green, Blue) contained
by them.
2. Chromaticity contains two parameters i.e, hue and saturation. When we put
hue and saturation together then it is known as Chrominance.
3. The various saturated pure spectral colours are represented along the
perimeter of the curve representing the three primary colours – red, green
and blue. Point C marked in chromaticity diagram represents a particular
white light formed
Shading Algorithms:
1. Shading is referred to as the implementation of the illumination model at the pixel points
or polygon surfaces of the graphics objects.
2. Shading model is used to compute the intensities and colors to display the surface.
3. The shading model has two primary ingredients: properties of the surface and properties
of the illumination falling on it.
4. The principal surface property is its reflectance, which determines how much of the
incident light is reflected.
5. If a surface has different reflectance for the light of different wavelengths,
Epd=Rp Id
where Epd is the energy coming from point P due to diffuse illumination. Id is the diffuse
illumination falling on the entire scene, and Rp is the reflectance coefficient at P
Constant Intensity Shading
1. A fast and straightforward method for rendering an object with polygon surfaces is constant
intensity shading, also called Flat Shading.
2. In this method, a single intensity is calculated for each polygon. All points over the surface of
the polygon are then displayed with the same intensity value.
3. Constant Shading can be useful for quickly displaying the general appearances of the curved
surface as shown in fig:
Gouraud shading
1. This Intensity-Interpolation scheme, developed by Gouraud and usually referred to as Gouraud
Shading, renders a polygon surface by linear interpolating intensity value across the surface.
2. Intensity values for each polygon are coordinate with the value of adjacent polygons along the
common edges, thus eliminating the intensity discontinuities that can occur in flat shading.
3. Each polygon surface is rendered with Gouraud Shading by performing the following calculations:
a. Determining the average unit normal vector at each polygon vertex
b. Apply an illumination model to each vertex to determine the vertex intensity.
c. Linear interpolate the vertex intensities over the surface of the polygon.
4. At each polygon vertex, we obtain a normal vector by averaging the surface normals of all polygons
staring that vertex as shown in fig:
5. Thus, for any vertex position V, we acquire the unit vertex normal with the calculation
1. Halftone is the reprographic technique that simulates continuous tone imagery through the
use of dots, varying either in size, in shape or in spacing.
2. "Halftone" can also be used to refer specifically to the image that is produced by this
process.
3. The human visual system has a tendency to average brightness over small areas, so the
black dots and their white background merge and are perceived as an intermediate shade
of grey.
4. The process of generating a binary pattern of black and white dots from an image is
termed halftoning.
5. Use dots of varying size to represent intensities
6. Area of dots proportional to intensity in image
intensities in a n x n cluster
Hidden Surface Removal
1. One of the most challenging problems in computer graphics is the removal of hidden parts from images of solid
objects.
2. In real life, the opaque material of these objects obstructs the light rays from hidden parts and prevents us from
seeing them.
3. In the computer generation, no such automatic elimination takes place when objects are projected onto the screen
coordinate system.
4. Instead, all parts of every object, including many parts that should be invisible are displayed.
5. To remove these parts to create a more realistic image, we must apply a hidden line or hidden surface algorithm to
set of objects.
6. Hidden line and Hidden surface algorithms capitalize on various forms of coherence to reduce the computing
required to generate an image.
7. Different types of coherence are related to different forms of order or regularity in the image.
8. Scan line coherence arises because the display of a scan line in a raster image is usually very similar to the display
of the preceding scan line.
9. Frame coherence in a sequence of images designed to show motion recognizes that successive frames are very
similar.
10. Object coherence results from relationships between different objects or between separate parts of the same
objects.
Types of hidden surface detection algorithms
● In this method, various parts of objects are compared. After comparison visible, invisible or
hardly visible surface is determined.
● These methods generally decide visible surface. In the wireframe model, these are used to
determine a visible line. So these algorithms are line based instead of surface based.
● Here positions of various pixels are determined. It is used to locate the visible surface instead
of a visible line.
● Each point is detected for its visibility. If a point is visible, then the pixel is on, otherwise off.
● So the object close to the viewer that is pierced by a projector through a pixel is determined.
That pixel is drawn is appropriate color.
Algorithms used for hidden line surface detection
N1=(v2-v1 )(v3-v2)
If N1.P≥0 visible
N1.P<0 invisible
Back Face Removed Algorithm
Repeat for all polygons in the scene.
Algorithm
For all pixels on the screen, set depth [x, y] to 1.0 and intensity [x, y] to a background value.
For each polygon in the scene, find all pixels (x, y) that lie within the boundaries of a polygon when
projected onto the screen. For each of these pixels:
(b) If z < depth [x, y], this polygon is closer to the observer than others already recorded for this pixel.
In this case, set depth [x, y] to z and intensity [x, y] to a value corresponding to polygon's shading. If
instead z > depth [x, y], the polygon already recorded at (x, y) lies closer to the observer than does this
new polygon, and no action is taken.
3. After all, polygons have been processed; the intensity array will contain the solution.
4. The depth buffer algorithm illustrates several features common to all hidden surface
algorithms.
5. First, it requires a representation of all opaque surface in scene polygon in this case.
6. These polygons may be faces of polyhedral recorded in the model of scene or may simply
represent thin opaque 'sheets' in the scene.
Painter Algorithm
● It came under the category of list priority algorithm. It is also called a depth-sort algorithm.
In this algorithm ordering of visibility of an object is done. If objects are reversed in a
particular order, then correct picture results.
● Objects are arranged in increasing order to z coordinate. Rendering is done in order of z
coordinate. Further objects will obscure near one. Pixels of rear one will overwrite pixels of
farther objects. If z values of two overlap, we can determine the correct order from Z value
as shown in fig (a).
● If z objects overlap each other as in fig (b) this correct order can be maintained by splitting
of objects.
● Depth sort algorithm or painter algorithm was developed by Newell, sancha. It is called the
painter algorithm because the painting of frame buffer is done in decreasing order of distance.
The distance is from view plane. The polygons at more distance are painted firstly.
● The concept has taken color from a painter or artist. When the painter makes a painting, first of
all, he will paint the entire canvas with the background color. Then more distance objects like
mountains, trees are added. Then rear or foreground objects are added to picture. Similar
approach we will use. We will sort surfaces according to z values. The z values are stored in the
refresh buffer.
Painter Algorithm
Step1: Start Algorithm
Step2: Sort all polygons by z value keep the largest value of z first.
The success of any test with single overlapping polygon allows F to be painted.
Area Subdivision Algorithm
1. Inside surface: It is surface which is completely inside the surrounding window or specified boundary as
shown in fig(b).
2. Outside surface: The polygon surface completely outside the surrounding window as shown in fig (d)
3. Surrounding surface: It is polygon surface which completely encloses the surrounding window as
shown in fig (e)
4. Overlapping surface: It is surface partially inside or partially outside the surface area as shown in fig (c)