程序代写代做代考 10: The OpenGL Pipeline

10: The OpenGL Pipeline

19: Volume Rendering

COMP5821M: Geometry Processing
: Height Field
For every point in the plane, define a height
The graph is then a terrain
i.e. a surface in a 3D embedding space

COMP5821M: Geometry Processing
Contours
We can define curves using contours
Let an artist design the landscape
Pick a threshold, generate a curve

COMP5821M: Geometry Processing
Manifold Dimension
f is a 2-manifold embedded in 3-D
It’s contours are 1-manifolds
embedded in 2-D
or in 3-D
What happens if we add a dimension?

COMP5821M: Geometry Processing
Implicit (Blobby) Surfaces
Define a function
Often a sum of Gaussian distributions
It’s a 3-manifold embedded in 4-D
It’s contours are 2-manifolds in 3-/4-D
Choose a threshold h
Extract the level set / contours
They are guaranteed to be manifold

COMP5821M: Geometry Processing
Implicit Surfaces
We can use many types of functions:
CT/MRI scans
Numerical simulations
Mathematical models – eg. sum of Gaussians
Distance fields
any property we can compute in 3-D
In practice, we need to start with a 3-D mesh

COMP5821M: Geometry Processing
Meshes in 3D
In 2-D, we used triangles and squares
In 3-D, we use tetrahedra and cubes
also pyramids, octahedra & triangular prisms
Interpolation follows the same rules as in 2-D
geometric interpolation (meshes)
kernel filters (sampling theory)

COMP5821M: Geometry Processing
Simplices
An n-simplex is the simplest n-dimensional object
a cell defined by n+1 points
0-simplex: 1 point
1-simplex: line segment – 2 points
2-simplex: triangle – 3 line segments, 3 points
3-simplex: tetrahedron – 4 triangles, 6 line segments, 4 points

COMP5821M: Geometry Processing
Simplicial Complex
A simplicial complex or simplicial mesh is a set of simplices
usually uses barycentric interpolation
can use Bézier interpolation

COMP5821M: Geometry Processing
Barycentric Interpolation
Linear interpolation based on distances
Extend by using distance to faces

COMP5821M: Geometry Processing

Simplex Construction
By hand (owch!)
Delaunay triangulation (later)
Subdividing Cubes
Subdividing Meshes

COMP5821M: Geometry Processing
Isosurfaces
Contours in 3D
Basically the same as we saw in 2D

2-manifolds embedded in 3 or 4 space
But we can’t usually show multiples
because we’ve run out of dimensions

COMP5821M: Geometry Processing
Result

COMP5821M: Geometry Processing
Cubic Meshes
By far the most common case
Generalisation of squares in 2-D

Samples
Mesh

COMP5821M: Geometry Processing
Trilinear Interpolation
Repeat linear interpolation in 3 dimensions

COMP5821M: Geometry Processing
Trilinear Interpolation

COMP5821M: Geometry Processing
An Example

COMP5821M: Geometry Processing
Computing Normal
Normal vector is based on gradient
always perpendicular to contours
describes steepest ascent
but outside is typically low-valued
use negative gradient as normal

COMP5821M: Geometry Processing
Central Differencing:
Approximation of gradient:

Compute at vertices of cell
Interpolate along edges

COMP5821M: Geometry Processing
Direct Volume Rendering

courtesy T. Möller, SFU

COMP5821M: Geometry Processing
Direct Volume Rendering
3D equivalent of colour mapping
Define a transfer function:
maps from data to colour opacity
Then compute light transport through data
i.e. a computational X-ray
Or think of it as luminous jelly

COMP5821M: Geometry Processing
Modelling Transmission
No longer modelling surfaces
Modelling diffuse internal reflection
We get light added and subtracted

COMP5821M: Geometry Processing
Density Clouds
Photons are blocked by absorption
Probability depends on density of material
i.e. how many particles are in the way
Measured as optical density
# of particles / mm
E.g. 5mm of lead might block 90% of photons
How much would 10mm block?

COMP5821M: Geometry Processing
Volume Rendering Integral
Due to Kajiya, Sabella, Max (1986) (3 papers!)
is the wavelength of light
is a ray of length L through pixel x
is the colour contribution at point s
is the mass density at s

COMP5821M: Geometry Processing
TF Design
courtesy T. Möller, SFU

COMP5821M: Geometry Processing
First Intersection
courtesy T. Möller, SFU

Equivalent to an Isosurface (Tuy&Tuy, 1984)
100% opacity at chosen isovalue

COMP5821M: Geometry Processing
Average Intensity
courtesy T. Möller, SFU

Constant Opacity throughout volume
Equivalent to an x-ray

COMP5821M: Geometry Processing
Accumulate
courtesy T. Möller, SFU

Use TF to highlight structures
Levoy, 1988

COMP5821M: Geometry Processing
DVR Ray-tracing
For each pixel
Compute corresponding ray in volume
Walk along ray in small increments
Computing contribution to integral
Then display as image
This makes regular raytracing look cheap!
So sci. vis. has many hacks/speedups

COMP5821M: Geometry Processing
Example

COMP5821M: Geometry Processing
Pseudocode

COMP5821M: Geometry Processing
Applications to Rendering
Mist
Fog
Smoke
Explosions
Particle Systems
X-rays
Visualisation in general

COMP5821M: Geometry Processing

Dr. Hamish Carr, COMP 30270 Advanced Computer Graphics, Autumn 2008

Contours

• First used by Edmond Halley, 1701

• Later adapted to mapping terrain (1752)

Dr. Hamish Carr, COMP 30270 Advanced Computer Graphics, Autumn 2008
Contours•
First used by Edmond Halley , 1701

Later adapted to mapping terrain (1752)

(s, t, u)(0, t, u) (1, t, u)
(0, 0, u) (1, 0, u)

(0, 1, u) (1, 1, u)

(0, 0, 0) (1, 0, 0)

(0, 1, 0) (1, 1, 0)

(0, 0, 1) (1, 1, 1)

(0, 1, 1) (1, 1, 1)

(s, t, u)(0, t, u) (1, t, u)
(0, 0, u) (1, 0, u)
(0, 1, u)
(1, 1, u)
(0, 0, 0) (1, 0, 0)
(0, 1, 0) (1, 1, 0)
(0, 0, 1) (1, 1, 1)
(0, 1, 1)
(1, 1, 1)

Light Source

Object
Image Plane

Reflection / Refraction

Absorption

Emission

Light Sour ce
Object
Image Plane
Reflection / Refraction
Absorption
Emission

color

object (color, opacity)

1.0

color
object (color , opacity)
1.0