100% found this document useful (1 vote)
187 views15 pages

Nidhish Raj Mourya - Depth Buffer Method (Chapter 4)

The document discusses the depth buffer method for visible surface detection in 3D computer graphics. It begins by defining visible and hidden surfaces when rendering 3D graphics. It then discusses the need for visible surface detection methods to determine which surfaces are visible. The depth buffer method stores depth values in a depth buffer and compares depths to determine which surfaces are visible at each pixel. The algorithm initializes the depth buffer to maximum depths, renders surfaces calculating pixel depths, and replaces depth and color buffers when surfaces are closer than existing values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
187 views15 pages

Nidhish Raj Mourya - Depth Buffer Method (Chapter 4)

The document discusses the depth buffer method for visible surface detection in 3D computer graphics. It begins by defining visible and hidden surfaces when rendering 3D graphics. It then discusses the need for visible surface detection methods to determine which surfaces are visible. The depth buffer method stores depth values in a depth buffer and compares depths to determine which surfaces are visible at each pixel. The algorithm initializes the depth buffer to maximum depths, renders surfaces calculating pixel depths, and replaces depth and color buffers when surfaces are closer than existing values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

SHRI VAISHNAV VIDYAPEETH VISHVDYALAYA

Session: 2020-21

Subject: Computer Graphics and Multimedia

Subject Code: BTCS-503

Topic: Depth Buffer Method for Visible-Surface Detection

Submitted to: Submitted by:


Mr. Juber Mirza Sir Name: Nidhish Raj Mourya
Roll no. : 18100BTCSAII02849
AGENDA
1. Visible and Hidden Surfaces
2. Visible Surface Detection Methods
3. Need of Visible Surface Detection
4. Classification of Visible Surface Detection Methods
5. Introduction to Depth Buffer Method
6. Algorithm for Depth Buffer Method
7. Advantages and Disadvantages of Depth Buffer Method

07/24/2021 Depth Buffer Method 2


Visible Surfaces and Hidden Surfaces
Whenever we render the 3-D Graphics Image on 2-D Display We Observe
• Visible Surfaces: In a Polygon, visible surfaces are those surfaces which are visible to the observer
from a chosen angle of observation. The Visible Surface of Graphics is completely dependent on the
angle of Observation.
• Hidden Surface: Hidden surfaces Comes in picture when we generate the graphics on screen and
when it is opaque some part of image is only visible to the user by chosen view angle and all other
part is invisible to the observer.

B A

Depth Buffer Method


07/24/2021 3
Visible Surfaces Detection Methods
• Visible Surface Detection methods are also referred as Hidden Surface Elimination Methods or
visible surface determination methods.
• Visible surface detection aims to determine visible surfaces in the synthesized image, which is the
most common visibility problem in computer graphics.
• These Methods are used to identify those parts of a scene that are visible from a chosen viewing
position.
• These Methods are also useful when Surfaces are obscured or hidden by the other opaque surfaces
along the line of sight (projection), then they are invisible to the viewer. Then we use surface
detection methods

Depth Buffer Method


07/24/2021 4
Need of Visible Surfaces Detection Methods
Visibility Problem

B A A B A

Selecting the exact set of polygons which are visible from a given view point. More Generally the
problem is when you render pair of Objects or N Objects then which pixel should be in front of
another pixel. Which pixel should be rendered and visible.

Depth Buffer Method


07/24/2021 5
Classification of Visible Surfaces Detection Methods

Visible Surface
Detection Methods

Object Space Image Space


Methods Methods

Depth Buffer Method


07/24/2021 6
Classification of Visible Surfaces Detection Methods
 Object-space Methods: Object-space Methods Compare objects and parts of objects to
each other within the scene definition to determine which surfaces are visible:
For each object in the scene do
Begin
1. Determine those parts of the object whose view is unobstructed by other parts of it
or any other object with respect to the viewing specification.
2. Draw those parts in the object color.
End
• Compare each object with all other objects to determine the visibility of the object parts.
• If there are n objects in the scene, complexity = O(n*n) = O(n2)
• These were developed for vector graphics system.
• It requires a lot of calculations if the image is to enlarge.
• Suitable for scene with small number of objects and objects with simple relationship with
each other.

Depth Buffer Method


