Real-time Rendering of Efficient Substitutes for Subdivision Surfaces

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Real-time Rendering of Efficient Substitutes for Subdivision Surfaces - Presentation Transcript

    1. Implementation Tianyun Ni
    2. Overview This course section: real-time rendering of efficient substitutes for subdivision surfaces. – Recent theoretical results – Leveraging DirectX 11 Topics: – Introduction to DirectX 11 Tessellation – Implementation on DirectX 11 pipeline – Implementation on current hardware – Practical implementation issues Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    3. © Bay Raitt © Kenneth Scott, id Software © Kenneth Scott, id Software © Mike Asquith, Valve Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    4. © Kenneth Scott, id Software Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    5. Current Authoring Pipeline Control Cage, or SubD Mesh Smooth Surface Displaced Surface Generate LODs … GPU Polygon Mesh
    6. Direct3D 11 Pipeline For Real-time Tessellation Rendering + Displacement Control Cage Map GPU Optimally Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009 Tessellated Mesh
    7. Direct3D 11 Tessellation Pipeline • Save memory and bandwidth - Memory is a critical bottleneck to render highly detailed surfaces = + © Bay Raitt Level 8 Level 16 Level 32 Level 64 Regular Triangle Mesh 16MB 59MB 236MB 943MB D3D11 compact 1.9MB 7.5MB 30MB 118MB representation Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    8. Direct3D 11 Tessellation Pipeline + Displacement Control Cage Map GPU Optimally Tessellated Mesh Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    9. D3D11 Tessellation Process on GPU + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    10. Direct3D 11 Graphics Rendering Pipeline Input Assembler Resources (buffers, textures, constants) Vertex Shader Hull Shader New Direct3D 11 Tessellator Pipeline Stages Domain Shader Geometry Shader Setup/Raster Pixel Shader Programmable Output Merger Fixed function Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    11. Direct3D 11 Tessellation Vertex Shader + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    12. Vertex Shader • Transforms control cage vertices Vertex Shader Hull Shader Tessellator Domain Shader Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    13. Vertex Shader • Applications • Realistic animation: skinning, morph targets, etc Vertex Shader Hull Shader • Physical Simulation: hair simulation, particle system, soft body deformation Tessellator Domain Shader Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    14. Vertex Shader Direct3D 11 Tessellation New Primitive Hull Shader Type: Patch + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    15. Hull Shader • New patch primitive type Vertex Shader - The only supported primitive when tessellation is enabled - Arbitrary vertex count (up to 32) Hull Shader - No implied topology Tessellator • Computes control points • Computes tessellation factors Domain Shader Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    16. Adaptive Tessellation • Curvature, view-dependent Level of Detail © Pixolator @ ZBrushCentral © Bay Raitt Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    17. Hull Shader: Control Point Construction • All control points Pj are a weighted sum of vertices: Pj = ∑ wij Vi • For each connectivity, pre-computes wij and stores them in a stencil texture • The hull shader invokes multiple threads. Each thread computes one control point. Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    18. Hull Shader: Control Point Construction ACC_CONTROL_POINT SubDToParametricPatchHS( InputPatch<CONTROL_POINT_OUTPUT, M> p, uint tid : SV_OutputControlPointID, uint pid : SV_PrimitiveID ) { ACC_CONTROL_POINT output; int topo = getPatchConnectivityID(pid); connectivity type ID int num = getVertexCount(pid); the number of vertices in the patch primitive float3 output.pos= float3(0,0,0); for (int i=0; i< num; i++) { Compute int idx = getVertexIDinPatch(pid,i); use index global ordering one control point per int index = fetchIndexInStencil(topo, idx, tid); output.pos += p[i] * gStencil.Load(int3((index, 0,0)); thread } return output; } Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    19. Vertex Shader Direct3D 11 Tessellation New Primitive Hull Shader Type: Patch Tessellator + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    20. Tessellator • Fixed function stage, but configurable • Domains: - Triangle Vertex Shader - Quad - Isolines Hull Shader • Spacing: Tessellator - Discrete - Continuous (fractional) Domain Shader - Pow2 Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    21. Tessellator Vertex Shader Hull Shader Tessellator Level 5 Level 5.4 Level 6.6 Domain Shader Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    22. Vertex Shader Direct3D 11 Tessellation New Primitive Hull Shader Type: Patch Domain Shader Tessellator + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    23. Domain Shader • One invocation per generated vertex • Evaluate surface given parametric UV{W} coordinates Vertex Shader • Apply displacements Hull Shader Tessellator Control U V {W} points coordinates Domain Shader one vertex Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    24. Overview This course section: real-time rendering of efficient substitutes for subdivision surfaces. – Recent theoretical results – Leveraging DirectX 11 Topics: – Introduction to DirectX 11 Tessellation – Implementation on DirectX 11 pipeline – Implementation on current hardware – Practical implementation issues Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    25. Tessellation Process Regular Extraordinary + Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    26. Patch Construction Schemes • PN Triangles by Alex Vlachos, Jörg Peters, Chas Boyd, and Jason Mitchell “Curved PN Triangles”, I3D 2001: Proceedings of the 2001 Symposium on Interactive 3D Graphics, pages 159-166, 2001. Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    27. PN Triangles on Direct3D 11 Pipeline HS input: Hull Shader Tessellation factors Tessellator control points Domain Shader DS Input from Tessellator: • uvw coordinates for one vertex DS Output: • one tessellated vertex Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    28. Patch Construction Schemes • ACC Patches by Charles Loop and Scott Schaefer “Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches” , ACM Transactions on Graphics, Vol. 27 No. 1 Article 8 March 2008. Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    29. ACC Patch on Direct3D 11 Pipeline HS input: Hull Shader Tessellation factors Tessellator control points Domain Shader DS Input from Tessellator: • uv coordinates for one vertex Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    30. Patch Construction Schemes • Pm Patches by Ashish Myles, Tianyun Ni and Jörg Peters “Fast Parallel Construction of Smooth Surfaces from Meshes with Tri/Quad/Pent Facets”, Symposium on Geometry Processing (SGP), Copenhagen, Denmark, January 2 - 4, 2008. m Pm-sectors m=3 m=4 … Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    31. Pm – Patch on Direct3D 11 Pipeline HS input: Hull Shader Tessellation factors Tessellator control points Domain Shader DS Input from Tessellator: • uv, or uvw coordinates for one vertex Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    32. Overview This course section: real-time rendering of efficient substitutes for subdivision surfaces. – Recent theoretical results – Leveraging DirectX 11 Topics: – Introduction to DirectX 11 Tessellation – Implementation on DirectX 11 pipeline – Implementation on current hardware – Practical implementation issues Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    33. Instanced Tessellation on Current Hardware Input Assembler Vertex Shader Vertex Shader Pass1: Animation Hull Shader Vertex Shader Pass 2: Patch Construction Tessellator Geometry Shader Domain Shader Pass 3: Vertex Shader Compute TF Geometry Shader Setup/Raster Pixel Shader Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    34. Instanced Tessellation on Current Hardware Input Assembler Vertex Shader Hull Shader • Define a generic pattern Tessellator • Replicate the patterns multiple times • Draw instanced geometry Domain Shader • Adaptive Tessellation Geometry Shader • per object • per patch Setup/Raster Pixel Shader Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    35. Instanced Tessellation on Current Hardware Input Assembler Patch index buffer Patch Factor Vertex Shader 2 4 5 0 2 Hull Shader 1 2 One Bucket 2 1 Patch index buffer Tessellator 3 4 0 1 Domain Shader 4 1 Geometry Shader 5 1 Patch index buffer 6 4 Setup/Raster 3 6 Pixel Shader Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    36. Instanced Tessellation on Current Hardware Input Assembler Patch index buffer Patch Factor Vertex Shader 2 4 5 0 2 Hull Shader 1 2 One Bucket 2 1 Patch index buffer Tessellator 3 4 0 1 Domain Shader 4 1 Geometry Shader 5 1 Patch index buffer 6 4 Setup/Raster 3 6 Pixel Shader Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    37. Adaptive Tessellation on Current Hardware • Generic Mesh Refinement On GPU http://iparla.labri.fr/publications/2005/BS05/GenericMeshRefinementOnGPU.pdf • Generic Adaptive Mesh Refinement http://http.developer.nvidia.com/GPUGems3/gpugems3_ch05.html • Semi-uniform Adaptive Patch Tessellation http://sintef.org/project/Heterogeneous%20Computing/preprints/topofix-draft.pdf Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    38. Instanced Tessellation on Current Hardware Input Assembler Vertex Shader Vertex Shader Pass1: Animation Hull Shader Vertex Shader Pass 2: Patch Construction Tessellator Geometry Shader Pass 3: Domain Shader Vertex Shader Compute TF Geometry Shader Vertex Shader Setup/Raster Pass 4: Setup/Raster Surface Pixel Shader Evaluation Pixel Shader +DM Output Merger Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    39. Instanced Tessellation on Current Hardware Input Assembler Vertex Shader • In the vertex shader - Load patch index from Hull Shader bucket’s patch list Pass 4: Surface - Load edge tessellation Tessellator Evaluation level to stitch boundaries +DM Domain Shader - Load control points to evaluate surface Vertex Shader Geometry Shader - Apply Displacement Setup/Raster Mapping Setup/Raster Pixel Shader Pixel Shader Output Merger Output Merger Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    40. Overview This course section: real-time rendering of efficient substitutes for subdivision surfaces. – Recent theoretical results – Leveraging DirectX 11 Topics: – Introduction to DirectX 11 Tessellation – Implementation on DirectX 11 pipeline – Implementation on current hardware – Practical implementation issues Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    41. Watertight Tessellation • Floating point precision issue - Addition is neither commutative nor associative - Special care has to be taken to obtain watertight results to prevent cracks Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    42. Watertight Patch Construction • Control Points Construction - Control points type: corner, edge, face - In all cases we can compute a control point as weighted sum: Pj = ∑ wij Vi - Needs consistent ordering of the summation V8 V7 V6 V9 V5 V0 V1 V3 V4 V2 Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    43. Watertight Surface Evaluation Inconsistent Consistent Positions: orientations P(u,v) = ∑ bi Bi(u,v) Problem: a+b+c != c+b+a Solution 1: All computations need to done in consistent parametric orientation Solution 2: Symmetric evaluation Courtesy of Valve Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    44. Watertight Displacement • Displacement Mapping - Sample displacement value from a texture - Displace vertex along its normal Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    45. Watertight Displacement • Watertight normals - Cross product of a pair of tangent, bitangent vectors - All three vectors should be co-planar - Problem: cross(tanU,tanV) ≠cross(tanV, tanU) - Solution: Define corner and edge ownership tanV tanU tanU Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    46. Watertight Displacement Problem: Non-watertight Texture Seams due to - Bilinear discontinuities - Varying floating point precision on different regions of the texture map - Seamless parameterization removes bilinear artifacts, but does not solve floating point precision issues Solution: Define patch ownership of the seams Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    47. Watertight Displacement • Store 4 texture coordinates per vertex (0: interior, 1,2: edges, 3: corner) tx3 tx1 ty2 ty3 – 16 per quad patch, 12 per triangle tx2 tx0 ty3 ty0 ty1 patch – The corresponding texture ty1 coordinate can be selected using the value of the parametric tw1 tw0 tz0 tz2 tw2 coordinate UV – Compute Barycentric interpolation tw3 tw2 tz1 3 tz3 tw of texture coordinates Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    48. Watertight Surface Evaluation Suggested Reading: • Tessellation of Subdivision Surfaces in DirectX 11 (Gamefest 08) http://developer.nvidia.com/object/gamefest-2008- subdiv.html • Next-Generation Rendering of Subdivision Surfaces (Siggraph08) http://developer.nvidia.com/object/siggraph-2008- Subdiv.html • Course Notes (Siggraph09) http://www.nitianyun.com/sigcourse09.html Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    49. Live Demo Instanced Tessellation GPU Patch Construction Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009
    50. Q&A Tianyun Ni Ignacio Castaňo tni@nvidia.com icastano@nvidia.com Efficient Substitutes for Subdivision Surfaces – SIGGRAPH Course 2009

    + NVIDIANVIDIA, 3 months ago

    custom

    1401 views, 1 favs, 5 embeds more stats

    This slide deck is from Part 4 of this course, deta more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1401
      • 1038 on SlideShare
      • 363 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 22
    Most viewed embeds
    • 348 views on http://developer.nvidia.com
    • 8 views on http://origin-developer.nvidia.com
    • 5 views on http://www.developer.nvidia.com
    • 1 views on http://203.208.39.132
    • 1 views on http://www.extrox.com

    more

    All embeds
    • 348 views on http://developer.nvidia.com
    • 8 views on http://origin-developer.nvidia.com
    • 5 views on http://www.developer.nvidia.com
    • 1 views on http://203.208.39.132
    • 1 views on http://www.extrox.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories