GLSL Review Monday, Nov. 28 2011. OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.

Slides:



Advertisements
Similar presentations
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
Advertisements

COMPUTER GRAPHICS SOFTWARE.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Informationsteknologi Wednesday, December 12, 2007Computer Graphics - Class 171 Today’s class OpenGL Shading Language.
HCI 530 : Seminar (HCI) Damian Schofield.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
Status – Week 277 Victor Moya.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
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.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
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.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
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.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
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.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
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.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
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.
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.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The GPU.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
Shaders, part 2 alexandri zavodny.
- Introduction - Graphics Pipeline
Programmable Pipelines
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Graphics Processing Unit
Deferred Lighting.
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
Chapter VI OpenGL ES and Shader
Graphics Processing Unit
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter V Vertex Processing
ICG 2018 Fall Homework1 Guidance
Programming with OpenGL Part 3: Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

GLSL Review Monday, Nov

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Aggregate per-vertex data such as location, normal, color, tex coords, etc.

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Perform model-view, perspective, normal translations to vertices and normals

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Break down quads, lines, points, etc. into triangles for easy interpolation in the rasterizer. Custom shaders can actually add new primitives to the pipeline here.

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Divide triangle surface into per-pixel fragments, interpolating attributes from triangle vertices to each fragment

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Use normal, color, texture information to assign color to fragments

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Blend overlapping fragments from different shapes according to transparency and OVER operator

OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending Display! Send finalized framebuffer contents back to the CPU!

What can shaders do? More complex material shading models More realistic surface simulation using fractals, etc. Arbitrary modification of geometry Why do it on the GPU instead of the CPU? …

What can shaders do? Why do it on the GPU instead of the CPU? – Parallelism – Processor / bus highly optimized for graphics tasks Vs.

Shaders Access through STShaderProgram If we replace OpenGL’s default shaders, we *must* replicate all necessary functionality from the GL pipeline (i.e. transforming vertices to clip coordinates, assigning colors to fragments.)

Vertex Shader Input: untransformed vertex (as entered by GL programmer), vertex data (such as color, normals, etc.) Output: model-view and projection- transformed vertex, inverse transpose- transformed normal This is our chance to pass any model-related position information to the fragment shader!

Rasterize stage: (not programmable, but important) Takes triangles (sets of 3 vertices) and breaks them into fragments (pixel-sized tiles covering the surface of the triangle.) Vertex data is interpolated to produce fragment data Each fragment sent to the fragment shader

Fragment shader Can use any information passed from the vertex shader to calculate gl_FragColor Can access textures Blending (for semi-transparent, overlapping fragments) occurs later.

ModelView matrix Transforms objects into “eye” space This space is the physical model of the environment we’ve programmed: the locations, vector magnitudes, and relative angles of all objects we are drawing are defined in this space. The camera, at (0, 0, 0) is the “eye”

Projection Matrix Transforms vertices from eye coordinates into clip coordinates – Clip coordinates of objects within the image are in the [-1, 1] x [-1, 1] x [0, 1] box. If model-view matrix places objects and camera into eye space, Projection matrix chooses the camera lens, sets camera fov and takes picture.

Projection Matrix OpenGL has 2 kinds of projection: Orthographic and Perspective We can create custom projection matrices to simulate different types of lenses (e.g. fisheye projection)

Projection Matrix Not guaranteed to preserve relative vector lengths or angles between vectors from eye space (In fact, probably won’t!) Is it possible to compute physical properties of the model (for shading purposes) without this metric information?