0% found this document useful (0 votes)
5 views12 pages

Computer Graphics Unit 5

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 12

RENAISSANCE UNIVERSITY, INDORE

School of Computer Science


BCA/BSC V Sem
Subject: Computer Graphics

Unit 5

Basic Illumination Models

Illumination models describe how light interacts with surfaces in a scene to produce realistic
images. These models are crucial in computer graphics to simulate how objects appear under
various lighting conditions. The most common models are:

1. Ambient Lighting

● Ambient lighting is a simple, uniform light source that is present everywhere in the scene. It
doesn’t come from a specific direction and affects all objects equally.
● It is used to simulate the effect of indirect light that has scattered multiple times in the
environment. It prevents areas from being completely dark, giving a base brightness to all
surfaces.

2. Diffuse Reflection

● Diffuse reflection occurs when light hits a rough surface and is scattered evenly in all
directions.
● It Creates a soft, matte appearance without highlights, suitable for materials like wood,
fabric, and matte paint.

3. Specular Reflection

● Specular reflection occurs when light reflects off a shiny or smooth surface, like metal or
glass, in a single direction.
● It creates a glossy, reflective appearance, highlighting the material’s smoothness or polish.

Properties of Light

1. Wavelength and Color

● Light is an electromagnetic wave with different wavelengths corresponding to different


colors.
● The visible spectrum for humans ranges from approximately 380 nm (violet) to 750 nm
(red).
● Each wavelength corresponds to a unique color sensation: shorter wavelengths are
blue/violet, and longer wavelengths are red/orange.
2. Intensity

● The brightness of light, which determines how much light energy is hitting a surface.
● Higher intensity results in brighter illumination.

3. Direction

● Light has directionality, which affects how it interacts with surfaces.


● Direct light creates strong shadows, while diffuse light results in softer lighting.

4. Reflection, Absorption, and Transmission

● When light hits a surface, it can be:


○ Reflected (bounced off the surface),
○ Absorbed (converted to heat or other energy), or
○ Transmitted (passed through the object, like glass).

Standard Primaries

Standard primaries are specific colors used as references for color reproduction systems, such as
monitors, cameras, and printers. They are foundational in defining a color space.

RGB Primaries

● Red, Green, and Blue are the standard primaries for additive color models.
● By combining these primaries in different intensities, a wide range of colors can be created.
● Used in digital displays, lighting, and digital photography.

CMY Primaries

● Cyan, Magenta, and Yellow are the primaries for the subtractive color model.
● Mixing these colors absorbs (subtracts) light, creating a range of colors.
● Commonly used in color printing.

Diffuse Reflection
Diffuse reflection is the reflection of light from a surface such that an incident ray is reflected at
many angles, rather than at just one angle as in the case of specular reflection.
An illuminated ideal diffuse reflecting surface will have equal luminance from all directions in the
hemisphere surrounding the surface, i.e. Lambertian reflectance. A surface built from a
non-absorbing powder such as plaster, or from fibres such as paper, or from a polycrystalline
material such as white marble, reflects light diffusely with great efficiency. Many common materials
exhibit a mixture of specular and diffuse reflection.
When a beam of light falls at a particular angle onto a very smooth opaque surface, almost the whole
light will be reflected from the interface along a narrow set of directions. The surface would be
judged as very glossy as shown in Fig. (a). At certain viewing angles on the surface, an observer can
view the reflected images of the surroundings. The interface of a very rough surface will tend to
reflect light at many different angles, because the light meets the surface at many different angles.
The reflected light is so diffused that the observer cannot view images of the surroundings. The
reflection from such a matte surface is shown in Fig. (c).

Specular Reflection
Specular reflection is a type of surface reflectance often described as a mirror-like reflection of light
from the surface. In specular reflection, the incident light is reflected into a single outgoing
direction.

Light reflects on a surface known as specular surface (similar to that of a mirror) at the angle of
incidence. It is further reflected at a similar angle.

The type of surface on which it is reflected, as well as the position of the light source, affect the
secondary beam. For instance, consider when light falls on an uneven or irregular surface such as an
unpolished or ragged surface. The absorption effect is higher because it reduces the reflected light
beam’s strength. To produce specular reflection, surface irregularities need to be smaller than the
length of the beam’s radiation, such as in the case of polished metal, glass, plastic or transparent
liquid surfaces. On a “perfect” surface, the angle of beam radiation is equivalent to that of the
incident radiation.

