Download - Hidden Surface Removal
![Page 1: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/1.jpg)
Hidden Surface Removal
Fall, 2011
![Page 2: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/2.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/3.jpg)
Visibility Culling & Hidden Surface Removal
Determine which parts of which surfaces should be scan converted
![Page 4: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/4.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/5.jpg)
3D Rendering Pipeline
Somewhere in here we have to decidewhich objects are visible, andwhich objects are hidden
![Page 6: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/6.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/7.jpg)
3D Rendering Pipeline
![Page 8: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/8.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/9.jpg)
Occlusion Culling
Cell & Portal
![Page 10: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/10.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/11.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/12.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/13.jpg)
3D Rendering Pipeline
![Page 14: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/14.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/15.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/16.jpg)
Ray Casting
Fire a ray for every pixel If ray intersects multiple objects, take the closest
![Page 17: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/17.jpg)
Ray Casting Pipeline
![Page 18: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/18.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/19.jpg)
3D Rendering Pipeline
![Page 20: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/20.jpg)
Scan-line Algorithm
For each scan line, construct spans Sort by depth
![Page 21: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/21.jpg)
3D Rendering Pipeline
![Page 22: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/22.jpg)
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](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/23.jpg)
3D Rendering Pipeline
![Page 24: Hidden Surface Removal](https://reader037.vdocument.in/reader037/viewer/2022103006/568139f4550346895da1b045/html5/thumbnails/24.jpg)
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