31.01.2013 Views

Adaptive Ray Tracing of Subdivision Surfaces - Computer Graphics ...

Adaptive Ray Tracing of Subdivision Surfaces - Computer Graphics ...

Adaptive Ray Tracing of Subdivision Surfaces - Computer Graphics ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Technical Report TUBS-CG-2003-06<br />

<strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

Kerstin Müller, Torsten Techmann, Dieter W. Fellner<br />

{kerstin.mueller,t.techmann,d.fellner}@tu-bs.de<br />

This TR has been published with The Eurographics Association and Blackwell Publishers 2003,<br />

Proceedings <strong>of</strong> Eurographics 2003, CGF 22(3), pages 535–562 and is available at<br />

www.eg.org/EG/CGF/volume22/issue3/paper175.pdf.<br />

Institute <strong>of</strong> <strong>Computer</strong> <strong>Graphics</strong><br />

University <strong>of</strong> Technology<br />

Mühlenpfordtstr. 23, D-38106 Braunschweig<br />

http://graphics.tu-bs.de<br />

c○ <strong>Computer</strong> <strong>Graphics</strong>, TU Braunschweig, 2003


EUROGRAPHICS 2003 / P. Brunet and D. Fellner<br />

(Guest Editors)<br />

<strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

Kerstin Müller, Torsten Techmann and Dieter Fellner<br />

Volume 22 (2003), Number 3<br />

Abstract<br />

<strong>Subdivision</strong> <strong>Surfaces</strong> as well as (interactive) ray tracing have become an important issue in computer graphics.<br />

But ray tracing <strong>of</strong> subdivision surfaces has received only little attention. We present a new approach for ray<br />

tracing <strong>of</strong> subdivision surfaces. The algorithm uses a projection <strong>of</strong> the ray onto the surface and works mainly in<br />

two dimensions along this projection. While proceeding from patch to patch, we examine the bounding volume <strong>of</strong><br />

their borders: the lower the distance between ray and subdivision surface, the more refinement steps are adaptively<br />

applied to the surface but only along the projection <strong>of</strong> the ray. The adaptive refinement <strong>of</strong> a patch is controlled by<br />

curvature, size, its membership to the silhouette, and its potential contribution to the light transport. The algorithm<br />

is simple and mainly consists <strong>of</strong> elementary geometric computations. Hence it is fast and easy to implement<br />

without the need for elaborate preprocessing. The algorithm is robust in the sense that it deals with all features <strong>of</strong><br />

subdivision surfaces like creases and corners.<br />

Categories and Subject Descriptors (according to ACM CCS): I.3.7 [<strong>Computer</strong> <strong>Graphics</strong>]: <strong>Ray</strong>tracing<br />

1. Introduction<br />

The increasing interest in subdivision surfaces – due to their<br />

potential in robust freeform modeling – implies the demand<br />

for efficient rendering algorithms, both for interactive<br />

and photorealistic display. While interactive rendering has<br />

been addressed by several authors 10, 11 and near-interactive<br />

ray tracing 13, 12 has come within reach, efficient ray tracing<br />

<strong>of</strong> subdivision surfaces has only received little attention.<br />

Firstly, we will have a look at ray tracing <strong>of</strong> the wellknown<br />

parametric surfaces besides the subdivision surfaces.<br />

Woodward 2 proposed a recursive subdivision method carried<br />

out in the orthogonal viewing coordinate system <strong>of</strong> the ray. A<br />

numerical approach is described, e.g, in 4 . Further methods<br />

for ray tracing parametric surfaces can be found, e.g., in 3, 5 .<br />

The ray tracing methods for subdivision surfaces existing<br />

so far can be classified in two different categories: i) The<br />

surface is tesselated before the ray tracing process and the<br />

c○ The Eurographics Association and Blackwell Publishers 2003. Published by Blackwell<br />

Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 350 Main Street, Malden, MA<br />

02148, USA.<br />

resulting polygons are rendered. ii) The intersection test is<br />

done directly with the subdivision surface.<br />

For the first category, a tesselator refines the surface uniformly<br />

or adaptively considering the curvature <strong>of</strong> the surface.<br />

The obtained set <strong>of</strong> polygons is rendered by a ray tracer<br />

that is able to deal at least with polygons. Consequently a<br />

variety <strong>of</strong> freeform surfaces is easy to display via its tesselation<br />

without the need for special intersection algorithms.<br />

In order to achieve a high quality image (e.g., visible at reflections<br />

and at silhouettes <strong>of</strong> objects and their shadows), a<br />

sufficiently fine tesselation is necessary. Because the refinement<br />

is performed independently from the scene description,<br />

the complete object must be refined. That means also<br />

parts not necessary for the ray tracing computation are subdivided,<br />

e.g., parts <strong>of</strong> the object with no contribution to the<br />

light transport. This leads to a high number <strong>of</strong> polygons taking<br />

into account the exponential growth during a subdivision


step. To get this exponential growth under control, a suitable<br />

subdivision level for the subdivision object must be chosen<br />

depending on, e.g., the distance to the camera.<br />

In the second category, the adaptive refinement <strong>of</strong> the subdivision<br />

object is done automatically during the ray tracing<br />

process. Therefore only parts <strong>of</strong> the object with contribution<br />

to the light transport are refined. Within this category, parts<br />

with a high curvature and members <strong>of</strong> the silhouette are refined<br />

further than flat parts in other areas <strong>of</strong> the object. In<br />

this way, only the necessary polygons are chosen to obtain a<br />

high quality image. As a sophisticated example <strong>of</strong> the second<br />

class, Kobbelt, Daubert, and Seidel 6 developed a boundingenvelope<br />

technique for intersecting a ray with a subdivision<br />

surface. To use this bounding-envelope technique, the minimum<br />

and maximum values <strong>of</strong> the basis function <strong>of</strong> each vertex<br />

influencing a patch, which is the part <strong>of</strong> the surface corresponding<br />

to one face <strong>of</strong> a control mesh, have to be precomputed.<br />

This has to be done for every occuring valence. This<br />

algorithm is fast and has a relatively low memory consumption.<br />

The implementation <strong>of</strong> features like creases and corners<br />

in particular is hard work, because the basis functions<br />

have to be computed for every practically possible combination<br />

<strong>of</strong> valences and creases. This leads to a huge, nonpractical<br />

number <strong>of</strong> cases and therefore the algorithm is not<br />

very easy to implement. A further approach in the style <strong>of</strong><br />

Woodward 2 works mainly in the 2D viewing plane orthogonal<br />

to the ray. Using the property that the resulting surface<br />

<strong>of</strong> one face <strong>of</strong> the control mesh is located inside the convex<br />

hull defined by the 1-neighbourhood <strong>of</strong> its control points, the<br />

1-neighbourhood is parallel-projected orthogonally onto the<br />

viewing plane. If the origin <strong>of</strong> the ray is inside the convex<br />

hull built by the projected 1-neighbourhood, the corresponding<br />

face is subdivided. The subfaces are recursively examined<br />

down to the desired subdivision level. Compared to the<br />

size <strong>of</strong> the corresponding patch these bounding volumes are<br />

relatively large. So there are many intersection tests which<br />

consume a lot <strong>of</strong> computation time. But this method is easy<br />

to implement and supports all special features like creases or<br />

corners.<br />

Our goal is to devise an algorithm, that automatically and<br />

adaptively refines only those parts <strong>of</strong> a surface with potential<br />

contribution to the light transport based on curvature, projected<br />

size, and its membership to the silhouette to obtain a<br />

