Top Banner

Click here to load reader

of 93

Advance topics :

Feb 24, 2016

Download

Documents

raleigh

Advance topics :. UNIT - 6. Topics to cover :. visible surface detection concepts, back-face detection, depth buffer method , illumination, light sources, illumination methods ( ambient , diffuse reflection, specular reflection), - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Advance topics :

UNIT - 6Advance topics :Topics to cover :visible surface detection concepts, back-face detection, depth buffermethod, illumination, light sources, illumination methods (ambient, diffuse reflection, specular reflection), Color models: properties of light, XYZ, RGB, YIQ and CMY color models2IntroductionPurpose Identify the parts of a scene that are visible from a chosen viewing position. Classification Object-Space Methods Compare objects and parts of objects to each other within the scene definition. Image-Space Methods Visibility is decided point by point at each pixel position on the projection plane. Sorting : Facilitate depth comparisons Coherence : Take advantage of regularities in a scene33Visible Surface DetectionA major consideration in the generation of realistic graphics is determining what is visible within a scene from a chosen viewing positionAlgorithms to detect visible objects are referred to as visible-surface detection methods

5visible surface detection conceptsObject space algorithms: determine which objects are in front of othersResize doesnt require recalculationWorks for static scenesMay be difficult to determineImage space algorithms: determinewhich object is visible at each pixelResize requires recalculationWorks for dynamic scenesBack-Face DetectionA fast and simple object-space method for locating back facesA point (x,y,z) is inside a polygon surface with plane parameters A, B, C, D if : Ax + By + Cz + D < 0When an inside point is along the line of sight to the surface, the polygon must be a back face and so cannot be seen

Back-Face CullingBack faces

Back-face removal expected to eliminate about half of the polygon surfaces in a scene. A scene contains only nonoverlapping convex polyhedra7

7Depth-Buffer MethodDepth-buffer(z-buffer) Method Object depth: Measured from the view plane along the z axis of a viewing system. Each surface is processed separately. Can be applied to planar and nonplanar surfaces Require two buffers: depth and frame buffers Basic concepts Project each surface onto the view plane For each pixel position covered, compare the depth values. Keep the intensity value of the nearest surface

88Depth-Buffer MethodInitial states Depth buffer : Infinity Frame buffer : Background color

9

9Depth Buffer MethodA commonly used image-space approachEach surface is processed separately, one point at a timeAlso called the z-buffer methodIt is generally hardware implementedDepth Buffer Method3 surfaces overlap at (x,y). S1 has the smallest depth value

Depth Buffer MethodTwo buffers are neededDepth buffer (distance information)Frame buffer (intensity/color information)Depth Buffer MethodDepth-Buffer Algorithmfor all (x,y)depthBuff(x,y) = 1.0, frameBuff(x,y)=backgndcolorfor each polygon Pfor each position (x,y) on polygon Pcalculate depth zif z < depthBuff(x,y) thendepthBuff(x,y) =z frameBuff(x,y)=surfColor(x,y)

Scan-Line MethodImage space methodExtension of scan-line algorithm for polygon fillingAs each scan line is processed, all polygon surface projections intersecting that line are examined to determine which are visibleScan-Line MethodExample

A-Buffer MethodExtension of Depth-buffer ideasDrawback of the Depth-buffer methodDeal only with opaque surfacesA-bufferReference a linked list of surfacesAntialiased, Area-averaged, Accumulation-buffer

Each position has two fieldsDepth fieldStore a positive or negative real numberIntensity fieldStore surface-intensity information or a pointer value

1616A-Buffer MethodOrganization of an A-bufferSingle-surface overlap

Multiple-surface overlap17

17Scan-Line MethodAn extension of scan-line polygon filling Fill multiple surfaces at the same time Across each scan line, depth calculations are made for each overlapping surface

18

18Scan-Line MethodSurface tablesEdge tableCoordinate endpoints, inverse slop, pointers into polygon tablePolygon tableCoefficient, intensity, pointers into the edge tableFlagTaking advantage of CoherencePass from one scan line to the nextSame active listNo need of depth calculationBe carefulnot cut through or cyclically overlap each other1919Scan-Line MethodOverlapping polygon surfaces

20

20Depth Sorting MethodPainters Algorithm Surfaces are sorted in order of decreasing depth. Surfaces are scan converted in order, starting with the surface of greatest depth. Two surfaces with no depth overlap

