computer graphics 2 lecture 8 visibility
Download
Skip this Video
Download Presentation
Computer Graphics 2 Lecture 8: Visibility

Loading in 2 Seconds...

play fullscreen
1 / 34

Computer Graphics 2 Lecture 8: Visibility - PowerPoint PPT Presentation


  • 125 Views
  • Uploaded on

Computer Graphics 2 Lecture 8: Visibility. Pr. Min Chen Dr. Benjamin Mora. University of Wales Swansea. 1. Benjamin Mora. Main techniques for visibility. Historical Techniques. Z-buffer techniques. Used Much. Basis for current hardware-accelerated Technologies. Ray-Tracing.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Computer Graphics 2 Lecture 8: Visibility' - brent


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
computer graphics 2 lecture 8 visibility

Computer Graphics 2Lecture 8:Visibility

Pr. Min Chen

Dr. Benjamin Mora

University of Wales Swansea

1

Benjamin Mora

main techniques for visibility
Main techniques for visibility
  • Historical Techniques.
  • Z-buffer techniques.
    • Used Much.
    • Basis for current hardware-accelerated Technologies.
  • Ray-Tracing.
    • See Next Lecture!

University of Wales Swansea

2

Benjamin Mora

content
Content
  • Painter & Priority Lists Algorithms.
  • Cells and Portals.
  • Area subdivision algorithms.
    • Warnock and Weiler Atherton algorithms.
  • Scan line algorithms.
  • The z-buffer algorithm.
  • Extensions.
    • Culling.
    • Hidden Surface Removal
      • Hierarchical Occlusion maps.
      • Hierarchical z.
    • Depth peeling.
    • Soft Shadows.
    • Shadow mapping.

University of Wales Swansea

3

Benjamin Mora

old techniques
Old Techniques

University of Wales Swansea

4

Benjamin Mora

painter s algorithm
Painter’s Algorithm
  • Painter’s Algorithm:
    • Only if graphics primitives can be separated by planes.
      • Primitive can be projected from the farthest one to the closest (Back-to-Front) without any need to find the closest intersection.
      • All the primitives being on the same side of the viewpoint (A) will be intersected first, so a Front-to-back analysis is more efficient.

(A)

(B)

University of Wales Swansea

5

Benjamin Mora

priority list bsp trees fuch

1

2

2

3

1

5

5

4

4

3

Priority List/BSP Trees (Fuch)

University of Wales Swansea

6

Benjamin Mora

priority list bsp trees fuch1
Priority List/BSP Trees (Fuch)
  • Proposed by Henry Fuch (1980).
  • By preprocessing the scene and creating a binary space subdivision, primitives can then be projected in a visibility order.
  • Handles Transparency correctly.
  • In practice, constructing a Binary Space Partitioning tree is difficult!

University of Wales Swansea

7

Benjamin Mora

cells and portals

C

D

A

B

F

E

A

B

C

F

E

D

Cells and Portals
  • In architectural scenes, rooms are usually not visible from other rooms.
  • Used in 3D games (with Z-buffering).
  • A visibility graph is usually associated to the scene.

University of Wales Swansea

8

Benjamin Mora

cells and portals1
Cells and Portals
  • However:
    • Do not work with scenes like forest, clouds,…
    • Needs to pre-compute the graph.
      • Dynamic scenes are an issue.
    • Sorting out visibility inside the cells is still required.
  • Sometime a method that can compute visibility in real-time (on-the-fly) is needed.
    • Z-Buffer/Hierarchical Z-buffer.
    • Hierarchical Occlusions Maps.
    • Occlusion queries.

University of Wales Swansea

9

Benjamin Mora

area subdivision algorithms
Area Subdivision Algorithms
  • Warnock Algorithm (1969).
    • Not really used anymore.
    • Hierarchical method.
    • Quadtree structure.
    • Assumes no overlapping
    • Visibility is computed

on a per-block basis.

http://www.evl.uic.edu/aej/488/diagrams/areasub.gif