high quality image. The algorithm deals with all features <strong>of</strong><br />

subdivision surfaces (e.g., creases and corner) and is easy to<br />

implement. Only the basic subdivision rules are required as<br />

well as the rules for the computation <strong>of</strong> limit points and limit<br />

normals and no preprocessing step is necessary.<br />

2. Outline <strong>of</strong> the algorithm<br />

Initially, each patch with its bounding volume is sorted into<br />

an arbitrary space-subdivision scheme. If the ray intersects<br />

the bounding volume <strong>of</strong> a patch, our algorithm starts with<br />

the intersection test between patch and ray. Conceptually the<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

algorithm works in a plane defined by the corners <strong>of</strong> the<br />

patch. The parallel projection in direction <strong>of</strong> its normal is<br />

called casting a shadow. If the ray casts a shadow on the<br />

patch (B.t.w., this gave the algorithm its name: ShaoLin =<br />

Shadow <strong>of</strong> the Line) and the ray is nearby the patch, an<br />

intersection is possible. Therefore the patch is subdivided<br />

recursively according to the refinement criteria until an intersection<br />

is found or the algorithm determines that no intersection<br />

occurs.<br />

SHAdow Of the LINe<br />

shadowed subpatches:<br />

level 1<br />

level 2<br />

level 3<br />

Figure 1: Basic idea <strong>of</strong> the ShaoLin algorithm.<br />

3. Notations<br />

The following presentation is based on the Loop subdivision<br />

scheme 7 . Nevertheless, the techniques can easily be transfered<br />

to other subdivision schemes (see Section 8.2) taking<br />

into account the properties described in Section 8.1.<br />

We use capital letters to denote planes, faces and patches.<br />

The length <strong>of</strong> a vector is denoted by | v |. We assume that<br />

normal vectors are always normalised. The superscript describes<br />

the subdivision level, e.g., cp l n, whereas the subscript<br />

indicates the numeration.<br />

4. <strong>Subdivision</strong> <strong>Surfaces</strong><br />

A subdivision surface is defined by a control mesh M 0 . By<br />

applying the subdivision rules to the mesh M 0 , we get a finer<br />

mesh M 1 . The sequence <strong>of</strong> control meshes converges to the<br />

limit surface L(M 0 ).<br />

cp 0 8<br />

cp 0 9<br />

cp 0 10<br />

cp 0 2<br />

cp 0 7<br />

cp 0 3<br />

F 0<br />

cp 0 1<br />

N(F 0 )<br />

cp 0 5<br />

cp 0 4<br />

cp 0 6<br />

cp 0 11=n<br />

cp 1 2<br />

cp 1 3<br />

cp 1 1<br />

ln 2<br />

ln 3<br />

ln 1<br />

l p 2<br />

T (N(F 0 ))<br />

l p 3<br />

l p 1<br />

L(N(F 0 ))<br />

Figure 2: Example for Loop subdivision<br />

c○ The Eurographics Association and Blackwell Publishers 2003.


The vertices <strong>of</strong> a control mesh M l are called control<br />

points cp l i. The 1-neighbourhood <strong>of</strong> cp l i consists <strong>of</strong> the control<br />

points adjacent to cp l i and the point cp l i itself. The 1neighbourhood<br />

<strong>of</strong> a face F l = △cp l 1cpl2 cpl3 is denoted by<br />

N(F l ) and consists <strong>of</strong> the control points cp l 1 ,...,cpl n <strong>of</strong><br />

all faces adjacent to any vertex <strong>of</strong> F l . The Loop scheme<br />

provides two kinds <strong>of</strong> subdivision rules (see Fig. 2). One<br />

rule creates a vertex cp l+1<br />

i in the refined mesh M l+1 for<br />

each vertex cp l i <strong>of</strong> M l as an affine combination <strong>of</strong> the 1neighbourhood<br />

<strong>of</strong> cp l i. The other rule creates a vertex cp l+1<br />

j<br />

in M l+1 for each edge <strong>of</strong> M l as an affine combination <strong>of</strong> the<br />

vertices <strong>of</strong> the two faces adjacent to that edge. The weights<br />

for the rules can be found, e.g., in 7, 8 . By applying alternative<br />

subdivision rules8 special features like creases, corners,<br />

darts, or conicals can be created on the surface. A limit point<br />

is defined as l pi := liml→∞ cp l i. The limit normal lni denotes<br />

the surface normal <strong>of</strong> L(M l ) at the point l pi. The limit<br />

surface L(N(F l )) = L(cp l 1 ,...,cpl n) is called the patch corresponding<br />

to F l . This patch is a part <strong>of</strong> the limit surface<br />

L(M l ). T (cp l 1 ,...,cpl n) := T (N(F l )) := △l p1l p2l p3 is the<br />

chord triangle <strong>of</strong> F l .<br />

Consider two neighbouring faces with a shared edge, A l<br />

and B l <strong>of</strong> mesh M l and the subfaces B l+1<br />

1 ,B l+1<br />

2 ,B l+1<br />

3 ,B l+1<br />

4 <strong>of</strong><br />

B l where B l+1<br />

1 ,B l+1<br />

2 ,B l+1<br />

3 ,B l+1<br />

4<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

are parts <strong>of</strong> the mesh M l+1<br />

(see Fig. 3). T (N(B l+1<br />

1 )) and T (N(B l+1<br />

2 )) do in general not<br />

lie at the border <strong>of</strong> T (N(A l )). Thus a gap may occur between<br />

the tesselated limit surfaces <strong>of</strong> A l and B l caused by their different<br />

subdivision levels. To obtain a gap-less surface, a gap<br />

polygon has to be inserted.<br />

A l<br />

B l+1<br />

1<br />

Bl Bl+1<br />

4<br />

B l+1<br />

3<br />

B l+1<br />

2<br />

¡ ¡ ¢¡¢<br />

¢¡¢ ¡ ¡<br />

¡ ¡ ¢¡¢<br />

¢¡¢ ¡ ¡<br />

N(B l+1<br />

1 ) T (N(B l+1<br />

N(A<br />

1 ))<br />

l ) T (N(A l ))<br />

N(B l )<br />

N(B l+1<br />

N(B<br />

4 )<br />

l+1<br />

N(B<br />

3 )<br />

l+1<br />

2 )<br />

T (N(B l+1<br />

T (N(B<br />

4 ))<br />

l+1<br />

T (N(B<br />

3 ))<br />

l+1<br />

2 ))<br />

Figure 3: Two neighbouring tesselated patches at different<br />

subdivision levels: a gap (hatched triangle) occurrs between<br />

the two surfaces. So it is necessary to insert a gap triangle<br />

to obtain a closed surface. The dashed curves on the<br />

right side describe the patches L(N(A l )) and L(N(B l+1<br />

1 )),<br />

L(N(B l+1<br />

2 )), L(N(B l+1<br />

3 )), L(N(B l+1<br />

4 )).<br />

Since the application <strong>of</strong> a subdivision rule is a convex<br />

combination we can infer that the convex hull <strong>of</strong> N(F l ) en-<br />

c○ The Eurographics Association and Blackwell Publishers 2003.<br />

closes the patch L(N(F l )). Consequently, if a plane Q does<br />

not intersect the convex hull <strong>of</strong> N(F l ), it does not intersect<br />

the patch L(N(F l )) either. Let Q be a plane orthogonal to the<br />

chord triangle T = △l p1l p2l p3 <strong>of</strong> a patch S. If Q intersects<br />

T , Q also intersects at least one chord triangle <strong>of</strong> the subpatches<br />

