Lesson 35 a Buffer

download Lesson 35 a Buffer

of 8

Transcript of Lesson 35 a Buffer

  • 7/21/2019 Lesson 35 a Buffer

    1/8

    Hidden Line EliminationHidden Line Elimination

    MethodsMethods

  • 7/21/2019 Lesson 35 a Buffer

    2/8

    Scan-Line MethodScan-Line Method

    This method is an extension of the scan-lineThis method is an extension of the scan-linealgorithm for filling polygon interiorsalgorithm for filling polygon interiors

    Instead of filling just one surface, we hae to dealInstead of filling just one surface, we hae to dealwith multiple surfaceswith multiple surfaces

    !s each scan line is processed, all polygon surfaces!s each scan line is processed, all polygon surfacesintersecting that line are examined to determineintersecting that line are examined to determinewhich are isi"lewhich are isi"le

    !cross each scan line, depth calculations are made!cross each scan line, depth calculations are madefor each oerlapping surface to determine which isfor each oerlapping surface to determine which isnearest to the iew planenearest to the iew plane

    #hen the isi"le surface has "een determined, the#hen the isi"le surface has "een determined, theintensity alue for that position is entered into theintensity alue for that position is entered into the

    refresh "ufferrefresh "uffer

  • 7/21/2019 Lesson 35 a Buffer

    3/8

    Scan-Line MethodScan-Line Method

    !

    y

    x

    $

    %

    &

    H

    E

    '

    (

    S) S*

  • 7/21/2019 Lesson 35 a Buffer

    4/8

    Scan-Line MethodScan-Line Method

    !ny num"er of oerlapping polygon surfaces can "e!ny num"er of oerlapping polygon surfaces can "e

    processed with this scan-line methodprocessed with this scan-line method

    (lags for the surfaces are set to indicate whether a(lags for the surfaces are set to indicate whether a

    position is inside or outsideposition is inside or outside $epth calculations are performed when surfaces oerlap$epth calculations are performed when surfaces oerlap

    #hen these coherence methods are used,we need to "e#hen these coherence methods are used,we need to "e

    careful to +eep trac+ of which surface section is isi"lecareful to +eep trac+ of which surface section is isi"le

    on each scan lineon each scan line This wor+s only if surfaces do not cut through orThis wor+s only if surfaces do not cut through or

    otherwise cyclically oerlap each otherotherwise cyclically oerlap each other

  • 7/21/2019 Lesson 35 a Buffer

    5/8

    !-&uffer method!-&uffer method

    !n !-"uffer method is an extension in the depth-"uffer!n !-"uffer method is an extension in the depth-"uffermethodmethod

    The !-"uffer method represents an antialiased, area-The !-"uffer method represents an antialiased, area-aerages, accumulation-"ufferaerages, accumulation-"uffer

    This is deeloped "y Lucasfilm for implementation in theThis is deeloped "y Lucasfilm for implementation in thesurface-rendering system called EESsurface-rendering system called EES

    ! limitation of .-"uffer method is that it can only find one! limitation of .-"uffer method is that it can only find oneisi"le surface at each pixel positionisi"le surface at each pixel position

    The !-"uffer method expands the depth "uffer so that eachThe !-"uffer method expands the depth "uffer so that eachposition in the "uffer can reference a lin+ed list of surfacesposition in the "uffer can reference a lin+ed list of surfaces

  • 7/21/2019 Lesson 35 a Buffer

    6/8

    !-&uffer method!-&uffer method

    More than one surface intensity can "e ta+en intoMore than one surface intensity can "e ta+en into

    consideration at each pixel position and o"ject edges can "econsideration at each pixel position and o"ject edges can "e

    antialiasedantialiased

    Each position in the !-"uffer has two fields/Each position in the !-"uffer has two fields/ $epth field-stores a positie or negatie real num"er$epth field-stores a positie or negatie real num"er

    Intensity field-stores surface-intensity information or a pointer alueIntensity field-stores surface-intensity information or a pointer alue

    If the depth field is positie, the num"er stored at thatIf the depth field is positie, the num"er stored at that

    position is the depth of a single surface oerlapping theposition is the depth of a single surface oerlapping the

    corresponding pixel areacorresponding pixel area

    The intensity field then stores the '& components of theThe intensity field then stores the '& components of the

    surface color at that point and the percent of the pixelsurface color at that point and the percent of the pixel

    intensityintensity

  • 7/21/2019 Lesson 35 a Buffer

    7/8

    !-&uffer method!-&uffer method

    If the depth field is negatie, this indicates multiple-surfaceIf the depth field is negatie, this indicates multiple-surface

    contri"ution to the pixel intensitycontri"ution to the pixel intensity

    The intensity field then stores a pointer to a lin+ed list ofThe intensity field then stores a pointer to a lin+ed list of

    surface datasurface data

    $ata for each surface in the lin+ed list includes/-$ata for each surface in the lin+ed list includes/- '& intensity components'& intensity components

    Surface identifierSurface identifier

    0ercent of area coerage0ercent of area coerage

    0ointer to next surface0ointer to next surface

    $epth$epth

  • 7/21/2019 Lesson 35 a Buffer

    8/8

    Than+ ouThan+ ou