Volume Rendering Volume Rendering Isosurface Generation Isosurface - - PowerPoint PPT Presentation

volume rendering volume rendering isosurface generation
SMART_READER_LITE
LIVE PREVIEW

Volume Rendering Volume Rendering Isosurface Generation Isosurface - - PowerPoint PPT Presentation

Visualization Techniques Visualization Techniques Volume Rendering Volume Rendering Isosurface Generation Isosurface Generation Cludio T. Silva Cludio T. Silva Outline Introduction to Volume Rendering Out-Of-Core Techniques


slide-1
SLIDE 1

Visualization Techniques

Volume Rendering Isosurface Generation

Visualization Techniques

Volume Rendering Isosurface Generation

Cláudio T. Silva Cláudio T. Silva

slide-2
SLIDE 2

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Outline

  • Introduction to Volume Rendering
  • Out-Of-Core Techniques
  • Introduction to External Memory Algorithms
  • Isosurface Generation
  • Direct Volume Rendering
  • Hardware-Assisted Techniques
  • Introduction to Programmable Hardware
  • Direct Volume Rendering
  • Isosurface Generation (remarks)
slide-3
SLIDE 3

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Introduction to Volume Rendering

slide-4
SLIDE 4

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Grid Types

Regular Rectilinear Irregular Curvilinear

slide-5
SLIDE 5

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Volume Rendering vs Isosurfaces

Direct Volume Rendering

  • Volume data Image
  • Looks “inside” the data

Isosurfaces

  • Volume data Polygon model
  • Slice of the data

M Mc

cPherson, LANL

Pherson, LANL M Mc

cPherson, LANL

Pherson, LANL

slide-6
SLIDE 6

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Isosurfaces

For a query value q, find and display the isosurface of q: C(q) = {p | F(p) = q}

slide-7
SLIDE 7

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Isosurface Extraction Pipeline Volume Data Triangles Triangles Triangle Strips Display

Marching Cubes simplification stripping

Search Phase Generation Phase O(N) O(K), K = N^(2/3) Search Phase: N cells K active cells

slide-8
SLIDE 8

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Scalar Intervals and Active Cells

(v1, f1=F(v1)) f4 f3 (v2, f2=F(v2)) (p, q=F(p)) f_min = min(f1, f2, f3, f4) f_max = max(f1, f2, f3, f4) Produce Interval I = [f_min, f_max] for each cell Active cells = cells intersected by the isosurface = cells with f_min <= isovalue q <= f_max

[Cignoni et al 96]

slide-9
SLIDE 9

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Interval Tree [Edelsbrunner 81] u u0 u1

2 1 3 4 S0 S1 q1 q2 Intervals: crossing slab boundary -- u, else -- child left list: left(u) = (2, 0, 1) right list: right(u) = (1, 2, 0)

slide-10
SLIDE 10

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Isosurface Acceleration

Span Space [Livnat et al] Seed Cells [Bajaj et al, and others] Optimal Contour Trees [Chiang et al, Carr et al] Lots of other work…

slide-11
SLIDE 11

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Direct Volume Rendering: Optical Models

Light

