By Joey Green. What is a geometry shader? Demo Go over code More geometry shader info Transform Feedback Render To Cube Map Final Project.

Slides:



Advertisements
Similar presentations
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Advertisements

Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
 The success of GL lead to OpenGL (1992), a platform-independent API that was  Easy to use  Close enough to the hardware to get excellent performance.
Real-time Dynamic HDR Based Lighting in a Static Environment Marcus Hennix Daniel Johansson Gunnar Johansson Martin Wassborn.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
Introduction to Geometry Shaders 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.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
The programmable pipeline Lecture 10 Slide Courtesy to Dr. Suresh Venkatasubramanian.
GEOMETRY SHADER. Breakdown  Basics  Review – graphics pipeline and shaders  What can the geometry shader do?  Working with the geometry shader  GLSL.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
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.
Week 2 - Wednesday CS361.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
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 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSE 690: GPGPU Lecture 6: Cg Tutorial Klaus Mueller Computer Science, Stony Brook University.
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.
1 10/24/ :01 UML Graphics II Shadows Session 4.
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.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Accelerated Stereoscopic Rendering using GPU François de Sorbier - Université Paris-Est France February 2008 WSCG'2008.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
OpenGL Shader Language Vertex and Fragment Shading Programs.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Lecture.
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.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Computer Graphics Imaging Lecture 13 and 14 UV Mapping.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
CS 4722 Made by Dr. Jeffrey Chastine Modified by Dr. Chao Mei
Shaders, part 2 alexandri zavodny.
- Introduction - Graphics Pipeline
Shader.
The Graphic PipeLine
Introduction to OpenGL
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Models and Architectures
Suggestive Contours with Geometry Shader
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
Chapter VI OpenGL ES and Shader
Graphics Processing Unit
Lecture 13 Clipping & Scan Conversion
Chapter XVIII Surface Tessellation
Computer Graphics Introduction to Shaders
© 2012 Elsevier, Inc. All rights reserved.
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
Introduction to OpenGL
OpenGL-Rendering Pipeline
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

By Joey Green

What is a geometry shader? Demo Go over code More geometry shader info Transform Feedback Render To Cube Map Final Project

One primitive at a time Manipulate, Remove, or Create Primitives Discards original primitive Result is new set of transformed vertices Clip coordinates Does not replace vertex shader Input and output primitive types don’t have to match August 3, 2009: OpenGL 3.2 as core functionality

Glchar GeometryShaderSource; //load shader source Glint objectGS; objectGS = glCreateShader(GL_GEOMETRY_SHADER); glShaderSource(objectGS, 1, &GeometryShaderSource, NULL); glCompileShader(objectGS); myShaderProgam = glCreateProgram() glAttachShader(myShaderProgram, objectGS); glAttachShader(myShaderProgram, objectVS); glAttachShader(myShaderProgram, objectFS); glUseProgram(myShaderProgram);

Demo

Vertex Shader

Geometry Shader

Fragment Shader

Primitive type must match primitive mode Input Types: points lines lines_adjacency triangles triangles_adjacency Draw Modes: points lines lines_strip line_loop lines_adjacency lines_strip_adjacency triangles triangle_strip triangle_fan triangles_adjacency Triangle_strip_adjacency

One to six input vertices per input primitive [2]

gl_PrimitiveIDIn number of primitives processed so far set in primitive assembly stage gl_in[] gl_Position – position from vertex shader, transformed? gl_PointSize – size in pixels gl_ClipDistance[] – user defined clip distance

Right after Geometry or Vertex Shader Move vertex attributes to transform feedback buffer Decide to reprocess or send on for rendering Calculations per vertex per frame can stay on GPU

Cube Map Texture Reflections Texture with six sections for each face Without Geometry Shader for (face = 0; face < 6; face++) { //change section to render to //change the look at direction drawSpheres(); } With Geometry Shader gl_Layer Render primitives to the different layers gl_Layer specifies layer to render to One pass

Without GS( Spines )With GS Extend a quad along an edge that is shared by a front and back facing triangle. Draw front faces Draw back faces in line mode Spines along the end of an edge

Required Shaders Cube Map Geometry Shader Real-Time Glow Shader Desired Scene Rendered from height map [5] [6]

[1] K. Akeley and M. Segal, “The OpenGL Graphics System: A Specification( Version 4.0 ( Core Profile ) – March 11, 2010), “ The Khronos Group Inc., Mar pp [2] P. Rideout, “Silhouette Extraction,” The Little Grasshopper, ( current 24 Oct ) [3] M. Costa, “Chapter 11 – Advanced Shader Usage – Geometry Shaders,” Rendering Wonders, ( current 7 Feb ) [4] B. Dole, “Tutorial 28 – Particle System using Transform Feedback,” OpenGL Step By Step, current 8 August 2011 ) [5] J. Tsiombika, “Cube Map Test,” Nuclear’s Junkyard ( current 20 March 2009 ) [6] J. O’Rorke, “Chapter 21. Real-Time Glow,” Nvidia Developer Zone, ( current September 2007 ) [7] P. Rideout, “Noise Based Particles, Part II,” The Little Grasshopper, ( current 29 Jan )