hidden surface removal

24
Hidden Surface Removal Fall, 2011

Upload: satya

Post on 05-Jan-2016

41 views

Category:

Documents


4 download

DESCRIPTION

Hidden Surface Removal. Fall, 2011. Visibility. Surface may be back-facing Surface may be occluded Surface may overlap in the image plane Surface may intersect. Visibility Culling & Hidden Surface Removal. Determine which parts of which surfaces should be scan converted. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Hidden Surface Removal

Hidden Surface Removal

Fall, 2011

Page 2: Hidden Surface Removal

Visibility

Surface may be back-facing Surface may be occluded Surface may overlap in the image plane Surface may intersect

Page 3: Hidden Surface Removal

Visibility Culling & Hidden Surface Removal

Determine which parts of which surfaces should be scan converted

Page 4: Hidden Surface Removal

Visibility Culling & Hidden Surface Removal

Visibility Culling Back Face Culling View Frustum Culling Occlusion Culling

Hidden Surface Removal Object space

• Polygon Clipping

• Depth sort

Screen space• Ray casting

• Scan-line

• Z-buffer

• Area subdivision

Page 5: Hidden Surface Removal

3D Rendering Pipeline

Somewhere in here we have to decidewhich objects are visible, andwhich objects are hidden

Page 6: Hidden Surface Removal

Back-Face Culling

Q: How do we test for back-facing polygons?A: Dot product of the normal and viewing direction

Page 7: Hidden Surface Removal

3D Rendering Pipeline

Page 8: Hidden Surface Removal

View Frustum Culling

Do not draw polygons outside the view frustum Accelerate checks with bounding volume hierarchies or

spatial data structures (e.g., octree)

Page 9: Hidden Surface Removal

Occlusion Culling

Cell & Portal

Page 10: Hidden Surface Removal

Hidden Surface Removal Algorithm

Object space Polygon Clipping Depth sort

Screen space Ray casting Scan-line Z-buffer Area subdivision

Page 11: Hidden Surface Removal

Weiler-Atherton Polygon Clipping

Clip to polygons overlapping and in front of them Computes exact visible areas of every polygon Way slow!

Page 12: Hidden Surface Removal

Depth sort

“Painter’s algorithm” Sort surface in order of decreasing maximum depth Scan convert surfaces in back-to-front order

Page 13: Hidden Surface Removal

3D Rendering Pipeline

Page 14: Hidden Surface Removal

BSP Tree

Binary space partition with solid cells labeled Constructed from polygonal representations Provides linear-time depth sort for arbitrary view

Page 15: Hidden Surface Removal

Hidden Surface Removal Algorithm

Object space Polygon Clipping Depth sort

Screen space Ray casting Scan-line Z-buffer Area subdivision

Page 16: Hidden Surface Removal

Ray Casting

Fire a ray for every pixel If ray intersects multiple objects, take the closest

Page 17: Hidden Surface Removal

Ray Casting Pipeline

Page 18: Hidden Surface Removal

Z-Buffer

Color & depth of closest object for every pixel Update only pixels whose depth is closer than in buffer Depths are interpolated from vertices, just like colors

Page 19: Hidden Surface Removal

3D Rendering Pipeline

Page 20: Hidden Surface Removal

Scan-line Algorithm

For each scan line, construct spans Sort by depth

Page 21: Hidden Surface Removal

3D Rendering Pipeline

Page 22: Hidden Surface Removal

Area Subdivision

Warnock’s algorithm Fill area if:

• All surfaces are outside area, or

• Only one surface intersects area, or

• One surface occludes other surfaces in area

Otherwise, subdivide

Page 23: Hidden Surface Removal

3D Rendering Pipeline

Page 24: Hidden Surface Removal

Summary

Find visible surfaces Visibility Culling

• Back Face Culling

• View Frustum Culling

• Occlusion Culling

Hidden Surface Removal• Object space

– Polygon Clipping– Depth sort

• Screen space– Ray casting– Scan-line– Z-buffer– Area subdivision