<strong>of</strong> S, because l p1,l p2 and l p3 do not move during<br />

further refinements.<br />

Let us now have a look at the border curves <strong>of</strong> a patch: In<br />

the regular case, that means a valence <strong>of</strong> 6 (see Fig. 4a), the<br />

border curve is a Bézier curve b(t) = ∑ 4 i=0 B4 i (t)bi with its<br />

Bézier control points (e.g., deduced from 9 ):<br />

b0 = 1<br />

12 (cpl 5 + cp l 8 + cp l 2 + cp l 1 + cp l 3 + cp l 7 + 6cp l 4)<br />

b1 = 1 1<br />

(<br />

12 2 cpl5 + 1<br />

2 cpl1 + 3<br />

2 cpl8 + 3<br />

2 cpl3 + 6cp l 4 + 2cp l 7)<br />

b2 = 1<br />

12 (2cpl8 + 2cp l 3 + 4cp l 4 + 4cp l 7)<br />

b3 = 1 1<br />

(<br />

12 2 cpl6 + 1<br />

2 cpl10 + 3<br />

2 cpl8 + 3<br />

2 cpl3 + 6cp l 7 + 2cp l 4)<br />

b4 = 1<br />

12 (cpl8 + cp l 3 + cp l 4 + cp l 9 + cp l 10 + cp l 6 + 6cp l 7)<br />

It follows from the properties <strong>of</strong> the Bézier curve that b0 is<br />

the limit point <strong>of</strong> the control point cp4, as well as b4 is the<br />

limit point <strong>of</strong> the control point cp7. b1 lies on the tangentline<br />

b0 + αb ′ (0) with α > 0. b3 is also on the tangent-line<br />

b4 + βb ′ (1) with β < 0. Furthermore, the border curve is inside<br />

the convex hull <strong>of</strong> bi,i = 0,...,4. Let P be a parallel projection<br />

onto a plane in direction <strong>of</strong> the normal vector <strong>of</strong> the<br />

plane. Because <strong>of</strong> the property <strong>of</strong> the affine invariance, the<br />

equation ∑ 4 i=0 P(bi)·B 4 i (t) = P(∑ 4 i=0 bi ·B 4 i (t)) holds. These<br />

properties are essential for the correctness <strong>of</strong> the algorithm.<br />

a)<br />

cp l<br />

5<br />

cp l<br />

2<br />

cp l<br />

1<br />

b0<br />

cp l<br />

4<br />

cp l<br />

8<br />

b1<br />

cp<br />

b2<br />

b(t)<br />

b3<br />

l<br />

3<br />

cp l<br />

cp<br />

7<br />

l<br />

10<br />

cp l<br />

6<br />

b4<br />

cp l<br />

9<br />

b)<br />

cp l<br />

8<br />

cp l<br />

9<br />

cp l<br />

7<br />

cp l<br />

2<br />

c0<br />

cp l<br />

0<br />

cp l<br />

6<br />

cp l<br />

3<br />

cp l+1<br />

01<br />

c1 c2 c3<br />

l p01 c(t)<br />

cp l<br />

5<br />

cp l<br />

1<br />

cp l<br />

4<br />

Figure 4: Border curve. a) regular case: The fat edge on the<br />

mesh is corresponding to the border curve b(t). b) irregular<br />

case: The curve c(t) is similar to the border curve (dashed)<br />

<strong>of</strong> the grey marked face, corresponding to the fat marked<br />

edge on the mesh. This edge is subdivided to obtain its limit<br />

point l p01.<br />

In the irregular case, that means the valence is not equal<br />

to 6, it is generally not possible to find the Bézier control<br />

points bi,i = 0,...,4 to obtain the border curve. Stam 9 , e.g.,<br />

proposes a parametrisation for Loop subdivision surfaces in<br />

irregular cases (one irregular point in the patch): The param-<br />

c4


eter space is partitioned into an infinite set <strong>of</strong> triangular tiles<br />

Ω n k (i.e., regular areas) near the extraordinary point. Depending<br />

on the parameter (u,v) to be calculated and its assigned<br />

Ω n k , the resulting point on the surface is computed via the<br />

eigenstructure <strong>of</strong> the used subdivision matrix depending on<br />

the valence. Unfortunately this kind <strong>of</strong> parametrisation is not<br />

useful for finding the control points bi,i = 0,...,4 <strong>of</strong> the irregular<br />

border curve with the desired convex hull property.<br />

So we choose a curve c(t) similar to the irregular border<br />

curve with the properties (see Fig. 4b):<br />

P1: c(0) = l p0, c(1) = l p1,<br />

P2: the tangent <strong>of</strong> the border curve at point l p0 has the same<br />

direction as c ′ (0), and the tangent <strong>of</strong> the border curve at<br />

point l p1 has the same direction as c ′ (1),<br />

P3: c(0.5) is equal to the limit point l p01 <strong>of</strong> cp l+1<br />

01 .<br />

From this similar curve, we can now calculate the Bézier<br />

control points ci,i = 0,...,4:<br />

c0 = l p0 (1)<br />

c1 = l p0 + 1<br />

12 tangent0<br />

(2)<br />

c2 = 8<br />

3 (l p01 − 1<br />

16 c0 − 1<br />

4 c1 − 1<br />

4 c3 − 1<br />

16 c4) (3)<br />

c3 = l p1 − 1<br />

12 tangent1<br />

(4)<br />

c4 = l p1 (5)<br />

where tangent0 and tangent1 are the tangential vectors <strong>of</strong> the<br />

border curve at points cp l 0 and cpl1 , respectively.<br />

5. Data Structure<br />

The implementation <strong>of</strong> subdivision surfaces uses a versatile<br />

class hierarchy designed to be extensible and maintainable.<br />

Each <strong>of</strong> the classes described below includes an according<br />

iterator class for navigation purposes and for retrieving information<br />

about the part <strong>of</strong> the mesh the iterator points to.<br />

The base class <strong>of</strong> this hierarchy is an abstract mesh class<br />

defining a general interface. This class is used to derive specialized<br />

mesh classes like a triangle or a quadrangle mesh<br />

implementing the maintenance and navigation for the respective<br />

mesh. On the next level <strong>of</strong> the class hierarchy there<br />

are special subdivision classes adding subdivision functionality.<br />

This functionality includes local and global refinement,<br />

navigation from parent to child and back, computation <strong>of</strong><br />

limit points and normals, chord normals and so on. One <strong>of</strong><br />

the key properties <strong>of</strong> these subdivision classes is the option<br />

to perform local subdivision steps. This allows adaptive refinement<br />

with a minimal effort.<br />

With this architecture we cover most <strong>of</strong> the needs that occur<br />

in applications using subdivision surfaces. The modular<br />

concept enables us to quickly exchange the subdivision<br />

scheme or modify the rules <strong>of</strong> one scheme, e.g., inserting<br />

rules for creases.<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

6. ShaoLin Toolbox<br />

After l subdivision steps <strong>of</strong> the starting patch S defined<br />

by L(cp 0 1 ,...,cp0 n), we obtain 4 l subpatches S j. The border<br />

curves <strong>of</strong> S j which are part <strong>of</strong> the border curves <strong>of</strong> the<br />

starting patch are called outer border curves. Subpatches S j<br />

without outer border curves are called inner patches (see<br />

Fig. 5). Similarly subpatches with outer border curves are<br />

outer patches. In subdivision level l we get 3 · 2 l outer border<br />

curves, 3 · 2 l − 3 outer patches and 4 l − 3 · 2 l + 3 inner<br />

