Programmable Graphics Hardware



Similar documents
CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Introduction to GPGPU. Tiziano Diamanti

Computer Graphics Hardware An Overview

Developer Tools. Tim Purcell NVIDIA

Color correction in 3D environments Nicholas Blackhawk

How To Teach Computer Graphics

L20: GPU Architecture and Models

Graphics Cards and Graphics Processing Units. Ben Johnstone Russ Martin November 15, 2011

GPGPU Computing. Yong Cao

Performance Optimization and Debug Tools for mobile games with PlayCanvas

DTI / Titolo principale della presentazione IPHONE ENCRYPTION. Litiano Piccin. 11 ottobre 2014

Introduction to Computer Graphics

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

GPUs Under the Hood. Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology

QCD as a Video Game?

ITIL v3 - Overview. Claudio Tancini Marzo 2015 INTERNAL USE ONLY

Computer Graphics on Mobile Devices VL SS ECTS

Corso: Supporting and Troubleshooting Windows 10 Codice PCSNET: MW10-3 Cod. Vendor: Durata: 5

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

Writing Applications for the GPU Using the RapidMind Development Platform

Real-Time Realistic Rendering. Michael Doggett Docent Department of Computer Science Lund university

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Web Based 3D Visualization for COMSOL Multiphysics

Parallel Web Programming

OpenGL Shading Language Course. Chapter 5 Appendix. By Jacobo Rodriguez Villar jacobo.rodriguez@typhoonlabs.com

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

ONLINE COLLABORATION USING DATABASES IMAGE EDITING SPECIALISED LEVEL CAD2D SPECIALISED LEVEL

Optimizing AAA Games for Mobile Platforms

GPU Architecture. Michael Doggett ATI

How To Test An Electronic Board With A Flying Probe Tester

Low power GPUs a view from the industry. Edvard Sørgård

Chi sono in quattro punti.

NVFX : A NEW SCENE AND MATERIAL EFFECT FRAMEWORK FOR OPENGL AND DIRECTX. TRISTAN LORACH Senior Devtech Engineer SIGGRAPH 2013

A Crash Course on Programmable Graphics Hardware

Introduction to Computer Graphics with WebGL

Main Points. File layout Directory layout

The Future Of Animation Is Games

IBM Academic Initiative

Radeon HD 2900 and Geometry Generation. Michael Doggett

How To Lock A File In A Microsoft Microsoft System

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith

Introduction GPU Hardware GPU Computing Today GPU Computing Example Outlook Summary. GPU Computing. Numerical Simulation - from Models to Software

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA

Lecture Notes, CEng 477

Introduction to Computer Graphics

Corso: Mastering Microsoft Project 2010 Codice PCSNET: MSPJ-11 Cod. Vendor: Durata: 3

Visualizing Data: Scalable Interactivity

Lezione 4: Grafica 3D*(II)

Source code security testing

Overview Motivation and applications Challenges. Dynamic Volume Computation and Visualization on the GPU. GPU feature requests Conclusions

AutoForm plus R6 Prodotti Stand-alone: Configurazioni compatibili

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

SCADA / Smart Grid Security Who is really in control of our Control Systems?

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

AMD GPU Architecture. OpenCL Tutorial, PPAM Dominik Behr September 13th, 2009

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Radeon GPU Architecture and the Radeon 4800 series. Michael Doggett Graphics Architecture Group June 27, 2008

Introduction to WebGL

n N e E 0 m A R sr S l /01

L ordine perfet to. In perfect order. Attuatore elettrico a stelo per apertura e chiusura di finestre a sporgere, a lamelle, pale frangisole e cupole

SISTEMA ANTE EVO 2 DOOR SYSTEM EVO 2

GPU Shading and Rendering: Introduction & Graphics Hardware

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

FOR TEACHERS ONLY The University of the State of New York

Hardware design for ray tracing

AMD RenderMonkey IDE Version 1.71

3D Computer Games History and Technology

PREPOSITION OF PLACE

Computer Graphics. Anders Hast

BRINGING UNREAL ENGINE 4 TO OPENGL Nick Penwarden Epic Games Mathias Schott, Evan Hart NVIDIA

