wscg 2007 memory efficient and robust software implementation of the raycast algorithm aline pina...

52
WSCG 2007 Memory Efficient and Robust Software Implementation of the Raycast Algorithm Aline Pina COPPE/UFRJ Rio de Janeiro - Brazil [email protected] Cristiana Bentes DESC/UERJ Rio de Janeiro - Brazil cristianabentes@gmail. com Ricardo Farias COPPE/UFRJ Rio de Janeiro - Brazil [email protected]

Upload: ralf-snow

Post on 17-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

WSCG 2007

Memory Efficient and Robust Software Implementation of

the Raycast Algorithm

Aline PinaCOPPE/UFRJ

Rio de Janeiro - Brazil

[email protected]

Cristiana BentesDESC/UERJ

Rio de Janeiro - Brazil

[email protected]

Ricardo FariasCOPPE/UFRJ

Rio de Janeiro - Brazil

[email protected]

Outline

• Volume Visualization

• Ray-casting

• Proposed Ray-casting Algorithms

• Experimental Results

• Conclusions

Volume Visualization

• Volumetric data images

• 3D data 2D plane

• Gains:

– Understanding

– Visual analysis and interpretation

Volumetric Data

• Generated:

– Simulation (Fluid Dynamic)

– Sensors (CT scanner)

– Measured Data (Ocean Buoys)

• Represented:

– 3D grid of voxels (Regular or Irregular)

Volume Visualization Methods

Surface Rendering x Volume Rendering

• More information

• Shows internal structures

• Computational intensive

• Loses information

• Hides internal structures

• Faster to compute

• Object is semi-transparent • Discard data between surfaces

Volume Rendering Algorithms

• Cell projection: cells are projected on the screen

• Ray-casting: rays are casted through every pixel

Ray-casting

Ray-casting - History

• First software implementation:

– Garrity(1990) - cell connectivity

• Improvement:

– Bunyk(1998) - entry points + new auxiliary

structures

Ray-casting - History

• Problems:

• Auxiliary data structures - high memory

consumption

• Degenerate cases

Our Goal

• Improvements in Bunyk approach:

– Completely handle degenerate cases

– Smaller data structures

– Deal with tetrahedral and/or hexahedral grids

Ray-casting Algorithms

• ME-Raycast

Memory Efficient Ray-casting

• EME-Raycast

Enhanced Memory Efficient Ray-casting

ME-Raycast

ME-Raycast

• Data Structures

– Points array

– Cells array

– Use_set for each vertex

– Neighbor_set for each cell

– Faces array – on-the-fly

ME-Raycast

• Use_set(v)

– List of all cells incident on v

v

A B

C

D

E

Use_set(v) = {A, B, C, D, E}

2D example

ME-Raycast

• Neighbor_set(c)

– List of all cells that share a face with c

A

2D example

ME-Raycast

• Neighbor_set(c)

– List of all cells that share a face with c

A

B C

D

Neighbor_set(A) = {B, C, D}

2D example

ME-Raycast

• Faces array

– List of all faces intersected by the rays

3D example

ME-Raycast

• Faces array

– List of all faces intersected by the rays

3D example

A

ME-Raycast

• Faces array

– List of all faces intersected by the rays

3D example

Faces array

AA

ME-Raycast

• Faces array

– List of all faces intersected by the rays

3D example

Faces array

AA

BB

ME-Raycast

• Faces array

– List of all faces intersected by the rays

3D example

Faces array

AA

BB

ME-Raycast

• Algorithm

– Preprocessing:

• Read data – create arrays Points and Cells

• Create Use_set

• Create Neighbor_set

ME-Raycast

• Algorithm

– Raycasting:

• Project visible faces – entry point

• For each pixel:

– Find next intersection – check other cell's faces

– If (no intersection) – check degenerate cases

– Accumulate color and opacity

EME-Raycast

EME-Raycast

• Data Structures

– Points array

– Cells array

– Use_set for each vertice

– Neighbor_set for each cell

– Faces array

EME-Raycast

• Algorithm

– Verification of intersection:

• Checking the face - recalculate parameters

Handling Degeneracies

Handling Degeneracies

• Ray hits a vertex

a

2D example

Handling Degeneracies

• Ray hits a vertex

a bA

E

Bunyk check

2D example

Handling Degeneracies

• Ray hits a vertex

a bA

E

B

C

D

Our check

2D example

Handling Degeneracies

• Ray hits a vertex

a bA

E

B

C

D

c

2D example

Handling Degeneracies

• Ray hits an edge

3D example

Handling Degeneracies

• Ray hits an edge

a

3D example

Handling Degeneracies

• Ray hits an edge

a b

3D example

Handling Degeneracies

• Ray hits an edge

a

3D example

b

Handling Degeneracies

• Ray hits an edge

a b

Bunyk check

3D example

Handling Degeneracies

• Ray hits an edge

a b c

Our check

3D example

Experimental Results

Experimental Results

Datasets # Cells

Blunt Fin 187 395

Combustion Chamber 215 040

Oxygen Post 513 375

SPX 827 904

Delta Wing 1 005 675

Hexa 1 920

Workload

Experimental Results

• Baselines:

– Bunyk (ray-casting)

– ZSweep (cell projection)

ViewingDirection

Screen

Step 1

Bunyk Algorithm

ViewingDirection

Screen

Step 2

Bunyk Algorithm

Target Z

SweepDirection

Z

XP

v

t

PixelListP

ZSweep Algorithm

Target ZZ

XP

v

t

PixelListP

ZSweep Algorithm

Experimental Results

Degenerate cases:

5122 10242

Blunt 10 31

Comb - 2

Oxygen

11 38

Delta 7 17

SPX 5 18Pixels not rendered

Experimental Results

Memory Consumption

ME-Raycast – 1024 x 1024 image

Bunyk ZSweep

Blunt 75% 40%

Combustion 76% 76%

Oxygen 66% 70%

Delta 61% 152%

SPX 74% 222%

Experimental Results

Memory Consumption

EME-Raycast – 1024 x 1024 image

Bunyk ZSweep

Blunt 39% 20%

Combustion 37% 37%

Oxygen 30% 30%

Delta 27% 68%

SPX 27% 83%

Experimental Results

Execution Time

ME-Raycast – 1024 x 1024 image

Bunyk ZSweep

Blunt 126% 29%

Combustion 106% 38%

Oxygen 136% 38%

Delta 148% 33%

SPX 116% 41%

Experimental Results

Execution Time

EME-Raycast – 1024 x 1024 image

Bunyk ZSweep

Blunt 304% 70%

Combustion 224% 80%

Oxygen 289% 82%

Delta 271% 61%

SPX 222% 79%

Conclusions

• Two memory-aware ray-casting algorithms

• Improved Bunyk work: memory, degenerate cases, handling hexahedral

• Significant gains in memory usage

• Correct images

Future Work

• Software out-of-core version

• GPU implementation

• Parallelization

Thank you!

[email protected]