+ All Categories
Home > Documents > Generic Mesh Refinement on GPU

Generic Mesh Refinement on GPU

Date post: 11-Jan-2016
Category:
Upload: marlin
View: 24 times
Download: 0 times
Share this document with a friend
Description:
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) - PowerPoint PPT Presentation
Popular Tags:
34
Generic Mesh Generic Mesh Refinement on Refinement on GPU GPU Tamy Boubekeur & Christophe Tamy Boubekeur & Christophe Schlick Schlick LaBRI – INRIA – CNRS LaBRI – INRIA – CNRS University University of of Bordeaux Bordeaux
Transcript
Page 1: Generic Mesh Refinement on GPU

Generic Mesh Generic Mesh Refinement on Refinement on

GPUGPUTamy Boubekeur & Christophe Tamy Boubekeur & Christophe

SchlickSchlick

LaBRI – INRIA – CNRSLaBRI – INRIA – CNRSUniversityUniversity ofof Bordeaux Bordeaux

Page 2: Generic Mesh Refinement on GPU

Today GPU Features Today GPU Features

Combination of Vertex and Fragment ShadersCombination of Vertex and Fragment Shaders Dedicated hardware primitives (VBO, FBO) Dedicated hardware primitives (VBO, FBO) C-like programming language (GLSL, CG, HLSL)C-like programming language (GLSL, CG, HLSL)

> Most of the rendering task is on GPU> Most of the rendering task is on GPU

Page 3: Generic Mesh Refinement on GPU

Today GPU Rendering Today GPU Rendering

Per-pixel illuminationPer-pixel illumination Hard and Soft ShadowsHard and Soft Shadows HDR images [ATI 2003]HDR images [ATI 2003] Global Illumination Effects Global Illumination Effects

[NVIDIA 2005] [NVIDIA 2005]

> Near-Realistic real-time > Near-Realistic real-time renderingrendering

Page 4: Generic Mesh Refinement on GPU

Realistic ImageRealistic Image

Means realistic lighting of course, but also:Means realistic lighting of course, but also:

1.1. Complex objects (many polygons)Complex objects (many polygons)

2.2. Details (at the pixel resolution)Details (at the pixel resolution)

Usual solution:Usual solution:

1.1. Shape complexity: smooth and/or Shape complexity: smooth and/or detailled surfaces detailled surfaces

2.2. Appearance complexity: high-resolution Appearance complexity: high-resolution multi-texturing + fragments shaders multi-texturing + fragments shaders

Page 5: Generic Mesh Refinement on GPU

Fair Surface Fair Surface RepresentationRepresentation

Multi-scale representation for real-time graphics:Multi-scale representation for real-time graphics:1.1. Light representation for animation/physics.Light representation for animation/physics.2.2. On-the-fly geometric refinement for silhouette On-the-fly geometric refinement for silhouette

and contours.and contours.3.3. Details at rasterization time.Details at rasterization time.

One acceptable solution:One acceptable solution:1.1. CPU: Low resolution “clever” mesh, carefully CPU: Low resolution “clever” mesh, carefully

designed.designed.2.2. CPU/GPU: Medium resolution displacement map.CPU/GPU: Medium resolution displacement map.3.3. GPU: High resolution appearance map (normal, GPU: High resolution appearance map (normal,

color).color).

Page 6: Generic Mesh Refinement on GPU

Fair Surface Fair Surface RepresentationRepresentation

Multi-scale representation for real-time graphics:Multi-scale representation for real-time graphics:1.1. Light representation for animation/physics.Light representation for animation/physics.2.2. On-the-fly geometric refinement for silhouette On-the-fly geometric refinement for silhouette

and contours.and contours.3.3. Details at rasterization time.Details at rasterization time.

One acceptable solution:One acceptable solution:1.1. CPU: Low resolution “clever” mesh, carefully CPU: Low resolution “clever” mesh, carefully

designed.designed.2.2. CPU/GPU: Medium resolution displacement CPU/GPU: Medium resolution displacement

map.map.3.3. GPU: High resolution appearance map (normal, GPU: High resolution appearance map (normal,

color).color).

Page 7: Generic Mesh Refinement on GPU

Previous WorkPrevious Work Subdivision SurfacesSubdivision Surfaces

Many schemes [Catmull 1978]Many schemes [Catmull 1978][Loop 1987][Zorin 2000][Stam [Loop 1987][Zorin 2000][Stam 2003]2003]

Local control [Biermann 2001]Local control [Biermann 2001] Hardware evaluation [Bishoff Hardware evaluation [Bishoff

2000][Bolz 2002]2000][Bolz 2002] GPU implementation [Bolz 2003]GPU implementation [Bolz 2003]