patches.<br />

l p1<br />

l p2<br />

Figure 5: Inner (white) and outer (grey) subpatches <strong>of</strong> the<br />

starting patch S after two subdivision steps with the triangle<br />

plane T P <strong>of</strong> S. The three outer border curves <strong>of</strong> S are drawn<br />

dashed.<br />

With T P, we denote the plane defined by the three position<br />

vectors l p1,l p2 and l p3. The normal vector <strong>of</strong> T P is<br />

t pn. For the ray r = (rayorg,raydir) with the ray origin rayorg<br />

and the ray direction raydir let RP be the plane constructed<br />

by the position rayorg and the two direction vectors t pn and<br />

raydir. If t pn and raydir are linearly dependent, the second<br />

direction vector <strong>of</strong> RP can be chosen arbitrarily. During ray<br />

tracing we use an RP-coordinate system defined as follows:<br />

rpy = t pn, rpz = raydir ×t pn t pn × rpz<br />

, rpx =<br />

| raydir ×t pn | | t pn × rpz |<br />

rpz<br />

l p3<br />

T P<br />

rpy<br />

rayorg<br />

t pn<br />

rpx<br />

t pn T P<br />

CP<br />

RP<br />

raydir<br />

Figure 6: Planes used by the ShaoLin algorithm<br />

PS : IR 3 → T P is the projection in direction t pn onto T P,<br />

where t pn and T P are defined by a starting patch S. We say<br />

that the ray r casts a shadow on S if PS(S) ∩ PS(r) �= ∅. An<br />

intersection between patch S and ray r is possible if and only<br />

if patch S is shadowed.<br />

Let us now have a look at the tesselated world: Let T be<br />

the chord triangle <strong>of</strong> patch S, and H1,2,3 the three convex<br />

c○ The Eurographics Association and Blackwell Publishers 2003.


hulls <strong>of</strong> the three border curves <strong>of</strong> S. In the very most cases<br />

(see Fig. 7)<br />

PS(S) ⊆ �<br />

i=1,2,3 PS(Hi) ∪ T (6)<br />

A patch that fulfills Equation (6) is called a valid patch.<br />

The projected border curve area is the region on T P outside<br />

<strong>of</strong> T between the projected border curve and T . If<br />

Equation (6) holds, the projected border curve area is part<br />

<strong>of</strong> �<br />

i=1,2,3 PS(Hi) ∪ T . If Equation (6) is not satisfied, we<br />

can make several subdivision steps and start with valid subpatches<br />

as starting patches. We obtain valid patches because<br />

the sequence <strong>of</strong> subpatches converges to a smooth surface.<br />

The surface <strong>of</strong> patch S is smooth, due to the fact that creases<br />

do not exist in the interior <strong>of</strong> the patch. In Section 8 we will<br />

treat the special case that Equation (6) is not satisfied. In the<br />

following, we assume (6) is true. Thus, intersection between<br />

patch S and ray r is possible if and only if T or H1,2,3 are<br />

shadowed, that means:<br />

�� i=1,2,3 PS(Hi)<br />

�<br />

∪ T ∩ PS(r) �= ∅<br />

RP<br />

PS : IR 3 → T P<br />

T P<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

T P<br />

£¡£¡£<br />

£¡£¡£<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

§¡§¡§¡§¡§<br />

§¡§¡§¡§¡§<br />

¨¡¨¡¨¡¨¡¨<br />

¨¡¨¡¨¡¨¡¨<br />

£¡£¡£<br />

£¡£¡£<br />

£¡£¡£<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

§¡§¡§¡§¡§<br />

§¡§¡§¡§¡§<br />

§¡§¡§¡§¡§<br />

¨¡¨¡¨¡¨¡¨<br />

¨¡¨¡¨¡¨¡¨<br />

¨¡¨¡¨¡¨¡¨<br />

£¡£¡£<br />

£¡£¡£<br />

£¡£¡£<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¤¡¤¡¤<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¥¡¥¡¥¡¥¡¥<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

¦¡¦¡¦¡¦¡¦<br />

§¡§¡§¡§¡§<br />

§¡§¡§¡§¡§<br />

§¡§¡§¡§¡§<br />

¨¡¨¡¨¡¨¡¨<br />

¨¡¨¡¨¡¨¡¨<br />

¨¡¨¡¨¡¨¡¨<br />

£¡£¡£<br />

Figure 7: Projection onto T P: PS(S) (hatched) is part <strong>of</strong><br />

�<br />

i=1,2,3 PS(Hi) ∪ T (grey marked).<br />

Let Tj, j = 1,...,4 l , be the sub-chord-triangles <strong>of</strong> patch S<br />

at subdivision level l. Hk, k = 1,...,3·2 l are the border curve<br />

hulls <strong>of</strong> S at subdivision level l. The projection function PS<br />

always uses the projection plane and direction defined by its<br />

starting patch S (see Fig. 8). An intersection between patch<br />

S and ray r is possible if and only if at least one Tj or Hk is<br />

shadowed, that means:<br />

�� �<br />

PS(Tj)<br />

j=1,...,4l RP<br />

� �� ��<br />

∪<br />

PS(Hk) ∩ PS(r) �= ∅<br />

k=1,...,3·2l PS : IR 3 → T P<br />

T P<br />

Figure 8: Projection onto T P after one subdivision step with<br />

its shadowed parts (grey marked).<br />

To perform a shadow test with a chord triangle T , we<br />

T P<br />

c○ The Eurographics Association and Blackwell Publishers 2003.<br />

check if there is a limit point <strong>of</strong> T in the right half space<br />

defined by RP and another limit point <strong>of</strong> T in the left half<br />

space. The classification costs <strong>of</strong> one limit point are 2 additions,<br />

3 subtractions, 3 multiplications and 1 comparison.<br />

Therefore the testing costs for all 4 sub-chord-triangles Ti,<br />

i = 1,...,4 from a subdivision step are at most 12 additions,<br />

18 subtractions, 18 multiplications, and 6 comparisons.<br />

The plane orthogonal to the plane RP containing the position<br />

vector rayorg and the direction vector raydir is called CP<br />

in the following. A further test uses the convex hull property<br />

<strong>of</strong> the patch S. Let C(S) be the convex hull <strong>of</strong> S built by its<br />

control points cp 0 1 ,...,cp0 n. We say C(S) is crossing CP if<br />

CP ∩C(S) �= ∅. Similar to the shadow test, we check if there<br />

are control points located in the right and the left half space<br />

defined by CP. An intersection between patch S and ray r is<br />

possible if and only if C(S) is crossing CP. Let us now consider<br />

the situation after l subdivision steps: S j, j = 1,...4 l<br />

are the subpatches <strong>of</strong> S and C(S j) its corresponding convex<br />

hulls. Again an intersection between patch S and ray r is<br />

possible if and only if at least one C(S j) is crossing CP, that<br />

means CP ∩ ( �<br />

j=1,...,4 l C(S j)) �= ∅.<br />

7. Algorithm<br />

7.1. Description <strong>of</strong> the Algorithm<br />

It is typically not trivial to find out whether r casts a shadow<br />

upon the patch S. For this reason we first test the chord triangle<br />

T <strong>of</strong> S plus the hulls <strong>of</strong> its three border curves, which<br />

can be done very fast. If T or a hull <strong>of</strong> its border curves are<br />

crossed by the shadow, an intersection is possible. A second<br />

test is applied to check if C(S) is crossing CP. We use these<br />

two tests to decide in advance, if an intersection is possible<br />

at all.<br />