C.S.E. Nodi Tipici Parametrizzati al /04/2015 Copyright (c) Castalia srl

NVIDIA GeForce GTX 580 GPU Datasheet

Accelerating Intensity Layer Based Pencil Filter Algorithm using CUDA

Chapter 2 - Graphics Programming with JOGL

The Economic Outlook Il quadro economico INTELLIGENCE ON THE WORLD, EUROPE, AND ITALY LO SCENARIO DI OGGI E DI DOMANI PER LE STRATEGIE COMPETITIVE

Optimizing Unity Games for Mobile Platforms. Angelo Theodorou Software Engineer Unite 2013, 28 th -30 th August

Android and OpenGL. Android Smartphone Programming. Matthias Keil. University of Freiburg

Introduction to GPU Programming Languages

Programming 3D Applications with HTML5 and WebGL

Game Development in Android Disgruntled Rats LLC. Sean Godinez Brian Morgan Michael Boldischar

4 IN 5 OUT MATRIX SWITCHER YUV & Stereo Audio

Vertex and fragment programs

Medical Image Processing on the GPU. Past, Present and Future. Anders Eklund, PhD Virginia Tech Carilion Research Institute

Geo-Platform Introduction

GPU Profiling with AMD CodeXL

Un nuovo modello di efficienza all interno del Data Center Fabio Di Dionisio HP Storage Division

Nuovi domini di primo livello - Registra nuove estensioni con FabsWeb_HOST

NVIDIA workstation 3D graphics card upgrade options deliver productivity improvements and superior image quality

Technologies and systems for business integration.

Corso: Core Solutions of Microsoft Skype for Business 2015 Codice PCSNET: MSKY-5 Cod. Vendor: Durata: 5

ATI Radeon 4800 series Graphics. Michael Doggett Graphics Architecture Group Graphics Product Group

Transcription:

Programmable Graphics Hardware Alessandro Martinelli alessandro.martinelli@unipv.it 6 November 2011 Rendering Pipeline (6): Programmable Graphics Hardware Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware Computer Graphics

Vertex e Fragment Shader Rendering Pipeline (6): Programmable Graphics Hardware Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware Vertex and Fragment Shaders Shading Languages Examples Geometry Shading, Redirection and Unified Shading A. Martinelli Pipeline 2/12/2009 2 / 19

Vertex e Fragment Shader Rendering Pipeline (OpenGL 1.x Model) With shaders, the Rendering Pipeline... Vertici ymax (x,c,z,txos[])min (x,c,z,txos[])max y Modulo di Digitalizzazione ymin Frammenti( (x,y),(c,z,txos[]) ) Gestione Primitive Clipping, Viewport Transform A. Martinelli Pipeline 2/12/2009 3 / 19

Vertex e Fragment Shader Rendering Pipeline (OpenGL 2.0+ Model)...got changed: Vertex Pipeline and Fragment Pipeline got replaced by progammable graphics hardware components, which are used to customize how vertices and fragments are elaborated. ymax (x,c,z,txos[])min (x,c,z,txos[])max y Modulo di Digitalizzazione ymin Frammenti( (x,y),(c,z,txos[]) ) Gestione Primitive Clipping, Viewport Transform A. Martinelli Pipeline 2/12/2009 4 / 19

Vertex e Fragment Shader New Units Vertex Shader replaces fixed vertex-based functionalities: texture coordinates management, transforms, lighting Fragment Shader replaces fixed fragment-based functionalities: all color mixing methods for multi-texturing, and fog. This units may be implemented by software developers: so it is possible to customize the way in which vertices and fragments are managed. The languages we will use to do so are called Shading Langauges All the GPU supporting this model, will have more units working in parallel and running your vertex or fragment shader on more vertices and fragments at a time. A. Martinelli Pipeline 2/12/2009 5 / 19

Vertex e Fragment Shader Vale la considerazione già fatta per la pipeline standard: il numero dei frammenti è mediamente molto più grande del numero dei vertici che descrivono i triangoli. Questo comporta la necessità di disporre di un numero superiore di unità di fragment shading che di vertex shading, esattamente come presentanto nella slide precedente. A. Martinelli Pipeline 2/12/2009 6 / 19