[Shiue 2005][Shiue 2005] Local RefinementLocal Refinement

Curved PN Triangles [Vlachos Curved PN Triangles [Vlachos 2001][Chung 2003]2001][Chung 2003]

Scalar Tagged Meshes Scalar Tagged Meshes [Boubekeur 2005][Boubekeur 2005]

Page 8: Generic Mesh Refinement on GPU

Dynamic RefinementDynamic Refinement

Coarse Mesh

Tessellated Mesh

Refined MeshTessellator Displacement RENDERING

Frame Rendering:

CPU GPU

Non-programmable Graphics Hardware

Graphics Bus

AdvantagesAdvantages DrawbacksDrawbacksFlexibilityFlexibility Slow - Graphics Bus

bottleneckStatic Refinement limited by CPU memory

Refinement

Page 9: Generic Mesh Refinement on GPU

Dynamic RefinementDynamic Refinement

Coarse Mesh

Tessellated Mesh

Refined MeshTessellator Displacement RENDERING

Frame Rendering:

CPU GPU

Programmable Graphics Hardware

AdvantagesAdvantages DrawbacksDrawbacks Reduce per-frame CPU Reduce per-frame CPU workloadworkload

Tessellation still CPU limitedGraphics Bus bottleneck increased (tessellated mesh + displacement control data)

Graphics BusRefinement

Page 10: Generic Mesh Refinement on GPU

Our goalOur goal

Coarse Mesh

Tessellated Mesh

Refined MeshTessellator Displacement RENDERING

CPU GPU

Virtual GPU Tessellator Unit on today’s GPU

Dynamic coarse meshes on CPUDynamic coarse meshes on CPU Per-polygon tessellation on GPUPer-polygon tessellation on GPU Local computation of refined verticesLocal computation of refined vertices General enough solution for various kinds of General enough solution for various kinds of

local displacementlocal displacement

Graphics Bus Refinement

Page 11: Generic Mesh Refinement on GPU

Our ApproachOur Approach

Storing only ONE triangle fully tessellated : the Storing only ONE triangle fully tessellated : the RefinementRefinementPatternPattern (RP), directly on the GPU memory (RP), directly on the GPU memory1.1. ““Configuring” the GPU with the coarse triangle parametersConfiguring” the GPU with the coarse triangle parameters2.2. Rendering the RP instead of each coarse triangleRendering the RP instead of each coarse triangle3.3. ““Conforming” the RP to the current GPU « configuration »Conforming” the RP to the current GPU « configuration »

Page 12: Generic Mesh Refinement on GPU

GPU Refinement PatternGPU Refinement Pattern

The The only oneonly one drawn primitive drawn primitive A collection of triangle strips, pre-generated and stored on the A collection of triangle strips, pre-generated and stored on the

GPUGPU Problem : Problem :

1.1. How to transform efficiently the RP toward the current coarse How to transform efficiently the RP toward the current coarse triangle ?triangle ?

2.2. How to resolve this problem in a GPU-friendly fashion (ie. for each How to resolve this problem in a GPU-friendly fashion (ie. for each vertex of the RP vertex of the RP independently) ?independently) ?

Page 13: Generic Mesh Refinement on GPU

GPU Refinement PatternGPU Refinement Pattern

Solution:Solution:1.1. Encoding the barycentric coordinates {u, v, w} as Encoding the barycentric coordinates {u, v, w} as

position of the RP vertices.position of the RP vertices.

2.2. Using this parameterization to interpolate parameters Using this parameterization to interpolate parameters (position, normal, color, textures coordinates, etc) of (position, normal, color, textures coordinates, etc) of the current triangle in the vertex shader the current triangle in the vertex shader

Page 14: Generic Mesh Refinement on GPU

Displacement Displacement computationcomputation

Performed by the Vertex Shader for each refined Performed by the Vertex Shader for each refined vertex.vertex.

3D-based displacement with interpolated 3D-based displacement with interpolated position.position.

2D-based displacement with interpolated texture 2D-based displacement with interpolated texture coordinates > “texturing meshes with meshes”.coordinates > “texturing meshes with meshes”.

Page 15: Generic Mesh Refinement on GPU

Level Of DetailLevel Of Detail

Discrete LOD by simply storing a set of RP at Discrete LOD by simply storing a set of RP at different resolution on the GPU memorydifferent resolution on the GPU memory

Switching on a per-object basis between the Switching on a per-object basis between the different level of detaildifferent level of detail

