Download presentation
Presentation is loading. Please wait.
Published byBrett Owen Modified over 8 years ago
1
CS 325 Introduction to Computer Graphics 03 / 10 / 2010 Instructor: Michael Eckmann
2
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Today’s Topics Questions/comments? Go over the exam Visible Surface determination –depth buffer (aka z-buffer) a-buffer
3
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Visible Surface Determination Types Image precision for (each pixel in display) { Find closest object that is pierced by the projector through that pixel Draw the pixel at the appropriate color in frame buffer } Object precision for (each object in world) { Determine parts of object whose view is unobstructed by other parts of it or by other objects Save the visible parts } Go through all the visible parts and display at proper resolution in frame buffer Some combination of image and object precision
4
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Visible Surface Determination The visible surface determination algorithms we'll discuss are: Back Face Culling (removal) --- someone remind us of the gist of this Depth Buffer method (aka z-buffer) –A-Buffer method Depth Sort BSP Tree Scanline Algorithm
5
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Depth Buffer Back face culling is an object precision type of visible surface determination. An example of the image precision type of visible surface determination is the depth buffer method. For Depth Buffering we have two buffers The frame buffer (e.g. of size 1024 x 768) for storing the color of each pixel The depth buffer (same size as the frame buffer) for storing the depth value of the object at each pixel –The size of the value of each depth is typically 16 to 32 bits –The size of the value depends on how fine distance needs to be stored. Problems occur if the finite depth stored is not accurate enough.
6
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Depth Buffer Pseudocode for depth buffering: Initialize the 2d depth buffer (z-buffer) to have the maximum depth for each entry Initialize the 2d frame buffer (frame-buffer) to have the background color for each entry for each polygon for each pixel in that polygon's projection –Compute depth at pixel (x,y) –If z-buffer(x,y) > depth(x,y) Then z-buffer(x,y) = depth(x,y) And frame-buffer(x,y) = color of polygon at (x,y) What does this do?
8
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Depth Buffer No presorting of objects nor object to object comparisons are needed Polygons can be processed in any order Doesn't require objects to be polygons (only need to be able to determine a color and depth) Large amount of space necessary for the z-buffer but it is simple --- can reduce space by processing in sections. Hardware implementation of depth buffering is common, thereby increasing speed (as opposed to software implementations). Problems with antialiasing (at polygon edges) and transparent objects. Why?
9
Michael Eckmann - Skidmore College - CS 325 - Spring 2010 A-Buffer Method The A-Buffer (accumulation buffer) method described in the text is an extension to Depth Buffer Method. For depth buffer method: How many colors are stored for a pixel position? Answer: One. How many objects influenced that color? Answer: One. To allow for translucent/transparent objects to be displayed as well as antialiasing at polygon edges, the a-buffer stores A field for the depth A field for the surface data –When we store a non-negative depth, the surface data field stores the color of the one polygon at that closest depth (just like depth-buffer method) –When we store a negative depth, the surface data field points to a linked list of data that will be accumulated in some fashion to determine the pixel color.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.