+ All Categories
Home > Documents > Direct3D 11 Tessellation

Direct3D 11 Tessellation

Date post: 28-Oct-2014
Category:
Upload: dipesh-kumar-gautam
View: 122 times
Download: 0 times
Share this document with a friend
Popular Tags:
41
Transcript
Page 1: Direct3D 11 Tessellation
Page 2: Direct3D 11 Tessellation

Direct3D 11 Tessellation

Speaker: Kevin Gee

Research: Charles Loop / Scott SchaferSlides: Shanon Drone, Matt Lee, Michael Oneppo

Page 3: Direct3D 11 Tessellation

Design BackgroundProgrammable pipeline can target any surface approach.One primary scenario facilitates subdivision surfaces as a primitive type.Charles Loop and Scott Schaefer provided a reference approximation to Catmull-Clark.Converts Sub-D surface into Bezier patches.Other approaches are possible too.

Page 4: Direct3D 11 Tessellation

Why Tessellate?Many reasons including

Reduced asset memory sizeMore morph targetsCheap / free LODs

Reduced asset creation time

Improved pixel shader utilizationReduced GPU skinning costsRun faster simulationsMove Sub-D costs to GPU

Page 5: Direct3D 11 Tessellation

Pre-Tesselated Mesh: ~5500 kb

Asset Size: Comparison

Sub-D Mesh: ~130 kb

Page 6: Direct3D 11 Tessellation

Morph Targets

Huge potential memory / size winsMorph targets in Sub-D take up less space than fully-tessellated \ sparse morph targetsEnable richer animations for the same memory cost

Page 7: Direct3D 11 Tessellation

Level of Detail

Continuous LOD becomes possible.Reduces content creation time

Cheaper than building & testing explicit LODs

Improves pixel shader quad utilization

Page 8: Direct3D 11 Tessellation

Faster SimulationSkin at the control mesh level

Saves skinning costs

Cloth in Sub-DReduces the resolution of the simulationKeeps a smooth surface for renderingThe more complex the simulation, the bigger the savings

Compute surface constraints at a lower frequency

Limit high-frequency positions to avoid penetrations

Page 9: Direct3D 11 Tessellation

DIRECT3D 11 PIPELINE OVERVIEW

Page 10: Direct3D 11 Tessellation

InputAssembler

VertexShader

Vertex Buffer

Index Buffer

Texture

GeometryShader

Texture

Stream Output

Rasterizer/Interpolator

PixelShader

OutputMerger

Depth/Stencil

Texture

Render Target

HullShader

Texture

DomainShader

Texture

Tessellator

Page 11: Direct3D 11 Tessellation

New Primitives

Page 12: Direct3D 11 Tessellation

Hull ShaderOperates per input primitive

E.g. patch

Computes control point transformsE.g. Basis Change

Computes tessellation factors per edge of generated patches

Page 13: Direct3D 11 Tessellation

Hull Shader Syntax[patchsize(12)][patchconstantfunc(MyPatchConstantFunc)]MyOutPoint main(uint Id : SV_ControlPointID, InputPatch<MyInPoint, 12> InPts){ MyOutPoint result; …

result = TransformControlPoint( InPts[Id] );

return result;}

Page 14: Direct3D 11 Tessellation

TessellatorInputs

Takes in “Tessellation Factors” provided by the Hull shader Tess factors per-side in the range of [2.0..64.0]

OutputsUV or UVW domain pointsConnectivity of those points (tris, lines)No adjacency information

Many possible partitioning schemes

Page 15: Direct3D 11 Tessellation

Tessellation Scheme

demo

Page 16: Direct3D 11 Tessellation

Domain Shader

Operates on each point generated by the tessellatorGets ALL control points as input

Control points and patch constant data are passed directly to the domain shader

Evaluate primitive surface to compute position of points

Convert from U,V space into positions, tangents

Page 17: Direct3D 11 Tessellation

Domain Shader Syntaxvoid main( out MyDSOutput result,

float2 myInputUV : SV_DomainPoint, MyDSInput DSInputs,

OutputPatch<MyOutPoint, 12> ControlPts, MyTessFactors tessFactors ){

result.Position = EvaluateSurfaceUV( ControlPoints, myInputUV );

}

Page 18: Direct3D 11 Tessellation

APPLYING SUBDIVISION SURFACES TO THE PIPE

Page 19: Direct3D 11 Tessellation

What Are Subdivision Surfaces?

Surfaces defined by iterative refinementMany different techniques

Catmull-Clark (1978)Doo-Sabin (1978)Loop (1987)

Techniques differ primarily in edge cases and fixing trouble spots in previous techniques

Page 20: Direct3D 11 Tessellation

Catmull-Clark Subdivision

Start with a quad meshFaces and edges are split in the centerVertices are averaged with their surrounding neighborsInfinite iteration results in the “limit surface”

Page 21: Direct3D 11 Tessellation

Why Catmull-Clark?