Continuous LOD by interpolation between 2 Continuous LOD by interpolation between 2 consecutive level of details.consecutive level of details.

Page 16: Generic Mesh Refinement on GPU

Drawing algorithmDrawing algorithm

Draw (Draw (CoarseMeshCoarseMesh M, M, levellevel L) L)

GPU::RP::bindLOD (L);GPU::RP::bindLOD (L);

for allfor all TriangleTriangle T of M T of M dodo

GPU::placeAttributeOnGPU (T);GPU::placeAttributeOnGPU (T);

GPU::RP::draw ();GPU::RP::draw ();

Page 17: Generic Mesh Refinement on GPU

Drawing algorithmDrawing algorithm

Refinement Shader

1: Attribute Interpolation

2:Displacement Computation

3: Output refined vertex

Draw (Draw (CoarseMeshCoarseMesh M, M, levellevel L) L)

GPU::RP::bindLOD (L);GPU::RP::bindLOD (L);

for allfor all TriangleTriangle T of M T of M dodo

GPU::placeAttributeOnGPU (T);GPU::placeAttributeOnGPU (T);

GPU::RP::draw ();GPU::RP::draw ();

Page 18: Generic Mesh Refinement on GPU

ImplementationImplementation

Requires only Vertex Shader 1 compatible Requires only Vertex Shader 1 compatible GPUs (GPUs (allall programmable GPUs) programmable GPUs)

No use of Fragment Shaders, no multi-No use of Fragment Shaders, no multi-pass, no render-to-texture, etc.pass, no render-to-texture, etc.

Small vertex shader codeSmall vertex shader code

RP stored as triangle strips in a VBORP stored as triangle strips in a VBO

Page 19: Generic Mesh Refinement on GPU

Workload balanceWorkload balance Software side/CPU workload:Software side/CPU workload:

Initialization of the RP (set of RP for LOD).Initialization of the RP (set of RP for LOD). High level modification of the coarse mesh.High level modification of the coarse mesh.

Realtime graphics bus load:Realtime graphics bus load: Upload of the coarse per-triangle parameters Upload of the coarse per-triangle parameters

through uniforms variables (positions, through uniforms variables (positions, normals, colors, additional local parameters…)normals, colors, additional local parameters…)

Drawing call of RP (VBO) at the chosen LODDrawing call of RP (VBO) at the chosen LOD

Note: Nb draw calls = Nb coarse trianglesNote: Nb draw calls = Nb coarse triangles

Page 20: Generic Mesh Refinement on GPU

Workload balanceWorkload balance GPU additional workload:GPU additional workload:

At the beginning of the Vertex Program, for At the beginning of the Vertex Program, for the the RP-based interpolation RP-based interpolation (i.e. the (i.e. the “tessellation”)“tessellation”)

Essentially, the procedural displacement Essentially, the procedural displacement computation or query (displacement map with computation or query (displacement map with Vertex Shaders 3.0)Vertex Shaders 3.0)

Note:Note: the RP-based interpolation masks the the RP-based interpolation masks thememory latency for texture access from the memory latency for texture access from the

vertexvertexshader [NVIDIA 2004]shader [NVIDIA 2004]

Page 21: Generic Mesh Refinement on GPU

Procedural DisplacementProcedural Displacement

Concept: Concept: Object = Simple Base Mesh + Procedural Function(s)Object = Simple Base Mesh + Procedural Function(s)

Deep refinement required for Deep refinement required for high frequencieshigh frequencies: :

ex: a.sin(f|P|)ex: a.sin(f|P|) Full use of GPU (GPU-limited for deep Full use of GPU (GPU-limited for deep

refinements)refinements)

12 coarse triangle + frequency control; 786 432 12 coarse triangle + frequency control; 786 432 on GPU triangleson GPU triangles

Page 22: Generic Mesh Refinement on GPU

Curved PN TrianglesCurved PN Triangles Local triangle Local triangle

smoothing with cubic smoothing with cubic Bezier patchesBezier patches

Point-Normal Point-Normal ConstructionConstruction

Linear or quadratic Linear or quadratic normal fieldnormal field

[ATI/Valchos et al. 2004]

Interpolatory refinementInterpolatory refinement No dynamic topology to manageNo dynamic topology to manage Still non ordered triangle streamStill non ordered triangle stream Usually enough for real-time Usually enough for real-time

renderingrendering

Page 23: Generic Mesh Refinement on GPU

Curved PN TrianglesCurved PN Triangles

With our approach:With our approach: Each coarse triangle is provided to GPU with its Bezier Each coarse triangle is provided to GPU with its Bezier

