Hidden Lines and Surfaces



Hidden Lines and Surfaces

Hidden surface removal determines which parts of objects are visible and removes those that are behind other surfaces.

Why Needed?

  • To create realistic images
  • Avoid drawing unnecessary (hidden) parts

Back Face Detection Algorithm

Idea:

  • Surfaces facing away from viewer are not visible

Method:

  • Use surface normal vector (N) and view vector (V)

👉 If:

NV>0N \cdot V > 

→ Surface is visible

👉 If:

NV<0N \cdot V  

→ Surface is hidden (back face)

Advantages

  • Simple
  • Fast

Limitation

  • Works only for closed objects

Depth Buffer Method (Z-Buffer)

Idea

  • Store depth (Z value) for each pixel
  • Compare and display closest surface

Steps

  1. Initialize Z-buffer with large values
  2. For each pixel:
    • Compare depth
    • Keep nearest pixel

Advantages

  • Simple
  • Works for all objects

Disadvantages

  • High memory usage
  • Precision issues

A-Buffer Method

Extension of Z-buffer that handles transparency and anti-aliasing

Features

  • Stores multiple surfaces per pixel
  • Supports partial visibility

Advantages

  • Better image quality
  • Handles transparency

Disadvantages

  • More memory & computation

Scan-Line Method

Idea:

  • Process image line by line (scan line)

Steps:

  1. Take one horizontal line
  2. Find intersecting polygons
  3. Compare depth
  4. Fill visible pixels

Advantages

  • Efficient for polygons

Disadvantages

  • Complex implementation

Basic Illumination Models

Purpose:

To calculate how light interacts with surfaces → determines brightness & realism.

A. Ambient Light

Idea

  • Background light present everywhere
I=IaKaI = I_a K_

Feature

  • Independent of light position

B. Diffuse Reflection

Idea

  • Light scattered equally in all directions
I=IlKd(NL)I = I_l K_d (N \cdot L

Feature

  • Depends on angle between light and surface

C. Specular Reflection

Idea:

  • Produces shiny highlights
I=IlKs(RV)nI = I_l K_s (R \cdot V)

Feature:

  • Depends on viewer position
  • Controls shininess

D. Phong Illumination Model

Combined Model

I=IaKa+IlKd(NL)+IlKs(RV)nI = I_a K_a + I_l K_d (N \cdot L) + I_l K_s (R \cdot V)^

Advantages

  • Realistic lighting
  • Widely used

Combined Approach

  • Combines Ambient + Diffuse + Specular
  • Produces realistic shading

Warn Model (Ward Model)

Improved illumination model for realistic surfaces

Features

  • Handles rough surfaces
  • Better specular reflection

Intensity Attenuation 

Idea

Light intensity decreases with distance

Formula

I=I0a+bd+cd2I = \frac{I_0}{a + bd + cd^2

Effect

  • Distant objects appear dim

Color Consideration

Idea

  • Light has RGB components

Process

  • Apply lighting model separately for:
    • Red
    • Green
    • Blue

Result

  • Realistic colored objects

Transparency

Ability to see through objects

Technique

  • Alpha blending
I=αI1+(1α)I2I = \alpha I_1 + (1-\alpha) I_

Example:

  • Glass, water

Shadows


Dark regions where light is blocked

Types:

1. Hard Shadows

  • Sharp edges

2. Soft Shadows

  • Blurred edges

Techniques

  • Shadow mapping
  • Ray tracing

Final Summary Table

TopicKey IdeaAdvantage
Back Face DetectionRemove back surfacesFast
Z-bufferDepth comparisonSimple
A-bufferTransparency supportAccurate
Scan-lineLine-by-line renderingEfficient
Phong ModelCombined lightingRealistic

Concept Flow

Hidden Surface Removal → Rendering → Illumination → Color → Transparency → Shadows