0% found this document useful (0 votes)
14 views29 pages

UNIT 4 Module

The document outlines the fundamentals of color models and realism in computer graphics, emphasizing the evolution from simple drawings to photorealistic renderings. It covers basic illumination models, including ambient, diffuse, and specular reflections, along with halftoning and dithering techniques for simulating continuous tones. The importance of these concepts is highlighted for various applications in gaming, film, and virtual reality, as well as their implementation in modern graphics processing units.

Uploaded by

thamizhm0206
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views29 pages

UNIT 4 Module

The document outlines the fundamentals of color models and realism in computer graphics, emphasizing the evolution from simple drawings to photorealistic renderings. It covers basic illumination models, including ambient, diffuse, and specular reflections, along with halftoning and dithering techniques for simulating continuous tones. The importance of these concepts is highlighted for various applications in gaming, film, and virtual reality, as well as their implementation in modern graphics processing units.

Uploaded by

thamizhm0206
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

IFETCE R-2019A

Academic Year: 2025-26

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


UNIT IV: COLOUR MODELS AND REALISM Computer Graphics
Module

Basic illumination models - halftone patterns and dithering techniques - Properties of light -
Standard primaries and chromaticity diagram; Intuitive colour concepts – Color Model :
RGB – YIQ – CMY – HSV – HLS. Computer Graphics Realism: Tiling the plane –
Recursively defined curves – space filling curves – fractals – ray tracing.

1. INTRODUCTION TO COLOUR MODELS AND REALISM


Computer graphics has evolved from simple line drawings to photorealistic renderings that rival
photography. This transformation has been driven by advances in color representation and realistic
rendering techniques. Understanding color models and realism is fundamental to creating
compelling visual experiences in games, films, virtual reality, and scientific visualization.
Color models provide mathematical frameworks for representing and manipulating colors in digital
systems. Different applications require different color models: monitors use RGB (Red, Green,
Blue), printers use CMYK (Cyan, Magenta, Yellow, Black), and artists often work with HSV (Hue,
Saturation, Value) for intuitive color selection.
Realism in computer graphics encompasses techniques that simulate the physical behavior of light
and matter. From basic illumination models that calculate how surfaces reflect light, to
sophisticated ray tracing algorithms that simulate global illumination, these techniques enable the
creation of images that appear three-dimensional and lifelike on two-dimensional screens.
This module explores both the theoretical foundations and practical applications of color models
and realistic rendering. We begin with fundamental illumination models, progress through color
theory and representation, and conclude with advanced techniques for generating realistic imagery
including fractals and ray tracing.
The importance of these topics extends beyond academic interest. Modern graphics processing units
(GPUs) implement these algorithms in hardware, enabling real-time rendering for interactive
applications. Understanding these concepts is essential for graphics programmers, game developers,
digital artists, and anyone working with visual computing technologies.
2. BASIC ILLUMINATION MODELS
Illumination models are mathematical frameworks that describe how light interacts with surfaces to
produce the colors we see. These models form the foundation of realistic rendering in computer
graphics, determining how objects appear under various lighting conditions.
The goal of illumination modeling is to calculate the intensity and color of light reaching the viewer
from each point on a surface. This calculation depends on several factors: the properties of the light
source, the material properties of the surface, the geometry of the scene, and the position of the
viewer.
2.1Ambient Light
IFETCE R-2019A
Academic Year: 2025-26

Ambient illumination represents the uniform, non-directional light that illuminates all surfaces
equally. In the real world, ambient light results from multiple reflections and scattering that create a
general level of illumination even in areas not directly lit by light sources.
The ambient illumination model is the simplest lighting model:
I ambient =k a ⋅ I a

Where:
 I ambient is the ambient light intensity reaching the viewer

 k a is the ambient reflection coefficient of the material (0 ≤ k a ≤ 1)

 I a is the intensity of the ambient light source

The ambient reflection coefficient k a represents the fraction of ambient light that the surface
reflects. A value of 0 means the surface absorbs all ambient light (appears black), while a value of 1
means the surface reflects all ambient light.
Ambient lighting alone produces flat, unrealistic images because it provides no information about
the three-dimensional shape of objects. However, it serves an important role in preventing
completely dark areas and providing a base level of illumination in realistic rendering systems.
In practice, ambient lighting is often implemented as a constant term added to more sophisticated
lighting calculations. The ambient component ensures that no surface appears completely black,
which would be unrealistic in most real-world lighting conditions.

2.2 Diffuse Reflection (Lambert Model)


Diffuse reflection, also known as Lambertian reflection, describes how rough or matte surfaces
scatter incident light uniformly in all directions. This model, formulated by Johann Heinrich
Lambert in 1760, is fundamental to computer graphics lighting.
The key principle of Lambertian reflection is that the apparent brightness of a surface depends only
on the angle between the incident light direction and the surface normal, not on the viewing
direction. This means a Lambertian surface appears equally bright from all viewing angles when the
lighting remains constant.
The mathematical model for diffuse reflection is:
I diffuse =k d ⋅ I p ⋅max (0 , ⃗
N ⋅⃗
L)

Where:
 I diffuse is the diffusely reflected light intensity

 k d is the diffuse reflection coefficient (0 ≤ k d ≤ 1)

 I p is the intensity of the point light source


IFETCE R-2019A
Academic Year: 2025-26

 ⃗
N is the unit surface normal vector
 ⃗
L is the unit vector pointing from the surface toward the light source

 max (0 , x) ensures that surfaces facing away from the light source (⃗
N ⋅ ⃗L <0) receive no
direct illumination

The dot product ⃗N ⋅ ⃗L equals cos θ , where θ is the angle between the surface normal and the light
direction. This cosine relationship means that:
 Surfaces perpendicular to the light direction (θ=0 °) receive maximum illumination
 Surfaces at grazing angles receive proportionally less light
 Surfaces facing away from the light (θ> 90° ) receive no direct illumination
The Lambert model accurately represents many real materials including paper, unfinished wood,
concrete, and fabrics. It forms the foundation for more complex shading models and is
computationally efficient, making it widely used in real-time graphics applications.

2.3 Specular Reflection (Phong Model)


Specular reflection creates the bright highlights visible on shiny surfaces like polished metal,
plastic, or wet objects. Unlike diffuse reflection, specular reflection is highly directional, creating
highlights that change position as either the light source or viewer moves.
The Phong reflection model, developed by Bui Tuong Phong in 1975, provides a computationally
efficient approximation of specular reflection:
I specular =k s ⋅ I p ⋅¿