Specular reflection rarely occurs in nature, but rather in man-made spaces. Still waters are an
example of nature’s ability to produce this type of reflection.
Diffuse vs. Specular Reflection

Property Diffuse Reflection Specular Reflection

Surface Type Rough, matte surfaces Smooth, shiny surfaces

Light Distribution Scattered in all directions Reflected in a specific direction

View-Dependent No (appears the same from all Yes (depends on the viewer’s
angles) position)

Visual Effect Soft, even shading Bright, sharp highlights

Color Model

A Color Model is a mathematical representation that describes the way colors can be created,
represented, and manipulated. It is a systematic method to define colors by using sets of numbers
(or parameters) which correspond to color components or channels. These models are crucial in
computer graphics, printing, television, photography, and other visual media because they help
manage how colors are represented and transferred between devices.
1. RGB Color Model

The RGB Color Model is an additive color model used primarily in electronic displays, such as
computer screens, televisions, and cameras. The RGB model represents colors by combining three
primary colors: Red, Green, and Blue. Each of these colors can have an intensity ranging from 0 (no
color) to 255 (full intensity).

In RGB, colors are created by adding light. Combining all three colors at full intensity (255, 255,
255) results in white, while (0, 0, 0) is black.

RGB allows for over 16 million different color combinations (256 values for each color channel).

Applications: The RGB model is used in:

● Digital screens (monitors, TVs, and smartphones)


● Digital cameras
● Web design (HTML, CSS)

Example of RGB Values:

● Pure Red: (255, 0, 0)


● Pure Green: (0, 255, 0)
● Pure Blue: (0, 0, 255)
● Yellow: (255, 255, 0)
● Cyan: (0, 255, 255)
● Magenta: (255, 0, 255)

2. CMY Color Model

The CMY Color Model is a subtractive color model used primarily in color printing. It represents
colors by combining three primary colors: Cyan, Magenta, and Yellow.

CMY is based on the concept of light absorption. Instead of adding light, it subtracts wavelengths
from white light. For example, cyan absorbs red, magenta absorbs green, and yellow absorbs blue.
When combined:
○ Cyan + Magenta = Blue
○ Cyan + Yellow = Green
○ Magenta + Yellow = Red

The combination of CMY colors can produce a wide range of colors, although it does not include as
many colors as the RGB model due to limitations in ink.

In practical printing, a fourth color, Black (K), is added to the CMY model to form CMYK. This is
because combining cyan, magenta, and yellow rarely results in a pure black, so black ink is used to
improve contrast and detail.

Applications: The CMY/CMYK model is used in:

● Color printing (books, magazines, brochures)


● Physical media design

Example of CMY Values:

● Pure Cyan: (1, 0, 0)


● Pure Magenta: (0, 1, 0)
● Pure Yellow: (0, 0, 1)

3. YIQ Color Model

The YIQ Color Model is a color space used primarily in analog television broadcasting, particularly
in the United States with the NTSC (National Television System Committee) standard. It separates
color information into three components: Y, I, and Q.

● Y (Luminance): Represents the brightness or grayscale component of the image. It


determines the perceived intensity (black and white information) of the picture, making it
crucial for image clarity.
● I (In-phase Chrominance): Carries hue information, focusing more on the orange-cyan
range. It provides color details that are sensitive to human vision.
● Q (Quadrature Chrominance): Carries additional color information, emphasizing the
green-magenta range.
Unlike RGB, YIQ separates image intensity (luminance) from color information (chrominance). This
allows for better compression and transmission of data in broadcasting since the human eye is more
sensitive to brightness than to color differences.

The YIQ model is used in:

● Analog color television (NTSC)


● Some video compression systems
● Legacy broadcasting technologies

Comparison of RGB, CMY, and YIQ Models

Aspect RGB CMY YIQ

Type Additive Color Model Subtractive Color Luminance-Chrominance


Model Color Model

Primary Red, Green, Blue Cyan, Magenta, Yellow Luminance (Y), In-phase
Components (and Black) (I), Quadrature (Q)

Applications Screens, Digital Media Printing, Physical Analog TV Broadcasting