coefficients:coefficients:{b300, b030,b003, b210,b201,b021, b120,b102,b012, b111}{b300, b030,b003, b210,b201,b021, b120,b102,b012, b111} After tessellation, the displacement is computed with After tessellation, the displacement is computed with

coefficients in the vertex programcoefficients in the vertex program

Note: coefficients can be computed on the GPU and Note: coefficients can be computed on the GPU and stored as textures.stored as textures.

Page 24: Generic Mesh Refinement on GPU

Scalar Tagged MeshScalar Tagged Mesh

Enriched Meshes for real-time applicationsEnriched Meshes for real-time applications PN Triangles + Scalar tag control on a per-PN Triangles + Scalar tag control on a per-

vertex basisvertex basis Surface refinement driven by scalar tagsSurface refinement driven by scalar tags

[EG 2005]

Page 25: Generic Mesh Refinement on GPU

Scalar Tagged MeshScalar Tagged Mesh

Shape Shape factors: sharpness, tension, biasfactors: sharpness, tension, bias, …, … Sharp Sharp creases locallycreases locally defineddefined Bezier coefficient: classification around each Bezier coefficient: classification around each

vertexvertex Intuitive behaviorIntuitive behavior

[EG 2005]

Page 26: Generic Mesh Refinement on GPU

Scalar Tagged MeshScalar Tagged Mesh

Procedural Normal MapProcedural Normal Map Procedural Displacement MapProcedural Displacement Map With our approach: still coarse With our approach: still coarse

triangle/coefficient transmissiontriangle/coefficient transmissionNote: branching needed in our implementation

[EG 2005]

Page 27: Generic Mesh Refinement on GPU

PerformancePerformance

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

Page 28: Generic Mesh Refinement on GPU

AdvantagesAdvantages

Negligible graphics bus bandwidthNegligible graphics bus bandwidth Full use of GPU for deep refinementFull use of GPU for deep refinement Easy to implementEasy to implement Easy to integrate as API extension Easy to integrate as API extension

(OpenGL driver implementation)(OpenGL driver implementation) Drawing of objects that would not fit Drawing of objects that would not fit

in memoryin memory

Page 29: Generic Mesh Refinement on GPU

DrawbacksDrawbacks

Attributes transfer not optimal Attributes transfer not optimal (uniform variables)(uniform variables) Need of a middleware support for full Need of a middleware support for full

GPU utilization at low tessellation rateGPU utilization at low tessellation rate Today more interesting for deep Today more interesting for deep

refinement (>6x6)refinement (>6x6)

Page 30: Generic Mesh Refinement on GPU

AlternativeAlternative

Non triangular RPNon triangular RP Non polygonal rendering (point-Non polygonal rendering (point-

based surfaces)based surfaces) Non regular RPNon regular RP Alternative RP parameterizationAlternative RP parameterization Alternative interpolationAlternative interpolation

Page 31: Generic Mesh Refinement on GPU

ConclusionConclusion A low cost Hardware Tessellator Unit A low cost Hardware Tessellator Unit Generic method for hardware surface Generic method for hardware surface

tessellation an displacementtessellation an displacement An hardware implementation of Curved An hardware implementation of Curved

PN Triangles for ALL programmable GPUsPN Triangles for ALL programmable GPUs Very deep tessellation rate for procedural Very deep tessellation rate for procedural

displacementsdisplacements Easy to implementEasy to implement Work on today’s GPU/no additional Work on today’s GPU/no additional

hardwarehardware

Page 32: Generic Mesh Refinement on GPU

ConclusionConclusion

Refinement ShaderRefinement Shader::1.1. RP-based interpolation = TessellationRP-based interpolation = Tessellation

2.2. Function evaluation/query = Function evaluation/query = DisplacementDisplacement

3.3. OutputOutput

Page 33: Generic Mesh Refinement on GPU

Current and Future WorkCurrent and Future Work Symmetry analysis for rough view-Symmetry analysis for rough view-

dependent LODdependent LOD Refinement with high order continuity Refinement with high order continuity

using constrained meshes (vertex using constrained meshes (vertex degree) [Bolz2002]degree) [Bolz2002]

Semi-automatic conversion of larges Semi-automatic conversion of larges meshes to GPU Fair Representationmeshes to GPU Fair Representation

New local smoothing algorithms (ST-New local smoothing algorithms (ST-Meshes)Meshes)

Page 34: Generic Mesh Refinement on GPU

Thank you for your Thank you for your attention ! attention !

http://www.labri.fr/~boubek

Demo


Recommended