21

2122Painters AlgorithmDraw surfaces from back (farthest away) to front (closest): Sort surfaces/polygons by their depth (z value)Draw objects in order (farthest to closest)Closer objects paint over the top of farther away objectsDepth Sorting Method Tests for each surface that overlaps with S in depth: The bounding rectangles in the xy plane for the two surfaces do not overlap. Surface S is completely behind the overlapping surface relative to the viewing position. The overlapping surface is completely in front of S relative to the viewing position. The projections of the two surfaces onto the view plane do not overlap.

23If one of these tests is true, no reordering is necessary23Depth Sorting Method24 Two surfaces with depth overlap but no overlap in the x direction.

24Depth Sorting Method25Surface S is completelybehind the overlapping surface SOverlapping surface S is completely in front of surface S, but S is not completely behind S

25Depth Sorting Method26 Two surfaces with overlapping bounding rectangles in the xy plane.

26Depth Sorting Method27Surface S has greater depthbut obscures surface SThree surfaces entered into the sorted surface list in the order S, S, S should be reordered S, S, S.

27BSP-Tree MethodBinary Space-Partitioning (BSP) tree An efficient method for determining object visibility by painting surface onto the screen Particularly useful when the view reference point changes, but the scene is fixed. In VR applications, BSP is commonly used for visibility preprocessing.

Basic concepts Identify surfaces that are inside and outside the partitioning plane, relative to the viewing direction2828BSP-Tree Method29

29BSP-Tree MethodPartitioning planes For polygonal objects, we may choose the planes of object facets. Any intersected polygon is split into two parts

When the BSP tree is complete Selecting the surfaces for display from back to front Implemented as hardware for the construction and process of BSP tree.

3030Area Subdivision MethodTake advantage of area coherence in a scene Locating those view areas that represent part of a single surface. Recursively dividing the total viewing area into smaller and smaller rectangles.

Fundamental tests Identify an area as part of a single surface By comparing surfaces to the boundary of the area It is too complex to analyze easily. Subdivide this area into smaller rectangles.

3131Area Subdivision MethodFour possible relationships that a surface can have with a specified area boundary: Surrounding surface One that completely encloses the area. Overlapping surface One that is partly inside and partly outside the area. Inside surface One that is completely inside the area. Outside surface One that is completely outside the area.

3232Area Subdivision Method33Surrounding SurfaceOverlapping SurfaceInside SurfaceOutside Surface

33Area Subdivision MethodNo further subdivisions of a specified area are needed if one of the following conditions is true: All surfaces are outside surfaces with respect to the area. Check bounding rectangles of all surfaces Only one inside, overlapping, or surrounding surface is in the area. Check bounding rectangles first and other checks A surrounding surface obscures all other surfaces within the area boundaries.

3434Area Subdivision MethodObscuring Surround surfaces identification1 Using depth sorting Order surfaces according to their minimum depth from the view plane. Compute the maximum depth of each surrounding surface.

35

35Area Subdivision MethodObscuring-surround surfaces identification-2 Using plane equations Calculate depth values at the four vertices of the area for all surrounding, overlapping, and inside surfaces. If the calculated depths for one of the surrounding surfaces is less than those for all other surfaces, it is identified.

If both methods for identifying obscuring-surround surface are fail It is faster to subdivide the area than to continue with more complex testing.3636Area Subdivision MethodSubdivide areas along surface boundaries Sort the surfaces according to the minimum depth Use the surface with the smallest depth value to subdivide a given area.

37

37Octree MethodsOctree representation Projecting octree nodes onto the viewing surface in a front-to-back order

38

38Ray-casting MethodAlgorithmCast ray from viewpoint from each pixel to find front-most surface39

39Ray-casting MethodComments for p pixelsMay (or may not) utilize pixel-to-pixel coherenceConceptually simple, but not generally used40

40Curved SurfacesVisibility detection for objects with curved surfacesRay casting Calculating ray-surface intersectionLocating the smallest intersection distanceOctree Approximation of a curved surface as a set of plane, polygon surfaceReplace each curved surface with a polygon meshuse one of the other hidden-surface methods4141Curved SurfacesCurved-Surface RepresentationsExplicit surface equation

Surface Contour PlotsPlotting the visible-surface contour lines

Eliminating those contour section that are hidden by the visible parts of the surfaceOne waymaintain a list of ymin and ymaxymin