Top Banner
CSE 681 Ray Tracing Implicit Surfaces
34

CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

Dec 23, 2015

Download

Documents

Vivian Scott
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Ray Tracing Implicit Surfaces

Page 2: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Overview

• Similar to CSG– Combine primitive objects to form complex object

• Primitives are “density fields”

• Combine by summing densities

• The surface is all points at which the density equals a user-defined threshold

Page 3: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Implicit Surface

• A surface not explicitly represented• The surface consists of all points which satisfy a

functionF(x,y,z) = 0

• Usually, the implicit function is defined so thatF(x,y,z) < 0 => inside the object

F(x,y,z) > 0 => outside the surface

Sometimes F(x,y,z) is based on a distance-to-a-central-element

• The surface points have to be searched for!

Page 4: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

For example: single metaball

f(x,y,z) < 0

f(x,y,z) = 0

f(x,y,z) > 0

f(x,y,z) = x2+y2+z2-r2

Page 5: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Multiple Implicits• Define each primitive as positive density field• Sum densities• Surface is defined at threshold• Usually have finite radius of influence

Page 6: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Organic shapes

Page 7: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Density Function

density

Distance from center

1.0

0.0

R

R

Page 8: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Threshold• Define threshold that defines density of surface• RT is the radius of the isosurface (blob) in isolation

density

Distance from center

1.0

0.0

R

T

RT

RT

R

0)( Tpdp

d

Page 9: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Blended Blobs

• Define surface as sum of densities

0)( Tpdp i

0)( Tpdwp ii

Page 10: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Weighted Density Functions• Define surface as weighted sum of densities

f(p) = wi di (p) - T = 0

Weights can be negative, too!

To keep the same radius, but increase blending, change weight, wi, and the threshold, T, simultaneously.

Page 11: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Ray Intersection

Need to search along the ray for the first time f(P(t)) = 0

Shortcuts andSearch strategies?

Page 12: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Search for Intersection

Page 13: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Search for Intersection

Identify spans of interest: bounds on intersection

Page 14: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Density Functions

Define a density function that is:Easy to evaluateBlends smoothlyIntuitive to use

Density functions proposed in the literatureExponentialPiecewise cubicCubic in distance squared

Page 15: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Density Functions

D(r)

r

0.5

0.5

Page 16: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Density Functions

di(p) = D(|P-Ci|/R) = D(r)

r is normalized distance

D1 ( r ) = (1-r2)3 0 <= r < 1

D2 ( r ) = 1 - (4/9)r6 + (17/9)r4 - (22/9)r2 0 <= r < 1

D3 ( r ) = exp(-ar2)

D4 ( r ) = 1-3r2 0 <= r < 1/3

(3/2)(1-r) 2 1/3 <= r < 1

Page 17: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Density Functions

D2 ( r ) = 1 - (4/9)r6 + (17/9)r4 - (22/9)r2 0 <= r < 1

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Page 18: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Density Functions

D3 ( r ) = exp(-ar2)

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Page 19: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Density Functions

D4 ( r ) = 1-3r2 0 <= r < 1/3

(3/2)(1-r) 2 1/3 <= r < 1

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Page 20: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Density Functions

D1 ( r ) = (1-r2)3 0 <= r < 1

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Page 21: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Primitives

Point

Line

Polygon

Polygonal mesh

Polyline

Polyhedron

Anything you can efficiently compute the distance from

Page 22: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Primitives

Point

Line

Polyline

Distance from point

Distance from line or endpoints - partition by perpendiculars

Distance from one of lines or points - partition by perpendiculars

Page 23: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Primitives

Polygon

Polygonal mesh

Partition space by planes perpendicular to plane through an edge

Same, for each face - two planes per edge

Page 24: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Primitives

Polyhedra

Convex?

Concave?

Page 25: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Display Considerations

Find point of intersection along ray: F(P(t)) = 0

Compute normal

Page 26: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Computing the NormalForm analytic expression of implicit functionAnd take partial derivativesN = (F/x, F/y, F/z)

Take discrete approximation by sampling functionCompute gradientN = ( F(x+dx,y,z)-F(x,y,z), F(x,y +dy,z)-F(x,y,z), F(x,y,z +dz)-F(x,y,z) )

Page 27: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Bulge problem

One long primitive

Two side-by-side primitives

Page 28: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

CSG-approach to control blending

Use nodes to combine primitives by either summing or taking max of functions

Page 29: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Complexity

•Bounding volumes

•Spatial subdivision - cellular bucket sort

•Hierarchical spatial subdivision – quadtree

•Binary spatial partitioning

Page 30: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Display alternative

Marching cubes algorithm - construct surface fragments from isosurface intersections with grid cells

Page 31: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Distance-based Primitives

Page 32: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Examples

Page 33: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Examples

Page 34: CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”

CSE 681

Examples