Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
Advertisements

Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
The Graphics Pipeline Patrick Cozzi University of Pennsylvania CIS Fall 2012.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
Damon Rocco.  Tessellation: The filling of a plane with polygons such that there is no overlap or gap.  In computer graphics objects are rendered as.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
Status – Week 243 Victor Moya. Summary Current status. Current status. Tests. Tests. XBox documentation. XBox documentation. Post Vertex Shader geometry.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Geometric Objects and Transformations. Coordinate systems rial.html.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
1 Dr. Scott Schaefer Programmable Shaders. 2/30 Graphics Cards Performance Nvidia Geforce 6800 GTX 1  6.4 billion pixels/sec Nvidia Geforce 7900 GTX.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
CSE Real Time Rendering Week 2. Graphics Processing 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
Accelerated Stereoscopic Rendering using GPU François de Sorbier - Université Paris-Est France February 2008 WSCG'2008.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Geometry Shader (GLSL)
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Fateme Hajikarami Spring  What is GPGPU ? ◦ General-Purpose computing on a Graphics Processing Unit ◦ Using graphic hardware for non-graphic computations.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
What are Computer Graphics Basically anything that is on you Monitor – This includes the text that you will see Text isn’t Advanced Graphics But…. Understanding.
Ray Tracing using Programmable Graphics Hardware
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
CS 4722 Made by Dr. Jeffrey Chastine Modified by Dr. Chao Mei
GPU Architecture and Its Application
- Introduction - Graphics Pipeline
Programmable Shaders Dr. Scott Schaefer.
Graphics Processing Unit
Introduction to OpenGL
Chapter 6 GPU, Shaders, and Shading Languages
From Turing Machine to Global Illumination
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Graphics Processing Unit
Chapter V Vertex Processing
Lecture 13 Clipping & Scan Conversion
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Introduction to OpenGL
OpenGL-Rendering Pipeline
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.

Overview Geometry Shaders in the Pipeline Primitive Types Applications Performance

Birds Eye View Create or destroy primitives on the GPU Requires – DirectX 10 – OpenGL 3.2 or GL_ARB_geometry_shader4 Geometry Shader

Geometry Shaders in the Pipeline Vertex Shader Fragment Shader Vertices in world coordinates Vertex Shader Fragment Shader Vertices in world coordinates Perspective Divide and Viewport Transformation clip coordinateswindow coordinates

Geometry Shaders in the Pipeline Geometry Shader Vertex Shader Fragment Shader Primitive Assembly PD and VT Geometry Shader Vertex Shader Fragment Shader Primitive Assembly Clipping PD and VT Geometry Shader Vertex Shader Fragment Shader PD and VT clip coordinates window coordinates

Primitive Types Geometry Shader Output primitives can be disconnected

Primitive Types Input Primitives GL_POINTS GL_LINES GL_TRIANGLES Adjacency Output Primitives GL_POINTS GL_LINE_STRIP GL_TRIANGLE_STRIP

Primitive Types Input primitive type doesn’t have to equal output primitive type blogs.agi.com/insight3d/index.php/2008/10/23/geometry-shader-for-debugging-normals/

Applications – Wireframe How would you implement glPolygonMode?

Applications – Wireframe How would you implement glPolygonMode? Triangles Points or Line Strips

Applications - Billboards How would you implement GL_ARB_point_sprite?

Applications - Billboards How would you implement GL_ARB_point_sprite? Points Triangle Strips

Applications - Billboards Code: miniglobe.svn.sourceforge.net/viewvc/miniglobe/Source/Scene/Renderables/BillboardCollection/

Applications - Billboards Code: miniglobe.svn.sourceforge.net/viewvc/miniglobe/Source/Scene/Renderables/BillboardCollection/

Applications – Wide Lines glLineWidth with width > 1 is deprecated in OpenGL 3.

Applications – Wide Lines

Two steps Clip to near plane. Why? Expand line to two triangles along screen space normal How would you outline? Code: miniglobe.svn.sourceforge.net/viewvc/miniglobe/Source/Scene/Renderables/Polyline/

Applications Displacement mapping Single pass cube map generation Terrain decompression Culling with instancing Extrusions Shadow volumes Fins along silhouettes for fur rendering

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

Images from meshula.net/wordpress/?p=124 coloranglelength Applications: Fur in Lost Planet

Performance Duplicates per-vertex operations for vertices shared by primitives Geometry Shader Vertex Shader 5 vertices processed9 vertices processed

Performance Geometry Shader Geometry Shader Geometry Shader Geometry Shader Must guarantee order in == order out

Performance Order guarantee affects parallelism Geometry Shader Geometry Shader Geometry Shader Reorder Buffer Clipping

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

Performance Maximum number of vertices a GS will output, e.g.: layout(triangle_strip, max_vertices = 4) out; NVIDIA: Minimize this, it determines the speed of GS execution Minimize vertex size – GS Input: Pack in VS – GS Output: Compute in FS

Performance GeForce 8, 9, and GTX2xx – Output size = vertex size * max_vertices Maximum output size: 1,024 scalars Performance is inversely proportional to output size Not a continuous function: 1-20 scalars: Peak Performance scalars: 50% Performance On GeForce 8800 GTX

Performance 1 The geometry shader must meet criteria in ATI Programming Guide ATI Optimized for 1:1 and 1:4 amplification 1 High amplification can't use on-chip buffers – memory bandwidth problem

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

Summary Geometry shaders are now widely used Modify incoming primitive or make a limited number of copies Not for Large scale amplification Instancing

Resources developer.nvidia.com/object/gpu_programming_guide.html Section 4.6

Resources developer.amd.com/media/gpu_assets/ATI_Radeon_HD_2000_programming_guide.pdf

Resources Introduction to Direct3D 10 SIGGRAPH 2007 Course Notes

Resources GL_ARB_geometry_shader4

Resources Section 3.5