Progressive Mesh. Reddy Sambavaram Insomniac Games

Similar documents
Mesh Simplification. Mesh Simplification. Mesh Simplification Goals. Mesh Simplification Motivation. Vertex Clustering. Mesh Simplification Overview

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

Efficient Minimization of New Quadric Metric for Simplifying Meshes with Appearance Attributes

CSE 554 Lecture 6: Fairing and Simplification

All the Polygons You Can Eat. Doug Rogers Developer Relations

Geometric Features for Non-photorealistiic Rendering

CGAL. Mesh Simplification. (Slides from Tom Funkhouser, Adam Finkelstein)

Mesh Decimation. Mark Pauly

Illumination and Geometry Techniques. Karljohan Lundin Palmerius

Appearance Preservation

Mesh Repairing and Simplification. Gianpaolo Palma

Applications. Oversampled 3D scan data. ~150k triangles ~80k triangles

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

Mesh Decimation Using VTK

Surface Simplification Using Quadric Error Metrics

3-Dimensional Object Modeling with Mesh Simplification Based Resolution Adjustment

A Developer s Survey of Polygonal Simplification algorithms. CS 563 Advanced Topics in Computer Graphics Fan Wu Mar. 31, 2005

As a consequence of the operation, there are new incidences between edges and triangles that did not exist in K; see Figure II.9.

Meshes: Catmull-Clark Subdivision and Simplification

CS 283: Assignment 1 Geometric Modeling and Mesh Simplification

Geometric Modeling. Bing-Yu Chen National Taiwan University The University of Tokyo

LOD and Occlusion Christian Miller CS Fall 2011

Triangle meshes I. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2017

To Do. Resources. Algorithm Outline. Simplifications. Advanced Computer Graphics (Spring 2013) Surface Simplification: Goals (Garland)

Triangle meshes I. CS 4620 Lecture 2

A Comparison of Mesh Simplification Algorithms

Real-Time Shape Editing using Radial Basis Functions

CS 4620 Midterm, March 21, 2017

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

Level Set Extraction from Gridded 2D and 3D Data

Direct Rendering of Trimmed NURBS Surfaces

Simple Silhouettes for Complex Surfaces

#Short presentation of the guys

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

Occluder Simplification using Planar Sections

CS 563 Advanced Topics in Computer Graphics Polygonal Techniques. by Linna Ma

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Streaming Massive Environments From Zero to 200MPH

CSE 163: Assignment 2 Geometric Modeling and Mesh Simplification

CS 130 Exam I. Fall 2015

Hardware Displacement Mapping

Variational Shape Approximation

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Geometric Modeling. Mesh Decimation. Mesh Decimation. Applications. Copyright 2010 Gotsman, Pauly Page 1. Oversampled 3D scan data

3D Modeling: Surfaces

and Recent Extensions Progressive Meshes Progressive Meshes Multiresolution Surface Modeling Multiresolution Surface Modeling Hugues Hoppe

Pipeline Operations. CS 4620 Lecture 14

Shadows in the graphics pipeline

CS 4620 Program 3: Pipeline

Ray Casting of Trimmed NURBS Surfaces on the GPU

Could you make the XNA functions yourself?

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Scientific Visualization Example exam questions with commented answers

Real-Time Hair Simulation and Rendering on the GPU. Louis Bavoil

Morphological: Sub-pixel Morhpological Anti-Aliasing [Jimenez 11] Fast AproXimatte Anti Aliasing [Lottes 09]

An Algorithm of 3D Mesh Reconstructing Based on the Rendering Pipeline

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Geometry Processing & Geometric Queries. Computer Graphics CMU /15-662

Who has worked on a voxel engine before? Who wants to? My goal is to give the talk I wish I would have had before I started on our procedural engine.

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

CS 354R: Computer Game Technology

Multiresolution Meshes. COS 526 Tom Funkhouser, Fall 2016 Slides by Guskov, Praun, Sweldens, etc.

Geometric modeling 1

Parallel Computation of Spherical Parameterizations for Mesh Analysis. Th. Athanasiadis and I. Fudos University of Ioannina, Greece

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

3D Rasterization II COS 426

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Pipeline Operations. CS 4620 Lecture 10

Cornell University CS 569: Interactive Computer Graphics. Introduction. Lecture 1. [John C. Stone, UIUC] NASA. University of Calgary

#Short presentation of the guys

Drawing Fast The Graphics Pipeline

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Curves and Surfaces 2

Spring 2009 Prof. Hyesoon Kim

Game Architecture. 2/19/16: Rasterization

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

Spring 2011 Prof. Hyesoon Kim

Real-Time Graphics Architecture

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

A General Simplification Algorithm

A Short Survey of Mesh Simplification Algorithms

AGDC Per-Pixel Shading. Sim Dietrich

The Graphics Pipeline

Simplification of Meshes into Curved PN Triangles

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

User Guide. Melody 1.2 Normal Map Creation & Multiple LOD Generation

Simplification. Stolen from various places

Triangle Rasterization

This blog addresses the question: how do we determine the intersection of two circles in the Cartesian plane?

Triangle meshes. Computer Graphics CSE 167 Lecture 8

Flowmap Generator Reference

Lecture 21: Shading. put your trust in my shadow. Judges 9:15

Transcription:

Progressive Mesh Reddy Sambavaram Insomniac Games

LOD Schemes Artist made LODs (time consuming, old but effective way) ViewDependentMesh (usually used for very large complicated meshes. CAD apps. Probably the future???) ViewIndependentMesh (started off as a retro fit to get view dependent ideas on to view independent meshes for the current gen games) Indexed based lod (we don t touch vertex data but re-hash index data for lods)

Factors affecting the choice of LOD Scheme Per Class memory (mesh representation data shared by all instances of the mesh) Instance memory cost Per-frame processing cost Complexity of the scheme (artist/set-up time needed) Vertex cache coherency

End of Resistance 1 Ties and ufrag had no lod Few mobys had discrete artist made lod (remember mn0, mn1 maya nodes ) We did have shader lod (where shader defaulted to cheaper version of itself [disabling detail etc..] at distance).

0 Index Lod Basics0 5 5 1 4 2 3 1 3 2 Tri indices: LOD Tri indices: 0,1,5 0,5,3 3,5,4 0,1,5 0,5,3 4,5,1 4,1,2 4,2,3 5,1,2 5,2,3 Collapse edge 4-5 by replacing index 4 with 5 and remove the triangles associated with that edge. If all the tris in above mesh were planar and it was flat shaded, we wouldn t perceive the difference among the two meshes Essentially at a given distance we want to collapse a certain set of edges (and remove the tris with it) such that the reduced mesh is indistinguishable from the hi-res one.

Advantages of the Index Lod No spu time needed No per instance memory unlike other lod schemes Just make the index offset point to different location per instance (vertex data un-touched) Minimal user time (mostly automatic) needed to set up the lod

Dis-advantages of Index lod Instead of collapsing one vertex on to another one, if instead we collapsed both vertices on to a new optimal one then we can get the distance at which we collapse much closer. Edge collapse is a discrete jump rather than a smooth transition But the benefits of minimal processing and lower memory requirements out-weighed the disadvantages for us.

Iterative Edge Contraction Every edge is assigned a cost (an estimate of visual quality degradation if we collapse it) Maintain edges in a heap keyed on cost At each iteration we extract the lowest cost edge and collapse it This greedy way of choosing the edges is a good compromise between a very fast low-quality methods and very slow high quality methods. It provides a good estimate of local shape and error

Quadric Error (PART 1) Each triangle of the original mesh satisfies the plane eq n v+ d = 0 T For a given edge collapse a->b, compute all the geometric error by computing sum of the errors by substituting a by b for all tris which involve a.

Quadric Error Squared distance of vertex to the plane ( Quadric : Q( v ) = D 2 = nt v + d ) 2 For a given edge collapse a->b, quadric error is defined as sum of all the quadrics defined by the faces involving a i.e., QuadricError : E ( a > b ) = ( ) = v t n t n v + 2dn t v + d 2 = v T Av + 2b t v + c TrisWith "a " TriArea Q( b ) For 3 dimensions we can easily visualize. Now extend it to n dimensions. Each vertex has a geometric position and m scalar attributes (base map uvs, light map uvs, color, normals, skinning info.) v = [ p, s ] R 3+ m orr n

Quadric Error

Quadric Error Perpendicular distance =

Quadric Error Matrix A of size (3+m)x(3+m) is dense Storage for the co-efficients in error = (4+m)(5+m)/2 (quadratic in m) To trade off geometric accuracy and attribute accuracy, user specifies for each attribute a relative importance weight. we pre-multiply attributes by weight i.e., scaling in some axes in 3+m space For scale invariance, all attributes are resized to be unit length in each attribute field. can be cost prohibitive memory and computational complexity wise as the mesh size increases)

Modified Quadric Error Metric Rather than projecting a given point onto the tri face in an abstract higher-dimensional space of size 3+m, do projection in geometric space of size 3 Compute attribute error based on geometric correspondence(huges Hoppe) Error = Geometric error (projected distance) + attribute error To compute attribute error we need to compute expected attribute value s at the projected point p on the tri

Modified quadric error metric s j ' ( p' ) = g Tj p + d j Gradient g and scalar d should linearly interpolate over the tri Hence we compute them by 4x4 linear system Hence the geometric error is Storage cost comparison for the new error metric is 11+4m [compared to (4+m)x(5+m)/2] Our library uses above error metric (faster to compute and easier to store)

Handling Discontinuities So far, things would work fine if there are no geometric or attribute discontinuities. (which are bound to happen every where in our data) Basic algorithm above ignores boundaries and is clearly un-acceptable

