Advanced Topics in GPU Tessellation: Algorithms and Lessons Learned Natalya Tatarchuk GGpraphics SW Architect Game Computing Applications, O-CTO AMD GPG Outline Benefits of tessellation Tessellation pipelines: Xbox 360 through Direct3D® 11 Rendering with tessellation Interpolative subdivision for object and character rendering Higher order surfaces on GPU Animated tessellated characters Terrain rendering with adaptive tessellation Tools and art pointers Conclusions Outline Benefits of tessellation Tessellation pipelines: Xbox 360 through Direct3D® 11 Rendering with tessellation Interpolative subdivision for object and character rendering Higher order surfaces on GPU Animated tessellated characters Terrain rendering with adaptive tessellation Tools and art pointers Conclusions The Benefits of Tessellation Tessellation reduces memory footprint and bandwidth Only store low resolution mesh Always relevant, especially for consoles Polygons Total Memory Low resolution 5160 polygons VB/IB: 100K Froblin model 2K x 2K 16 bit displacement map: 10MB ZBrush High res >15M polygons ~270MB VB and 180MB IB storage Froblin model The Benefits of Tessellation Scalability Stable and predictable performance Performance Analysis: Terrain Low Resolution with High Resolution, Tessellation No Tessellation On-disk model 840 triangles 1,280,038 triangles polygon count (pre-tessellation) Original model 1210 fps (0.83 ms) rendering cost Actual rendered 1,008,038 triangles 1,280,038 triangles model polygon count VRAM Vertex buffer 70 KB 31 MB size VRAM Index buffer 23 KB 14 MB size Rendering time 821.41 fps (1.22 ms) 301 fps (3.32 ms) Both use the same displacement Rendering with tessellation is > 6X map (2K x 2K) faster and provides memory savings and identical pixel shaders over 44MB! Subtracting the cost of shading Tessellation Performance Analysis Far Close- away up view view Rendering Num faces: Mode ATI ATI ATI ATI N = 411 x N RadeonTM RadeonTM RadeonTM RadeonTM T L HD 4870 HD 2900 XT HD 4870 HD 2900 XT Original low res 4,050 852 fps 359 fps850 fps275 mesh (NL) triangles Continuously tessellated 1.6 M triangles 232 fps 143 fps213 fps101 mesh (NT) Adaptively Dynamic, tessellated 1.6M > NA > 845 fps 356 fps574 fps 207 mesh NA 4K triangles HigQgher Qualit y Animation and Simulations More complex computations Pass 1: Control at lower resolution cage animation Provide more animation data per fewer vertices Animated object vertex buffer Higher fidelity physics (collisions, etc) Pass 2: Tessellate Separating control cage animated mesh animation pre tessellation gives higher overall performance 30% boost in the Froblins example The Benefits of Tessellation Provide data to GPU at coarse resolution Render at high resolution Displacement surfaces are first-class citizens tessellate displace Model concept courtesy of Valve Character LOD Management Character LOD Management Combine tessellation, stream out and instancing features for level of detail management Direct3D® 10 / Direct3D® 10.1 / Direct3D® 11 Use tessellation to get maximum amount of details with stable performance Example: Render an army of instanced characters Get reallyyy close to any of them and see the details Regularly drawn Froblin No tessellation used High Detail Froblin with Tessellation and Displacement Mapping Froblin Close-up: No tessellation Froblin With Tessellation and Disp lacement Mapp ing Close-up Outline The benefits of tessellation Tessellation pipelines: Xbox 360 through Direct3® D11 Rendering with tessellation Interpolative subdivision for object and character rendering Higher order surfaces on GPU Animated tessellated characters Terrain rendering with adaptive tessellation Tools and art pointers Conclusions Direct3D 11 Direct3D 11 is a strict superset of Direct3D 10 & 10.1 Direct3D 11 adds support for features like multithreading, tessellation, and compute to Direct3D 10.1 The fastest way to move to Direct3D 11 is to start developing on Direct3D 10/10.1 today Direct3D 11 will be available on Vista and future Windows OS’s Direct3D 11 will run on downlevel hardware Multithreading! Direct3D 10.1, 10 and 9 hardware/drivers FllFull functi onalit y (for example, tesse llti)llation) will require Direct3D 11 hardware Direct3D11 Pipeline InputAssembler Direct3D 10.1 pipeline VertexSha der Plus Hull Shader 3 new sta ges for Tessellator Tessellation DomainShader Plus GeometryShader StreamOutput Compute Shader Rasterizer PixelShader Compute Data Structure Shader OutputMerger Tessellation Process Evaluate surface Tessellator positions Add displacement SuperSuper--primprim Mesh Tessellated Mesh Tessellated and Displaced Mesh Displacement Map Domain Parametrization Direct3D 11 Tessellation InputAssembler VtVertexShad er Control cage transformation and animation: Hull Shader -Morphing / Skinning / Transforms -The mesh can have any format: Tessellator patches or polygons DomainShader GeometryShader Rasterizer PixelShader OutputMerger Direct3D 11 Tessellation InputAssembler Once per control primitive VertexSha der Hull Shader Per-patch data and operations • Such as tessellation factors Tessellator • Access data for the entire primitive in original mesh DomainShader • BiBasis conversion • Example: Approximating Catmull-Clark GeometryShader surfaces by transforming control cage into BBiezier patthches Rasterizer • Project patches into screenspace PixelShader • No redundant per-patch data fetches OutputMerger Direct3D 11 Tessellation InputAssembler VertexSha der Hull Shader Fixed function tessellation unit: -Generates uvs and connectivity Tessellator information for domain primitive type (lines, triangles and quads) DomainShader -Up to 64x prim itive / dtdata amplification GeometryShader StreamOutput Rasterizer PixelShader OutputMerger Direct3D 11 Tessellation InputAssembler VertexSha der Hull Shader Tessellator Evaluate each surface point Get patch ID and uv coordinates DomainShader Patch data is stored in local storage Outputs surface position GeometryShader StreamOutput Rasterizer PixelShader OutputMerger Tessellation Pre Direct3D 11 GPU tessellation already available Supported on Xbox 360 Supported on ATI RadeonTM HD 2000 Series and beyond Even on the integrated chipsets! Subset of Direct3D 11 tessellation features Available publicly on AMD Developer website in August 2008 Preview and Prepare for Direct3D 11 Support across most APIs gives you best bang for the buck for this feature Support on Windows XP as well as Vista PC versions can use Xbox 360 native features Reach more players Developing artwork takes time Integrating tessellation early gives you and your artists time to design and polish Xbox 360 / DirectX 9 Pipeline InputAssembler VertexShader sources e R / Rasterizer mory e e M PixelShader OutputMerger Xbox 360 / DirectX 9 Tessellation Pipe line InputAssembler Tessellation unit: -Generates uvsand topology Tessellator connectivity for input primitives -Prior to vertex shader -Parallel evaluation of new vertices sources VertexShader e - Fast (uvu,v) generation R / - All data stays in vertex cache ory Rasterizer - Up to 15x amplification on Xbox m m 360 and pre Direct3D 11 HW Me PixelShader OutputMerger Xbox 360 / DirectX 9 Tessellation Pipe line InputAssembler Vertex Shader acts as an evaluation Tessellator shader Can use data recirculation for emulating Hull and Domain shader sources VertexShader e functionality: R / • Use R2VB or renderable vertex ory Rasterizer texture in Direct3D 9 m m • Stream out in Direct3D 10 / 10. 1 Me PixelShader OutputMerger Supported Primitive Typ es Triangles and Tri-Tri-patchespatches Quads and Quad Patches Lines and Line Patches Continuous Tessellation Mode Floating point tessellation level perper--drawdraw call Eliminates ppppgopping as vertices are added through tessellation Ll10Level 1.0 Ll20Level 2.0 LevelLevel == 1.71.01.32.01.1 Adaptive Tessellation Mode Tessellation level is specified per edge Edge tessellation factor = 7.x Edge tessellation factor = 5.x Edge tessellation factor = 5.x Outline The benefits of tessellation Tessellation pipelines: Xbox 360 through Direct3D 11 Rendering with tessellation Interpolative subdivision for object and character rendering Higher order surfaces on GPU Animated tessellated characters Terrain rendering with adaptive tessellation Tools and art pointers Conclusions Interpgpolating Subdivision Planar subdivision == amplification Generate more triangles from original mesh Main purposes Reduce memory footprint Improve visual quality with displacement mapping Addinggg More Triangles Benefits of Interpolative Tessellation Use the same art assets as for regular rendering Same meshes can be used for rendering with and without tessellation Subdivision surfaces require separate assets Additional asset: displacement map Use for better surface effects on all HW (even without tessellation support) Use inverse displacement mapping shadersshaders,, such as parallax occlusion mapping Easy method for LOD management Tessellated Characters Rendering Tessellate and displace Get up close to a character and see a lot of dildetails LevelLevel--ofof--detaildetail management 1K polygons 430,000 Start byyg rendering polygons lowlow--resolutionresolution mesh That’s the control cage Tessellate and displace for finer details Example D3D9 Evaluation Shader Example D3D9 Evaluation Shader August 21, 2008 Liggghting with Disp lacement Can continue lighting using TS normal maps even if displ aci ng Imppgortant to generate dis placement and normal maps using the same tangent space / SW Then normal encoded in TS normal map matches the normal
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages99 Page
-
File Size-