Curved PN Triangles

8
Curved PN Triangles Alex Vlachos org Peters Chas Boyd Jason L. Mitchell ATI Research Microsoft Corporation University of Florida Figure 1: Which rendering would you prefer? (from left to right) (a) Input triangulation, (b) Gouraud shaded input triangulation, (c) geometric component of the PN triangles (shaded according to surface normal variation) (d) curved PN triangles (shaded with independently constructed quadratically varying normals). Abstract To improve the visual quality of existing triangle-based art in real- time entertainment, such as computer games, we propose replacing flat triangles with curved patches and higher-order normal variation. At the hardware level, based only on the three vertices and three vertex normals of a given flat triangle, we substitute the geometry of a three-sided cubic B´ ezier patch for the triangle’s flat geometry, and a quadratically varying normal for Gouraud shading. These curved point-normal triangles, or PN triangles, require minimal or no change to existing authoring tools and hardware designs while providing a smoother, though not necessarily everywhere tangent continuous, silhouette and more organic shapes. CR Categories: I.3.5 [surface representation, splines]: I.3.6— graphics data structures Keywords: curved surface, PN Triangle, hardware, real-time, sur- face tessellation NSF NYI CCR-9457806, [email protected], [email protected], [email protected], [email protected] 1 Introduction In interactive 3D entertainment, software design cycles are long and hardware product release cycles are short. As a result, new techniques added to hardware must have a simple migration path if content already in development is to use the technique; conversely, the less change a new hardware feature imposes on the art pipeline and API, the more likely it is to be used. A majority of computer games use triangles as their fundamental modeling primitive, and all use triangles for hardware-accelerated rendering. This is the result of existing tool support, hardware sup- port and the artist’s familiarity with triangles. It is increasingly common for applications to pass normals to the hardware to take advantage of transform-capable video cards. In this paper, we introduce curved point-normal triangles, or short PN triangles, as an inexpensive means of improving visual quality by smoothing out silhouette edges and providing more sam- ple points for vertex shading operations. Each PN triangle replaces one original flat triangle by a curved shape that is retriangulated into a programmable number of small (flat) subtriangles. We select this representation for a resource-limited hardware environment: the PN triangle is to be generated on-chip without any software assistance. Specifically, PN triangle generation and subtriangulation are to be inserted between the vertex-and-primitive-assembly stage and the vertex-shading stage of the graphics pipeline (Figure 2). The geometry of a PN triangle is defined as one cubic B´ ezier patch. The patch matches the point and normal information at the vertices of the flat triangle. Its normal is a separate linear or quadratic B´ ezier interpolant of the data. No additional data beyond the position and normal data are used. Other data attached to the flat input triangle are forwarded to the subtriangles, mostly by linearly

description

 

Transcript of Curved PN Triangles

Page 1: Curved PN Triangles

Curved PN Triangles

Alex Vlachos�

Jorg Peters���

ChasBoyd�

JasonL. Mitchell�

�ATI Research

�Microsoft Corporation

�Universityof Florida

Figure1: Whichrenderingwouldyouprefer?(fromleft to right) (a) Input triangulation,(b) Gouraudshadedinputtriangulation,(c) geometriccomponentof thePNtriangles(shadedaccordingto surfacenormalvariation)(d) curvedPNtriangles(shadedwith independentlyconstructedquadraticallyvaryingnormals).

Abstract

To improve thevisualquality of existing triangle-basedart in real-timeentertainment,suchascomputergames,we proposereplacingflat triangleswith curvedpatchesandhigher-ordernormalvariation.At the hardware level, basedonly on the threeverticesand threevertex normalsof a given flat triangle,we substitutethegeometryof a three-sidedcubicBezierpatchfor thetriangle’s flat geometry,and a quadraticallyvarying normal for Gouraudshading. Thesecurvedpoint-normaltriangles,or PN triangles,requireminimal orno changeto existing authoringtools andhardwaredesignswhileproviding a smoother, thoughnot necessarilyeverywheretangentcontinuous,silhouetteandmoreorganicshapes.

CR Categories: I.3.5 [surfacerepresentation,splines]: I.3.6—graphicsdatastructures

Keywords: curvedsurface,PNTriangle,hardware,real-time,sur-facetessellation�

NSF NYI CCR-9457806,[email protected],[email protected],[email protected],[email protected]