Handling Discontinuities To preserve geometric dis-continuities, for each boundary edge we also also take the distance from the plane perpendicular to the tri along the edge. Therefore cost of moving along the edge is lower than cost of moving away Thus it allows interior vert on the boundary to collapse into another vert on the same boundary, but heavily weighs against moving it away from boundary. Hence, algorithm tries to preserve the feature edges (which are marked as boundaries using dis-continuities in attribute and geometric data by a pre-processing step before any thing starts)

Sliding window algorithm (PART 2) Briefly what is Indexed based Rendering : All vertices are in one memory pool/list/vector Every tri is represented by indices of the vector of vertices which make it. All the indices of all tris in a mesh are in one memory pool GPU runs through the indices and for every 3 pull those corresponding vertices to render the triangle Sliding Window algorithm: Each edge collapse ( a patch) removes some tris and adds new tris which are less than what it removed Index ordering is dictated by the patches As distance increases we slide the start and end pointers (like lod0 & lod1 in the figure). Thus we progressively lod with increasing distance.

Sliding window algorithm

Sliding window algorithm At each frame based on distance from camera we estimated how many tris we need to draw based on it which we moved the window on the index buffer (we used a simple linear estimate function, adjustable by user) Granularity of a patch to a collapsed edge implied too many patches (un-acceptable index buffer bloat) So, we made our patches not one edge at a time. It was compute based on error metric (for each delta of error we made a patch). Solved index buffer bloat and also aids in vertex coherency un-explored for lack of time But our current scheme essentially does this at few discrete steps).

Analysis of Sliding Window Scheme Advantages: Fast progressive algorithm which implies we start lod ing from a short distance Gradual small pops rather than discrete big pops (which means farther away we push distance to lod) Dis-advantages: Index ordering is dictated by algorithm not exactly ideal ordering for the GPU Index memory bloat 3 to 4x Tie Main ram class s vert data Index data 1 282/(200k) 40% 146.7k 117.74k/( 34k) 680 454/(334k) 36% 239.3k 174.8k/(55.04k) (we could mitigate both the dis-advatages by increasing error delta for a patch and with in a patch index-order its tris for GPU. Essentially our current scheme)

Early Performance numbers Sample early development [digging into my outlook] runtime stats at the same distance (compared to non-loding mesh) Tie 80% tri reduction 66% 47% 1 0.1267/0.149 ms(85%) 0.1068/.1425 (74%) 0.0727/0.135 (53%) 680 0.182/0.205 (88%) 0.169/0.196(86%) 0.101/0.187(54%) When initially released into the wild, Ratchet never needed more than 60% of its tri count (We even decided to silently cut the hi-lod patches and start the hi-res at 60% for game and keep the rest around only for cinematics) Btw, It's really cool to see how low the "far" scores can get when you combine fade-out lod and index lod. For that ratchet moby 376, I could easily get the far score down around 2.5 where it had been at 19.5 with no visible difference. From an old mail from Al Hastings

DEMO This is from self and data in i8 from last dec/jan (not the final version but the last version I cached as a back up)

Sample results

Sample results

Sample results

Sample Results

Sample Results

Sample Results

Sample Results

Sample Results

Sample Results

Sample Results

Sample Results

Current LOD Scheme used in R&C:TOD At the time tie s had the concept of segments which also forced us to go in the direction of few discrete steps as segment boundaries with in a fragment had to be preserved our tool essentially did few discrete pops and optimized each patch for GPU index ordering. Current scheme essentially does what ties with segmenting did, few finite steps across the whole asset (all fragments combined) Fixes vertex cache and index bloat both of the sliding window deficiencies. Inherently few large patch error steps. Each patch index order is optimized for GPU

Current LOD Scheme used in R&C:TOD Num patches defaulted to 4 steps of 60%, 40% and 25% reductions User could tweak above settings and the distance at which it happens We hijacked [A Friend s] tools to generate above steps as it considers asset as a whole our tool was more developed for sliding window our tool treated fragment boundaries as normal boundaries and operated independently inside it Index LOD is also aided by fade-out lod where beyond certain distance certain fragments have the ability to slowly fade out

Reference Papers New Quadric Metric for Simplifying Meshes with Appearance Attribute Hugues Hoppe Huges Hoppe s phd thesis Efficient Minimization of New Quadric Metric for simplifying Meshes with Appearance Attributes Huges Hoppe & Steve Marschner Simplifying Surfaces with Color and Texture using Quadric Error Metrics Michael Garland & Paul S. Heckbert Topology-driven Progressive Mesh Construction for Hardware-Accelerated Rendering Pavlo turchyn & Sergey Korotov (Sliding Window finders) Quadric-Based Simplification in Any Dimension Michael Garland & Yuan Zhou A Multiphase Approach to Efficient Surface Simplification Michael Garland & Eric Shaffer User-Guided Simplification Youngihn Kho & Michael Garland