Vertex e Fragment Shader Some details... Vertex Shader It takes as input all data related to a vertex you send to the pipeline. It gives as output output still vertex infos, the ones used by the primitives manager and clipping modules. It can only change vertex Data. It cannot generate new vertices. It cannot delete vertices. Fragment Shader It takes as input a fragment produces by rasterization hardware. It gives as output a fragment, with the data required by buffers manager. It cannot generate new fragments, but It may delete (discard) fragments. A. Martinelli Pipeline 2/12/2009 6 / 19

Shading Languages Rendering Pipeline (6): Programmable Graphics Hardware Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware Vertex and Fragment Shaders Shading Languages Examples Geometry Shading, Redirection and Unified Shading A. Martinelli Pipeline 2/12/2009 7 / 19

Shading Languages Shading Languages There are some available shading languages: HLSL ( High Level Shading Language ): Microsoft Direct3D Shading Language. GLSL ( Graphics Library Shading Language): OpenGL Shading Language CG: very well known NVidia specific Shading Language. Shading languages are vectorial languages: They define operations on vectors with 1,2 3 or 4 elements. Sums, products and subtractions are always component by component on vectors with same length. You can use control structures like if or for. But: they may bring to performance issues on some hardware. The only safe control is a for cycling a fixed number of times. (Like for(int i=0;i<4;i++)), because you will have a compiler unwrapping your cycle. A. Martinelli Pipeline 2/12/2009 8 / 19

Shading Languages GLSL Nowadays, You will find GLSL in almost every OpenGL based platform. OpenGL Versions: main differences OpenGL 2.0 will still have the Fixed Pipeline. So, in that case, GLSL will allow the access to all the State Variables used by Fixed Pipelines. For example, you can read Fixed-Pipeline Lights Parameters in your shader. With OpenGL ES 2.0/2.1 and WebGL you have not a Fixed Pipeline. So the OpenGL API is missing important functions used to set State Variables and that State Variables are not available in GLSL A. Martinelli Pipeline 2/12/2009 9 / 19

Shading Languages GLSL: Variables Shading Languages variables are very significant: Predefined Language Variables Uniform Variables Varying Variables Of course, these languages will have temporary variables as every other languages. A. Martinelli Pipeline 2/12/2009 10 / 19

Shading Languages Predefined Language Variables Predefined Language Variables are used to access fixed pipeline data. For example: gl Vertex is the input position for a vertex in a Vertex Pipeline(should only be read). gl Position is the output position (unit volume position) for a vertex in a Vertex Pipeline(should only be written). gl Color is the input fragment color in a Fragment Shader (should only be read). gl ModelViewProjectionMatrix is the result of all transforms, a 4x4 which is the product of the Projection with the Modelview (should only be read). A. Martinelli Pipeline 2/12/2009 11 / 19

Shading Languages Varying Variables Generic Vertex Properties assigned by your Vertex Pipeline, which should be interpolated by rasterization Hardware because you want a value for them on each fragment. You can see them both in Fragment and in Vertex Shader. They can only be written on the Vertex Side. They can only be read on the Fragment Side. A Paradox in the Libraries At the time being, varying variables are deprecated in OpenGL 4.0. They are replaced with different solutions. But WebGL and ES versions still will be based on varying. A. Martinelli Pipeline 2/12/2009 12 / 19

Shading Languages Uniform Variables They are like standard State Variables. They are used to assign settings/parameters to Shaders. They indeed should be seen as Customized State Variables. They can only be read both by Vertex and Fragment Shaders. They will be assigned an identifier. With gluniform and the identifier, we will be able to assign values to Uniforms. A. Martinelli Pipeline 2/12/2009 13 / 19

Examples Rendering Pipeline (6): Programmable Graphics Hardware Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware Vertex and Fragment Shaders Shading Languages Examples Geometry Shading, Redirection and Unified Shading A. Martinelli Pipeline 2/12/2009 14 / 19

Examples An Example GLSL Vertex Shader: void main(void){ gl Position = gl ModelViewProjectionMatrix gl Vertex; gl FrontColor = gl Color; gl TexCoord[0] = gl MultiTexCoord0; } GLSL Fragment Shader: void main(void){ gl FragColor = gl Color vec4(1,0.5,0.5,1); } A. Martinelli Pipeline 2/12/2009 15 / 19