Media (NTSC)

Mixing Light-based, Ink-based, combines Separates brightness from


combines to make to make black color
white

Each color model is tailored to specific uses, ensuring that colors are represented and reproduced
accurately for various media types.
Animation

Animation refers to the movement on the screen of the display device created by displaying a
sequence of still images. Animation is the technique of designing, drawing, making layouts and
preparation of photographic series which are integrated into the multimedia and gaming products.
Animation connects the exploitation and management of still images to generate the illusion of
movement. A person who creates animations is called animator. He/she use various computer
technologies to capture the pictures and then to animate these in the desired sequence.

Animation includes all the visual changes on the screen of display devices. These are:

1. Change of shape as shown in fig:

2. Change in size as shown in fig:

3. Change in color as shown in fig:


4. Change in structure as shown in fig:

5. Change in angle as shown in fig:

Principles of Animation

The 12 Principles of Animation were introduced by Disney animators Ollie Johnston and Frank
Thomas in the 1980s to describe the core principles that create lifelike animations. These are:

1. Squash and Stretch: Gives the illusion of weight and flexibility to objects.
2. Anticipation: Prepares the audience for major actions the character will perform.
3. Staging: Directs the audience’s attention to the most important parts of the scene.
4. Straight Ahead Action and Pose-to-Pose: Different approaches to
animation—straight-ahead creates spontaneity, while pose-to-pose is more planned and
controlled.
5. Follow Through and Overlapping Action: Provides realistic motion by having body parts
move at different speeds and stop at different times.
6. Slow In and Slow Out: Increases the realism of motion by varying the speed of the start and
end of movements.
7. Arc: Objects tend to move in curved paths (arcs) for more natural-looking movements.
8. Secondary Action: Additional actions that complement the main action, adding depth and
detail.
9. Timing: Involves the number of frames for a particular action, influencing the speed and
emotion conveyed.
10. Exaggeration: Adds more appeal and impact by overstating actions or features.
11. Solid Drawing: Understanding basic drawing techniques to create three-dimensional forms
and realistic characters.
12. Appeal: Ensuring that characters and objects are visually engaging and interesting.
Application Areas of Animation

1. Education and Training: Animation is used in school, colleges and training centers for education
purpose. Flight simulators for aircraft are also animation based.

2. Entertainment: Animation methods are now commonly used in making motion pictures, music
videos and television shows, etc.

3. Computer Aided Design (CAD): One of the best applications of computer animation is Computer
Aided Design and is generally referred to as CAD. One of the earlier applications of CAD was
automobile designing. But now almost all types of designing are done by using CAD application, and
without animation, all these works can't be possible.

4. Advertising: This is one of the significant applications of computer animation. The most
important advantage of an animated advertisement is that it takes very less space and capture
people attention.

Animation Functions

1. Morphing
Morphing is an animation function which is used to transform object shape from one form to
another is called Morphing. It is one of the most complicated transformations. This function is
commonly used in movies, cartoons, advertisement, and computer games.
2. Wrapping:
Wrapping function is similar to morphing function. It distorts only the initial images so that it matches
with final images and no fade occurs in this function.

3. Tweening:
Tweening is the short form of 'inbetweening.' Tweening is the process of generating intermediate
frames between the initial & last final images. This function is popular in the film industry.

4. Panning:

Usually Panning refers to rotation of the camera in horizontal Plane. In computer graphics, Panning
relates to the movement of fixed size window across the window object in a scene. In which
direction the fixed sized window moves, the object appears to move in the opposite direction as
shown in fig:

If the window moves in a backward direction, then the object appear to move in the forward direction
and the window moves in forward direction then the object appear to move in a backward direction.

5. Zooming:

In zooming, the window is fixed an object and change its size, the object also appear to change in size.
When the window is made smaller about a fixed center, the object comes inside the window appear
more enlarged. This feature is known as Zooming In.
When we increase the size of the window about the fixed center, the object comes inside the window
appear small. This feature is known as Zooming Out.

6. Fractals:
Fractal Function is used to generate a complex picture by using
Iteration. Iteration means the repetition of a single formula again
& again with slightly different value based on the previous
iteration result. These results are displayed on the screen in the
form of the display picture.

You might also like