s s s I s s g s I s s I ∆ Ω − ∆ + = ∆ + ) ( ) ( ) ( ) ( ) (

s

s ∆

dx s x dy y e x g s I

∫ ∫Ω

− = ) ( ) ( ) (

slide-12
SLIDE 12

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Volume Rendering at a High Level (a) Sampling Phase (b) Sorting Phase

slide-13
SLIDE 13

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Unstructured Grid Volume Rendering Ray Tracing Viewing

Direction

Z Y X Screen

P

slide-14
SLIDE 14

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Outline

  • Introduction to Volume Rendering
  • Out-Of-Core Techniques
  • Introduction to External Memory Algorithms
  • Isosurface Generation
  • Direct Volume Rendering
  • Hardware-Assisted Techniques
  • Introduction to Programmable Hardware
  • Direct Volume Rendering
  • Isosurface Generation (remarks)
slide-15
SLIDE 15

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Principles of External Memory Algorithms

I/O Computational Model Algorithmic Techniques

  • Caching & Prefetching
  • [Cox-Ellsworth 1997; Sutton-Hansen 2000; Bajaj et al

1999; etc]

  • External Merge Sort
  • Out-Of-Core Pointer De-Referencing
  • Meta-Cell Technique [Chiang and Silva 1998]
  • Indexing (B-Tree-Like Data Structures)
slide-16
SLIDE 16

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

I/O Computational Model

  • B: # items fitting in one disk block
  • One I/O reads/writes one block (B items)
  • Virtual memory vs Out-of-core techniques
  • Batched computations (e.g. external sorting)
  • On-line computations (e.g. B-tree)

CPU Internal Memory External Memory (D disks) usually D = 1

slide-17
SLIDE 17

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Caching & Prefetching

slide-18
SLIDE 18

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Meta-Cell Technique [Chiang and Silva 1998]

Out-of-core technique for creating spatially coherence geometry for unstructured grids

216 meta-cells 1000 meta-cells

slide-19
SLIDE 19

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Out-Of-Core Isosurface Extraction

slide-20
SLIDE 20

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Preprocessing Pipeline

volume dataset Meta-cell Computation meta-cells meta-intervals Tree Construction binary-blocked I/O interval tree

Isosurface Extraction

slide-21
SLIDE 21

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Isosurface Query Pipeline

isovalue q interval searching meta-cells disk read active meta-cell ID’s generation phase (use Vtk) active meta-cells isosurface full dataset

slide-22
SLIDE 22

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Out-Of-Core Direct Volume Rendering

  • Sampling Phase does not change
  • The part that changes is the sorting phase
slide-23
SLIDE 23

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Sorting

Application Rasterization Display Object Space Image-Space Sorting

i.e., let’s sort the i.e., let’s sort the pixes pixes! !

slide-24
SLIDE 24

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Image-Order Sorting: Carpenter’s A-Buffer Idea: Keep a list of intersections for each pixel

slide-25
SLIDE 25

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-26
SLIDE 26

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-27
SLIDE 27

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-28
SLIDE 28

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-29
SLIDE 29

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-30
SLIDE 30

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-31
SLIDE 31

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-32
SLIDE 32

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-33
SLIDE 33

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-34
SLIDE 34

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-35
SLIDE 35

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-36
SLIDE 36

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer

slide-37
SLIDE 37

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer Not sorted!

slide-38
SLIDE 38

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Cell-Projection With An A-Buffer Sorted!

slide-39
SLIDE 39

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

A Simple Memory-Insensitive Technique

Data Sampling Dereferenced Sorted Compose X , Y , Z X , Y , Z

1 1 1

X , Y , Z

n n n

I , I , I , I

00 01 02 03 10 11 12 13 t0 t1 t2 t3

n

vertices

t

tetrahedra

I , I , I , I I , I , I , I

slide-40
SLIDE 40

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Data Sampling Dereferenced Sorted XYZ XYZ XYZ XYZ

00 01 02 03 10 11 12 13 t0 t1 t2 t3

XYZ XYZ XYZ XYZ XYZ XYZ XYZ XYZ Compose

slide-41
SLIDE 41

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Data Sampling Dereferenced Sorted Pix Z Alpha

1 P

Compose Pix Z Alpha Pix Z Alpha

slide-42
SLIDE 42

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Data Sampling Dereferenced Sorted Compose Pix Z Alpha

0` 1` P`

Pix Z Alpha Pix Z Alpha

slide-43
SLIDE 43

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Data Projected Dereferenced Sorted Compose

slide-44
SLIDE 44

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Features of Memory-Insensitive Algorithm

  • Dataset can be arbitrarily large
  • Easily to implement
  • Cell intersection code
  • Sample Integration code
  • External Memory sort
  • Transfer function modifications for same

viewpoint are fast! (also for time-varying data)

slide-45
SLIDE 45

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Complexity Analysis c cells N-by-N pixels Number of Intersections: O(c N2) Problems:

  • 1. Time: sorting intersections takes too long!
  • 2. Memory: storage too high!
slide-46
SLIDE 46

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Sorting

Application Rasterization Display Image-Space Sorting Object-Space Sorting

slide-47
SLIDE 47

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Approximate Object-Space Sorting

1

slide-48
SLIDE 48

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2

slide-49
SLIDE 49

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2 3

slide-50
SLIDE 50

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2 3 4 5

slide-51
SLIDE 51

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2 3 4 5 6 7

slide-52
SLIDE 52

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2 3 4 5 7 6

A Solution: A Solution: Use an insertion Use an insertion-

  • sort A

sort A-

  • buffer!

buffer!

slide-53
SLIDE 53

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

1 2 3 4 5 7 6

What about the What about the space problem space problem ? ?

  • Use a conservative bound on the intersections

Use a conservative bound on the intersections

slide-54
SLIDE 54

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

ZSWEEP: Sort in Image and Object Space

Do an approximate sorting of the cells (e.g., based on the order of the vertices), and use an insertion sort for the intersections – solves the sorting overhead Propose a conservative technique for limiting the memory usage, by performing compositing on the intersections, anytime the lists become “too large” – solves the memory overhead

slide-55
SLIDE 55

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

ZSWEEP - DEMO

slide-56
SLIDE 56

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Blocking for Out-Of-Core Rendering

Meta Meta-

  • cell

cell

Chiang, Silva, Schroeder 1998

slide-57
SLIDE 57

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Out-Of-Core ZSWEEP: Data Management

Meta-cell Event: fetch A fetch B dump A dump B Sweep Plane

[ [Farias Farias and Silva 2001a] and Silva 2001a]

slide-58
SLIDE 58

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Tile-Based ZSWEEP

SGI R10K L2 – 2MB ZSWEEP: 56% hit rate TB-ZSWEEP: 94% hit rate

slide-59
SLIDE 59

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Out-Of-Core ZSWEEP Results

Generating 2048x2048 Image (sec) Blunt Fin

Combustion Chamber

Oxygen Post Delta Wing Original ZSWEEP OOC-ZSWEEP Memory Time Memory Time

330 330 350 380 386 407 775 639 6.2 6.2 13.2 24.2 331 423 667 537

slide-60
SLIDE 60

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Video

QuickTime™ and a Photo decompressor are needed to see this picture.

slide-61
SLIDE 61

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Outline

  • Introduction to Volume Rendering
  • Out-Of-Core Techniques
  • Introduction to External Memory Algorithms
  • Isosurface Generation
  • Direct Volume Rendering
  • Hardware-Assisted Techniques
  • Introduction to Programmable Hardware
  • Direct Volume Rendering
  • Isosurface Generation (remarks)
slide-62
SLIDE 62

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Hardware-Assisted Volume Rendering

  • Introduction to Programmable Hardware
  • Texture-Based Volume Rendering
  • Rendering Unstructured Grids
slide-63
SLIDE 63

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Introduction to Programmable Hardware

  • Graphics Pipeline
  • Programmable Graphics Pipeline
slide-64
SLIDE 64

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

Joao Comba, UFRGS

slide-65
SLIDE 65

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

glBegin(GL_TRIANGLES); glVertex3f(0.0,0.0,0.0); glVertex3f(1.0,0.0,0.0); glVertex3f(0.5,1.0,0.0); ... glEnd();

Joao Comba, UFRGS

slide-66
SLIDE 66

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1 2 3 4

Joao Comba, UFRGS

slide-67
SLIDE 67

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1 2 3 4 1 2 3 1 3 4

Joao Comba, UFRGS

slide-68
SLIDE 68

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1 2 3 1 3 4

Joao Comba, UFRGS

slide-69
SLIDE 69

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1’ 2 3 1 3 4

Joao Comba, UFRGS

slide-70
SLIDE 70

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1’ 2’ 3 1 3 4

Joao Comba, UFRGS

slide-71
SLIDE 71

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1’ 2’ 3’ 1 3 4

Joao Comba, UFRGS

slide-72
SLIDE 72

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1’ 2’ 3’ 1 3 4

Joao Comba, UFRGS

slide-73
SLIDE 73

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1 3 4 1’ 2’ 3’

Joao Comba, UFRGS

slide-74
SLIDE 74

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

3 4 1’

Joao Comba, UFRGS

slide-75
SLIDE 75

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

4 1’ 3’

Joao Comba, UFRGS

slide-76
SLIDE 76

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

1’ 3’ 4’

Joao Comba, UFRGS

slide-77
SLIDE 77

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

Joao Comba, UFRGS

slide-78
SLIDE 78

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

Joao Comba, UFRGS

slide-79
SLIDE 79

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

Joao Comba, UFRGS

slide-80
SLIDE 80

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB

Joao Comba, UFRGS

slide-81
SLIDE 81

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: Parallelization

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB Vertex Transformation Vertex Transformation

1 2 3

Joao Comba, UFRGS

slide-82
SLIDE 82

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: Parallelization

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB Vertex Transformation Vertex Transformation

1’ 2’ 3’

Joao Comba, UFRGS

slide-83
SLIDE 83

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: Parallelization

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring

Joao Comba, UFRGS

slide-84
SLIDE 84

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: Parallelization

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring Fragment Texturing and Coloring

Joao Comba, UFRGS

slide-85
SLIDE 85

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Vertex Transformation Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Programmable Vertex Processor

Joao Comba, UFRGS

Program

slide-86
SLIDE 86

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Vertex Processor

Program

Joao Comba, UFRGS

slide-87
SLIDE 87

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Programmable Fragment Processor

Program

Vertex Processor

Joao Comba, UFRGS

slide-88
SLIDE 88

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Primitive Assembly and Rasterization Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Fragment Processor

Program

Vertex Processor

Joao Comba, UFRGS

slide-89
SLIDE 89

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Primitive Assembly and Rasterization Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Fragment Processor

Program

Vertex Processor Fragment Processor Fragment Processor Fragment Processor

Joao Comba, UFRGS

slide-90
SLIDE 90

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: The Big Picture

Primitive Assembly and Rasterization Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Fragment Processor Vertex Processor

Joao Comba, UFRGS

slide-91
SLIDE 91

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Graphics Pipeline: The Big Picture

Primitive Assembly and Rasterization Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Fragment Processor Vertex Processor

GPU is a stream processor

  • Multiple programmable processing

units

  • Connected by data flows

Joao Comba, UFRGS

slide-92
SLIDE 92

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Programmable Graphics Pipeline

Primitive Assembly and Rasterization Fragment Texturing and Coloring Raster Operations Fragments Colored Fragments Vertices Transformed Vertices Pixel Updates 3D Application

  • r Game

3D API: OpenGL or Direct 3D

3D API commands

FB CPU – GPU Boundary Vertex Processor Vertex Processor Vertex Processor Vertex Processor

Program

Joao Comba, UFRGS

slide-93
SLIDE 93

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Texture-Based Volume Rendering

Slice Decom position (Proxy Geometry) Rendering of textures slices Final I m age

Trilinear Hardw are I nterpolation Com positing ( Blending)

Rezk-Salama Visualization 2002 Tutorial

slide-94
SLIDE 94

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Rendering Unstructured Grids

Brian Wylie, Sandia

model with millions of cells

Visibility Sort

graphics card PC (CPU) for each cell in order compute cell’s screen projection decompose to triangles find thickest cell distance compute each triangle’s parameters final image of model

Software Programmable Hardware

CPU GPU Cell Contribution

slide-95
SLIDE 95

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Visibility Sorting

1 2 4 3 6 7 5

B p A

A < B

p

slide-96
SLIDE 96

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Williams’ MPVO

A B C E D F

Viewing direction

A B C E D F B < A A < C B < E C < E C < D E < F D < F Idea: Define ordering relations by looking at shared faces.

slide-97
SLIDE 97

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Shirley-Tuchman (ST) Algorithm

Class 1 Class 2 Class 3 Class 4 Brian Wylie, Sandia

slide-98
SLIDE 98

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Wylie et al’s GPU-based ST

Moves all of the following functions from the CPU the GPU:

  • Transform to screen space
  • Determine projection class
  • Calculate thick vertex location
  • Determine depth at thick vertex
  • Compute color and opacity for thick vertex
  • Apply exponential attenuation texture

Brian Wylie, Sandia

slide-99
SLIDE 99

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

GPU Limitations

Each instance of a vertex shader program works

independently on a single vertex in SIMD fashion

No support dynamic vertex creation or topology

modification within the vertex program

No branching No knowledge of neighboring vertices Cannot change execution based on past information

Brian Wylie, Sandia

slide-100
SLIDE 100

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Idea: Morph a Canonical Graph

V1’ V4’ V0’ V3’ V2’

Basis Graph Isomorphic to all projection cases Example later… Brian Wylie, Sandia

slide-101
SLIDE 101

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-102
SLIDE 102

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. (Trivial) Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-103
SLIDE 103

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-104
SLIDE 104

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Projection Classes

Class 1 Class 2 Class 3 Class 4 Brian Wylie, Sandia

slide-105
SLIDE 105

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Projection Permutations

Permutation Determination

14 cases need at least 4 Boolean tests

Definitions

vec1 = v1-v0 vec2 = v2-v0 vec3 = v3-v0 cross1 = vec1 x vec2 cross2 = vec1 x vec3 cross3 = vec2 x vec3

Tests

test1 = (cross1*cross2 < 0) test2 = (cross1*cross3 > 0) test3 = (distance from v0 to middle vertex – distance from v0 to Intersection) > 0 test4 = (cross1 > 0)

Brian Wylie, Sandia

slide-106
SLIDE 106

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-107
SLIDE 107

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Isomorphic Property of Basis Graph

Brian Wylie, Sandia

slide-108
SLIDE 108

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-109
SLIDE 109

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Thick Vertex Calculation

In all cases the coordinates of the intersection point I are computed.

(Intersection of lines computed ala Graphics Gems III p. 199-202). This intersection calculation gives us α and β terms that are used for interpolation (depth, alpha, and color) later on.

  • Class 1:
  • Class 2:

// Compute thick vertex "thickness" float z1 = P1[2] + alpha * (P2[2] - P1[2]); float z2 = P3[2] + beta * (P4[2] - P3[2]); float thickness = fabs(z1-z2); // Extra computation for class 1 if (!test3) thickness /= alpha;

Brian Wylie, Sandia

slide-110
SLIDE 110

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-111
SLIDE 111

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Color and Opacity Calculation

Use same α and β terms to interpolate color and opacity along the line

segments to give the front and back face intersection terms CF, CB and τF, τB.

Thick vertex color (CF + CB) / 2 * The extinction coefficient τ is (τF + τB) / 2. τ and the thickness l, are then used as lookups into a 2D texture map

defined as 1 – exp (-τl). [Stein et al. 1994].

* approximate color from Shirley and Tuchman.

Brian Wylie, Sandia

slide-112
SLIDE 112

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

PT algorithm in Vertex Program

Transform to screen space. Determine projection class (and permutation). Map the vertices to the basis graph. Calculate intersection point of line segments. Determine depth at thick vertex. Compute color and opacity for thick vertex ( texture ) Multiplex the result to correct output vertex.

Brian Wylie, Sandia

slide-113
SLIDE 113

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Multiplex input to output

Use a lookup table (loaded in the parameter registers) and an index based on the 4 tests to determine the

  • utput vertex.

// Which vertex to copy to output (using lookup table) lookup_index = test1*8 + test2*4 + test3*2 + test4;

  • utput_vertex = lookup_table[call_index][lookup_index];

Brian Wylie, Sandia

slide-114
SLIDE 114

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

‘Feeding’ the Vertex Program

// Load up the 4 vertices glVertexAttrib3fvNV(1, nodes[0]->getXYZ()); glVertexAttrib3fvNV(2, nodes[1]->getXYZ()); glVertexAttrib3fvNV(3, nodes[2]->getXYZ()); glVertexAttrib3fvNV(4, nodes[3]->getXYZ()); // Load up color for the vertices glVertexAttrib4fvNV(5, colorvectors[0]); glVertexAttrib4fvNV(6, colorvectors[1]); glVertexAttrib4fvNV(7, colorvectors[2]); glVertexAttrib4fvNV(8, colorvectors[3]); // Writing to v[0] here invokes the vertex program. glBegin(GL_TRIANGLE_FAN); glVertexAttrib3sNV(0, 0, 1, 0); glVertexAttrib3sNV(0, 1, 0, 1); glVertexAttrib3sNV(0, 2, 0, 1); glVertexAttrib3sNV(0, 3, 0, 1); glVertexAttrib3sNV(0, 4, 0, 1); glVertexAttrib3sNV(0, 1, 0, 1); glEnd();

These calls could easily be wrapped up into a glTetraExt () call.

Brian Wylie, Sandia

slide-115
SLIDE 115

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Remarks

Wylie et al’s technique can be easily extended to

  • ther computations, e.g., isosurface or isoline

generation (this was a homework exercise in my graphics class last Spring) For isosurfaces, one can send two triangles (four vertices in a strip), since for a tetrahedral cell, the isosurface going through it has at most two triangles One student (Francis Chang) found a clever solution with 30 instructions!

slide-116
SLIDE 116

Scientific Computing and Imaging Institute, University of Utah Scientific Computing and Imaging Institute, University of Utah

Acknowledgements

  • DOE VIEWS, DOE MICS, SNL, and LLNL
  • National Science Foundation
  • CCR-0306530 and EIA-0323604
  • Joao Comba, Ricardo Farias, Brian Wylie, and
  • thers for slides and help with presentation