If S passed both tests, S is divided into four subpatches<br />

S1,...,S4. Then it is checked onto which chord triangle <strong>of</strong><br />

those subpatches Si or onto which hull <strong>of</strong> the corresponding<br />

outer border curves the shadow <strong>of</strong> r is cast. Because we deal<br />

with a closed tesselated part <strong>of</strong> the surface, the hulls <strong>of</strong> the<br />

inner border curves do not have to be considered. So it is<br />

sufficient to examine the hulls <strong>of</strong> the outer border curves, to<br />

ensure that the transition to the neighbouring patches <strong>of</strong> S is<br />

without any gap.<br />

T P<br />

S2<br />

S3<br />

S4<br />

S1<br />

Shadowlist:<br />

1. S3<br />

2. S4<br />

3. S2<br />

shadowed subpatches:<br />

level 1<br />

Figure 9: Shadowlist after one subdivision step<br />

The shadowed subpatches <strong>of</strong> S (see Figure 9) are gathered<br />

in a shadowlist sorted by their distance to rayorg. Beginning<br />

with the first subpatch in this shadowlist the following pro


cedure is recursively applied to each subpatch in that list until<br />

an intersection is found or the end <strong>of</strong> the list is reached.<br />

The parameters for this part <strong>of</strong> the algorithm are the patch to<br />

examine, the ray, and the current subdivision level.<br />

It is checked whether the control points <strong>of</strong> the current<br />

patch cross CP. If they do, an intersection is possible and<br />

we decide whether to make a further refinement. To obtain<br />

a high quality image with low consumption <strong>of</strong> run time and<br />

memory, three refinement criteria are considered:<br />

• Silhouette: If the patch belongs to the silhouette, it should<br />

be refined further than the inner parts <strong>of</strong> the object. A<br />

chord triangle with normal n counts as a silhouette triangle,<br />

if sil :=| n·raydir |≤ εs, 0 ≤ εs ≤ 1 where εs specifies<br />

the silhouette.<br />

• Curvature: Parts <strong>of</strong> the object with a high curvature<br />

need further refinement to look smooth. Instead <strong>of</strong><br />

expensively computing the exact curvature value <strong>of</strong> a<br />

patch, we subdivide the patch initially. Now we can evaluate<br />

the maximum distance <strong>of</strong> the three new limit points<br />

l p4,l p5,l p6, originating from the four sub-triangles, to its<br />

corresponding edges <strong>of</strong> the chord triangle △l p1l p2l p3. If<br />

cv := max<br />

i=1,2,3 {| ai − bi·ai<br />

bi·bi · bi |} ≥ εc,<br />

with ai = l p j − l pi, j = i + 3<br />

bi = l p (i+1) mod 3 − l pi<br />

l p 6<br />

l p 1<br />

for an εc ≥ 0, then a further refinement is necessary.<br />

• Size: An additional refinement <strong>of</strong> the patch is not necessary<br />

if the resulting sub-chord-triangles projected onto<br />

the image plane IP are too small with regard to the pixel<br />

size. In order to achieve smooth reflections, the size <strong>of</strong> the<br />

chord triangles projected onto IP must not exceed a given<br />

maximum.<br />

To take into account all the termination criteria, we use a<br />

combined ε and check the following:<br />

if projected size <strong>of</strong> the patch on IP < minSize then<br />

stop refinement;<br />

else<br />

if projected size <strong>of</strong> the patch on IP > maxSize then<br />

further refinement necessary;<br />

else<br />

if cv<br />

sil < ε then<br />

stop refinement;<br />

else<br />

further refinement necessary;<br />

end if;<br />

end if;<br />

end if;<br />

l p 3<br />

l p 4<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

l p 5<br />

l p 2<br />

If a further subdivision step is necessary, it is determined<br />

which <strong>of</strong> the new subpatches is crossed by the shadow <strong>of</strong> the<br />

ray. Those patches are gathered in a new shadowlist, again<br />

ordered by their distance to rayorg. At this point the recursion<br />

<strong>of</strong> ShaoLin starts again for each patch <strong>of</strong> that list.<br />

7.2. W-Case<br />

Special attention is required for the following: Let A and<br />

B be subpatches <strong>of</strong> the start patch S. In the case depicted<br />

in Figure 10a only B is put into the shadowlist, even if<br />

PS(A) ∩ PS(r) �= ∅, because T (A) is not shadowed. Since the<br />

tesselation <strong>of</strong> S forms a closed surface on each subdivision<br />

level, no ray intersection can get lost.<br />

a) b) B3 c) B3<br />

B<br />

B4 �����������������������������<br />

B4<br />

B2 ©�©�©�©�©�©�©�©�©�©�©�©�©�©�©�© B1 B2 B1<br />

�����������������������������<br />

A2<br />

©�©�©�©�©�©�©�©�©�©�©�©�©�©�©�©<br />

A1 A4<br />

A<br />

A3<br />

shadowed limit triangles:<br />

������� ���������<br />

level 1 level 2<br />

undefined area<br />

Figure 10: W-Case: A gap occurs at subdivision level 2 and<br />

is closed by the reactivation <strong>of</strong> A.<br />

A recursive call for element B in the shadowlist follows.<br />

Again, it is tested if C(B) is crossing CP and further refinements<br />

are necessary. If the tests are successful, B is<br />

subdivided into B1,B2,B3,B4. In general, it is PS(T (B)) �=<br />

�<br />

i=1,...,4 PS(T (Bi)), which means, the intersection between<br />

G := PS(T (B)) \ �<br />

i=1,...,4 PS(T (Bi)) and the projection <strong>of</strong><br />

the neighbouring patch PS(A) may be non-empty. This is the<br />

case, if PS(r) leaves and re-enters �<br />

i=1,...,4 PS(T (Bi)) at the<br />

outer edge path <strong>of</strong> the face pair (B1,B2) (fat marked in Fig.<br />

10b). We call this a w-case.<br />

Whenever this happens, the shadow crosses an undefined<br />

area between B1 and B2 – a so-called gap (the hatched area<br />

in Fig. 10b). This gap belongs to the projected area <strong>of</strong> the<br />

neighbour patch A. To close the gap, patch A gets ‘reactivated’<br />

and is added to the shadowlist. In the shadowlist A is<br />

tagged as a w-case. Now the shadowlist contains B1, A (wcase),<br />

B2. When the recursive call for A (w-case) is reached,<br />

the tag w-case leads to a special treatment for A: The crossing<br />

test with CP and the evaluation <strong>of</strong> the three termination<br />

criteria are skipped, hence a refinement <strong>of</strong> A is enforced.<br />

Now the check for the shadow crossing the subfaces and the<br />

processing <strong>of</strong> possible w-cases are applied as usual. As a result<br />

<strong>of</strong> this algorithm the ray traverses a closed surface. In<br />

the above example the patches B1, A1, A4, A3, and B2 are<br />

processed (Fig. 10c). In the same way possible w-cases at<br />

the other two outer edge paths <strong>of</strong> the face pairs (B2,B3) and<br />

(B3,B1) have to be examined.<br />

c○ The Eurographics Association and Blackwell Publishers 2003.


7.3. Intersection Test<br />

If the termination criteria determine that the current patch<br />

does not need further refinement, a possible ray intersection<br />

with the current patch’s chord triangle is computed. If the<br />

current patch is an outer subpatch <strong>of</strong> the original patch S,<br />

also the concerned border curve areas have to be tested for<br />

ray intersection. To examine these regions, the Bézier control<br />

points <strong>of</strong> the border curve are projected onto a plane V P<br />

