All the Polygons You Can Eat. Doug Rogers Developer Relations

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

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

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

Barycentric Coordinates and Parameterization

AGDC Per-Pixel Shading. Sim Dietrich

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

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

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

Adjacency Data Structures

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

CPSC / Texture Mapping

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

Mesh Decimation Using VTK

Progressive Mesh. Reddy Sambavaram Insomniac Games

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

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

Mesh Repairing and Simplification. Gianpaolo Palma

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

Surface Simplification Using Quadric Error Metrics

Appearance Preservation

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

CSE 554 Lecture 6: Fairing and Simplification

Point A location in geometry. A point has no dimensions without any length, width, or depth. This is represented by a dot and is usually labelled.

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

Digital Geometry Processing. Computer Graphics CMU /15-662

INF3320 Computer Graphics and Discrete Geometry

Prime Time (Factors and Multiples)

View-Dependent Selective Refinement for Fast Rendering

Mesh Decimation. Mark Pauly

a triangle with all acute angles acute triangle angles that share a common side and vertex adjacent angles alternate exterior angles

LOD and Occlusion Christian Miller CS Fall 2011

Grafica 3D per i beni culturali: MeshLab features. Lezione 7: 22 Marzo 2013

Curvature-Adaptive Remeshing with Feature Preservation of Manifold Triangle Meshes with Boundary

Processing 3D Surface Data

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Motivation MGB Agenda. Compression. Scalability. Scalability. Motivation. Tessellation Basics. DX11 Tessellation Pipeline

Voronoi Diagram. Xiao-Ming Fu

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

CS451 Texturing 4. Bump mapping continued. Jyh-Ming Lien Department of Computer SCience George Mason University. From Martin Mittring,

Geometry Definitions and Theorems. Chapter 9. Definitions and Important Terms & Facts

CS 4620 Midterm, March 21, 2017

Computer Graphics 7 - Rasterisation

Triangle meshes I. CS 4620 Lecture 2

Geometric Features for Non-photorealistiic Rendering

Alex Li 11/20/2009. Chris Wojtan, Nils Thurey, Markus Gross, Greg Turk

Topics and things to know about them:

Grafica 3D per i beni culturali: MeshLab features. 8 Marzo 2018

4.6 Normal Mapping Simplifying Meshes for Normal Mapped Objects. CHAPTER 4 Surfacing

More Texture Mapping. Texture Mapping 1/46

Geometry - Chapter 1 - Corrective #1

Advanced 3D-Data Structures

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

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

Shape Modeling with Point-Sampled Geometry

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

Lesson 01 Polygon Basics 17. Lesson 02 Modeling a Body 27. Lesson 03 Modeling a Head 63. Lesson 04 Polygon Texturing 87. Lesson 05 NURBS Basics 117

A Comparison of Mesh Simplification Algorithms

Segmentation & Constraints

Parameterization with Manifolds

CS 283: Assignment 1 Geometric Modeling and Mesh Simplification

Circular Arcs as Primitives for Vector Textures

Glossary of dictionary terms in the AP geometry units

Manipulating the Boundary Mesh

Deforming meshes that split and merge

Curve Corner Cutting

Chapter 17: The Truth about Normals

Physically-Based Modeling and Animation. University of Missouri at Columbia

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Mesh Representations & Geometry Processing

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.

Texture mapping. Computer Graphics CSE 167 Lecture 9

Deus Ex is in the Details

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Lecture notes: Object modeling

Geometry Practice. 1. Angles located next to one another sharing a common side are called angles.

Convex Hulls in Three Dimensions. Polyhedra

Pump Up Your Pipeline

Simple Silhouettes for Complex Surfaces

pine cone Ratio = 13:8 or 8:5

Cross-Parameterization and Compatible Remeshing of 3D Models

Swept Blend Creates a quilt using swept blend geometry.

Half-edge Collapse Simplification Algorithm Based on Angle Feature

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Topological Issues in Hexahedral Meshing

Geometry Vocabulary Math Fundamentals Reference Sheet Page 1

The Vegetation of Horizon Zero Dawn. Gilbert Sanders Principal Artist, Guerrilla Games

Direct Rendering. Direct Rendering Goals

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

Mathematics Assessment Anchor Glossary Grades 3 & 4

Digital Geometry Processing

Level Set Extraction from Gridded 2D and 3D Data

a ray that divides and angle into two congruent angles triangle a closed polygon with 3 angles whose sum is 180

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

NVIDIA Developer Toolkit. March 2005

Direct Extraction of Normal Mapped Meshes from Volume Data

Triangle meshes. Computer Graphics CSE 167 Lecture 8

Tiling Three-Dimensional Space with Simplices. Shankar Krishnan AT&T Labs - Research

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

Transcription:

All the Polygons You Can Eat Doug Rogers Developer Relations doug@nvidia.com

Future of Games Very high resolution models 20,000 triangles per model Lots of them Complex Lighting Equations Floating point Usually rely on surface normal

Managing Levels of Detail Model of 20,000 is good Model of 20,000 is that covers 20 pixels is not Reduce triangle count Retain as much quality as possible Melody (Multiple Level Of Detail Extraction)

Melody Features Normal Map Generation Texture Coordinate Generation Texture Coordinate Optimization Simplification Optimization Subdivision Surface Hull

Polygon Reduction 19k 9k 4k 2k 500 Melody automatically creates these model

But just reducing the polygon count reduces the quality We want this model: To be lit like the original 500 faces low res model 19k faces

Lighting a low resolution model Using lighting information from the hires model for the low res model 500 faces 19k faces

Real World Example

In Wire Frame

Terms: Reference Model High resolution model used as a reference Used for surface attribute info Part of Dawn s wing

Terms: Working Model Model that is to be simplified to create the lo-res model May be same as reference model or a hand simplified model or Same as reference Manually simplified

Lighting calculations are based on surface normals Calculate the normals for the reference (hi-res res) resolution model Store them into a texture (normal map) Use them on the working (low res) ) model

Calculating Surface Normals for hi-res mesh Calculate face normals Use face normals to calculates vertex normals Use vertex normals to calculate surface normal

What is a Face Normal? A vector is normal to a surface when its direction is perpendicular to the plane which contains this surface When the magnitude of the vector is equal to 1 unit, the vector is called normalized The direction the triangle is facing, or the up direction Normal Vector

What is a Vertex Normal? Summing all the face normal and normalizing the result yields one vertex normal This vector is the vertex normal and is used for vertex lighting

Multiple Normals per Vertex Sharp edges or borders of smoothing groups do not share normal Multiple normals per vertex Multiple normals on a cube corner

Surface Normals Normals are interpolated across a face (Barycentric( Barycentric) Always length 1.0 Vertex surface normals

Iterate surface normal Iterated surface normal

Iterate surface normal Iterated surface normal

Iterate surface normal Iterated surface normal

Iterate surface normal calculated per pixel pixels

Getting the hi-res normals to the low res model On the high resolution surface, we have many vertex normals Hi res model faces

Low res model Fewer vertices, fewer normals Low res normal Low res model

Low res model Iterated normals on low res model contains much less surface detail Iterated normals Low res model faces pixels

Textures are per-pixel pixel storage So grab the normal from the high res surface Store that in a texture (called a normal map) Use those normals instead of the low-res iterated normals

Properties of Normals Normals are 3D vectors (x,y,z( x,y,z) Unit length (always 1.0) So each vector component has range [-1,[ 1]

Normal Maps We can store the xyz components of the normal in the RGB color channel of the texture Map directions [-1,1][ to color [0,255] Normal to Color -1 0 0 128 +1 255

Two types of Normals Object Space Relative the object Tangent Space Relative to each face Melody creates both

Tangent Space Local coordinate system defined per vertex Allow relative normals, or normals defined in this local space Rotate the light into this space, or the normal into object space Coordinate system may be rotated by the deformation Tangent space transforms object Space to tangent Space Tangent, binormal and Normal define tangent basis

Tangent Space Normals Texel normals are relative to the face normal The vector (0,0,1) is considered the up direction and coincident with the face normal (0,0,1) is stored as color (128,128,255) Can be derived from height maps Use 2D Images, using the Normal Map Plugin for Photoshop http://developer.nvidia.com/view.asp?io developer.nvidia.com/view.asp?io=ps_texture_compression_pluginps_texture_compression_plugin

Normals Displayed as Colors Tangent space Object space

Normal Maps Need to have texture coordinates Artist supplied Automatically created Texel cannot be used in more than one place on the model Texels correspond to a position on the model Example, tiling or mirroring is not allowed

Automatic Texture Coordinate Creation We could just flatten the triangles and pack them in the texture No index reuse (poor cache performance) Waste texture space Resulting texture map

Charts Instead, we combine the faces to form charts Combine faces until some criteria is met Flatness One perimeter Resulting texture map

One Chart Special case Needs one connected border Not required to be flat No flipped triangles Can be automatically generated Automatically generated

Normal Map Now that we have texture coordinates Store normals Wait! How did we get the normals to store in the texture? Object space normal map Tangent space normal map

Ray Casting Follow the iterated normal from the lo-res surface to the hires surface

Ray Casting Extend the iterated normal to find the intersection of the hi res model Intersection point

Ray Casting Calculate the iterated normal for the hi res model at the intersection point Calculate hi-res normal at intersection point

Ray Casting Store this in

Ray Casting the normal map

What can happen in during raycasting Intersection point behind ray Allow ray to go forward and backwards

What can happen in during raycasting Multiple Intersections

Chosing closest intersection This might not be what you want May hide the detail on the top most surface Selecting closest

Restricting ray length Define bounds for ray Chose farthest within bounds

Restricting ray length No intersection within bounds

Restricting ray length Find closest intersection if no Intersection within bounds

Simplification Attribute discontinuities Texture Normal Color Features Sharp Edges Seams Boundaries perimeter of material

Simplification Edge Collapse Edge collapse method removes one or two faces collapse edge collapse edge

Simplification Option Attempt to preserve seams, sharp edges or boundaries Check topology after collapse so no illformed geometry is created When edge is collapsed (p2 p1), placement of p1: Optimal position Any where along edge Endpoints (p1 or p2) or edge midpoint Endpoints only (vertex removal). Can be used if you have weighted vertices

Progressive Mesh Collapse until no more legal collapses................ Edge collapses based on weight Collapse each edge, one at a time and record all collapses Allows undo of collapses Assignment to LOD for additional processing

Save to LOD from Progressive Mesh Collapse/Expand to achieve triangle count................ copy copy LOD0 LOD1

Melody Simplification Methods Quadric Error Metric (QEM) Move new point to closest point on all faces Volume Preservation Maintain volume of model Energy Minimization (EMIN) Minimize new faces to data points sampled from reference model. Slow

Seam Any vertex that shares a position with another vertex and all the attributes do not match Discontinuity in color, texture coordinates, normal etc. Simplification can try to maintain seam positions Seams show attribute discontinuities. Show in red

Attribute Group A group of faces that are bordered by seams Attribute Groups

Attribute Group Matching Match Attribute Groups from low res model to reference model. Fetches correct normal For Simplification and Normal Map Generation Look on same group for normal first Reference Model Lo res model

Sharp Edge Angle between two faces that exceeds a specified values Typical values for sharp edge is 140 degrees. 180 is a flat surface. Sharp edges shown as yellow

Corner Angle fatter lines. Angle between two edges on one face Option not to generate during simplification Small corner angles produce slivers Very small area/perimeter ratio Poor GPU performance Corner angle Sliver: small corner angle

Boundary Edge that has only one face attached Defines the perimeter of a model

Illformed Geometry: Folded Edge Commonly called BowTie BowTie When two faces Share an edge and are Coplanar and Face in opposite directions Melody can simplify this, but its slower Shared edges between green and blue faces

Illconditioned Geometry Three or more faces sharing an edge Melody can simplify this, but its slower Non 2 manifold

Illconditioned Geometry T-junctions Vertex splits the edge on the red face

After LOD Creation............... Normal Map Creation Model Optimization LOD

Fitting to a Reference Model After simplification, fit all vertices in the working model to the reference model Tries to make a better match of low res models to high res models This just moves vertices Reference Working Fitting

Model Optimizations Fitting to reference model Move vertex only Geometry Optimization NOT simplification Adds or removes geometry Split Edge (create vertex and 4 edges) Flip Edge Collapse Edge (remove two face) Solves a spring based system Hugues Hoppe s technique

Optimize example optimize

Melody Demo

Links to Related Material http://developer.nvidia.com/ http://research.microsoft.com/~hhoppe/ http://talika.eii.us.es/~titan/magica talika.eii.us.es/~titan/magica/ http://www.cbloom.com/3d/galaxy3/index.html http://mirror.ati.com/developer/index.html http://www.okino.com/conv/conv.htm http://graphics.cs.uiuc.edu/~garland/research/quadrics.html http://gts.sourceforge.net http://www.loria.fr/~levy/papers/2002/s2002_lscm.pdf http://deas.harvard.edu/~pvs/research/tmpm/ http://developer.nvidia.com/view.asp?io=ps_texture_compression _plugin

Future Extreme simplification using Hull Subdivision surface + displacement map generation Better chart creation and packing Reduce memory usage Command line version DCC integration