University of Wales Swansea

10

Benjamin Mora

area subdivision algorithms1
Area Subdivision Algorithms
  • Weiler-Atherton algorithm
    • Kevin Weiler, Peter Atherton, “Hidden surface removal using polygon area sorting”, Siggraph 1977.
    • Works on 3D primitives instead of using screen space subdivisions.
    • Maintains a list of clipped (visible) polygons.
      • Every time a new polygon is processed, clipping with all the (visible) polygons is performed and a new list of polygons is generated.
      • Once all the polygons processed, the clipped parts can be used for the final image.

University of Wales Swansea

11

Benjamin Mora

area subdivision algorithms2

Subject Polygon

Clip Polygon

Area Subdivision Algorithms
  • Weiler Atherton algorithm.
    • Provides a general clipping algorithm for concave polygons.
    • Other algorithm for clipping: Sutherland-Hodgman algorithm.

University of Wales Swansea

12

Benjamin Mora

scanline watkins 70
Scanline (Watkins 70)
  • Watkins, G.S. A real-time visible surface algorithm. UTEC-CSc-70-101, Computer Science Dept., Univ. of Utah, June 1970.
  • Principles similar to Weiler Atherton algorithm, but uses 1D clipping (line) only.
    • Maintains a list of clipped lines for every row.
  • Scan-line term used for rasterization algorithms.

University of Wales Swansea

13

Benjamin Mora

scanline watkins 701

Scan Line y

Primitive list

Triangle #2

p1

p2

Row y

p1

p2

p1

p3

p3

p4

p3

p4

p4

p2

Triangle #1

Scanline (Watkins 70)

Image

University of Wales Swansea

14

Benjamin Mora

possible issues with these algorithms
Possible Issues with these algorithms
  • Could be too complex (e.g., 2D clipping).
    • Lead to several cases and bugs in implementations.
  • Not fast enough.
    • E.g. clipping.
  • Hardly parallelizable.
    • Not suitable to hardware acceleration.

University of Wales Swansea

15

Benjamin Mora

the z buffer
The Z-Buffer

University of Wales Swansea

16

Benjamin Mora

z buffer test
Z-Buffer test
  • Example:

Final image

Final z-buffer

University of Wales Swansea

17

Benjamin Mora

z buffer test1
Z-Buffer test
  • Used by current hardware technology.
  • Primitives can be sent to the graphics hardware in any order, thanks to the z-buffer test that will keep the closest fragments.
  • A z value is stored for every pixel (z-buffer).
  • Algorithm for a given pixel:

If the rasterized z-value is less than the current z-value

Then replace the previous color and z-value by the new ones

University of Wales Swansea

18

Benjamin Mora

z buffer test2

Row y

Row y+1

Row y+2

Z-Buffer test
  • A scan line algorithm can be used to find all the pixels on the projection of a single triangle.
  • Lines are filled with colors if the pixels pass the z-test.

University of Wales Swansea

19

Benjamin Mora

extensions to these techniques
Extensions to these techniques

University of Wales Swansea

20

Benjamin Mora

culling
Culling
  • Why ?
    • To avoid processing geometry that does not need to be processed.
    • Useful when having millions (or billions) of triangles.
    • Can be done at the triangle or pixel level.
  • View Frustum Culling.
  • Back Face Culling.
  • Occlusion Culling.

University of Wales Swansea

21

Benjamin Mora

culling1

Visible Triangle

Culled triangles

Culling
  • View Frustum Culling.
    • Primitives outside of the view frustum discarded.
    • Implemented on graphics cards.

Viewing pyramid

Viewpoint

University of Wales Swansea

22

Benjamin Mora

culling2

Bounding Box

Culling
  • Can be accelerated (software) by grouping triangle and computing the frustum intersection only for the bounding box.

Frustum

Don’t need to process these triangles.

University of Wales Swansea

23

Benjamin Mora

culling3

#1

#1

#3

#2

#2

#3