Geometry Shading, Redirection and Unified Shading Rendering Pipeline (6): Programmable Graphics Hardware Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware Vertex and Fragment Shaders Shading Languages Examples Geometry Shading, Redirection and Unified Shading A. Martinelli Pipeline 2/12/2009 16 / 19

Geometry Shading, Redirection and Unified Shading GPU: Towards the State of Art (1/3) There are some important additional elements in modern GPUs. Redirection: it is possible to move part of data stream traversing the Pipeline and store it in GPU memory. For example, we can move vertices elaborated by a Vertex Shader and store them in a Vertex Buffer Object. Unified Shading Model: we have a big set of programmable units, instead of having specific units for each Shader Type. Usually it is allowed (with specific libraries like OpenCL) to access that units apart from the rendering process, in order to use them to execute other parallel programming tasks. Geometry Shaders: an additional shader which can change the structure of primitives. It is allowed to generate geometries and vertices, and that s making it having serious performance issues. Primitives Shader: in order to make things more complex, OpenGL 4.0 allows the definition of customized primitives, with the introduction of Primitives Shaders. This should be seen as a workaround to the issues related to Geometry Shaders. A. Martinelli Pipeline 2/12/2009 17 / 19

Geometry Shading, Redirection and Unified Shading GPU: Towards the State of Art (2/3) Gestione Primitive Clipping, Viewport Transform Modulo di Digitalizzazione Buffer Manager A. Martinelli Pipeline 2/12/2009 18 / 19

Geometry Shading, Redirection and Unified Shading Esiste una unica unità di calcolo parallelo con un numero molto grande di unità programmabili al suo interno. I vertici che arrivano alla pipeline vengono passati ad una unità di gestione dei vertex shader; questa unità chiede all unità di calcolo parallelo di avere alcuni processori allocati all esecuzione di un programma di vertex shading. I vertici elaborati tornano all unità di gestione dei vertex shader, che li manda alla solita unità di gestione delle primitive. L unità di gestione delle primitive passa i dati delle primitive ad una unità di Gestione dei Geometry Shader; questa unità è in grado di applicare programmi che data una primitiva sono in grado di produrre un numero grande di primitive, benchè allo stato dell arte l output di questi moduli è bloccato ad un massimo 1Kb. Per svolgere queste operazioni di elaborazione delle primitive, il modulo ha bisogno che l unità di calcolo parallelo gli allochi delle unità programmabili. Le primitive elaborate seguono il solito processo che prevede: clipping, viewport mapping e digitalizzazione. I frammenti vengono processati da una unità di gestione dei fragment shader, che utilizza le unità programmabili generiche per l implementazione. I frammenti elaborati sono passati al solito all unità di gestione dei buffer. Le unità programmabili hanno libero accesso alla gestione delle texture. Le unità programmabili possono salvare uno stream di dati in posizioni di memoria della scheda grafica. Le unità programmabili possono essere utilizzate, attraverso appositi linguaggi, anche da applicazioni esterne che non svolgono attività grafica o che svolgono attività grafica di supporto. A. Martinelli Pipeline 2/12/2009 19 / 19

Geometry Shading, Redirection and Unified Shading GPU: Towards the State of Art (3/3) Some very important considerations: Geometry Shaders are bad. It has been proven that Geometry Shaders can be replaced with a good use of Vertex Shaders Primitive Shaders are better, but they are really new (the first time in OpenGL standard specification was 2010), and available in few platforms. Redirection may bring to bad performance on some platforms. It should be used carefully. Embedded Systems (and WebGL) will be slow in introducing new Shading functionalities, which are less significant. Something which is guaranteed: the Unified Shading Model is part of most of the GPU since 2006: Shading units are managed with a load-balancing mechanics (that is: at run time more or less units will execute Vertex or Fragments Shaders, depending upon the number of vertices and fragments) This will dynamically improve the performance of programs using shading languages. Another reliable fact nowadays is the availability of Instruments and Libraries to access Parallel Hardware in GPUs. A. Martinelli Pipeline 2/12/2009 19 / 19