defined by the point rayorg and the normal raydir. <strong>Ray</strong> r intersects<br />

the border curve area if and only if rayorg is in the<br />

convex hull <strong>of</strong> the control points projected onto V P.<br />

If an intersection is found, the surface normal <strong>of</strong> the intersection<br />

point is calculated using the limit normals at the<br />

corners <strong>of</strong> the patch and the barycentric coordinates <strong>of</strong> the<br />

intersection point with respect to the patch’s chord triangle.<br />

T P<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

parts <strong>of</strong> the patch<br />

tested for intersection:<br />

level 1<br />

level 2<br />

gap triangle<br />

Figure 11: Tested part <strong>of</strong> the patch: chord triangles, convex<br />

hulls <strong>of</strong> the outer border curve areas and a gap triangle.<br />

If the above tests do not find an intersection for the current<br />

patch, the current subdivision level is stored and the<br />

algorithm continues with the next patch (in the appropriate<br />

shadowlist). If the intersection test <strong>of</strong> the next patch occurs<br />

at another subdivision level than the last stored level, the ray<br />

may possibly hit a gap between those two chord triangles. To<br />

prevent such a gaping <strong>of</strong> the surface, intermediate polygons<br />

are created between the chord triangles <strong>of</strong> different subdivision<br />

levels (see Figure 11). These intermediate polygons are<br />

then checked for ray intersection. This and the inspection <strong>of</strong><br />

the outer border curve areas guarantee a closed surface while<br />

finding a ray intersection.<br />

7.4. ShaoLin in Pseudocode<br />

The ShaoLin algorithm takes a start patch, a ray, and the<br />

initial subdivision level (i.e. 0) as initial parameters.<br />

bool ShaoLin (patch, ray, level)<br />

if control points <strong>of</strong> patch cross CP then<br />

if further refinement necessary then<br />

Subdivide patch;<br />

Compute shadow and shadowlist;<br />

for each shadow-patch i in the shadowlist do<br />

if shadow-patch i was activated by w-case then<br />

// shadow-patch i is not a subpatch <strong>of</strong> patch!<br />

nextlevel=level;<br />

else<br />

nextlevel=level + 1;<br />

c○ The Eurographics Association and Blackwell Publishers 2003.<br />

end if;<br />

if ShaoLin (shadow-patch i , ray, nextlevel) then<br />

return true;<br />

end if;<br />

end for;<br />

return false;<br />

else<br />

// intersection possible<br />

if last tested level �= level then<br />

Insert gap polygon between<br />

the different subdivision levels<br />

if ray intersects gap polygon then<br />

return true;<br />

end if;<br />

end if;<br />

if ray intersects chord triangle then<br />

return true;<br />

end if;<br />

if patch is outer patch ∧<br />

ray intersects its outer border curve area(s) then<br />

return true;<br />

end if;<br />

end if;<br />

else<br />

// intersection not possible<br />

return false;<br />

end if;<br />

8. Discussion<br />

8.1. Prerequisites<br />

To guarantee the correctness <strong>of</strong> the algorithm the following<br />

requirements must be fulfilled:<br />

a) The projection <strong>of</strong> the border curve area onto T P lies completely<br />

inside the projection <strong>of</strong> the border curve’s bounding<br />

volume.<br />

b) PS(S) ⊆ �<br />

i=1,2,3 PS(Hi) ∪ T<br />

Regarding a): In the regular case the convex hull <strong>of</strong> the<br />

control points <strong>of</strong> the border curve forms the desired bounding<br />

volume (Fig. 4). In the irregular case five fix control<br />

points to construct the border curve do not exist, so we use<br />

a similar curve c(t) that meets the requirements P1, P2, and<br />

P3 (see Section 4). The control points <strong>of</strong> c(t) are used to<br />

build the bounding volume <strong>of</strong> such a border curve. Since the<br />

algorithm does not need the exact shape <strong>of</strong> that curve but<br />

merely the projection <strong>of</strong> its bounding volume, this part <strong>of</strong><br />

the algorithm is a well working heuristics. It is also possible<br />

to use other bounding volumes for the border curve (e.g., an<br />

enlarged sampling <strong>of</strong> the border curve).<br />

Regarding b): Equation (6) is true for common geometric<br />

models. Figure 12 shows a case where (6) is not true. For<br />

clarity, the left parts <strong>of</strong> Figures 12 and 13 show a cross section<br />

<strong>of</strong> the patch in question. The extreme positioning <strong>of</strong> the


control points <strong>of</strong> patch S leads to S overlapping itself. PS(Hi)<br />

is inside PS(S) and PS(S) ⊃ �<br />

i=1,2,3 PS(Hi) ∪ T .<br />

TP PS : IR 3 → T P<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

���������������TP ���������������<br />

��������������� ���������������<br />

��������������� ���������������<br />

��������������� ���������������<br />

��������������� ���������������<br />

Figure 12: Special case PS(S) �⊆ �<br />

i=1,2,3 PS(Hi) ∪ T .<br />

Left: cross section. Right: projected view onto T P,<br />

�<br />

i=1,2,3 PS(Hi) ∪ T (hatched) is inside PS(S) (grey marked).<br />

Since there are no creases inside <strong>of</strong> S, any further refinement<br />

<strong>of</strong> S provides patches with smaller curvature. This<br />

means, beginning with a certain subdivision level l and its<br />

associated subpatches A j, j = 1,...,4 l , for each <strong>of</strong> these A j<br />

no self-overlapping occurs, when projecting them onto T PA j<br />

(see Fig. 13). Hence PA j (A j) ⊆ �<br />

i=1,2,3 PA j (Hi) ∪ Tj is true<br />

for each A j. So the algorithm can start with those A j as start<br />

patches.<br />

T P A1 T P A2<br />

PA 1 : IR 3 → T PA 1<br />

PA 2 : IR 3 → T PA 2<br />

T P A1<br />

T P A2<br />

Figure 13: Special case after one subdivision step: we obtain<br />

four new triangle planes, T PA1 and T PA2 are illustrated<br />

on the left side in the cross section view. The projections <strong>of</strong><br />

the subpatches (grey marked, right side) into their triangle<br />

planes fulfill PA j (A j) ⊆ �<br />

i=1,2,3 PA j (Hi) ∪ Tj, j = 1,2,3<br />

To detect this case, the control point mesh <strong>of</strong> the patch S<br />

at a given subdivision level l, l is chosen sufficiently big, is<br />

projected onto T P. If a planar graph results, Equation (6) is<br />

fulfilled. The reverse implication is not necessarily true. In<br />

the case <strong>of</strong> a non planar graph, a subdivision step will be<br />

done with S and the subpatches <strong>of</strong> S will be tested recursively<br />

as new start patches with new T P’s. This procedure<br />

terminates, because the sequence <strong>of</strong> control points <strong>of</strong> the<br />

subpatches converges to a smooth surface (creases etc. do<br />

not appear in the interior <strong>of</strong> the patch). The detection method<br />

is more <strong>of</strong> theoretical interest because cases where Equation<br />

(6) is not true are rather pathological and do normally not<br />

occur in practice.<br />

8.2. Other <strong>Subdivision</strong> Schemes<br />

The ShaoLin algorithm can easily be adapted to other kinds<br />

<strong>of</strong> subdivision surfaces fulfilling the prerequisites <strong>of</strong> Section<br />

8.1. Firstly a suitable plane T P has to be defined. For<br />

Catmull-Clark surfaces1 this plane may for instance be determined<br />

