1 / 34

Generic Mesh Refinement on GPU

Generic Mesh Refinement on GPU. Tamy Boubekeur & Christophe Schlick LaBRI – INRIA – CNRS University of Bordeaux. Today GPU Features. Combination of Vertex and Fragment Shaders Dedicated hardware primitives (VBO, FBO) C-like programming language (GLSL, CG, HLSL)

marlin
Download Presentation

Generic Mesh Refinement on GPU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Generic Mesh Refinement on GPU Tamy Boubekeur & Christophe Schlick LaBRI – INRIA – CNRS Universityof Bordeaux

  2. Today GPU Features • Combination of Vertex and Fragment Shaders • Dedicated hardware primitives (VBO, FBO) • C-like programming language (GLSL, CG, HLSL) > Most of the rendering task is on GPU

  3. Today GPU Rendering • Per-pixel illumination • Hard and Soft Shadows • HDR images [ATI 2003] • Global Illumination Effects [NVIDIA 2005] > Near-Realistic real-time rendering

  4. Realistic Image Means realistic lighting of course, but also: • Complex objects (many polygons) • Details (at the pixel resolution) Usual solution: • Shape complexity: smooth and/or detailled surfaces • Appearance complexity: high-resolution multi-texturing + fragments shaders

  5. Fair Surface Representation • Multi-scale representation for real-time graphics: • Light representation for animation/physics. • On-the-fly geometric refinement for silhouette and contours. • Details at rasterization time. • One acceptable solution: • CPU: Low resolution “clever” mesh, carefully designed. • CPU/GPU: Medium resolution displacement map. • GPU: High resolution appearance map (normal, color).

  6. Fair Surface Representation • Multi-scale representation for real-time graphics: • Light representation for animation/physics. • On-the-fly geometric refinement for silhouette and contours. • Details at rasterization time. • One acceptable solution: • CPU: Low resolution “clever” mesh, carefully designed. • CPU/GPU: Medium resolution displacement map. • GPU: High resolution appearance map (normal, color).

  7. Previous Work • Subdivision Surfaces • Many schemes [Catmull 1978][Loop 1987][Zorin 2000][Stam 2003] • Local control [Biermann 2001] • Hardware evaluation [Bishoff 2000][Bolz 2002] • GPU implementation [Bolz 2003][Shiue 2005] • Local Refinement • Curved PN Triangles [Vlachos 2001][Chung 2003] • Scalar Tagged Meshes [Boubekeur 2005]

  8. Dynamic Refinement Frame Rendering: Graphics Bus Refinement Coarse Mesh Tessellated Mesh Refined Mesh Displacement Tessellator RENDERING CPU GPU Non-programmable Graphics Hardware

  9. Dynamic Refinement Frame Rendering: Graphics Bus Refinement Coarse Mesh Tessellated Mesh Refined Mesh Displacement Tessellator RENDERING CPU GPU Programmable Graphics Hardware

  10. Our goal Virtual GPU Tessellator Unit on today’s GPU Graphics Bus Refinement Coarse Mesh Tessellated Mesh Refined Mesh Displacement Tessellator RENDERING CPU GPU • Dynamic coarse meshes on CPU • Per-polygon tessellation on GPU • Local computation of refined vertices • General enough solution for various kinds of local displacement

  11. Our Approach Storing only ONE triangle fully tessellated : the Refinement Pattern (RP), directly on the GPU memory • “Configuring” the GPU with the coarse triangle parameters • Rendering the RP instead of each coarse triangle • “Conforming” the RP to the current GPU « configuration »

  12. GPU Refinement Pattern • The only one drawn primitive • A collection of triangle strips, pre-generated and stored on the GPU • Problem : • How to transform efficiently the RP toward the current coarse triangle ? • How to resolve this problem in a GPU-friendly fashion (ie. for each vertex of the RP independently) ?

  13. GPU Refinement Pattern • Solution: • Encoding the barycentric coordinates {u, v, w} as position of the RP vertices. • Using this parameterization to interpolate parameters (position, normal, color, textures coordinates, etc) of the current triangle in the vertex shader

  14. Displacement computation • Performed by the Vertex Shader for each refined vertex. • 3D-based displacement with interpolated position. • 2D-based displacement with interpolated texture coordinates > “texturing meshes with meshes”.

  15. Level Of Detail • Discrete LOD by simply storing a set of RP at different resolution on the GPU memory • Switching on a per-object basis between the different level of detail • Continuous LOD by interpolation between 2 consecutive level of details.

  16. Drawing algorithm Draw (CoarseMesh M, level L) GPU::RP::bindLOD (L); for allTriangle T of M do GPU::placeAttributeOnGPU (T); GPU::RP::draw ();

  17. Drawing algorithm Draw (CoarseMesh M, level L) GPU::RP::bindLOD (L); for allTriangle T of M do GPU::placeAttributeOnGPU (T); GPU::RP::draw (); Refinement Shader 1: Attribute Interpolation 2:Displacement Computation 3: Output refined vertex

  18. Implementation • Requires only Vertex Shader 1 compatible GPUs (all programmable GPUs) • No use of Fragment Shaders, no multi-pass, no render-to-texture, etc. • Small vertex shader code • RP stored as triangle strips in a VBO

  19. Workload balance • Software side/CPU workload: • Initialization of the RP (set of RP for LOD). • High level modification of the coarse mesh. • Realtime graphics bus load: • Upload of the coarse per-triangle parameters through uniforms variables (positions, normals, colors, additional local parameters…) • Drawing call of RP (VBO) at the chosen LOD Note: Nb draw calls = Nb coarse triangles

  20. Workload balance • GPU additional workload: • At the beginning of the Vertex Program, for the RP-based interpolation (i.e. the “tessellation”) • Essentially, the procedural displacement computation or query (displacement map with Vertex Shaders 3.0) Note: the RP-based interpolation masks the memory latency for texture access from the vertex shader [NVIDIA 2004]

  21. Procedural Displacement 12 coarse triangle + frequency control; 786 432 on GPU triangles • Concept: Object = Simple Base Mesh + Procedural Function(s) • Deep refinement required for high frequencies: ex: a.sin(f|P|) • Full use of GPU (GPU-limited for deep refinements)

  22. Curved PN Triangles • Local triangle smoothing with cubic Bezier patches • Point-Normal Construction • Linear or quadratic normal field [ATI/Valchos et al. 2004] • Interpolatory refinement • No dynamic topology to manage • Still non ordered triangle stream • Usually enough for real-time rendering

  23. Curved PN Triangles • With our approach: • Each coarse triangle is provided to GPU with its Bezier coefficients: {b300, b030,b003, b210,b201,b021, b120,b102,b012, b111} • After tessellation, the displacement is computed with coefficients in the vertex program Note: coefficients can be computed on the GPU and stored as textures.

  24. Scalar Tagged Mesh [EG 2005] • Enriched Meshes for real-time applications • PN Triangles + Scalar tag control on a per-vertex basis • Surface refinement driven by scalar tags

  25. Scalar Tagged Mesh [EG 2005] • Shape factors: sharpness, tension, bias, … • Sharp creases locallydefined • Bezier coefficient: classification around each vertex • Intuitive behavior

  26. Scalar Tagged Mesh [EG 2005] • Procedural Normal Map • Procedural Displacement Map • With our approach: still coarse triangle/coefficient transmission Note: branching needed in our implementation

  27. Performance Simple tessellation of triangular meshes. • no full resolution topology generation/storage • For dynamic objects, between 1 and 3 orders of magnitude faster than a CPU refinement

  28. Advantages • Negligible graphics bus bandwidth • Full use of GPU for deep refinement • Easy to implement • Easy to integrate as API extension (OpenGL driver implementation) • Drawing of objects that would not fit in memory

  29. Drawbacks • Attributes transfer not optimal (uniform variables) • Need of a middleware support for full GPU utilization at low tessellation rate • Today more interesting for deep refinement (>6x6)

  30. Alternative • Non triangular RP • Non polygonal rendering (point-based surfaces) • Non regular RP • Alternative RP parameterization • Alternative interpolation

  31. Conclusion • A low cost Hardware Tessellator Unit • Generic method for hardware surface tessellation an displacement • An hardware implementation of Curved PN Triangles for ALL programmable GPUs • Very deep tessellation rate for procedural displacements • Easy to implement • Work on today’s GPU/no additional hardware

  32. Conclusion • Refinement Shader: • RP-based interpolation = Tessellation • Function evaluation/query = Displacement • Output

  33. Current and Future Work • Symmetry analysis for rough view-dependent LOD • Refinement with high order continuity using constrained meshes (vertex degree) [Bolz2002] • Semi-automatic conversion of larges meshes to GPU Fair Representation • New local smoothing algorithms (ST-Meshes)

  34. Thank you for your attention ! Demo http://www.labri.fr/~boubek

More Related