Where:
 I specular is the specularly reflected light intensity

 k s is the specular reflection coefficient (0 ≤ k s ≤ 1)

 I p is the intensity of the point light source

 ⃗
R is the unit vector in the perfect reflection direction
 ⃗
V is the unit vector pointing from the surface toward the viewer
 n is the shininess exponent (typically 1 ≤ n ≤ 200)

The reflection vector ⃗


R is calculated using the incident light vector ⃗
L and surface normal ⃗
N:

R =2( ⃗
N ⋅ ⃗L) ⃗
N−⃗
L
The shininess exponent n controls the size and sharpness of the specular highlight:
IFETCE R-2019A
Academic Year: 2025-26

 Small values (n = 1-10) create large, soft highlights typical of rough metals
 Large values (n = 50-200) create small, sharp highlights typical of highly polished surfaces
 Very large values (n > 500) approach mirror-like reflection
The Phong model is an empirical approximation that doesn’t perfectly match physical reflection but
provides visually acceptable results with low computational cost. More physically accurate models
like Blinn-Phong or Cook-Torrance are used when higher realism is required.

2.4 Combined Illumination Equation


Real-world surfaces exhibit combinations of ambient, diffuse, and specular reflection. The
complete Phong illumination model combines all three components:
I total=I ambient + I diffuse + I specular

I total=k a I a +k d I p max(0 , ⃗
N ⋅⃗
L )+ k s I p ¿

For color rendering, this calculation is performed separately for red, green, and blue components:
I total ,red ∧¿ k a ,red I a ,red +k d ,red I p ,red max(0 , ⃗
N ⋅⃗
L )+ k s , red I p ,red ¿
¿
The material properties (k a ,k d , k s ) and shininess n determine the surface appearance:

 Matte surfaces: high k d, low k s, any n

 Shiny surfaces: moderate k d, high k s, large n

 Metallic surfaces: low k d, high k s, large n

 Plastic surfaces: moderate k d, moderate k s, moderate n

2.5 Worked Examples


Example 1: Basic Phong Illumination
Consider a surface point with the following parameters:
 Surface normal: ⃗
N =(0 , 0 , 1)

 Light direction: ⃗
L=(0.577 , 0.577 , 0.577) (pointing toward upper-right)

 View direction: ⃗
V =(0 , 0 , 1) (viewer directly above)

 Material properties: k a=0.1, k d=0.6 , k s=0.3 , n=64

 Light intensities: I a=0.2, I p=1.0

Step 1: Calculate ambient component


IFETCE R-2019A
Academic Year: 2025-26

I ambient =k a ⋅ I a=0.1 ×0.2=0.02

Step 2: Calculate diffuse component



N⋅⃗ L ∧¿(0)(0.577)+(0)(0.577)+(1)(0.577)=0.577
I diffuse ∧¿ k d ⋅ I p ⋅max(0 , ⃗
N ⋅⃗
L )=0.6 × 1.0× 0.577=0.346

Step 3: Calculate reflection vector



R∧¿ 2( ⃗N ⋅⃗
L) ⃗
N −⃗L
¿=2(0.577)(0 , 0 , 1)−(0.577 , 0.577 , 0.577)
¿=(0 ,0 ,1.154)−(0.577 ,0.577 ,0.577)
¿=(−0.577 ,−0.577 , 0.577)
Step 4: Calculate specular component

R ⋅⃗
V ∧¿ (−0.577)(0)+(−0.577)(0)+(0.577)(1)=0.577
I specular∧¿ k s ⋅ I p ⋅¿
¿
Step 5: Calculate total illumination
−6
I total=0.02+0.346+ 1.04 ×10 ≈ 0.366

Example 2: Material Comparison


Compare the appearance of three different materials under identical lighting:
Material A (Matte): k a=0.1, k d=0.8 , k s=0.1, n=5 Material B (Plastic): k a=0.1, k d=0.4 , k s=0.5 ,
n=32 Material C (Metal): k a=0.05, k d=0.2 , k s=0.75 , n=128
Using the same lighting conditions as Example 1:
 Material A: I total=0.02+0.462+0.046=0.528 (dominated by diffuse)

 Material B: I total=0.02+0.231+0.043=0.294 (balanced)

 Material C: I total=0.01+0.115+2.6 ×10−5=0.125 (sharp specular)

2.6 Practice Problems


Problem 1: Calculate the illumination for a surface with normal ⃗ N =(0.707 , 0.707 , 0), light
direction ⃗
L=(1 ,0 ,0), view direction ⃗
V =(0 , 0 , 1) , and material properties k a=0.2, k d=0.5 , k s=0.3 ,
n=16.
Problem 2: A surface receives light from two sources. Calculate the total illumination using
superposition principle.
Problem 3: Determine material parameters that would simulate: (a) chalk, (b) polished marble, (c)
brushed aluminum.
IFETCE R-2019A
Academic Year: 2025-26

3. HALFTONE PATTERNS AND DITHERING TECHNIQUES


Digital displays and printers have limited capability to reproduce continuous color variations.
Computer monitors typically display 256 levels (8 bits) per color channel, while printers often use
only binary ink deposition. Halftoning and dithering are essential techniques for creating the
illusion of continuous tones using discrete, limited color palettes.
These techniques exploit the spatial integration properties of human vision: when fine patterns are
viewed from sufficient distance, the eye perceives an average intensity rather than individual dots
or pixels. This perceptual phenomenon enables effective simulation of grayscale and color
gradations using only black and white dots or limited color sets.

3.1 Halftone Patterns


Halftoning originated in the printing industry for reproducing photographs in newspapers and
magazines using only black ink on white paper. The technique uses patterns of dots whose size,
spacing, or density varies to represent different gray levels.
Amplitude Modulated (AM) Halftoning: In AM halftoning, dots are arranged in a regular grid
with fixed spacing, but dot sizes vary to represent different intensities. Larger dots create darker
regions, while smaller dots create lighter regions. This method is widely used in commercial
printing.
The relationship between dot area and perceived gray level follows:
Dot Area
Gray Level=
Cell Area
For circular dots in square cells:
2
πr
Gray Level= 2
s
Where r is the dot radius and s is the cell size.
Frequency Modulated (FM) Halftoning: FM halftoning uses dots of constant size but varies their
frequency or density. Higher dot density creates darker regions. This approach, also called
stochastic screening, can produce higher resolution and avoid moiré patterns.
Hybrid Halftoning: Modern techniques combine AM and FM approaches, using AM halftoning
for smooth gradients and FM halftoning for detailed areas.