by 1/4(l p0 + l p1 + l p2 + l p3) as a point on the<br />

plane and ∑ 3 i=0 ∆l pi × ∆l p (i+1) mod 4 as the plane’s normal,<br />

where ∆l pi = l pi − l p (i−1) mod 4 and l pi are the limit points<br />

<strong>of</strong> the starting patch. The other planes and the hulls <strong>of</strong> the<br />

border curves are computed as described in Section 3. The<br />

algorithm works in the same manner as described in Section<br />

7 – with the minor difference for Catmull-Clark surfaces<br />

that we have to deal with shadowed quadrangles in the same<br />

way we process shadowed triangles for Loop surfaces. The<br />

implementation <strong>of</strong> the ShaoLin algorithm for Catmull-Clark<br />

surfaces is in progress.<br />

8.3. Optimisations<br />

We applied two kinds <strong>of</strong> optimisations concerning a) the algorithm<br />

and b) the underlying data structure. During the execution<br />

<strong>of</strong> the algorithm, we try to avoid unnecessary border<br />

curve area tests. If, for example, only one subpatch <strong>of</strong><br />

a patch is crossed by the shadow, it is not necessary to examine<br />

the border curve areas <strong>of</strong> the subpatches lying on the<br />

opposite edge <strong>of</strong> that patch. Furthermore intersection tests<br />

for border curve areas at the silhouette are needless, because<br />

this would not have a visible effect due to the fine tesselation<br />

there. The mesh implementation caches the limit points. Further,<br />

the valence <strong>of</strong> the vertices is stored instead <strong>of</strong> counted<br />

each time.<br />

9. Results<br />

9.1. Visual Results<br />

First <strong>of</strong> all, only those parts <strong>of</strong> the object are refined, which<br />

potentially contribute to the light transport. Hence, back<br />

parts and covered parts without contact to, e.g., shadow rays<br />

are not built. However, parts <strong>of</strong> the object critical to obtain<br />

a high quality image are especially fine subdivided (the silhouette,<br />

high curvature areas, and parts near the camera). We<br />

avoid refinements in subpixel domains (resulting from too<br />

small triangles) as well as non smooth reflections (resulting<br />

from too large triangles). This way, we use the rendering<br />

time and memory efficiently.<br />

To visualise the work <strong>of</strong> the adaptive refinement, we rendered<br />

a scene as ‘level map’. There the color <strong>of</strong> each pixel<br />

indicates the subdivision level where an intersection occurs.<br />

This can be observed in Figure 14.<br />

9.2. Run Time and Memory Consumption<br />

We chose three scenes for measuring the run time and the<br />

memory consumption: a simple scene with 268 faces in the<br />

subdivision surface control mesh (Frogship), a scene with<br />

5756 faces (Col-Henge), and a complex scene with 10328<br />

faces (Eggs’n’Bunnies). The computer used for this benchmarks<br />

was a Pentium IV with an Intel 845 chipset, 1.7 GHz<br />

and 1 GB RAM. The executable was built by a Micros<strong>of</strong>t<br />

Visual C++ 6.0 compiler using Windows 2000. We use the<br />

ray tracer integrated in the MRT14 rendering package (Modular<br />

Rendering Tool), an extensible library <strong>of</strong> rendering algorithms<br />

and data structures. To assess the results <strong>of</strong> the<br />

c○ The Eurographics Association and Blackwell Publishers 2003.


<strong>Subdivision</strong> level:<br />

1 2 3 4 5 6<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

7<br />

(no hit)<br />

Figure 14: Level map and original image <strong>of</strong> Frogship:<br />

adaptively refined subdivision surface by illumination and<br />

shadow rays.<br />

ShaoLin algorithm, the scenes were also rendered with two<br />

other approaches: i) Uniform: If the bounding volume <strong>of</strong> a<br />

subdivision object is hit by the ray, the object is tesselated<br />

once in a given subdivision level. ii) <strong>Adaptive</strong>: we implemented<br />

an algorithm following Woodward’s approach (see<br />

Section 1) extended by the same refinement criteria like the<br />

ShaoLin algorithm. To adapt and optimise it for subdivision<br />

surfaces, the control as well as the limit points are cached<br />

and all intersection tests are done in 2D. For simplicity we<br />

call it A3 (Another <strong>Adaptive</strong> Algorithm). Even though the<br />

adaptive algorithms <strong>of</strong>fer a variety <strong>of</strong> results (because <strong>of</strong> the<br />

three parameters: combined ε, maxSize, and minSize), we<br />

present only a small range here. The tables (see Tables 1, 2,<br />

3) can be used to find an adequate subdivision level for the<br />

uniform approach that provides an image quality comparable<br />

to that <strong>of</strong> the adaptive algorithms.<br />

comb. average <strong>Ray</strong> intersections in subdivision level<br />

ε level 0–1 2 3 4 5 6 7<br />

0.005 4.74 0 0 960 78606 118007 17546 3199<br />

0.010 4.32 0 0 7260 143327 58230 8026 1413<br />

0.020 4.10 0 0 24309 149340 37668 3876 443<br />

0.040 3.98 0 60 38697 140984 31456 1635 170<br />

0.080 3.94 0 668 41568 139241 29147 707 30<br />

0.200 3.92 0 1163 42603 138283 28135 305 11<br />

0.500 3.92 0 1234 42812 138087 27739 218 0<br />

Table 1: Number <strong>of</strong> ray intersections per subdivision level<br />

for Frogship (minSize=2 Pixels, maxSize=12 Pixels).<br />

comb. average <strong>Ray</strong> intersections in subdivision level<br />

ε level 0–1 2 3 4 5 6 7<br />

0.005 4.26 0 366 43581 406663 125442 32905 3434<br />

0.010 3.89 0 3749 196371 335172 82529 23545 1366<br />

0.020 3.57 0 26663 324712 210037 62414 18109 615<br />

0.040 3.26 0 138635 298292 152784 53122 15835 338<br />

0.080 3.06 0 232187 221692 129657 48624 15207 248<br />

0.200 2.98 0 267544 186845 115271 47336 15055 204<br />

0.500 2.96 0 274966 176705 112317 47033 15039 195<br />

Table 2: Number <strong>of</strong> ray intersections per subdivision level<br />

for Col-Henge (minSize=2 Pixels, maxSize=12 Pixels).<br />

At a given quality, for simple scenes the number <strong>of</strong> faces<br />

generated by the uniform approach is quite similar to the<br />

c○ The Eurographics Association and Blackwell Publishers 2003.<br />

comb. average <strong>Ray</strong> intersections in subdivision level<br />

ε level 0–1 2 3 4 5 6 7<br />

0.005 4.48 0 5671 119254 262671 274859 103913 6074<br />

0.010 4.32 0 27545 117212 299910 245126 84493 2089<br />

0.020 4.24 0 43791 104466 322688 223068 76369 511<br />

0.040 4.19 0 48299 121455 308671 216631 73181 196<br />

0.080 4.16 0 49585 132244 296500 214256 71473 43<br />

0.200 4.13 0 69865 117587 293285 212855 70949 9<br />

0.500 4.12 0 74910 112192 292307 212612 70600 4<br />

Table 3: Number <strong>of</strong> ray intersections per subdivision level<br />

for Eggs’n’Bunnies (minSize=2 Pixels, maxSize=20 Pixels).<br />

ShaoLin uni. uni. uni. uni. uni.<br />

lev. 3 lev. 4 lev. 5 lev. 6 lev. 7<br />

F’ship 83M 24M 48M 140M 495M 1635M<br />

