Docsity

Volume Rendering: A Deep Dive into Ray Casting and Marching Cubes - Prof. Juraj Obert, Study notes of Computer Graphics

Partial preview of the text

Download Volume Rendering: A Deep Dive into Ray Casting and Marching Cubes - Prof. Juraj Obert and more Study notes Computer Graphics in PDF only on Docsity!

Juraj Obert

[email protected]

http://graphics.cs.ucf.edu/cap4720/fall2008/

Volume Rendering

 Rendering until now:

 Input:

 geometry

 textures

 shaders

 Volume rendering:

 Input:

 density data in 3D volume

CT scan

Data storage

 3D textures:

 same as 2D textures but add yet another

dimension

 think of it as a 3D grid

 composed of volume elements or voxels

 typically store density data

Ray casting cont.

Max Mean First

Ray casting on GPUs

 How:

 Store 3D volume data in a 3D texture

 Map the 3D texture to a 3D box 1-to-

 use 3D texture coordinates u,v,w

 Integrate contributions along each ray

Ray casting on GPUs

(u,v,w)

(U,V,W)

front faces back faces

Ray casting on GPUs cont.

Pass 1:  setRenderTarget(renderTargetBF);  cullMode(CULL_FRONT_FACE);  setShader(outputTexCoords);  render(box);

Pass 2:  setRenderTarget(renderTargetFF);  cullMode(CULL_BACK_FACE);  setShader(outputTexCoords);  render(box);

Pass 3:  setRenderTarget(frameBuffer);  setShader(integrateIntensities);  render(quad);

Marching cubes

 Approximate surface

by a collection of

โ€œcubesโ€

 Compare density at

each vertex to a

threshold

Marching cubes

How many configurations can we possibly have?

Marching cubes cont.

 Implementation:

 Definitely not on older GPUs because you

cannot create new geometry

 Possible with shader model 4.0 (DirectX 10 and

higher)

 The number of cubes determines how

coarse/fine the final surface will be

Marching cubes cont.

Image courtesy of Diane Lingrand

What does the threshold value represent?