1 Intr oduction

In interactive 3D entertainment,software designcycles are longand hardware productreleasecycles are short. As a result, newtechniquesaddedto hardwaremusthave a simplemigrationpathifcontentalreadyin developmentis to usethetechnique;conversely,thelesschangea new hardwarefeatureimposeson theart pipelineandAPI, themorelikely it is to beused.

A majorityof computergamesusetrianglesastheir fundamentalmodelingprimitive, andall usetrianglesfor hardware-acceleratedrendering.This is theresultof existing tool support,hardwaresup-port and the artist’s familiarity with triangles. It is increasinglycommonfor applicationsto passnormalsto the hardware to takeadvantageof transform-capablevideocards.

In this paper, we introducecurved point-normal triangles, orshortPN triangles, as an inexpensive meansof improving visualqualityby smoothingoutsilhouetteedgesandproviding moresam-plepointsfor vertex shadingoperations.EachPNtrianglereplacesoneoriginalflat trianglebyacurvedshapethatis retriangulatedintoa programmablenumberof small(flat) subtriangles.We selectthisrepresentationfor aresource-limitedhardwareenvironment:thePNtriangleis to begeneratedon-chipwithoutany softwareassistance.Specifically, PN trianglegenerationandsubtriangulationareto beinsertedbetweenthe vertex-and-primitive-assemblystageand thevertex-shadingstageof thegraphicspipeline(Figure2).

The geometryof a PN triangle is definedas one cubic Bezierpatch. The patch matchesthe point and normal information atthe verticesof the flat triangle. Its normal is a separate linear orquadraticBezierinterpolantof thedata.No additionaldatabeyondthepositionandnormaldataareused.Otherdataattachedto theflatinput triangleareforwardedto thesubtriangles,mostlyby linearly

Page 2: Curved PN Triangles

Figure2: CurvedPNtriangletessellationin thegraphicspipeline

interpolatingthevaluesat theverticesof theflat input triangle.The PN triangle emerged in comparisonwith more sophisti-

catedsurfacing methodsto addressrequirementsspecific to theresource-limitedhardware environment, e.g. that no informationaboutneighboringtrianglescanbeaccumulated:

1. Improvedvisualappeal.

2. Compatibilitywith existingAPI datastructures:vertex arraysplus triangle index streamswheretrianglesarrive in unpre-dictableorder. Minimal or nomodificationof existing APIs.

3. Backward compatibility of the modelswith hardware thatdoesnot supportPN triangles;minimal or no effort to adaptexistingmodels.

4. No setupstep of the application,API, or hardware driver;in particular, hardwareshouldnot have to provide intermedi-atestoragefor randomaccess;consequentlyknowledge aboutneighboringfacetsis restrictedto thesharedverticesandver-tex normalson thecommonedge.

5. Applicability to shapesof arbitrarytopology.

6. Fastexecutionandsimpleimplementationin hardware.

In particular, it is not thepurposeof PN trianglesto convert trian-gulationsinto designerquality, everywheresmoothsurfaces,but tosoftentrianglecreasesandimprove thevisualappealby generatingsmoothersilhouettesandbettershading.

Thefollowing sectionswill definetheAPI-levelusageandplace-mentof thecurvedPNtrianglesin thegraphicspipeline(Section2),give a precisederivationof thePN triangleandits properties(Sec-tion 3),andthendiscussperformanceandvisualimpactto convincethe readerthat the requirementsarewell addressedby curved PNtriangles.

Figure3: The coefficientsor control pointsof a triangularBezierpatcharrangedto form a controlnet.

2 Basic form, API-level usage and place-ment in the graphics pipeline

Wewantto leveragetheexisting(flat) triangle-baseddatastructuressuchasvertex arrays: astreamof pointandnormalcoordinatesfol-lowedby setsof indicesthatallow picking theverticesof a trianglefrom thestream.Thatis, for eachtriangle,only the ��� coordinatesof thepositionandnormalof thethreeverticesof the trianglesareavailableandthereis a uniquenormalfor eachvertex.

An interestingaspectof thecurvedPNtrianglethatmaysurprisethenongraphics-immersedreaderis thatthenormalcomponentofthecurvedPNtriangle is independentlyspecifiedfrom thegeomet-ric componentof a curvedPN triangle. Thegeometryof a curvedPNtriangledefinedby a cubicpatch� (c.f. Figure3)

