hidden surface removal

Post on 05-Jan-2016

41 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

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

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

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

3D Rendering Pipeline

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

Back-Face Culling

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

3D Rendering Pipeline

View Frustum Culling

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

spatial data structures (e.g., octree)

Occlusion Culling

Cell & Portal

Hidden Surface Removal Algorithm

Object space Polygon Clipping Depth sort

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

Weiler-Atherton Polygon Clipping

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

Depth sort

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

3D Rendering Pipeline

BSP Tree

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

Hidden Surface Removal Algorithm

Object space Polygon Clipping Depth sort

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

Ray Casting

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

Ray Casting Pipeline

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

3D Rendering Pipeline

Scan-line Algorithm

For each scan line, construct spans Sort by depth

3D Rendering Pipeline

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

3D Rendering Pipeline

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

top related