Introduction to Geometry Shaders - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Introduction to Geometry Shaders

Description:

clip coordinates. window coordinates. Geometry Shaders in the ... Clipping. Performance. Buffer size needs to support a number of threads running in parallel ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 25
Provided by: seasU
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Geometry Shaders


1
Introduction to Geometry Shaders
  • Patrick Cozzi
  • Analytical Graphics, Inc.

2
Overview
  • Geometry Shaders in the Pipeline
  • Primitive Types
  • Applications
  • Performance

3
Birds Eye View
  • Create or destroy primitives on the GPU
  • Requires DirectX 10 or GL_ARB_geometry_shader4

Geometry Shader
4
Geometry Shaders in the Pipeline
5
Geometry Shaders in the Pipeline
6
Primitive Types
Geometry Shader
Output primitives can be disconnected
7
Primitive Types
  • Input Primitives
  • GL_POINTS
  • GL_LINES
  • GL_TRIANGLES
  • Adjacency
  • Output Primitives
  • GL_POINTS
  • GL_LINE_STRIP
  • GL_TRIANGLE_STRIP

8
Primitive Types
  • Input primitive type doesnt have to equal output
    primitive type

9
Applications
  • Implement glPolygonMode
  • Triangles Points or Line Strips
  • Emulate GL_ARB_point_sprite
  • Points Triangle Strips

10
Applications
  • Displacement Mapping
  • Single pass generate a cube map
  • Extrusions
  • Shadow volumes
  • Fins along silhouettes for fur rendering

11
Applications Fur in Lost Planet
  • Render surface, write buffers for
  • Fur Color
  • Angle
  • Length
  • GS turns each pixel into a translucent polyline
  • Automatic LOD

12
Applications Fur in Lost Planet
color
angle
length
Images from meshula.net/wordpress/?p124
13
Performance
  • Duplicates per-vertex operations for vertices
    shared by primitives

5 vertices processed
9 vertices processed
Geometry Shader
Vertex Shader
14
Performance
  • Must guarantee order in order out

15
Performance
  • Order guarantee affects parallelism

16
Performance
  • Buffer size needs to support a number of threads
    running in parallel

17
Performance
  • Maximum number of vertices a GS will output
  • GEOMETRY_VERTICES_OUT_ARB
  • Determines the speed of GS execution
  • Make this and vertex sizes as small as possible

18
Performance
  • GeForce 8, 9, and GTX2xx
  • Output size vertex size GEOMETRY_VERTICES_OUT_
    ARB
  • Maximum output size 1,024 scalars
  • Performance is inversely proportional to output
    size
  • Not a continuous function
  • 1-20 scalars Peak Performance
  • 27-40 scalars 50 Performance
  • On GeForce 8800 GTX

19
Performance
  • Benefits
  • Reduces vertex buffer memory usage
  • Compute in GS, e.g. normals
  • Create more geometry
  • No need to duplicate (e.g. compared to equivalent
    VS implementation)
  • Less memory less bus traffic
  • Reduces vertex attribute setup cost

20
Summary
  • Modify incoming primitive or make a limited
    number of copies
  • Not for
  • Large scale amplification
  • Instancing

21
Resources
Introduction to Direct3D 10 SIGGRAPH 2007 Course
Notes
  • www.microsoft.com/downloads/details.aspx?FamilyId
    96CD28D5-4C15-475E-A2DC-1D37F67FA6CDdisplaylange
    n

22
Resources
GL_ARB_geometry_shader4
  • www.opengl.org/registry/specs/ARB/geometry_shader4
    .txt

23
Resources
Section 3.5
  • www.realtimerendering.com

24
Resources
Section 4.6
  • developer.nvidia.com/object/gpu_programming_guide.
    html
Write a Comment
User Comments (0)
About PowerShow.com