Broad support from industry and modeling packagesParametric evaluation introduced in 1998 (Stam) at Alias|wavefrontFurther refinements added edges and creasesPixar adopted Catmull-Clark early

Facilitates rich character animation

Page 22: Direct3D 11 Tessellation

Sub-D’s In Current SystemsBuild the model in

Sub-D’sModeling, texturing, rigging

Configure & preview displacement mapsAt export time

Tessellate into a poly meshApply displacement mapsWrite to disk

Game engineApply skinning transformRasterize

Page 23: Direct3D 11 Tessellation

Proposed Future SystemBuild the model in Sub-D’sConfigure & preview displacement mapsExport Sub-D meshGame engine

Convert Sub-D mesh into parametric surfaceTessellate to desired LOD levelApply displacement maps and skinningRasterize

Page 24: Direct3D 11 Tessellation

Catmull-Clark Terminology

Vertex, edge, quadValence is number of incident edges to a vertexRegular vertex has a valence of 4, otherwise it is an extraordinary vertex

Regular

VertexExtraordina

ryVertex

Page 25: Direct3D 11 Tessellation

Loop/Schaefer ResearchRepresent each quad’s limit surface as a bicubic patch (16 knots, 4x4)Add two biquadratic patches that create a U and V tangent field

12 knots, 3x4 eachCross-product is the normal vector

Adjust the U and V patch edges to account for surface discontinuities around extraordinary vertices

Page 26: Direct3D 11 Tessellation

Implementation OverviewInitialization time

Load Sub-D mesh (quad mesh)Build adjacency-based patches

Use 1-ring of vertices around each quad

Compute texture tangent space for each vertex

Run timeSkin the quad mesh in the vertex shader (VS)Convert Sub-D mesh into patches in the Hull shader (HS)Evaluate patches using the domain shader (DS)

Page 27: Direct3D 11 Tessellation

Quad Mesh

Page 28: Direct3D 11 Tessellation

Input Quads

Each patch consists of 4 inner quad vertices and a 1-ring neighborhood

Sub-D Patch

1-Ring Neighborhood

Page 29: Direct3D 11 Tessellation

D3D11 Sub-D Pipeline Overview

Hull Shader

VS

Tessellator

Sub-D Patch Buffer

PS

Domain Shader

Draw

GS

o Single passo No additional memoryo Avoids 16 fetches per vertexo Variable tessellation within a draw

o Subsets of HS can operate in parallel

Skin

Page 30: Direct3D 11 Tessellation

Regular and ExtraordinaryRegular patches

All vertices have 4 edge-adjacent neighbors

Valence 4

Predictable amount of data and work

Extraordinary patchesAny irregular patchNot quite as predictableRequire a little more workDraw call per valence supported

Page 31: Direct3D 11 Tessellation

Direct3D 10 SDK SampleSubdivision Surfaces

demo

Page 32: Direct3D 11 Tessellation

Handling CreasesAdd redundant geometry

Defined crease

Redundant geometry

Page 33: Direct3D 11 Tessellation

More Loop/Schaefer ResearchLatest version:

Modified Approximate Catmull-Clark Patches (ACC2)Outputs a Bezier patch consisting of 16 control vertices for regular patchesOutputs a Gregory patch consisting of 20 control vertices for extraordinary patches

Page 34: Direct3D 11 Tessellation

New Research (ACC2)Collapse position and tangent into a single bicubic patch

Fewer control points, less memory

Modification of a Gregory patch

Bicubic patch with 2 sets of interior knots (20 knots total)

b10b00 b20

b30

b01

b11v

b11u

b21v

b21u

b02

b03

b13 b23b33

b32

b31

b12v

b12u

b22v

b22u

Page 35: Direct3D 11 Tessellation

ACC2 Patch

Page 36: Direct3D 11 Tessellation

ACC2 Patch - Position

Average the inner point pairs and evaluate the resulting 4x4 bicubic patch for position

Page 37: Direct3D 11 Tessellation

ACC2 Patch - Tangents

Page 38: Direct3D 11 Tessellation

ACC2 Math

vpi

pi+1

pi-1

qi

b00 b10,i

b10,i+1

b20,i

b20,i+1

b11v,ib11u,i

qi-1

Page 39: Direct3D 11 Tessellation

This is a lot…There’s a lot of complexity here, but it’s worth itD3D11 can target almost any surface algorithm you want

BezierNURBsDynamic and static tessellationDisplacementSubdivision (using Loop transforms)

and more…

Page 40: Direct3D 11 Tessellation

Call to Action!

Experiment with the D3D10 Subdivision Surface Sample from the DirectX SDK NOW!Build support for Sub-D meshes into your pipelines, tools, and engines.

Look for a future Community Tech Preview (CTP) of Direct3D 11.

Page 41: Direct3D 11 Tessellation

www.xnagamefest.com

© 2008 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only.

Microsoft makes no warranties, express or implied, in this summary.


Recommended