TheModeling-RenderingParadigm EECS487:Interactive ComputerGraphics Renderer: Modeler: Modelingcomplexshapes Vertexdata • noequationforachair,face,etc. Fixedfunction transformand lighting • instead,achievecomplexityusing • polygons,parametricsurfaces,or Lecture36: • Polygonalmeshsimplification Vertexshader simplepieces implicitsurfaces scenegraph Clip,homogeneous divideandviewport Rasterize • witharbitraryprecision,inprinciple Texturestages Fragmentshader Fragmentmerging: stencil,depth 2D:RangeImage 3DGeometryRepresentations Representdifferentkindsofinformation: pointdata,surfacedata,volumetricdata Imagewithdepthinformation Points Solids • 2D:rangeimage • ConstructiveSolidGeometry • notacomplete3Ddescription:doesnotinclude • 3D:pointcloud • Voxels Surfaces Procedural • Polygonalmesh • Particlesystem • Parametricsurfaces • Spring-masssystem • Subdivisionsurfaces • Fractals • Implicitsurfaces • acquiredfromrangescanner,incl.MicrosoftKinectand GoogleTango partofobjectoccludedfromviewpoint Cyberware Curless Rangeimage Tessellation Funkhouser Rangesurface Funkhouser,Ramamoorthi Surfaces 3D:PointCloud Unstructuredsetof3D pointsamples Boundaryrepresentation(B-reps) • sometimesweonlycareaboutthesurface,e.g.,when renderingopaqueobjectsandperforminggeometric computations Acquiredfromrangefinder Disadvantage: nostructuralinfo • adjacency/connectivityhave tousee.g.,k-nearest neighborstocompute Increasinglyhottopicin graphics/visiontoday 3Dsurface triangles Microscribe3D Funkhouser,Ramamoorthi,Ohtake Chenney,Lozano SolidModeling ChoosingaRepresentation Somerepresentationsarebestthoughtofas definingthespacefilled Efficiencyfordifferenttasks: • medicaldatawithinformationattachedtothespace byfittingtomeasurements • interaction/manipulation:simplification, compression,localcontrolofshapefor modeling,animation,etc. • geometriccomputation:distance,intersection, normalvectors,smoothnessandcontinuity, abilitytoevaluatederivatives,curvature, similaritycomparisons,indexing,search • storageandtransmission:compactness • rendering,e.g.,withhardwareaccelerator: converttopolygon • creation/acquisition:byhand,procedurally, • transparentobjectswithinternalstructure • takingcutsoutofanobject, “WhatwillIseeifIbreakthisobject?” 3Dvolume volumeelement “voxel” Chenney,Lozano Funkhouser,Chenney AdvantagesofRepresentations WhatdoPeopleUse? Manipulation: Trianglemeshesmostwidelyused Subdivisionsurfacesusedalotinmovies • splineseasiestoriginally,butnow manyalgorithmsforpolygonmeshes Splinepatchesusedbymodelingprograms ConstructiveSolidGeometry(CSG)usedfor modelingmachineparts Volumedatausedinmedicalimaging Acquisitionandmodeling: • splines,CSGoriginallyusedformodeling • butincreasinglycomplexmeshes,rangeimages, andpointcloudacquiredfromrealworld Simplicity:meshes Rangeimagesusedinimage-basedrendering Pointcloudsbecomingincreasinglyrelevant, especiallywithcomputervision Efficienthardwarerendering:meshes Ramamoorthi ComparisonofB-Reps Features Polygonal Implicit Parametric Subdivision Mesh Surface Surface Surface Ramamoorthi PolygonalMesh Accurate ✗ ✔ ✔ ✔ Introductiontofivetopics: Compact ✗ ✔ ✔ ✔ 1. howtodrawgoodlookingmeshes? Intuitive ✗ ✗ ✔ ✗ 2. meshsimplification Local Affine ✔ ✔ ✗ ✔ ✔ ✔ ✔ ✔ 3. levelofdetail Realobjects ✔ ✔ ✗ ✔ Continuity ✗ ✔ ✔ ✔ Parameterization Rendering ✗ ✔ ✗ ✗ ✔ ✔ ✗ ✔ Intersections ✗ ✔ ✗ ✗ 4. meshrepresentation 5. errorcheckingandmeshprocessing Funkhouser DelaunayTriangulation DualMeshesandVoronoiDiagram Howtocreatea“goodlooking” trianglemeshfromasetofpoints? Thedualofameshexchangesitsfacesandvertices • minimumverticesandtriangles • fewer,largertriangles • nosliver Edgesindualcrossoriginaledges • placenewverticesatcentroidoffaces • atrightangles • atmidpoints AtriangulationisDelaunayifffor eachedgethecircumcircleofan adjacenttriangledoesnotcontaintheoppositevertex • (butmightnotactually“cross” ifnewvertexisatoriginaledge) DualofaDelaunayTriangulation isaVoronoiDiagram Amongallpossibletriangulations,theDelaunay triangulationmaximizesthesmallestangle • aVoronoifacedenotesaregioncloserto agivenDelaunay(original)vertexthanto anyotherDelaunayvertex Rhymeswith“baloney” [Hart,Bischoff&Kobbelt] MeshSimplification Hart,vanLaerhoven MeshSimplification Morepolygonsincreasesmodelaccuracy,but requiresmorespaceandprocessing/renderingtime Reducepolygoncount: • lessstorage • fasterrendering • simplermanipulation • needforaccuracydependsontheapplication • gamevs.medicalimaging • approximatesolutionsvs.finalsimulations • screenresolutionorviewingdistance maynotcallforaveryaccuratemodel Simplificationalgorithms: • vertexclustering • meshretiling • meshdecimation • meshoptimization Acquisitionsystems(e.g.,3Dscanner) oftenproducehugemodels • moredetailedthannecessary Desiredproperties: • generalityintypesofmesh • efficiencyandscalability • qualityofapproximation • visual • geometric:topologicalmodifications • controlofapproximationquality • continuousLoD • smoothtransitionsbetweenmodels • millionsofpolygonsperobjectarecommon • billionsofpolygonsperobjectarestartingtohappen • 300millionfaces=3.7GBaftergzipcompression Yu Funkhouser VertexClustering MeshRetiling Resamplemeshwith “uniformlyspaced” randomvertices: Method: • partitionspaceintocells • grids,spheres,octrees,... • mergeallverticeswithinthesamecell • triangleswithmultipleverticesinonecell degenerateintolinesorpoints • generaterandom verticesonsurface • spreadthemuniformly usingdiffusion/repulsion • triangulatevertices Properties: • generalandrobust • allowstopological Properties: changes • notbestquality • slow • blurssharpfeatures Hart,Funkhouser ManifoldSurface MeshDecimation LetMbeasurfacein3D Simplificationalgorithm: • eachoperationsimplifiesthemodelbyasmallamount • applymanyoperationsinaniterative,greedyfashionto Misamanifoldiffaneighborhood ofanypointpinMistopologically good equivalenttotheunitopendisk (interiorofaunitcircle) graduallyreducecomplexityofmesh: 1. 2. 3. 4. Funkhouser,Turk measureerrorintroducedbypotentialdecimationoperations placeoperationsinapriorityqueuesortedbyerror performoperationsinqueuesuccessively aftereachoperation,re-evaluateerrormetrics Topologicalequivalence(or homeomorphism)allows deformationthatdoesnotrip, tear,orpokeholes Typesofoperations: • vertexremove • edgecollapse • vertexcluster(virtualedgecollapse) Onamanifoldsurface: First,sometopologicalpropertiesofmeshes... TP3,Funkhouser • everyedgeissharedbyexactly2faces • aroundeachvertexexistsaclosedloopoffaces bad partof manifold surface Hart,TP3 PiecewiseLinearManifolds ManifoldswithBoundary M’isamanifoldwithboundaryiffaneighborhood ofanypointpinM’ishomeomorphictoahalfdisk Closedmesh Nodanglingfaces Onamanifoldwithaboundary: • edgesontheboundarybelongto exactlyoneface • aroundverticesontheboundary theloopoffacesisopen A3Dsurfacethatisamanifoldsurface withoutboundaryisaclosedsurface Edgesonlyboundtwofaces Watertight non-manifoldedge • noholesinthesurface • noboundary • orientable amanifoldsurface withboundary TP3 OrientableSurface Orientablesurfacehas2sides, likeapieceofpaper Byconvention,thenormalofa closedorientablesurfacepoints“outwards” TheMöbiusstripandKleinbottleare non-orientablesurfaces: dangling face non-manifold boundaryvertex Hart,TP3 VertexRemove Method • removevertexandadjacentfaces • fillholewithnewtriangles (2lesstriangles) Properties • requiresmanifoldsurfacearoundvertex • preserveslocaltopologicalstructure • filingholewellmaynotbeeasy TP3,EscherKarcher,Chu-Carroll, Hart,Funkhouser,Ramamoothi VirtualEdgeCollapse EdgeCollapse A.k.a.vertex-paircontractionorvertexcluster Method • mergetwoedgeverticesintoone • deletetwodegeneratetriangles • joinspreviouslyunconnectedareas • allowstopologicalsimplification • usuallylimitedtosmalldistance vertexsplit edgecollapse toavoidO(N2)virtualedges • notbestquality Properties • requiresmanifoldsurfacearoundvertex • preserveslocaltopologicalstructure • allowssmoothtransition Hart,Funkhouser Hart,Manocha IterativeEdgeCollapse SimplicialComplexSurface Properties • well-definedforanysimplicial Asurfaceissimplicialcomplexiff complexsurfaces • polygonsmeetonlyalongtheiredges • induceshierarchyonthesurface: • edgesintersectonlyattheirendpoints allowssmoothtransition(geomorph) • currentlymostpopulartechnique (standardfeatureinDirect3D) yes not TP3 Hart,Funkhouser,Watt00 LevelofDetail(LoD)Pyramid ErrorMetricsforSimplification Singleresolutionnotenough Usedtorankedgesduringsimplification • reflectsamountofgeometricerrorintroduced • applicationcontextdictatesrequireddetail • contextvariesovertime(andspace) • maindifferentiatingfeatureamongalgorithms Levelofdetail: • replaceeachobjectinthescenegraphwithahierarchy ofobjectsatdifferingresolutions • choosethemodelappropriateforcurrentcontext: collisiondetectionvs.rendering,frameratevs.quality Mustaddresstwointerrelatedproblems • whatisthebestcontractiontoperform? • whatisthebestpositionv’forremainingvertex? • canjustchooseoneoftheendpoints • butcanoftendobetterbyoptimizingpositionofv’ SeeTP3 §6.5fordetailsJ Hart RTR, Hodgins ContinuousLoD DiscreteLoD Needformulti-resolutionmeshes: Givenamodel,buildasetofapproximations • toreduce“popping”whenswitchingmodels, • canbeproducedbyanysimplificationsystem • atruntime,simplyselectwhichtorender • fairlyefficient geometricmorphbetweentwoLoDs • sometimescannotchooseasingleLOD,mayneeddifferent amountsofdetailsonthesamesurface(seenextslide) • progressivetransmission(detailincreasesovertime) • storagerequired< 2xoriginal • costofchanginglevelofdetailwhilerenderingnotsignificant • imagepyramids(mip-maps)agoodexample Inter-frameswitchingcauses“popping” • cansmoothtransitionwithimageblending • orgeometryblending(requirescontinuousLoD) Supportedbyseveralscenegraphs: • RenderMan,OpenInventor,IRISPerformer,... Hart Funkhouser,Certainetal. ProgressiveMeshing ProgressiveMeshing Iterativelydecimateameshusingedgecollapse Storetheinversevertexsplitforeachcollapse Themostsimplifiedmesh(basemesh)and vertexsplitrecordsformtheprogressivemesh: ecoln-1 ecoli ecol0 M = Mn … M 175 … M1 M0 13,546 3478 500 152 RatherthanafewdiscreteLODswehaveafullrange • vertexsplitdoesnotrequiremuchstorage • themeshesareflexibleandeasilyreversible • requiresoriginalpositionstobekeptwitheachedgecollapse Supportforselectiverefinement • requiresmoreinfoonadjacentvertices andfacesofeachcollapsededge 150 Cangeomorphsmoothly betweenLODs • minimizes“popping” Mn … vspln-1 Mi … M 175 … M1 vspli-1 M0 =M vpsl0 View-DependentSimplification Commonlyusedforterraingeneration TerrainclosetoviewerisshownwithagreaterLoD Preserve: • silhouette • specularhighlights Manocha,TP3 Hoppe96,Manocha,Funkhouse r cluster PolygonalMesh Introductiontofivetopics: 1. howtodrawgoodlookingmeshes? 2. meshsimplification 3. levelofdetail 4. meshrepresentation 5. errorcheckingandmeshprocessing Manocha,Hoppe PolygonalMeshRepresentation PolygonalMeshRepresentation Extension:moretopologyinformation:inaddition toalistofvertices,eachfacealso Howwouldyourepresentapolygonalmesh? (x , y , z ) (x , y , z ) Threealternatives: 3 3 3 4 4 • pointstoitsadjacentfaces • andforeachadjacentface,theindexofthesharededge 4 1. explicitmesh(facelist) 2. vertexlist 3. edgelist Especiallyconvenientforsubdivisionandmultiresolution hierarchies (x1, y1, z1) (x2, y2, z2) Importantproperties: • efficienttraversaloftopology(fordrawing,e.g.) • efficientuseofmemory(compactness) • efficientupdates(UI,vertexremoval,computingpervertexnormals) [Zorin,Bischoff&Kobbelt] PolygonalMeshRepresentation PolygonalMeshRepresentation Adjacencyoperationsimportantinmesh simplificationandmanyotherapplications: Explicitmeshor“polygonalsoup”model: alistofpolygonalfaces • givenface,finditsvertices Example:P = {P1, P2, P3, …, Pn} P1= ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3)), P2= ((x3, y3, z3), (x2, y2, z2), (x4, y4, z4)) Problems: • givenvertex,findfacestouchingit • givenface,findneighboringfaces • givenvertex,findneighboringvertices • givenedge,findverticesandfacesittouches • sharedverticesareduplicated • notopologyinformation(e.g.,whichvertices andedgesareshared),mustsearchthewhole listtomodifyavertex • roundofferrors:cracksandfailuretomatchvertices Ramamoorthi PolygonalMeshRepresentation PolygonalMeshRepresentation Vertexlistor“indexedfaceset”: Edgelist: Example:V = {(x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)}, P1 = (v1, v2, v3), P2 = (v3, v2, v4) Example:V = {(x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)}, E1 = (v1, v2, P1, ø), E2 = (v2, v3, P1, P2), E3 = (v3, v1, P1, ø), P1 = (E1, E2, E3), P2 = (E2, E4, E5) Characteristics: • sharedverticesarestoredonlyonce • butstillnotopologyinformation: Usedin 3dsmax, X3DOBJ fileformat findingsharededgesstillrequiresasearch Extension“wingededge”: • eachedgepointsto: • twoendpointvertices • twofacesthatshareedge • fouredgesemanatingfromitsendpoints • faces,verticescontainpointertooneedge Extension:triangleneighborlist: • vertexpointstoasingleneighboringtriangle • trianglepointstoitsthreeneighboringtriangles • canenumeratetrianglesaroundavertex Marschner PolygonMeshErrorChecking Polygonmeshcanarriveinerror duetohumanerrorsorscannerlimitations Thingstocheck: Marschner PolygonMeshProcessing Topologicalfixups:fixholes,cracks,self-intersection • everyvertexisanendpointtoatleasttwoedges • everyedgeispartofatleastonepolygon • everypolygonisclosed • everypolygonhasatleastonesharededge Otherchecks: • vertexnormal • normaltotheplane • plane’simplicitfunction • convexornot • holes?surfacewatertight? Podolak Borodin Funkhouser TheProblemswithPolygons Notaverycompactrepresentation • needsalotofflatelementstorepresent smoothorhighlydetailedsurfaces • accuracy:exactnessofrepresentationcanonly beapproximatedbyincreasingthenumberofpolygons • ifimageisenlarged,planarsurfacesagainbecomeobvious Intersectiontest?Inside/outsidetest? Hardtoedit • creatingpolygonalobjectsisstraightforward… thoughlaboriousandtedious • howdoyoueditapolygonal-meshsurface? • don’twanttomoveindividualvertices… • difficulttodeformobject:aregionoflowcurvature,representedwithlow polygoncount,cannotbedeformedintoahighcurvatureregion • itismoreamachinerepresentationthanaconvenientuserrepresentation