C’H’ 491M 189M 690M — — —<br />

E’n’B 1499M 1090M — — — —<br />

Table 4: Memory requirements for ShaoLin (ε = 0.01) and<br />

the uniform approach.<br />

number <strong>of</strong> faces generated by an adaptive approach. Due to<br />

the higher complexity <strong>of</strong> an adaptive algorithm, the uniform<br />

approach is comparable to the adaptive algorithm in this case<br />

regarding computation time and image quality (see Table 1<br />

and Fig. 15, left).<br />

With growing complexity <strong>of</strong> the scene, the ShaoLin algorithm<br />

can show its advantages: The number <strong>of</strong> generated<br />

faces is significantly smaller than in the uniform approach,<br />

saving run time and memory. These savings exceed by far<br />

the extra costs for the adaptive approach ShaoLin (see Fig.<br />

15 and Table 3).<br />

High memory requirements <strong>of</strong> the uniform approach lead<br />

to a limited subdivision level as shown by Table 4. It was,<br />

for instance, impossible to render the Eggs’n’Bunnies-scene<br />

with the uniform approach at subdivision level 4.<br />

Mainly due to the bigger bounding volumes defined by the<br />

1-neighbourhood, the A3 algorithm is noticeably slower than<br />

the ShaoLin algorithm (see Fig. 15). Because <strong>of</strong> the same<br />

refinement criteria, A3 yields similar level maps and has the<br />

same memory consumption.<br />

10. Conclusion<br />

With the ShaoLin algorithm we present an adaptive ray tracing<br />

method for subdivision surfaces. The algorithm is fast,<br />

yields high quality images and consumes little memory in<br />

comparison to the uniform approach. Furthermore, it is easy<br />

to implement, does not need precomputation and requires<br />

only the basic set <strong>of</strong> subdivision rules. The algorithm is also<br />

robust in the sense that it deals with all features <strong>of</strong> subdivision<br />

surfaces like creases and corners. Finally, the proposed<br />

ray-intersection algorithm is applicable, e.g., for simple collision<br />

detection, for radiosity calculations, and for picking<br />

objects interactively.


Time [sec]<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Frogship<br />

ShaoLin<br />

A3<br />

Uniform, level 7<br />

Uniform, level 6<br />

Uniform, level 5<br />

Uniform, level 4<br />

Uniform, level 3<br />

Uniform, level 2<br />

Uniform, level 1<br />

Uniform, level 0<br />

0<br />

0.005 0.01 0.02 0.04 0.08 0.2 0.5<br />

Combined Epsilon<br />

Müller et al / <strong>Adaptive</strong> <strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong><br />

Time [sec]<br />

2000<br />

1500<br />

1000<br />

500<br />

Col-Henge<br />

ShaoLin<br />

A3<br />

Uniform, level 4<br />

Uniform, level 3<br />

Uniform, level 2<br />

Uniform, level 1<br />

Uniform, level 0<br />

0<br />

0.005 0.01 0.02 0.04 0.08 0.2 0.5<br />

Combined Epsilon<br />

Time [sec]<br />

2500<br />

2000<br />

1500<br />

1000<br />

500<br />

Eggs N’ Bunnies<br />

ShaoLin<br />

A3<br />

Uniform, level 3<br />

Uniform, level 2<br />

Uniform, level 1<br />

Uniform, level 0<br />

0<br />

0.005 0.01 0.02 0.04 0.08 0.2 0.5<br />

Combined Epsilon<br />

Figure 15: Computation times for Frogship, Eggs’n’Bunnies and Col-Henge with resolution 800 × 800.<br />

Figure 16: Visual results <strong>of</strong> the ShaoLin algorithm (Eggs’n’Bunnies, GSS Europa, Col-Henge).<br />

References<br />

1. E. Catmull and J. Clark. Recursively generated Bspline<br />

surfaces on arbitrary topological meshes. <strong>Computer</strong><br />

Aided Design, 10(6):350–355, 1978. 8<br />

2. C. Woodward. <strong>Ray</strong> <strong>Tracing</strong> Parametric <strong>Surfaces</strong><br />

by <strong>Subdivision</strong> in Viewing Plane. W. Strasser and<br />

3.<br />

H. P. Seidel (ed), Theory and Practice <strong>of</strong> Geometric<br />

Modeling, Springer Verlag, 1989. 1, 2<br />

T. Nishita, T. W. Sederberg and M. Kakimoto <strong>Ray</strong> <strong>Tracing</strong><br />

Trimmed Rational Surface Patches SIGGRAPH 90<br />

proceedings,17:337–345, 1990. 1<br />

4. D. T. Toth On <strong>Ray</strong> <strong>Tracing</strong> Parametric <strong>Surfaces</strong> SIG-<br />

GRAPH 85 proceedings,12:171–179, 1985. 1<br />

5. D. Lischinski and J. Gonczarowski Improved Tech-<br />

6.<br />

niques for <strong>Ray</strong> <strong>Tracing</strong> Parametric <strong>Surfaces</strong>. The Visual<br />

<strong>Computer</strong>, 6(3):134–152, 1990. 1<br />

L. Kobbelt, K. Daubert, and H. P. Seidel. <strong>Ray</strong> <strong>Tracing</strong><br />

<strong>of</strong> <strong>Subdivision</strong> <strong>Surfaces</strong>. 9th Eurographics Workshop<br />

on Rendering proceedings, pp. 69–80, 1998. 2<br />

7. C. Loop. Smooth subdivision surfaces based on triangles.<br />

Master thesis, University <strong>of</strong> Utah, 1987. 2, 3<br />

8. J. E. Schweitzer. Analysis and Application <strong>of</strong> Subdi-<br />

9.<br />

vision <strong>Surfaces</strong>. PhD thesis, University <strong>of</strong> Washington,<br />

1996. 3<br />

J. Stam. Evaluation <strong>of</strong> Loop <strong>Subdivision</strong> <strong>Surfaces</strong>, SIG-<br />

GRAPH 99 Course Notes, 1999 3<br />

10. K. Müller and S. Havemann. <strong>Subdivision</strong> Surface Tesselation<br />

on the Fly using a versatile Mesh Data Structure.<br />

<strong>Computer</strong> <strong>Graphics</strong> Forum (Eurographics 2000<br />

Proc.), 19(3):151–159, 2000. 1<br />

11. K. Pulli and M. Segal. Fast Rendering <strong>of</strong> <strong>Subdivision</strong><br />

<strong>Surfaces</strong>. Technical report, University <strong>of</strong> Washington,<br />

1996. 1<br />

12. I. Wald, P. Slusallek, and C. Benthin. Interactive Distributed<br />

<strong>Ray</strong> <strong>Tracing</strong> <strong>of</strong> Highly Complex Models. Eurographics<br />

Rendering Workshop Proceedings, pp. 274–<br />

285 , 2001. 1<br />

13. I. Wald, P. Slusallek, C. Benthin, and M. Wagner. Interactive<br />

Rendering with Coherent <strong>Ray</strong> <strong>Tracing</strong>. <strong>Computer</strong><br />

<strong>Graphics</strong> Forum (Eurographics 2001 Proceedings),<br />

20(3):153–164, 2001. 1<br />

14. D. Fellner. Extensible Image Synthesis. Object–<br />

Oriented and Mixed Programming Paradigms, P. Wisskirchen<br />

(ed), Focus on <strong>Computer</strong> <strong>Graphics</strong>, Springer,<br />

pp. 7–21, 1996. 8<br />

c○ The Eurographics Association and Blackwell Publishers 2003.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!