Wrong vertex order

(Triangle is culled)

Culling
  • Back Face Culling.
    • If the viewpoint is fronting the backface, then the triangle is not processed.
    • Hardware accelerated
    • Can be enabled/disabled.
    • Orientation given by the order of projected vertices.

Projected Triangle

(Visible)

University of Wales Swansea

24

Benjamin Mora

occlusion culling
Occlusion Culling
  • A set of algorithms to avoid processing hidden geometry/surfaces
    • Hierarchical Occlusion Maps.
    • Hierarchical z-buffer.
    • Occlusion queries.

University of Wales Swansea

25

Benjamin Mora

hierarchical occlusion maps
Hierarchical Occlusion Maps

Hansong Zhang, Dinesh Manocha, Tom Hudson Kenneth E. Hoff III. Visibility Culling using Hierarchical Occlusion Maps. Siggraph 1997.

  • Proposed by Zhang et al.
  • Similar to Hierarchical z.
  • Only occlusion is stored here.

University of Wales Swansea

26

Benjamin Mora

hierarchical occlusion maps1
Hierarchical Occlusion Maps
  • Triangles are initially grouped into separate regions of space such as bounding boxes, grids or trees.
  • This data structure is traversed in a front to back order.
    • The visibility of the region is given by the HOM.
    • If region is visible, then its content (i.e., triangles) must be projected.
    • During projection, the content of the different maps is updated every time a pixel becomes opaque.
  • Not used by current hardware.
    • Hierarchical-z instead

University of Wales Swansea

27

Benjamin Mora

hierarchical z buffer
Hierarchical Z-buffer
  • Proposed by Greene et al.
  • A hierarchical z-max pyramid is constructed above the z-buffer.
  • Every time a z value is updated, the hierarchy is updated.

Ned Greene, Michael Kass and Gavin Miller. Hierarchical Z-Buffer Visibility. Siggraph 1993.

8

6

3

2

9

8

8

5

5

5

1

6

9

9

4

7

4

3

7

4

2

6

2

2

University of Wales Swansea

28

Benjamin Mora

hierarchical z buffer1
Hierarchical Z-buffer
  • Current ATI and NVidia graphics card implement a limited z-hierarchy.
  • Efficient when objects are projected in a front-to-back way.
  • ATI Hyper-Z III:

http://graphics.tomshardware.com/graphic/20020718/radeon9700-08.html

University of Wales Swansea

29

Benjamin Mora

occlusion queries
Occlusion Queries
  • New Graphics Hardware allows counting the number of fragments that pass the z-test.
  • 3 steps:
    • Lock the z-buffer and frame buffer (impossible to modify the content of these buffers).
    • Render a bounding box.
      • If no pixel has passed the z-test, then the region inside the BB is not visible.
    • Unlock the Z-buffer and Frame-Buffer.

University of Wales Swansea

30

Benjamin Mora

occlusion queries1
Occlusion Queries
  • Can take advantage of fast z tests.
  • Efficient only if the BB contains many primitives.
  • Must wait for the answer.
    • The program should do something before testing the answer.
    • Occlusions should be chained in order to avoid an empty graphics pipeline.

University of Wales Swansea

31

Benjamin Mora

depth peeling
Depth Peeling

From

Interactive Order-Independent Transparency

Cass Everitt

NVIDIA OpenGL Applications Engineering

University of Wales Swansea

32

Benjamin Mora

depth peeling1
Depth Peeling

From

Interactive Order-Independent Transparency

Cass Everitt

NVIDIA OpenGL Applications Engineering

University of Wales Swansea

33

Benjamin Mora

depth peeling2
Depth Peeling
  • Z-buffer based visibility only allows finding the nearest elements of the scene.
    • Transparency cannot correctly be handled.
  • Solution: use a multipass algorithm to find the second nearest surface, third nearest surface, and etc… for every pixel
    • At the end, combine the different images in a front-to-back-order.

University of Wales Swansea

34

Benjamin Mora

ad