3.2 Dithering Techniques


Dithering distributes quantization errors spatially to create the illusion of intermediate intensity
levels. Three main categories exist: threshold dithering, ordered dithering, and error diffusion
dithering.
Threshold Dithering (Point Processing): The simplest dithering method applies a fixed threshold
to each pixel independently:
IFETCE R-2019A
Academic Year: 2025-26

Output (i , j)=
{1 if Input (i, j) ≥T
0 if Input (i, j)<T

Where T is the threshold value, typically 0.5 for normalized intensities. This method is fast but
produces poor quality results with high contrast and loss of detail.
Ordered Dithering: Ordered dithering uses a predefined threshold matrix (dither matrix) that
varies the threshold value spatially. The most common is the Bayer matrix, constructed recursively:
D 1= [ 0 ]

D 2=
[ 03 21]

[ ]
0 8 2 10
12 4 14 6
D4 =
3 11 1 9
15 7 13 5

The general recursive formula is:

D 2 n=
[ 4 Dn 4 D n+ 2
4 Dn +3 4 D n+ 1 ]
For dithering, compare each pixel intensity with the corresponding normalized matrix value:

{
D(imod n , j mod n)
1 if Input (i, j)>
Output (i , j)= n
2

0 otherwise

Ordered dithering produces regular patterns that avoid temporal flickering in animations but can
create visible texture artifacts.

3.3 Floyd-Steinberg Algorithm


Error diffusion dithering, exemplified by the Floyd-Steinberg algorithm, produces higher quality
results by propagating quantization errors to neighboring pixels. The algorithm processes pixels
sequentially (typically left-to-right, top-to-bottom) and distributes the error from each pixel to
nearby unprocessed pixels.
Algorithm Steps:
1. For each pixel (i , j) in the image:
2. Calculate the quantized output:
Output (i , j)=Quantize(Input(i , j))
3. Calculate the quantization error:
IFETCE R-2019A
Academic Year: 2025-26

Error=Input (i , j)−Output(i , j)
4. Distribute the error to neighboring pixels using the Floyd-Steinberg filter:
Current 7 /16
1/16 ¿ ¿
3 /16 ¿
7
Input (i+ 1 , j)∧← Input (i+ 1, j)+Error ×
16
3
Input (i−1 , j+1)∧← Input(i−1 , j+1)+ Error ×
16
5
Input (i , j+1)∧← Input (i, j+1)+Error ×
16
1
Input (i+ 1 , j+1)∧← Input (i+ 1, j+1)+Error ×
16
The Floyd-Steinberg coefficients sum to 1, ensuring that the total error is preserved. The algorithm
produces high-quality results with minimal visible artifacts, making it suitable for photographic
images.
Other Error Diffusion Methods:
Jarvis-Judice-Ninke (JJN) uses a larger 5×3 filter:

[
1 X 7 5
48 3 5 ¿
5 ¿ 3 ¿ 1 ¿ 3 ¿ 5 ¿ 3 ¿ 1¿
]
Stucki uses a 5×3 filter with different coefficients:

[
1 X 8
42 2 4
4
¿
4 ¿2¿1¿2¿ 4¿2¿1¿
]
3.4 Visual Examples
Quality Comparison: Consider a smooth gray gradient from black (0) to white (1):
1. Threshold Dithering: Produces a sharp transition at the threshold point with complete loss of
gradient information.
2. Ordered Dithering (2×2 Bayer): Creates a regular checkerboard pattern that maintains gradient
information but introduces visible texture.
3. Ordered Dithering (8×8 Bayer): Produces smoother gradients with less visible patterns but may
show banding in smooth areas.
4. Floyd-Steinberg: Generates irregular but visually pleasing noise that effectively represents the
gradient without obvious patterns.
Detail Preservation: For images containing fine details:
IFETCE R-2019A
Academic Year: 2025-26

- Threshold dithering eliminates small features below the threshold - Ordered dithering preserves
details but adds regular texture - Floyd-Steinberg maintains fine details while adding organic-
looking noise

3.5 Practice Problems


Problem 1: Apply 2×2 Bayer dithering to a 4×4 image with values:

[ ]
0.1 0.3 0.5 0.7
0.2 0.4 0.6 0.8
0.3 0.5 0.7 0.9
0.4 0.6 0.8 1.0

Problem 2: Implement Floyd-Steinberg dithering for the first row of the above image, showing
error propagation.
Problem 3: Calculate the error diffusion coefficients for a simplified 3-pixel filter that distributes
error only to the right neighbor (weight α ) and bottom neighbor (weight 1−α ). What value of α
minimizes visible artifacts?
4. PROPERTIES OF LIGHT
Understanding the physical and perceptual properties of light is fundamental to computer graphics
color reproduction. Light, as electromagnetic radiation, possesses measurable physical
characteristics that determine how we perceive color, brightness, and other visual qualities.

4.1 Physical Properties


Wavelength and Frequency: Light is electromagnetic radiation characterized by wavelength λ and
frequency ν , related by:
c= λν
Where c=2.998 × 108 m/s is the speed of light in vacuum.
The visible spectrum spans approximately 380-700 nanometers:
 Violet: 380-450 nm
 Blue: 450-495 nm
 Green: 495-570 nm
 Yellow: 570-590 nm
 Orange: 590-620 nm
 Red: 620-700 nm
IFETCE R-2019A
Academic Year: 2025-26

Monochromatic light contains a single wavelength, while most light sources emit mixtures of
wavelengths described by spectral power distribution (SPD) functions P(λ) .
Intensity and Photometry: Light intensity describes the amount of electromagnetic energy per
unit area per unit time. Several photometric quantities are relevant:
 Luminous flux (Φ ): Total visible light power, measured in lumens (lm)
 Luminous intensity ( I ): Flux per solid angle, measured in candela (cd = lm/sr)
 Luminance ( L): Flux per unit area per solid angle, measured in cd/m²
 Illuminance ( E ): Incident flux per unit area, measured in lux (lm/m²)
The relationships are:

I ∧¿

d2 Φ
L∧¿
dA d Ωcosθ

E∧¿
dA
Where Ω is solid angle, A is area, and θ is the angle from the surface normal.
Polarization: Light waves oscillate in planes perpendicular to the propagation direction.
Polarization describes the orientation of these oscillations:
 Linear polarization: Oscillations in a single plane
 Circular polarization: Oscillations rotate uniformly
 Unpolarized light: Random oscillation orientations (most natural light)
Polarization affects reflection and transmission at surfaces, described by Fresnel equations. This is
important for realistic rendering of glass, water, and metallic surfaces.

4.2 Perceptual Properties


Human vision transforms physical light properties into perceptual attributes. Understanding this
transformation is crucial for effective color reproduction.
Hue: Hue corresponds roughly to the dominant wavelength of light but is more complex for
mixture spectra. The relationship between wavelength and perceived hue is nonlinear:
 Wavelength changes produce larger hue changes in blue-green and red regions
 Purple hues result from mixtures of red and blue wavelengths, not single wavelengths
 Spectral colors (single wavelengths) appear more saturated than mixture colors
IFETCE R-2019A
Academic Year: 2025-26

Saturation (Chroma): Saturation describes color purity or vividness. High saturation colors appear
vivid and pure, while low saturation colors appear washed out or grayish.
Physically, saturation relates to spectral purity:
Monochromatic component
Purity =
Total intensity
Perceptually, saturation depends on the ratio of chromatic to achromatic content and varies with
overall brightness level.
Brightness and Lightness: Brightness is the perceptual correlate of luminance, but the relationship
is nonlinear due to visual adaptation and contrast effects.
The Weber-Fechner law describes the relationship:
Perceived brightness ∝ log (Luminance)
More accurate models include Stevens’ power law:
Perceived brightness=k ⋅¿
Where n ≈ 0.33 for typical viewing conditions.

4.3 Human Vision and Color Perception


Photoreceptor Response: The human retina contains three types of cone cells with different
spectral sensitivities:
 L-cones: Peak sensitivity around 564 nm (red)
 M-cones: Peak sensitivity around 534 nm (green)
 S-cones: Peak sensitivity around 420 nm (blue)
Color perception results from comparing the responses of these three cone types. This trichromatic
theory explains why three primary colors can reproduce most visible colors.
The cone response functions can be approximated as:

L∧¿∫ P(λ)⋅l(λ)dλ
λ

M ∧¿ ∫ P( λ)⋅m(λ) dλ
λ

S∧¿ ∫ P( λ)⋅ s( λ)dλ


λ

Where P(λ) is the spectral power distribution and l(λ), m(λ), s( λ) are the cone sensitivity
functions.
Color Adaptation: The visual system adapts to different illumination conditions, maintaining
approximately constant color appearance. This involves:
IFETCE R-2019A
Academic Year: 2025-26

1. Chromatic adaptation: Adjusting sensitivity to match illuminant color 2. Brightness


adaptation: Adjusting overall sensitivity to illumination level 3. Spatial adaptation: Local
adjustments based on surrounding colors
Von Kries chromatic adaptation model:

[ ][ ][ ]
L' αL 0 0 L
'
M = 0 αM 0 M
S' 0 0 αS S

Where the adaptation coefficients depend on the illuminant.


Color Deficiencies: Approximately 8
 Protanomaly/Protanopia: L-cone deficiencies (red-blind)
 Deuteranomaly/Deuteranopia: M-cone deficiencies (green-blind)
 Tritanomaly/Tritanopia: S-cone deficiencies (blue-blind, rare)
Understanding these conditions is important for designing accessible color schemes.
5. STANDARD PRIMARIES AND CHROMATICITY DIAGRAM
Color reproduction systems require standardized methods for specifying and measuring colors. The
Commission Internationale de l’Éclairage (CIE) developed mathematical frameworks that form the
foundation of modern color science and digital color reproduction.

5.1 Defining Standard Primaries


Trichromatic Color Matching: The fundamental principle of color reproduction is that most
colors can be matched by mixing three appropriately chosen primary colors. This stems from the
trichromatic nature of human color vision.
Color matching experiments determine the amounts of three primary lights needed to match a test
color:
C=r [ R]+ g [G]+ b[B ]
Where C is the test color, [R ], [G], [B] are the primary colors, and r , g, b are the matching
coefficients (tristimulus values).
CIE RGB Primaries: The CIE established standard primaries in 1931:
 Red: 700.0 nm
 Green: 546.1 nm
 Blue: 435.8 nm
IFETCE R-2019A
Academic Year: 2025-26

These monochromatic primaries enable precise color specification but have practical limitations: 1.
Some colors require negative amounts of primaries (impossible in physical systems) 2. The
primaries are difficult to reproduce accurately in devices
CIE XYZ System: To address RGB limitations, the CIE defined mathematical primaries X, Y, Z
that: 1. Produce only positive tristimulus values for all visible colors 2. Have Y correspond to
luminance (brightness) 3. Enable efficient computation
The transformation from CIE RGB to XYZ uses:

[][ ][ ]
X 2.7689 1.7517 1.1302 R
Y = 1.0000 4.5907 0.0601 G
Z 0.0000 0.0565 5.5943 B

The XYZ color matching functions x́ (λ), ý (λ) , ź (λ) allow calculation of tristimulus values from
spectral data:

X ∧¿ k ∫ P(λ) x́ (λ)dλ
λ

Y ∧¿ k ∫ P (λ) ý (λ)dλ
λ

Z∧¿ k ∫ P( λ) ź ( λ)dλ
λ

Where P(λ) is the spectral power distribution and k is a normalization constant.

5.2 The CIE Chromaticity Diagram


Chromaticity Coordinates: To separate color information from brightness, chromaticity
coordinates are defined:
X
x∧¿
X +Y +Z
Y
y∧¿
X +Y + Z
Z
z∧¿
X +Y + Z
Since x + y + z=1, only two coordinates ( x , y ) are needed to specify chromaticity. The third
coordinate is z=1− x− y .
The Horseshoe Diagram: The CIE chromaticity diagram plots all visible colors in the (x , y )
plane. Key features include:
1. Spectral locus: The curved boundary representing monochromatic colors (380-700 nm) 2.
Purple line: The straight boundary connecting the red and violet ends 3. White point: The
achromatic point (typically D65: x=0.3127 , y=0.3290) 4. Planckian locus: The curve of
blackbody radiator colors at different temperatures
IFETCE R-2019A
Academic Year: 2025-26

5.3 Color Properties in the Diagram:


Dominant Wavelength: For any color point, draw a line from the white point through the color
point to the spectral locus. The intersection wavelength is the dominant wavelength, corresponding
to perceived hue.
Purity: The ratio of distances from white point to color point versus white point to spectral locus:
d (white, color)
Purity =
d (white , spectral)
High purity indicates saturated colors; low purity indicates desaturated colors.
Complementary Colors: Colors on opposite sides of the white point are complementary. Mixing
complementary colors produces white light.

Color Gamut and Additive/Subtractive Mixing


Color Gamut: A gamut is the range of colors reproducible by a device or system. In the
chromaticity diagram, gamuts appear as polygons whose vertices are the device primaries.
RGB Display Gamut: Typical sRGB gamut vertices:
 Red: x=0.640 , y=0.330
 Green: x=0.300 , y=0.600
 Blue: x=0.150 , y=0.060
Any color inside this triangle can be displayed; colors outside cannot be reproduced accurately.
Additive Color Mixing: In additive systems (displays), colors combine by adding light. Mixing
rules: 1. Mixing two colors produces colors on the line connecting them 2. Mixing three colors
produces colors inside the triangle formed by them 3. The mixture location depends on the relative
intensities
For two colors C 1 and C 2 with intensities I 1 and I 2:
I 1 x 1+ I 2 x 2
x mix∧¿
I 1+ I 2
I 1 y1 + I 2 y2
y mix ∧¿
I1 + I 2

Subtractive Color Mixing: In subtractive systems (printing), colors combine by removing


(absorbing) wavelengths from white light. The cyan, magenta, yellow (CMY) primaries are
complementary to RGB:
 Cyan absorbs red light
 Magenta absorbs green light
IFETCE R-2019A
Academic Year: 2025-26

 Yellow absorbs blue light


Subtractive mixing is more complex than additive mixing due to multiple scattering and absorption
effects in physical media.

5.4 Visual Diagrams


[Description of key diagrams that would be included:]
1. CIE 1931 Chromaticity Diagram: The horseshoe-shaped diagram showing the spectral locus,
purple line, and white point
2. Color Gamut Comparison: Overlay of different device gamuts (sRGB, Adobe RGB, CMYK)
on the chromaticity diagram
3. Color Mixing Illustration: Visual demonstration of additive mixing showing how colors
combine along straight lines
4. Spectral Power Distributions: Graphs showing the spectral content of different illuminants
(D65, tungsten, fluorescent)
6. INTUITIVE COLOUR CONCEPTS
While mathematical color models provide precise specifications, intuitive color concepts based on
artistic and perceptual principles offer more natural ways to think about and manipulate colors.
These concepts bridge the gap between technical color science and practical color use in design and
graphics applications.

6.1 Hue, Saturation, Brightness


Hue: Hue represents the "color" in the most basic sense—what we typically mean when we say
"red," "blue," or "green." It corresponds to the dominant wavelength of light but is more accurately
described as the position on the color wheel.
Key properties of hue:
 Cyclical: Colors transition smoothly around a wheel, returning to the starting point
 Temperature associations: Warm hues (red, orange, yellow) vs. cool hues (blue, green,
purple)
 Complementary relationships: Opposite hues on the color wheel create strong contrast
 Analogous relationships: Adjacent hues create harmonious combinations
The relationship between wavelength and perceived hue is nonlinear. Small wavelength changes in
the blue-green region (480-520 nm) produce large hue shifts, while similar changes in the yellow-
red region (580-650 nm) produce smaller perceptual differences.
IFETCE R-2019A
Academic Year: 2025-26

Saturation: Saturation describes color intensity or purity—how vivid or muted a color appears.
High saturation colors appear vibrant and pure, while low saturation colors appear grayish and
muted.
Saturation can be understood as:
 Distance from gray: Highly saturated colors are far from the neutral gray axis
 Spectral purity: Monochromatic light produces maximum saturation
 Chroma content: The ratio of chromatic to achromatic content
Factors affecting perceived saturation: 1. Viewing conditions: Colors appear less saturated under
dim light 2. Adaptation state: Prolonged viewing of saturated colors reduces their apparent
saturation 3. Surrounding colors: Neutral surroundings increase apparent saturation
Brightness/Lightness/Value: These terms describe the light-dark dimension of color but have
subtle differences:
 Brightness: Subjective impression of light emission or reflection
 Lightness: Relative brightness compared to white under the same viewing conditions
 Value: The lightness dimension in color systems (HSV, Munsell)
The relationship between physical luminance and perceived lightness follows approximately:

( )
1/ 3
¿ Y
L =116 −16
Yn

Where Y is the luminance and Y n is the luminance of white (CIE L*a*b* formula).

6.2 Colour Representation in Digital Systems


Bit Depth and Quantization: Digital systems represent continuous color variations using discrete
values. Common bit depths:
 8-bit per channel: 256 levels, 16.7 million colors total (24-bit color)
 10-bit per channel: 1,024 levels, 1.07 billion colors (30-bit color)
 16-bit per channel: 65,536 levels, high dynamic range (48-bit color)
Quantization introduces several artifacts: 1. Banding: Visible steps in smooth gradients 2.
Posterization: Reduction of color levels creating flat regions 3. Color shifts: Rounding errors
causing slight hue changes
Gamma Correction: Display devices have nonlinear response characteristics. Gamma correction
compensates for this nonlinearity:
Display Output =¿
IFETCE R-2019A
Academic Year: 2025-26

Typical gamma values:


 CRT monitors: γ ≈ 2.2
 LCD monitors: γ ≈ 2.2 (emulated)
 sRGB standard: γ ≈ 2.4 (with linear portion)
Proper gamma correction ensures: 1. Perceptually uniform brightness steps 2. Consistent
appearance across devices 3. Efficient use of limited bit depth
Color Space Transformations: Converting between color spaces requires careful handling of
gamut boundaries and precision:
RGB to HSV conversion:
V ∧¿ max(R , G , B)
C∧¿ V −min(R , G , B)

{
0 if V =0
S∧¿ C
otherwise
V

{
G−B
×60 ° if V =R
C
H∧¿ ( B−R +2)×60 ° if V =G
C
R−G
( + 4)×60 ° if V =B
C

6.3 Applications in UI/UX Design


Color Harmony Principles: Effective color schemes follow established harmony rules:
1. Monochromatic: Variations of a single hue with different saturation/brightness 2. Analogous:
Adjacent hues on the color wheel (e.g., blue, blue-green, green) 3. Complementary: Opposite hues
creating high contrast (e.g., red-green, blue-orange) 4. Split-complementary: Base hue plus two
colors adjacent to its complement 5. Triadic: Three evenly spaced hues forming an equilateral
triangle 6. Tetradic: Four hues forming two complementary pairs
Accessibility Considerations: Designing for color vision deficiencies:
1. Contrast ratios: WCAG guidelines specify minimum ratios: - Normal text: 4.5:1 - Large text:
3:1 - Graphical objects: 3:1
2. Color redundancy: Don’t rely solely on color to convey information 3. Safe color palettes: Use
tools to verify appearance for different types of color blindness
Psychological Color Effects: Colors influence mood, perception, and behavior:
 Red: Energy, urgency, passion (increases heart rate)
IFETCE R-2019A
Academic Year: 2025-26

 Blue: Trust, calm, professionalism (reduces blood pressure)


 Green: Nature, growth, harmony (most restful to the eye)
 Yellow: Optimism, attention, creativity (most visible color)
 Purple: Luxury, mystery, spirituality
 Orange: Enthusiasm, friendliness, warmth
Cultural associations vary significantly across different societies and should be considered for
global applications.

6.4 Practice Problems


Problem 1: Convert the RGB color (180, 100, 50) to HSV. Verify by converting back to RGB.
Problem 2: Design a complementary color scheme starting with HSV (240°, 80
Problem 3: Calculate the contrast ratio between text color RGB(64, 64, 64) and background color
RGB(248, 248, 248). Does this meet WCAG AA standards?
Problem 4: Create a triadic color scheme using hue 30° as the base. Calculate the other two hues
and suggest a practical application.
7. COLOUR MODELS IN COMPUTER GRAPHICS
Computer graphics applications require different color models optimized for specific purposes:
display technology, printing processes, user interfaces, and image processing. Understanding these
models and their conversions is essential for maintaining color accuracy across different devices
and applications.

7.1 RGB Model and Applications


The RGB (Red, Green, Blue) color model is the foundation of digital display technology, based on
the additive color mixing principles that match human trichromatic vision.
RGB Fundamentals: RGB represents colors as combinations of red, green, and blue light
intensities. The model forms a cube in three-dimensional space where:
 Origin (0,0,0): Black (no light)
 Corner (1,1,1): White (full intensity all channels)
 Edges: Primary (R,G,B) and secondary (cyan, magenta, yellow) colors
 Main diagonal: Grayscale values
Mathematical representation:
Color =r ⋅ R +g ⋅ G+ b ⋅B
IFETCE R-2019A
Academic Year: 2025-26

Where r , g, b are intensity coefficients (typically 0-1 or 0-255) and R , G , B are the primary color
vectors.
Device Dependencies: RGB is device-dependent—the same RGB values produce different colors
on different devices due to variations in: 1. Phosphor/LED spectral characteristics 2. White point
temperature 3. Gamma response curves 4. Manufacturing tolerances
Color management systems address these issues using: - Device profiles (ICC profiles) - Color
space transformations - Gamut mapping algorithms
Standard RGB Color Spaces:
sRGB: Default color space for web and consumer applications - Gamma: 2.4 (with linear portion) -
White point: D65 (6500K) - Gamut: Covers 35 - Primaries: R(0.640,0.330), G(0.300,0.600),
B(0.150,0.060)
Adobe RGB: Professional photography and printing - Larger gamut than sRGB ( 50 - Better cyan-
green reproduction - Requires color management for accurate display
ProPhoto RGB: Maximum gamut for photography - Covers 90 - 16-bit processing recommended
to avoid banding - Theoretical primaries (outside visible spectrum)
RGB Applications:
 Digital cameras and scanners
 Computer monitors and televisions
 LED displays and projectors
 Web graphics and digital images
 Video games and real-time rendering

7.2 YIQ Model in Broadcasting


The YIQ color model separates luminance (brightness) from chrominance (color) information,
making it ideal for television broadcasting where backward compatibility with black-and-white
receivers was essential.
YIQ Components:
 Y (Luma): Brightness information compatible with B&W displays
 I (In-phase): Orange-cyan color difference
 Q (Quadrature): Green-magenta color difference
The Y component uses perceptually-weighted RGB combination:
Y =0.299 R+ 0.587 G+0.114 B
IFETCE R-2019A
Academic Year: 2025-26

These weights reflect the eye’s sensitivity to different colors (highest for green, lowest for blue).
RGB to YIQ Conversion:

[][ ][ ]
Y 0.299 0.587 0.114 R
I = 0.596 −0.274 −0.322 G
Q 0.211 −0.523 0.312 B

YIQ to RGB Conversion:

[][ ][ ]
R 1.000 0.956 0.621 Y
G = 1.000 −0.272 −0.647 I
B 1.000 −1.106 1.703 Q

Broadcasting Advantages: 1. Luminance-chrominance separation enables bandwidth optimization


2. Human vision is more sensitive to brightness than color details 3. Color information can be
transmitted at lower resolution 4. Graceful degradation for B&W receivers
Modern Applications: While NTSC broadcasting used YIQ, modern applications prefer related
models: - YUV: Used in PAL broadcasting - YCbCr: Digital video compression (JPEG, MPEG) -
YPbPr: Component video connections

7.3 CMY/CMYK Model in Printing


The CMY (Cyan, Magenta, Yellow) model represents subtractive color mixing used in printing,
where colors are created by removing wavelengths from white light.
Subtractive Primaries: CMY primaries are complementary to RGB:
 Cyan: Absorbs red light (reflects blue + green)
 Magenta: Absorbs green light (reflects red + blue)
 Yellow: Absorbs blue light (reflects red + green)
Ideal CMY to RGB Conversion:
R∧¿ (1−C) ×(1−K )
G∧¿(1−M )×(1−K)
B∧¿ (1−Y )×(1−K)
Where K is the black component (explained below).
CMYK Extension: Real printing inks are impure—mixing CMY doesn’t produce true black but
rather a muddy brown. The K (Key/blacK) component is added for: 1. True black reproduction 2.
Reduced ink consumption 3. Better text clarity 4. Cost savings (black ink is cheaper)
RGB to CMYK Conversion:
IFETCE R-2019A
Academic Year: 2025-26

K∧¿1−max(R ,G , B)
(1−R−K )
C∧¿
(1−K )
(1−G−K )
M ∧¿
(1−K )
(1−B−K )
Y ∧¿
(1−K )
When K=1 (pure black), C = M = Y = 0.
Printing Considerations:
 Dot gain: Ink dots spread on paper, darkening the image
 Color gamut: CMYK gamut is smaller than RGB, especially for bright colors
 Paper color: White point varies with paper type
 Ink limitations: Total ink coverage typically limited to 300-400

7.4 HSV Model and Human Perception


HSV (Hue, Saturation, Value) provides an intuitive color representation that matches artistic and
perceptual concepts better than RGB.
HSV Geometry: HSV forms a cylinder (or inverted cone) where:
 Hue: Angular position (0-360°)
 Saturation: Radial distance from center (0-100
 Value: Height in cylinder (0-100
RGB to HSV Conversion:
V ∧¿ max (R ,G , B)
Δ∧¿ V −min(R , G , B)

{
0 if V =0
S∧¿ Δ
otherwise
V

Hue calculation:
IFETCE R-2019A
Academic Year: 2025-26

{
G−B
×60 ° if V =R
Δ
B−R
( +2)× 60° if V =G
H= Δ
R−G
( + 4)× 60 ° if V =B
Δ
undefined if Δ=0

If H < 0, add 360°.


HSV to RGB Conversion:
C∧¿ V × S
X∧¿C ׿
¿

{
(C , X ,0) if 0 ° ≤ H <60 °
( X ,C ,0) if 60 ° ≤ H <120 °
' ' ' (0 ,C , X) if 120 °≤ H <180 °
(R ,G , B )=
(0 , X , C) if 180 °≤ H <240 °
( X ,0 , C) if 240 °≤ H <300 °
(C , 0 , X) if 300 °≤ H <360 °

Final RGB: ( R , G , B)=(R ' + m, G' + m, B' + m)


HSV Applications:
 Color picker interfaces
 Image processing (color adjustments)
 Computer vision (color-based object detection)
 Artistic software
 Color harmony generation

7.5 HLS Model in Digital Graphics


HLS (Hue, Lightness, Saturation) provides an alternative perceptual color model with different
geometric interpretation than HSV.
HLS vs HSV Differences:
 Lightness: Average of RGB max and min values
 Value: Maximum of RGB values
 Saturation: Different definitions in each model
IFETCE R-2019A
Academic Year: 2025-26

 Geometry: Double cone vs single cone/cylinder


RGB to HLS Conversion:
max∧¿ max (R ,G , B)
min∧¿ min (R ,G , B)
max+ min
L∧¿
2
Δ∧¿ max−min
Saturation:

{
0 if Δ=0
Δ
if L> 0.5
S= 2−max−min
Δ
if L ≤ 0.5
max+min

Hue calculation is identical to HSV.


HLS Applications:
 CSS color specifications
 Digital art software
 Web design tools
 Color manipulation libraries

7.6 Comparative Tables


|p2cm|p2cm|p3cm|p3cm|p3cm| Model & Type & Primary Use & Advantages & Disadvantages
RGB & Additive & Displays & Device native, simple & Non-intuitive, device dependent
YIQ & Luma-Chroma & TV Broadcast & B&W compatible & Complex conversion
CMY/CMYK & Subtractive & Printing & Print native & Limited gamut, complex
HSV & Perceptual & User Interface & Intuitive hue control & Non-uniform perceptually
HLS & Perceptual & Web/Design & CSS standard & Less common than HSV

7.7 Example Conversions


Example 1: RGB to HSV Convert RGB(204, 102, 51) to HSV:
Normalize: R=0.8, G=0.4, B=0.2
IFETCE R-2019A
Academic Year: 2025-26

V ∧¿ max(0.8 ,0.4 , 0.2)=0.8


min∧¿ min (0.8 , 0.4 , 0.2)=0.2
Δ∧¿ 0.8−0.2=0.6
0.6
S∧¿ =0.75
0.8
Since V = R:
0.4−0.2 0.2
H= ×60 °= × 60 °=20 °
0.6 0.6
Result: HSV(20°, 75
Example 2: CMYK Separation Convert RGB(255, 100, 50) to CMYK:
Normalize: R=1.0, G=0.39, B=0.20
K∧¿1−max(1.0 ,0.39 , 0.20)=1−1.0=0
1−1.0−0
C∧¿ =0
1−0
1−0.39−0
M ∧¿ =0.61
1−0
1−0.20−0
Y ∧¿ =0.80
1−0
Result: CMYK(0
8. REALISM IN COMPUTER GRAPHICS
Realism in computer graphics encompasses techniques that simulate the appearance of natural
phenomena and physical processes. These methods range from geometric algorithms that create
complex patterns to sophisticated light simulation that produces photorealistic images.

8.1 Tiling the Plane


Tiling (tessellation) refers to covering a plane with geometric shapes without gaps or overlaps. This
fundamental concept has applications in texture mapping, mesh generation, pattern design, and
procedural content creation.
Regular Tilings: Only three regular polygons can tile the plane by themselves:
 Triangular tiling: Equilateral triangles, 6 triangles meet at each vertex
 Square tiling: Squares, 4 squares meet at each vertex
 Hexagonal tiling: Regular hexagons, 3 hexagons meet at each vertex
The constraint comes from angle requirements. At each vertex, the sum of interior angles must
equal 360°: - Triangle: 6 × 60° = 360° - Square: 4 × 90° = 360° - Hexagon: 3 × 120° = 360°
IFETCE R-2019A
Academic Year: 2025-26

Semi-regular Tilings (Archimedean): These use two or more regular polygons with the same
arrangement at every vertex. There are exactly 8 semi-regular tilings, including: - Truncated square:
squares and octagons (4.8²) - Snub square: squares and triangles (3⁴.6) - Hexagon-triangle:
hexagons and triangles (3.6²)
Penrose Tilings: Non-periodic tilings using two rhombi create fascinating patterns with fivefold
symmetry. Properties include: - Aperiodic: No translational symmetry - Quasicrystalline: Long-
range order without periodicity - Self-similar: Contains smaller copies of itself - Golden ratio
relationships: Edge ratios follow φ = (1+√5)/2
Applications in Graphics:
 Texture mapping: Seamless tiling textures
 Procedural generation: Infinite terrain and architectural patterns
 Mesh refinement: Adaptive tessellation for curved surfaces
 User interfaces: Pattern backgrounds and decorative elements

8.2 Tessellation in Graphics


Modern graphics hardware includes dedicated tessellation units that subdivide geometric primitives
to add surface detail without increasing memory requirements.
Hardware Tessellation Pipeline: 1. Hull Shader: Defines patch control points and tessellation
levels 2. Tessellator: Fixed-function unit that generates new vertices 3. Domain Shader:
Computes final vertex positions from barycentric coordinates
Adaptive Tessellation: Tessellation levels adjust based on: - Distance from camera (Level-of-
Detail) - Surface curvature (geometric complexity) - Screen-space size (pixel density) -
Performance requirements
Displacement Mapping: Tessellation enables real-time displacement mapping where height maps
modify surface geometry:
Pdisplaced =Poriginal +h (P)⋅ N

Where h(P) is the height value from a texture and N is the surface normal.

8.3 Recursively Defined Curves


Recursive algorithms generate complex curves through iterative geometric operations. These self-
similar structures exhibit fractal properties and can model natural phenomena.
Koch Curve: The Koch snowflake is constructed by recursively replacing line segments:
Initial condition: Equilateral triangle Recursion rule: Replace each line segment with a generator
pattern
IFETCE R-2019A
Academic Year: 2025-26

Algorithm: 1. Divide segment into three equal parts 2. Remove the middle third 3. Add two sides of
an equilateral triangle where the middle third was 4. Repeat for each new segment
Mathematical properties: - Length after n iterations: Ln=L0 ⋅¿ - Perimeter approaches infinity as n
→ ∞ - Area remains finite (bounded by the initial triangle’s circumcircle) - Hausdorff dimension:
log (4)/ log(3)≈ 1.26
Dragon Curve: Generated by folding paper and unfolding at right angles:
Recursion rules: - Dragon₀ = "F" (forward) - Dragon_n+1 = Dragon_n + "L" + reverse(Dragon_n
with R↔L)
Where L = turn left 90°, R = turn right 90°, F = move forward.
Sierpinski Gasket: Created by recursively subdividing triangles:
Algorithm: 1. Start with solid triangle 2. Remove central triangle (connecting midpoints) 3. Repeat
for each remaining triangle
Properties: - Self-similar at all scales - Area approaches zero - Hausdorff dimension:
log (3)/log (2)≈ 1.58

8.4 Space-Filling Curves


Space-filling curves are continuous curves that pass arbitrarily close to every point in a 2D region.
They provide efficient mappings between 1D and 2D data structures.
Hilbert Curve: The Hilbert curve maintains spatial locality—nearby points on the curve
correspond to nearby points in 2D space.
Construction algorithm (L-system): - Axiom: A - Rules: A → -BF+AFA+FB-, B → +AF-BFB-
FA+
Where: - F: move forward - +: turn right 90° - -: turn left 90° - A,B: production rules
Peano Curve: The first discovered space-filling curve:
L-system rules: - Axiom: F - F → F+F-F-F-F+F+F+F-F
Properties of space-filling curves: - Preserve locality reasonably well - Useful for memory
organization - Applications in database indexing - Image processing (scan-line orders)
Applications:
 Memory layout: Improving cache performance for 2D data
 Image compression: Reorganizing pixel data
 Spatial databases: Geographic information systems
 Load balancing: Distributing 2D computational domains
IFETCE R-2019A
Academic Year: 2025-26

8.5 Fractals
Fractals exhibit self-similarity across scales and are characterized by non-integer dimensions. They
effectively model natural phenomena like coastlines, mountains, and vegetation.

Mandelbrot Set: Defined by the iterative function z n+1=z 2n + c where z₀ = 0.

For each complex number c: 1. Iterate the function 2. If |z_n| remains bounded (|z_n| ≤ 2), c is in
the set 3. Color pixels based on iteration count before divergence
Pseudocode: “‘ for each pixel (x,y): c = complex(x, y) z = 0 iteration = 0 while |z| ≤ 2 and iteration
< max_iterations: z = z² + c iteration++ color = palette[iteration] “‘

Julia Sets: Related to Mandelbrot but with fixed c parameter: For fixed c, iterate z n+1=z 2n + c
starting from z₀ = pixel position.
Fractal Landscapes: Procedural terrain generation using fractal algorithms:
Diamond-Square Algorithm: 1. Initialize corner heights 2. Diamond step: Set center = average of
corners + random offset 3. Square step: Set edge midpoints = average of neighbors + random offset
4. Reduce random range and subdivide recursively
Midpoint Displacement: For 1D profiles (mountain silhouettes): 1. Connect endpoints with line 2.
Displace midpoint by random amount 3. Recursively displace subdivided segments with scaled
randomness
Perlin Noise: Generates coherent noise for natural textures: - Gradient-based interpolation -
Multiple octaves for different detail levels - Widely used in procedural content generation

8.6 Ray Tracing


Ray tracing simulates the physics of light transport by tracing rays from the camera through the
scene, calculating intersections and lighting interactions.
Basic Ray Tracing Algorithm:
1. Primary rays: Cast rays from camera through each pixel 2. Intersection testing: Find closest
surface intersection 3. Shading: Calculate local illumination at intersection point 4.
Reflection/Refraction: Cast secondary rays for mirrors and glass 5. Shadow rays: Test visibility to
light sources
Mathematical foundation: Ray equation: R(t )=O+t D Where O is origin, D is direction, t is
parameter.
Sphere Intersection: For sphere center C , radius r :

¿ R(t )−C ¿2 ∧¿ r 2
¿ O+t D−C ¿2∧¿ r 2
Expanding and solving quadratic:
IFETCE R-2019A
Academic Year: 2025-26
2
a t + bt+ c=0
Where:
a∧¿ D ⋅ D
b∧¿ 2 D⋅(O−C )
c∧¿(O−C )⋅(O−C)−r 2

Reflection and Refraction: Reflection direction: R=I −2(I ⋅ N )N


Refraction (Snell’s law): n1 sin θ1=n 2 sin θ2
Refraction direction:

T=
n1
n2
I+
n1
n2( )
cos θ1−cos θ 2 N

Advanced Ray Tracing: - Monte Carlo methods: Statistical sampling for global illumination -
Bidirectional path tracing: Tracing from both camera and lights - Photon mapping: Two-pass
algorithm for caustics and indirect lighting - Real-time ray tracing: Hardware acceleration (RTX,
RDNA2)

8.7 Implementations and Applications


Fractal Applications:
 Terrain generation: Games, flight simulators
 Texture synthesis: Natural patterns, organic surfaces
 Antenna design: Fractal antennas for compact size
 Compression: Fractal-based image compression
Ray Tracing Applications:
 Film rendering: Pixar, DreamWorks animation
 Architectural visualization: Photorealistic building renderings
 Product design: Automotive, jewelry visualization
 Gaming: Real-time reflections, global illumination

8.8 Practice Problems


Problem 1: Generate the first three iterations of the Koch curve starting from a unit line segment.
Problem 2: Calculate the intersection of ray R(t )=(0 , 0 ,0)+t (1 ,1 , 1) with sphere centered at
(2,2,2) with radius 1.
IFETCE R-2019A
Academic Year: 2025-26

Problem 3: Implement the midpoint displacement algorithm for a 1D mountain profile with 9
points.
Problem 4: Design a Penrose tiling pattern using the two basic rhombi shapes.

You might also like