07/24/2021 7
Classification of Visible Surfaces Detection Methods
 Image-space Methods: In Image-space Methods Visibility is determined point by point at
each pixel position on the projection plane.
For each pixel in the image do
Begin
1. Determine the object closest to the viewer that is pierced by the projector through
the pixel
2. Draw the pixel in the object color.
End

• For each pixel, examine all n objects to determine the one closest to the viewer.
• If there are p pixels in the image, complexity depends on n and p ( O(np) ).
• These are developed for raster devices.
• Image can be enlarged without losing accuracy.
• A change of display resolution requires re-calculation. Accuracy of the calculation is bounded by
the display resolution

Depth Buffer Method


07/24/2021 8
Depth-Buffer Method
• The Depth-buffer is one of the simplest image-space approach for visible surface detection.
• The Depth-buffer Method was introduced by Sir Catmull in 1974.
• It is also referred as Z- Buffer Method. It is the solution of Visibility problem, which is the problem
of deciding which elements of a rendered scene are visible, and which are hidden.
• This approach compares surface depths at each pixel position on the projection plane. Object depth
is usually measured from the view plane along the z axis of a viewing system.
• The depth values for a pixel are compared and then determines the color to be displayed in the frame
buffer.
• It is applied very efficiently on surfaces of polygon. Surfaces can be processed in any order. To
override the closer polygons from the far ones.
• Here we Use two buffers named as frame buffer and depth buffer. Each of these buffers has the
same resolution as the image to be captured.

Depth Buffer Method


07/24/2021 9
Depth-Buffer Method
• Depth buffer is used to store depth values for (x, y)
position, as surfaces are processed (0 ≤ depth ≤ 1).
• The frame buffer is used to store the intensity value
of color value at each position of (x, y).
• As surfaces are processed, the image buffer is used
to store the color values of each pixel position and
the Z-buffer is used to store the depth values for
each (x,y) position.

Diagram
• The z-coordinates are usually normalized to the range [0, 1]. The 0 value for z-coordinate indicates
back clipping pane and 1 value for z-coordinates indicates front clipping pane.

Depth Buffer Method


07/24/2021 10
Depth-Buffer Method
• Depth Values for a surface position(x , y) are calculated from the plane equation for each surface by:

Z = -(Ax + By +D) …….(Equ. 1)


C

• Depth Values for Z’ :

Z’ = -(A(x+1) + By +D) …….(Equ. 2)


C

• Hence from (1) and (2), we conclude :

Z’ = -(A) …….(Equ. 3)
C

Depth Buffer Method


07/24/2021 11
Depth-Buffer Algorithm
Algorithm include following Steps:

1. Initially each pixel of the Z-buffer is set to the maximum depth value (the depth of the back clipping
plane).
2. The image buffer is set to the background colour.
3. Surfaces are rendered one at a time.
4. For the first surface, the depth value of each pixel is calculated.
5. If this depth value is smaller than the corresponding depth value in the Z-buffer (i.e. it is closer to
the view point), both the depth value in the Z-buffer and the colour value in the image buffer are
replaced by the depth value and the colour value of this surface calculated at the pixel position.
6. Repeat step 4 and 5 for the remaining surfaces.
7. After all the surfaces have been processed, each pixel of the image buffer represents the colour of a
visible surface at that pixel.

Depth Buffer Method


07/24/2021 12
Example
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
B A B A
1

1 1 1

1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1

1 1 1 0.5

1 1 1 1 0.5 0.5 0.5

1 1 1 1 0.5 0.5 0.5 0.5 0.5

1 1 1 1 1 1 1 1 1

Depth Buffer Method


07/24/2021 13
Advantage and Disadvantages of Depth Buffer
Method

 Advantages of Depth Buffer Method


• It is easy to implement.
• It reduces the speed problem if implemented in hardware.
• It processes one object at a time.
• Accurate performance.

 Disadvantages of Depth Buffer Method


• It requires large memory.
• It is time consuming process.

Depth Buffer Method is only for rendering Opaque Objects.

Depth Buffer Method


07/24/2021 14
Thank you Very Much !!!!
Please You can ask Questions ?

STAY HOME, STAY SAFE !

Depth Buffer Method


07/24/2021 15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy