+ All Categories
Home > Documents > Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count...

Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count...

Date post: 11-Aug-2020
Category:
Upload: others
View: 8 times
Download: 0 times
Share this document with a friend
54
Transcript
Page 1: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost
Page 2: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

FutureFuture--Proof Games with Proof Games with RealReal--Time TessellationTime Tessellation

Natalya TatarchukGame Computing Applications Group (O-CTO)

AMD Graphics Products Group

Page 3: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Recent Evolution of Rendering

For the last decade, real-time shading has significantly increased in qualityGreat strides in lighting and shadowing techniques

Normal mapping is ubiquitous in gamesInverse displacement mapping is present in the latest top graphics-rich games

Parallax occlusion mapping in Crysis

Page 4: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

We can express subtle shading details in variety of ways

Shadowing, self-occlusion and surface features

However, there are always the tell-tale signs giving it all away…

The Need for Geometric Detail Hasn’t Gone Away

Page 5: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost
Page 6: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Bridging the Gap on Visual Quality for Games

Inflection points for games: content generation and rendering

Character modeling with detail and deformation

Image courtesy of Valve

Page 7: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Bridging the Gap on Visual Quality for Games

Inflection points for games: content generation and rendering

Character modeling with detail and deformation

Page 8: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

A Game Frame vs. a Movie Frame Comparison

Per-Frame

Shrek Typical Game

Content size

100 M polygons 200-500K polygons

Animation quality

350 bones skinned on the CPU

32-40 bones skinning on GPU

Rendering time

8000 sec a frame on a Pentium IV

0.015 sec or less a frame A frame from the Shrek [Yee04,

PDI/Dreamworks]

Page 9: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Bridging the Gap on Visual Quality for Games

Transition to deformable subdivision surfaces with displacement

Much higher quality

Page 10: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Those Costly Meshes…

Meshes are an inherently expensive representationNeed to store a fair amount of data (positions, uvs, animation)Lots of research has gone into LOD schemes

Vertex transform cost is incurred regardless of object-viewer proximity

Expensive for complex shaders or animated / detailed objects

Latest GPUs’ unified shader architecture has much more efficient geometric processing

But memory storage and fetch bandwidth is still a big concernEspecially for animation Large meshes reduce vertex cache reuse

Page 11: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Tessellation Process

• Start with a polygon mesh

• Recursively apply subdivision rule

Page 12: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

The Advantages of Using TessellationCompression of vertex dataScalability with a knob

Page 13: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

The Advantages of Using TessellationCompression of vertex dataScalability with a knobStable performance

Page 14: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

The Advantages of Using Tessellation

Amplification of animation data

Allows providing data to GPU at coarser resolution while rendering at high resolution

Page 15: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

The Advantages of Using Tessellation

Displacement mapped surfaces become first class citizens

Model concept courtesy of Valve

tessellate displace

Page 16: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Efficient GPU Tessellation Pipeline

Animate low-res meshCompute per-edge tessellation

factors

Generate parametric domain locations on each input mesh tri

Compute Surface position using the domain location

Input mesh and tessellation factors

computation

Vertex Shader (Evaluation Shader)

Tessellator

Page 17: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Tessellator Generates Domain Locations

(u,v)s on the domain surfaceBarycentric coordinates for a triangleParametric coordinates for quads or lines

Efficiently passed to the vertex shader for evaluationResulting tessellation is watertight

Page 18: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Domain Parametrization

Page 19: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

The Vertex Shader is Used as a Surface Evaluation Shader

Tessellator

Super-prim Mesh Tessellated and Displaced Mesh

Displacement Map

Tessellated Mesh

Vertex Shader

(Evaluation Shader)

Sampler

Page 20: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Evaluate Variety of Surfaces

Interpolative subdivisionHigher order surfaces

BezierN-PatchesB-Spline, NURBs, NUBsLoop, Catmull-Clark and othersubdivision surfaces

Select the type that you need by providing your own evaluation shader

Catmull-Clark surfaces for a cinematic character [DeRose98]

20

Page 21: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Efficient GPU Tessellation Pipeline

Tessellator

Rasterizer

Pixel ShaderProcess geometry, rasterize and render resulting high resolution mesh

Input mesh and tessellation factors

computation

Vertex Shader (Evaluation Shader)

Output to screen

Page 22: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

SuperPrimitives Types

Triangles

Quads

Lines

Page 23: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Specify floating point tessellation level per-draw callEliminates popping as vertices are added through tessellation

Use Continuous Tessellation

Level 1.0 Level 2.0

Page 24: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Watertight tessellation

Continuous Tessellation

Level = 1.0Level = 1.1Level = 1.3Level = 1.7Level = 2.0Level 1.0 Level 2.0

Page 25: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

High Quality Characters Rendering

Straight-forward LOD scheme: Get up close to a character and see a lot of detailsStart by rendering low-resolution character

That’s the control cage

Tessellate and displace for finer detailsUses the same art assets as when rendering without tessellation

Displacement map

Generate displacement maps with a new AMD tool – GPUMeshMapper

More on this tool in “Tessellation in the Low Poly World” session on Wednesday

Page 26: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Higher Quality Animation at Lower Cost with Tessellation

Animated objectvertex buffer

Animate on control cage: low polygon model– Allows more complex animation computations

– Higher quality animation with more animation data

– Can store animated mesh per-frame for later operations

– Can re-use animated objects from vertex buffer for shadows, reflections, etc.

Tessellate post animation– Generates new vertices and transforms them

into screen space– Allows more complex pixel shaders– Allow higher resolution textures

Page 27: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

An Animated Monster FrogLow resolution character - 2638 triangles- 95 KB memory

Rendered: 874 fps

Initial concept artwork from Bay Raitt, Valve

Page 28: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

~500x increase in detail for 7x cost in speed

Initial concept artwork from Bay Raitt, Valve

Tessellated character:- 1, 084,218 triangles- effective memory: 95KB- equivalent model memory: 40MBRendered at 120 fps

Page 29: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

31

Character Creation Pipeline in Film

Use subdivision surfaces• Much more control over model building for animation and texturing

Rough pipeline: • Create skeletal framework for creature rigging and animation

• Attach muscles• Build up into a complete form• Layer with skin• Animate

• Shade

Gollum, “The Lord of the Rings”, courtesy of New Line

31

Page 30: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Approximating Catmull-Clark Subdivision Surfaces on GPU

Convert CC surface to lower order representation Directly evaluate some number Bezier patches on GPU approximating the original surfaceSupport the same subdivision surfaces as in Maya

Very important for art pipelines

Page 31: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Approximating Catmull-Clark Subd Surfaces on GPU

C. Loop, S. Schaeffer “Approximating Catmull-

Clark subdivision surfaces with bicubic patches”, MSR

Tech Report 2007

T. L. Ni et al, “Smooth surfaces from 4-sided

facets”, SMI 2008

Page 32: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Lighting Displaced Models

Tessellation by itself can support a variety of lighting methods

Vertex lighting, normal-mapping, etcDisplacement mapping, on the other hand, is

less flexible

Page 33: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Combining Normal Maps and Displacement Maps

As we displace, we change the actual displayed normal

Page 34: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Combining Normal Maps and Displacement MapsNeed to rotate tangent frame Then could use tangent-space normal maps But is there a better way?

Page 35: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Lighting Directly from Displacement Map

Use central differences to approximate the derivative field

Compute per-pixel normals based on the per-vertex tangent frames based on current displacement

Memory savings at the cost of additional ALU ops

Instead of storing an additional normal map

Higher quality resulting lightingShows off the details that are only encoded in the displacement map

Support dynamic height fields Great for terrains / destruction Also see Johan Andersson SIGGRAPH 07 talk on terrain rendering for other ideas

Page 36: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Computing Normal from Displacement Map: Example

Page 37: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Rendering Terrain: Challenges

Very large models, continuous spans across spaceRendered simultaneously very close and far awayNecessitates good LOD handling

Require a lot of data / memory for polygonal representation

39

DICE: Battlefield 2

Page 38: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Rendering Tessellated Terrain

Tessellation pipeline handles this wellTessellate flat mesh and displace on the flyUse GPU-based noise or precomputed height map for displacement and shading

Adaptively subdivide to get detail where neededCan perform collision detection directly on the height map

Page 39: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Create Dynamic Terrain

Dynamic terrain becomes very straight-forwardBlend height maps for modification

Damage, destruction, earthquakes, bullet holes – limitless possibilities!

Page 40: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Dynamic Adaptive Tessellation

Tessellation level is specified per edge

Edge tessellation factor = 5.x

Edge t

essel

lation

facto

r = 3.

x Edge tessellation factor = 3.x

Edge tessellation factor = 5.x

Edge tessellation factor = 7.x

Edge tessellati on factor = 3.xEd

ge te

ssel

latio

n fa

ctor

= 3

.x

Page 41: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Adaptive Tessellation Flow

Transformed Superprim

Mesh

Superprim Mesh

Vertex Shader

Pixel Shader

Superprim Mesh

Vertex Shader

Pixel Shader

Sampler

Stream 0

Vertex Shader

Pixel ShaderSuperprim

Mesh

Stream 1Tessellator

Tessellation Factors

R2VB

Page 42: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Vertex Prepass Code Sample

Page 43: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Avoiding Cracks with Per-Edge Tessellation Factors

Adjacent edges must have precision-identical tessellation levels

Otherwise cracks will appear when displacing

Need extra care during tessellation factors computation

Ensure identical edge direction (using vertex ID)

Page 44: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Avoiding Cracks with Per-Edge Tessellation Factors

Adjacent edges must have precision-identical tessellation levels

Otherwise cracks will appear when displacing

Need extra care during tessellation factors computation

Ensure identical edge direction (using vertex ID)

Page 45: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Computing Tessellation Factors

Compute current edge’s end-points’ indices

Page 46: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Computing Tessellation Factors

Fetch the edge’s endpoints from transformed vertices texture, then compute tessellation factor with your

algorithm and output to PS / render target

Page 47: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Rendering Terrain with Displacement Map-Based Lighting and Procedural Snow placement based on normal

Page 48: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Performance Comparison: High Res versus Full Tessellated Mesh

Both use the same displacement map (2K x 2K) and identical pixel shaders

31 MB70 KBVRAM Vertex buffer size

Low Resolution with Tessellation

High Resolution, No Tessellation

On-disk model polygon count (pre-tessellation)

840 triangles 1,280,038 triangles

Original model rendering cost

1210 fps (0.83 ms)

Actual rendered model polygon count

1,008,038 triangles 1,280,038 triangles

VRAM Index buffer size

23 KB 14 MB

Rendering time 821.41 fps (1.22 ms) 301 fps (3.32 ms)

Rendering with tessellation is > 6X faster and provides memory savings

over 44MB! Subtracting the cost of shading

Page 49: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Performance Analysis: Low Res versus Rendering with Tessellation

161 fps

85 fps

215 fps

ATI Radeon HD 3750

253 fps

122 fps

305 fps

ATI Radeon HD 3750

ATI Radeon HD 2900

XT

ATI Radeon HD 2900

XT

356 fps

143 fps

359 fps

Far away view

Dynamic, 1.6M > NA > 4K triangles

1.6 M triangles

4,050 triangles

Num faces:

207Adaptivelytessellated

mesh NA

101Continuouslytessellatedmesh (NT)

275Original low res mesh

(NL)

Close-up

view

Rendering Mode

NT = 411 x NL

Page 50: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Cinematic Rendering Relies on Tessellation for Quality and Control

Currently film and games differ in geometry management

• Cinematic rendering relies on extreme details

• Previously, games couldn’t afford this luxury

We are changing this now!Both must manage details for stable performance

Geri’s Game, Pixar

Page 51: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Bring tessellation techniques from film in real time rendering scenarios

• Fast displacement mapping and animation

Results in significant visual improvements

• Better lighting• Better silhouettes• Better details• Better animation• Better performance

Cinematic Rendering Relies on Tessellation for Quality and Control –And So Will Games!

Geri’s Game, Pixar

Page 52: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Acknowledgments

Josh Barczak and AMD Game Computing Applications GroupNick Thibieroz, Bill Bilodeau, Holger Grün and Richard Huddy

Page 53: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

References

Andersson, J. 2007. Terrain Rendering in Frostbite using Procedural Shader Splatting. SIGGRAPH 2007 Course Notes, Course 28: Advanced Real-Time Rendering in 3D Graphics and Games. San Diego, CALoop, C., and Schaeffer, S. 2007. Approximating Catmull-Clark subdivision surfaces with bicubicpatches. Tech. rep., Microsoft Research, MSR-TR-2007-44ftp://ftp.research.microsoft.com/pub/tr/TR-2007-44.pdfT. L. Ni, Y. Yeo, A. Myles, V. Goel and J. Peters. 2008. Smooth Surfaces from 4-sided Facets. Shape Modeling International 2008http://www.cise.ufl.edu/submit/files/file_ecb56556e79a4768187235473d37d700.pdf

Page 54: Future-Proof Games with Real-Time Tessellation€¦ · No Tessellation On-disk model polygon count (pre-tessellation) 840 triangles 1,280,038 triangles Original model rendering cost

Questions?

Thank You!

58


Recommended