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:
→ Surface is visible
👉 If:
→ Surface is hidden (back face)
Advantages
- Simple
- Fast
Limitation
- Works only for closed objects
Depth Buffer Method (Z-Buffer)
- Store depth (Z value) for each pixel
- Compare and display closest surface
Steps
- Initialize Z-buffer with large values
-
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:
- Take one horizontal line
- Find intersecting polygons
- Compare depth
- Fill visible pixels
Advantages
- Efficient for polygons
Disadvantages
- Complex implementation
Basic Illumination Models
To calculate how light interacts with surfaces → determines brightness & realism.
A. Ambient Light
Idea
- Background light present everywhere
Feature
- Independent of light position
B. Diffuse Reflection
Idea
- Light scattered equally in all directions
Feature
- Depends on angle between light and surface
C. Specular Reflection
Idea:
- Produces shiny highlights
Feature:
- Depends on viewer position
- Controls shininess
D. Phong Illumination Model
Combined Model
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
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
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
| Topic | Key Idea | Advantage |
|---|---|---|
| Back Face Detection | Remove back surfaces | Fast |
| Z-buffer | Depth comparison | Simple |
| A-buffer | Transparency support | Accurate |
| Scan-line | Line-by-line rendering | Efficient |
| Phong Model | Combined lighting | Realistic |
Concept Flow
Hidden Surface Removal → Rendering → Illumination → Color → Transparency → Shadows