� ��� ���� � ��� for �����������! � � � � ��"$#��%&� � '(� )*,+-.+0/21 � � * -./4356 5 785 9:5 �

* - � / ��;� �=<=< � �?> � <=�=< � �?> � <=<=� �> � �A@B< 3 � � � > � @C�D< 3 �E� � > � �D<.@ 3 � � > � <F�A@ 3 � � > � @B<F� 3 �G �?> � <.@C� 3 �� �> � @=@[email protected] �E�I �J

Wegroupthe � * -A/ togetheras

vertex coefficients: � �=<=< � � <=�=< � � <=<=� �tangentcoefficients: � �A@B< � � @C�D< � � <F�A@ � � <.@C� � � @B<F� � � �D<.@ �

centercoefficient: � @=@=@ J

Coefficientsarealsooftencalledcontrol pointsandareconnectedto form a control net or control polyhedron(seeFigure 3). Thenormalcomponentof acurvedPNtriangleis eithera linearaverageof thevertex normalsor a quadraticfunctionof thepositionaland

Page 3: Curved PN Triangles

Figure 4: Subtriangulation(lod 0 through5) inducedby a uni-form � � grid (top) andthevisualeffect of two light sourceson anoctahedron(bottom).

normaldata.Thequadraticfunction K is definedas(c.f. Figure7)

K!��� �L�� � ��� for �;���L�����! � � � � �M"$#K(%&� � '(� )*N+-.+0/21 � K * -A/ �

* - � / ��OK �D<=< � �?> K <F�D< � �(> K <=<F� �> K @=@B< �G� > K <.@=@ �� > K @B<.@ �E �J

We call K @=@B< , K <.@=@ and K @B<.@ mid-edgecoefficients. ThevaluesofK arenormalizedbeforethey arepassedon to the vertex shadingstageof thepipeline.

Section3 describesin detailhow to choosethecoefficients � * -./ ,respectively K * -A/ sothatthepatchesmatchthepositionandnormalat eachof the threecornersof the original flat triangle. The PNtriangleisaspecialthree-sided,or “triangularBezier”patch.Three-sidedpatcheswereinventedby deCasteljau[3]. Farin [6] givesathoroughtreatmentof deCasteljau’spatchandits applications.

Giventhesimple,closedform of thepatchesit is straightforwardto evaluateand tesselate� and K . In particular, we canefficientlysubtriangulatebothpatchesover thesameuniform � , grid by pre-scribing just one number, the level of detail lod, definedas thenumberof evaluationpointsononeedgeminustwo (c.f. Figure4).If lod=0 thenthepatchis just evaluatedat thecornersandthis isequivalent to sendingthe original flat triangle down the graphicspipeline. An applicationdeveloperenablesPN trianglesby a callthatspecifieslod andaflagthatindicateswhetherK or thelinearlyvaryingnormalis to beevaluated(c.f. reffig:oct).

Figure5: Inputdata:points P * andnormalsQ * .2.1 Why choose cubicall y varying geometr y and

quadraticall y varying normals?

In opting for cubic geometryandquadraticnormals,we balancedthe simplicity neededfor hardware realizationwith a modelingrangethatwould allow usto improve contoursandshading.

Simplicitymeansthatwedonotgenerateandstoreneighborhoodinformation,aswouldberequiredby generalizedsubdivisionalgo-rithms (e.g. [10, 8]) or surfacesplines[13]. Simplicity madeusopt for aclosed-form,polynomialsurfacerepresentationthatis fastto evaluatewith little memoryuse. While it is possibleto derivesmoothlyjoining patcheswithoutbeingableto look at theneighbor(by deriving a uniquenormalalongthecommonboundaryfor eachof the abutting patches)the correspondingsurfacerepresentationsareexpensive: Nielson’s adaptationof the Coon’s patch[11] forexample(or [7], [1]) yields surfacepiecesof high rationaldegreeandwith (removable)singularitiesat thevertices.Theexactsurfacenormalsarea challengeto compute.Polynomialtangentcontinu-ousconstructionsrequireseveralpiecespertriangle,e.g.aClough-Tocher-like split [2], [16],[15] sincethetangentsof oneedgemustnottake informationfrom theneighboringedgeinto account.(BoththeoriginalPowell-Sabin[14] andClough-Tocherconstructionsdonotapplyin thesettingof free-formsurfaces.)Sincetangentconti-nuity doesnot imply overallbettervisualimpression(smoothinter-polatingschemesoftengenerateextraneouscreases,seeFigure12),wesettledfor a leastcostsurfacewith onepolynomialpiecepertri-angle. Its geometricshapeis not necessarilynormal-continuous,but we improve the shadingmonotonicityby prescribinga sepa-rate,continuousnormal.In [17] a morecomplex constructionwithquadraticpiecesis used.

The modelingrange of our surface representationshould, forexample,captureinflectionsimplied by the trianglepositionalandnormaldata. This requiresat leastcubic geometry(quadraticsdonothavestrict inflections)andquadraticnormals.Thechoiceof thecentercoefficient � @=@=@ , in particular, allowsusto bulgethePNtrian-gle. Thereis no additionaldatato suggesttheuseof higherdegreepatchesandsowe settledon the form of � and K given above. Ofcoursetherearemany possiblechoicesfor thecoefficients.Thepar-ticularchoicedescribedin thenext sectionhasthemeritof keepingthecurvedpatchprovably closeto theflat trianglewhile interpolat-ing its cornerpositionandnormals.

3 PN triangles

This sectionspecifiesanddiscussesthepropertiesof thechoiceofPNtrianglegeometryandnormalsrespectively. Thegeometrycom-

Page 4: Curved PN Triangles

Figure 6: Constructionof a tangentcoefficient: project %BRSP @ >P � '=T 3 into thetangentplaneat P @ .ponentwill influence,in particular, the object silhouetteand thenormalcomponentinfluencesthelighting calculation(vertex shad-ing). Thealgorithmassumesan input in the form of vertex arrays,i.e. thereis a uniquenormalfor eachvertex; however, therearesit-uationswhentwo triangulationsareto be connectedacrosssharpedges.Thelastsubsectiondiscussesthis case.

3.1 Geometr y coefficients of the PN triangle

We are given the positions P @ � P � � P �VUXW � and normalsQ @ � Q � � Q � UYW � of the trianglecornersas shown in Figure5.Our choiceof coefficients(controlpoints) � * -./ is asfollows.

0 Spreadthe � * -./ out uniformly over theflat triangle,i.e. place� * -./ in theintermediateposition % 6 P @ > 7 P � > 9 P � '=T 3 .1 Leavethevertex coefficientsin placesothey matchthecorner

positions.

2 For eachcorner, project the two tangentcoefficients closestto thecornerinto the tangentplanedefinedby the normalatthe corner. Hereprojectionmeans:find the closestpoint ontheplaneto thepoint. This is illustratedby Figure6. Recallthat the projectionof a point Z onto a planewith normal Qattachedtoapoint P is Z\[��;Z]�E�^Q where���_%`Za� P\'2bcQand b denotesa thedot product.

3 Move thecentercoefficient from its intermediateposition dto theaverageof all six tangentpointsandcontinueits motionin thesamedirectionfor �eT�R thedistancealreadytraveled.

In formulasfor implementation,coefficientsor controlpointsof thecurvedPNtrianglearedefinedasfollows:

� �=<=< ��P @ �� <=�=< ��P � �� <=<=� ��P � �� * - �f%`P - �gP * 'hbiQ * UjW here‘ b ’ is thescalarproduct�

� �A@B< �f%BRSP @ > P � �!� @C� Q @ '=T 3 �� @C�D< �f%BRSP � > P @ �!� �A@ Q � '=T 3 �� <F�A@ �f%BRSP � > P � �!� �D� Q � '=T 3 �� <.@C� �f%BRSP � > P � �!� �F� Q � '=T 3 �

Figure 7: Coefficients of the normal componentof a curved PNtriangle.

� @B<F� �_%BR�P � > P @ �k� �.@ Q � '=T 3 �� �D<.@ �_%BR�P @ > P � �k� @B� Q @ '=T 3 �l �_%&� �A@B< > � @C�D< > � <F�A@ > � <.@C� > � @B<F� > � �D<.@ '=T HdM�_%`P @ > P � > P � '=T 3 �� @=@=@ � l > % l �gdm'=T�RnJ3.2 Proper ties of the PN triangle geometr y

While smoothingout contours,the curved PN triangleshouldnotdeviate too muchfrom the original triangle to preserve the shapeandavoid interferencewith othercurved triangles. Evidently, thefinal geometryinterpolatestheverticesof theoriginalflat triangles.Let o be the lengthof the longesttriangleedge. The lemmabe-low shows that eachcubic boundarycurve stayscloseto its edge,becauseits Beziercoefficientsstaywithin a radiusof opT H of theedge. Therefore

lis within a distanceo?T H from the flat triangle

and,since d lies on the triangle, � @=@=@ ’s distanceto the triangleisat most opTeq . An improvedestimate,sincethecoefficientsareonlyapproximate,yields opT H thefor thecenterand opTSr for thebound-ary.

Lemma 3.1 Thecoefficient � �A@B< lies on a circle of radius s.P @ �P � s.T H about P @ > @t %`P � ��P @ ' .Proof [Thalesof Milet, 500B.C.] Thelocusof all right trianglecornersabove a line of length o?T 3 is a semicircleof radius o?T H .u&v

Symmetrysuggestsaformulaof thetype � @=@=@ �_%D�8�\w(' l > wxdfor the centralcoefficient. The specificchoice w��y�z�iT�R whichresultsin � @=@=@ �_%D�:�mw(' l > w(d{� 3 l T�R|�}dmR � l > % l ��d '=T�Rreproducesquadraticpolynomialsexactly asshown by Farin[5]. Inotherwords, if the othernine coefficientswerealreadychosentorepresenta quadraticpolynomialpatch,then wg�_�z�eT�R makesthePN triangleequalto thequadraticpolynomial. Alternatively, � @=@=@is the averageof the threechoicesthat eachmake onetransversaltangentfunctionlinear.

If weassumethatthetrianglesstemfrom atriangulationthathasonenormalassociatedwith eachvertex, thentheboundarycurvesof abutting PN trianglesaregeneratedby thesamealgorithm,and

Page 5: Curved PN Triangles

Figure8: Linearinterpolationof thenormalsat theendpoints(top)ignoresinflectionsin thecurvewhile thequadraticnormalconstruc-tion of curvedPNtriangles(bottom) picksupsuchshapevariations.

the surfaceis continuous,i.e without cracks. PN trianglesdo notusuallyjoin with tangentcontinuityexceptatthecorners.If they al-waysdid, wewouldhavesolvedanopenproblemof approximationtheory: whethertheverticesof a triangulationcanbe interpolatedby a ~ @ functionwith onecubicpiecepertriangle.

3.3 Normal coefficients of the PN triangle

Thenormalto thegeometrycomponentof thePNtrianglesdoesnotgenerallyvary continuouslyfrom triangleto triangle(c.f. Figure1(c)). Thereforewedefineanindependentlinearor quadraticnormalvariation. Thevalueof thenormalat a parameterpoint � � underlinear normal variation is thenormalizedaverageof the valuesatthevertices:

Q�%&� � '�� �s � s� � �_%D���!�a�! 'DQ @ > �:Q � > nQ � J

Sincethe shadingstageof the pipelinereceivessubtriangleswithnormals,say Q�%&� � ' � Q�%&� >��0� ' � Q�%&� � >M� ' for somestep-length

�, linearvariationof thenormalapproximatesPhongshad-

ing.

Linearly varying normalsignore inflectionsin the geometryasillustratedin Figure 8 (top). We thereforeprovide the option ofquadratic normal variation. To captureinflectionsasin Figure8(bottom) a mid-edgecoefficient for the quadraticmap K is con-structedfollowing e.g.[12]: the averageof the end-normalsis re-flectedacrossthe planeperpendicularto the edgeasillustratedinFigure9. Recallthatthereflection � [ of a vector � acrossa planewith (unnormalized)normaldirection � is � [ �f����RS n� where ���%`�Mbe�^'=T%`�Mb2��' and b denotesa thedotproduct.Figure1 (d)illustratesthis choiceof normal.

In formulasfor implementation,coefficientsor controlpointsofthe normalcomponentof a curved PN trianglearedefinedasfol-

Figure9: Constructionof themid-edgenormalcoefficient K @=@B< forquadraticallyvarying normals: the averageof the end-normalsisreflectedacrosstheplaneperpendicularto theedge.

lows for sAQ * s���� (c.f. Figure7):

K �D<=< �;Q @ �K <F�D< �;Q � �K <=<F� �;Q � � * - ��R %`P - �gP * 'hb�%`Q * > Q - '%`P - ��P * 'xb�%`P - �gP * ' U�WK @=@B< � � @=@B< T8s � @=@B< s ��� @=@B< �;Q @ > Q � �! @C� %`P � ��P @ ' �K <.@=@ � � <.@=@ T8s � <.@=@ s ��� <.@=@ �;Q � > Q � �! �D� %`P � ��P � ' �K @B<.@ � � @B<.@ T8s � @B<.@ s ��� @B<.@ �;Q � > Q @ �! �.@ %`P @ ��P � 'AJ

The valuesof K are normalizedbeforethey arepassedon to thevertex shadingstageof thepipeline.

3.4 Curved Sharp Edges

So far we assumedthat the dataoriginatedfrom a triangulationwith onenormalassociatedwith eachvertex. This implies thatwesmoothout all edges.To modelsharpor creaseedges,saya hemi-spherecappedby a disc, we would like to connecttwo triangula-tions by identifying verticeson their global boundaryto form thecrease.Evidently, theverticeson thecreasenow have two distinctnormalsand this must lead to cracksin the surfaceif only infor-mationbasedon oneof the two flat trianglesis available. Splineandgeneralizedsubdivision surfacessolve theproblemby taggingthevertices,respectively searchingtheneighborhoodandrecogniz-ing global boundarystatus. The argumentbelow shows that withentirelylocal information,crackscannotbeavoided.

Observation 3.1 (curved sharp creases) If two patches share avertex but not thecorrespondingnormal,there is no strategybasedonlyon thevertex andnormalinformation(andrespectingthever-tex andnormalinformation)local to onepatch at a timeto generatethesamecurvetangent for eitherpatch independentof thenormalinformationof theother.

Proof The tangentof the curve is definedasthe intersectionoftwo planes,eachdefinedby thevertex andoneof thetwo normals.Sinceonly oneplaneis known whenconstructingeachpatchacon-sistentchoiceis only possibleby chance. u&v

Page 6: Curved PN Triangles

Figure10: Sharpeninga blunt axe (left two) by addinga seamofsmalltriangles(right). Smalltrianglesat thebottomalsoisolatetheshaftfrom its endto keepit morecylindrical.

Theobservation impliesthatcurvedsharpcreaseswith differentnormalsassociatedwith eachsideof the(logical)edgebetweentwotriangleswill in generalresultin gapsin thesurface.

An exceptionis the PN constructionwhen the normalsat twoendpointsconsistentlyimply a straight line segmentas commonboundary, e.g.when both normalsare perpendicularto the edge.We are consideringseveral options to also supportcurved sharpcreases,e.g. increasingthe numberof indicesin the input streamfrom threeto (at most)ninefor triangleswith up to six creasehalf-edges.Theadditionalindicespoint to thepoint-normalpair of theabutting trianglein the neighboringtriangulation.This setupsup-portsdarts,i.e. edgesthat aresharpat oneendandsmoothat theother, aswell asgenericcreaseedges.

The algorithmfor determiningthe PN trianglegeometryis un-changedexceptthatwenow projectontoatangentline to obtainthetangentcoefficient of anedge:let Q @ and Q � be the two normalsassociatedwith thecreasepoint P @ alongtheedgeP @ P � . Then � �A@B<hasto lie ontheline P @ >�� %`Q @0� Q � ' where

�is thecrossproduct

and � �A@B< is theprojectionof %BR�P @ > P � '=T 3 ontothatline:

� �A@B< ��P @ > %`P � �gP @ 'xb.�3 � � �;�;Q @ � Q � J

Currently, as illustratedin Figure10, a softwarepreprocessingstepaddsa rim of smalltrianglesalongedgesintendedto besharp.

4 Hardware Performance

As Figure 2 illustrates, curved PN triangles are generatedandtesselatedin the pipeline stageinsertedbetweenthe vertex-and-primitive-assemblystageandthevertex-shadingstage.Thevertex-and-primitive-assemblystagecombinesmultiple streamsof datasuchas3-spaceposition,3-spacenormal,3-spacetangentvectors,texturecoordinatesandcolors. Of these,thePN triangleconstruc-tion only usesposition andnormal data. The other dataare for-wardedto the subtrianglestypically by linearly interpolatingthevaluesat the verticesof the flat input triangle. Vector-valuedat-tributescanalsousequadraticinterpolation.Becausetheinputandoutput trianglesof the curved PN triangle stageare of the sameformat,theimpactonthedesignonadjacentpipelinestagesis min-imal.

To getan initial estimateof the impactof insertingthetriangle-spawning PN trianglestage,we determinedthe numberof vectoroperationsfor eachoutput subtrianglevertex. The vector opera-tions aredot products,additionsof two vectors,scalingandper-componentmultiply of two vectors. The currentimplementationusesbetween6.8 and11.6 vectoroperationsper generatedvertexdependingon thenumberof evaluations.lod 2 and3 (seeFigure4) have thehighestratioof vectoroperationspervertex.

Figure11: Maskof PN triangleswith linearlyvaryingnormal(left)andquadraticallyvaryingnormal(right).

To get a moredetailedestimateof the impact,we needto con-siderfill rateandvertex shading.Fill rateis not a bottlenecksincethe screenareain pixels is unchanged.Vertex shading(transfor-mationandlighting) andtrianglesetup,on theotherhand,have tocopewith alargernumberof vertices.Theoverall renderingperfor-mance,in many applications,is, however, limited by thebandwidthneededto feed verticesto the graphicsprocessorratherthan thegraphicsprocessorcycles available for the geometry. Therefore,if the processoris sufficiently fastandthebus is busy, curved PNtrianglesrenderat thesamespeedasflat triangles.

Allowing a higher-order surfaceprimitive, suchas curved PNtriangles,to be passeddirectly to hardwareis a form of geometrycompressionthatreducesbustraffic into thegraphicschip. PN tri-angles,like other curved surfaceprimitives, can act asa level ofdetail mechanism.Sincethe input to the PN trianglestageis thelowestlevel of detail,aflat triangle,its storagecostsandbandwidthusageare minimal; and we can obtain higher levels of detail onthe fly. If, instead,a developerwereto storemodelsfor lod 0-4(Figure4) shewould needapproximately70 timesthe amountofmemory.

Key-frameinterpolationis anotherinstancewherePN trianglessubstantiallyenhanceperformance.Given two modelswith iden-tical topology, eithertheCPUor thegraphicsprocessormustgen-erateinterpolatedvaluesbetweenthe vertex positionsof the twomodels.An applicationcanreducethenumberof verticesit hastostoreby applyingthe PN trianglealgorithmafter key-frameinter-polation.

In summary, PN trianglescanbe viewed asa methodfor com-pressinggeometry. Both busbandwidthandmemoryusagecanbesubstantiallyreducedby employing coarserinputandPNtriangles.

5 Visual Results

Figure11 highlights the differencein visual appearancebetweencurved PN triangleswith linear and with quadraticnormal. Attimes,thePN surfacerenderingis evenpreferableto theexactren-dering of higher quality surfaces. Figure 12 placesnext to eachothera 20-triangleconerefinedwith Butterfly interpolatingsubdi-vision [4] (which convergesto an almosteverywhere~ � surface)andthegeometricallynon-smoothsurfaceof curved PN triangles.Surfacesgeneratedwith modifiedButterfly [18] andinterpolatory� 3 subdivision ([9], Figure10) exhibit thesameextraneousoscil-lationsasButterflyinterpolatingsubdivision. Ourexperimentswith

Page 7: Curved PN Triangles

Figure 12: Input ‘diamond model’ (top), Butterfly interpolatorysubdivision [4], (left), andthe curved PN trianglesurface(right).(Comparealsowith modifiedButterflyandinterpolatory

� 3 subdi-visionshown in Figure10of [9]).

charactersfrom existinggamesdemonstrateanappreciableincreasein visualqualityalreadyfor lod 1 or 2; themodelsrenderedontheright in Figure13 uselod=6.

6 Conc lusions and Future Work

Curved PN trianglesaim at providing a smoothersilhouetteandmoreorganicshapefor triangle-basedmodelsata minimalcostformodelpreparation,applicationprogrammodification,andrender-ing performance.CurvedPN trianglescanbeviewedasa trianglemultiplier in thateachPN triangletakeson inputa flat triangleandoutputsmany subtrianglesin the sameformat. Sendinga coarsertriangulationto be renderedcanthereforebe viewed asa form ofgeometrycompressionthatreducesbandwidthrequirementsandal-lows moregeometryto be deliveredto graphicsmemory, becausethe subtrianglesultimately renderedexist only on the chip. Theunderlyingarchitectureis a first steptowardssupportingmuchne-glectedtriangle-basedsurfacesat thehardwarelevel.

Ackno wledgments

We would like to thankour colleagesat ATI Research,especiallySteve Morein, Clay Taylor, VineetGoelandAndy Gruber, aswellasCharlesLoop from Microsoft ResearchandXiaobin Wu at theUniversity of Florida for their input. The conferencecommittee,especiallyCarlo Sequin,provided a variety of useful suggestionsto helpmake this a strongerpaper. We would alsolike to thankidSoftwarefor themodelsusedin Figure13,andSamHowell of ATIResearchprovidedsomeof theothermodelsandillustrations.

References

[1] H. ChiyokuraandF. Kimura. Designof solidswith free-formsurfaces.In SIGGRAPH83 ConferenceProceedings, volume17(3),pages289–298,July1983.

[2] R. CloughandJ.Tocher. Finiteelementstiffnessmatricesforanalysisof platesin blending. In Proceedingsof ConferenceonMatrix Methodsin Structural Analysis, 1965.

[3] P. deCasteljau.Outillagesmethodescalcul.Technicalreport,A. Citroen,Paris,1959.

[4] Nira Dyn,David Levin, andJohnA. Gregory. A butterflysub-divisionschemefor surfaceinterpolationwith tensioncontrol.ACM Transactionson Graphics, 9(2):160–169,April 1990.

[5] GeraldFarin. Smoothinterpolationto scattered3D data. InRobertE. Barnhill and Wolfgang Boehm,editors,Surfacesin Computer-AidedGeometricDesign, pages43–63.North-Holland,1983.

[6] GeraldFarin.TriangularBernstein–Bezierpatches.ComputerAidedGeometricDesign, 3(2):83–127,1986.

[7] J.A. Gregory. Smoothinterpolationwithouttwistconstraints,pages71–88.AcademicPress,1974.

[8] L. Kobbelt.� 3 subdivision. SIGGRAPH2000Conference

Proceedings, pages103–112,2000.New Orleans.

[9] U. Labsik andG. Greiner. Interpolatorysqrt(3)-subdivision.In M. GrossandF. R.A. Hopgood,editors,ComputerGraph-icsForum(Eurographics2000), volume19(3),2000.

[10] CharlesT. Loop. Smoothsubdivision surfacesbasedon tri-angles,1987. Master’s Thesis,Departmentof Mathematics,Universityof Utah.

[11] G. Nielson. A transfinite, visuallycontinuous,triangular in-terpolant, pages235–246.SIAM, 1987.

[12] C.W. A. M. VanOverveldandB. Wyvill. Phongnormalinter-polationrevisited. ACM Trans.on Graphics, 16(4):397–419,October1997.

[13] J.Peters.Smoothingpolyhedramadeeasy. ACMTransactionsonGraphics, 14(2):161–169,April 1995.

[14] M. J.D. Powell andM. A. Sabin.Piecewisequadraticapprox-imationson triangles. ACM Transactionson MathematicalSoftware, 3(4):316–325,December1977.

[15] L. A. Shirmanand C. H. Sequin. Local surface interpola-tionwith Bezierpatches:Errataandimprovements.ComputerAidedGeometricDesign, 8(3):217–222,August1991.

[16] Leon A. ShirmanandCarlo H. Sequin. Local surfaceinter-polationwith bezierpatches.ComputerAidedGeometricDe-sign, 4(4):279–295,December1987.

[17] K van Overveld and B. Wyvill. An algorithm forpolygon subdivision based on vertex normals. 1997.http://www.win.tue.nl/cs/tt/kees/graphics.references.

[18] DenisZorin, PeterSchroeder, andWim Sweldens.Interpolat-ing subdivision for mesheswith arbitrarytopology. In SIG-GRAPH96 ConferenceProceedings, pages189–192,1996.

Page 8: Curved PN Triangles

Figure13: A family of gamecharacters(left) andtheir PN trianglecounterparts(right). Themodelswereprovidedby id Software.Noneofthesecharacterswereauthoredwith PNtrianglesin mind.