Graphics Pipeline in a Nutshell



Similar documents
Computer Graphics Labs

Computer Graphics (Basic OpenGL, Input and Interaction)

An Introduction to. Graphics Programming

Chapter 1 Introduction to OpenGL

OpenGL & Delphi. Max Kleiner. 1/22

Aston University. School of Engineering & Applied Science

Methodology for Lecture. Review of Last Demo

Computer Graphics Labs

Graphics Input Primitives. 5. Input Devices Introduction to OpenGL. String Choice/Selection Valuator

CMSC 427 Computer Graphics 1

CS 4204 Computer Graphics

CMSC 427 Computer Graphics 1

The mouse callback. Positioning. Working with Callbacks. Obtaining the window size. Objectives

Univers Virtuels. OpenGL : Modélisation / Visualisation. Alexis NEDELEC. Centre Européen de Réalité Virtuelle Ecole Nationale d Ingénieurs de Brest

Introduzione ad OpenGL

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

Transformations in the pipeline

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Keyboard Mouse and Menus

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

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

Introduction to Computer Graphics

Jawaharlal Nehru Engineering College

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

An Introduction to 3D Computer Graphics, Stereoscopic Image, and Animation in OpenGL and C/C++ Fore June

4BA6 - Topic 4 Dr. Steven Collins. Chap. 5 3D Viewing and Projections

Einführung Computergraphik (WS 2014/15)

Input and Interaction. CS 432 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Computer Graphics Through OpenGL: From Theory to Experiments

Lecture Notes. Fundamentals of Computer Graphics. Prof. Michael Langer School of Computer Science McGill University

INTRODUCTION TO RENDERING TECHNIQUES

A Short Introduction to Computer Graphics

Input and Interaction. Project Sketchpad. Graphical Input. Physical Devices. Objectives

Nicolas P. Rougier PyConFr Conference 2014 Lyon, October 24 25

Lecture 3: Coordinate Systems and Transformations

Last lecture... Computer Graphics:

Lecture Notes, CEng 477

Input and Interaction

Introduction to Computer Graphics Techniques and Applications. Hong Qin Center for Visual Computing (CVC) Stony Brook University

Remote Graphical Visualization of Large Interactive Spatial Data

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

OpenGL Programming Guide

Chapter 2 - Graphics Programming with JOGL

CMSC 425 Game Programming 1

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Java game programming. Game engines. Fayolle Pierre-Alain

How To Learn To Program In Csc 406 Computer Graphics

3D Graphics and Cameras

REMOTE RENDERING OF COMPUTER GAMES

Equalizer. Parallel OpenGL Application Framework. Stefan Eilemann, Eyescale Software GmbH

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

Shadows. Shadows. Thanks to: Frédo Durand and Seth Teller MIT. Realism Depth cue

Cork Education and Training Board. Programme Module for. 3 Dimensional Computer Graphics. Leading to. Level 5 FETAC

Computer Graphics Hardware An Overview

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

Faculty of Computer Science Computer Graphics Group. Final Diploma Examination

Practical Data Visualization and Virtual Reality. Virtual Reality VR Software and Programming. Karljohan Lundin Palmerius

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

How To Draw A Billiards Ball In Gta 3D With Texture Mapping (Gta 3) On A Computer Or 2D Or Gta 2D (Gt) On Your Computer Or Computer Or Your Computer (Or Your Computer)

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

CS 378: Computer Game Technology

How To Teach Computer Graphics

Introduction to Computer Graphics

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

Interactive Computer Graphics

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

3D Math Overview and 3D Graphics Foundations

SkillsUSA 2014 Contest Projects 3-D Visualization and Animation

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Computer Graphics. Anders Hast

Intro to 3D Animation Using Blender

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

Computer Graphics on Mobile Devices VL SS ECTS

Programming 3D Applications with HTML5 and WebGL

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

Introduction Week 1, Lecture 1

Computer Graphics. Computer graphics deals with all aspects of creating images with a computer

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

VisIt Visualization Tool

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

Character Creation You can customize a character s look using Mixamo Fuse:

Graphical displays are generally of two types: vector displays and raster displays. Vector displays

The Design of the OpenGL Graphics Interface

Basic controls of Rhinoceros 3D software

Plug-in Software Developer Kit (SDK)

3D Viewing. Chapter 7. Projections. 3D clipping. OpenGL viewing functions and clipping planes

Creating Your Own 3D Models

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Multiresolution 3D Rendering on Mobile Devices

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Introduction to Computer Graphics

DEVELOPMENT OF REAL-TIME VISUALIZATION TOOLS FOR THE QUALITY CONTROL OF DIGITAL TERRAIN MODELS AND ORTHOIMAGES

Visualization of 2D Domains

Transcription:

Graphics Pipeline in a Nutshell How do we create a rendering such as this? CS334 Spring 2008 Design the scene (technical drawing in wireframe ) Apply perspective transformations to the scene geometry for a virtual camera Hidden lines removed and colors added Geometric primitives filled with constant color 1

View-independent lighting model added View-dependent lighting model added Texture mapping: pictures are wrapped around objects Reflections, shadows, and bumpy surfaces 2

How are the objects described in a computer? Points (or vertices) e.g., x, y, z Lines l(t) = a+tb (a,b) (u,v,s,t) Triangles 3 points 2 vectors (cross product) meshes: nice collection of triangles strips: efficient collection of connected triangles Polygons n-sided polygons typically convex (why?) polygon soup Manifold: 2D manifold in 3D space: what are they good for? Is a tabletop object part of the table or a separate object? Curved surfaces B-spline patches Functions F(x,y,z)=0 Superquadrics, etc What else? image: http://research.microsoft.com/users/hhoppe/gim.pdf What information is needed per vertex? Position Normal Color Texture coordinates What information is needed per geometric primitive? Color Normal Material properties (e.g. textures) Transformations 3

Transformations Transformations glrotatef(d,rx,ry,rz); gltranslate3f(tx,ty,tz); gltranslate3f(tx,ty,tz); glrotatef(d,rx,ry,rz); and Shading Transformation Light sources Point light Models an omnidirectional light source (e.g., a bulb) Directional light Models an omnidirectional light source at infinity Spot light Models a point light with direction Light model Ambient light Diffuse reflection Specular reflection Geometric Primitives 4

s Etc Perspective projection OpenGL OpenGL Online Software interface to graphics hardware ~150 distinct commands Hardware-independent and widely supported To achieve this, no windowing tasks are included GLU (Graphics Library Utilities) Provides some higher-level modeling features such as curved surfaces, objects, etc. Open Inventor A higher-level object-oriented software package Programming Guide ( Red book ) http://www.opengl.org/documentation/red_book_1.0 Reference Manual ( Blue book ) http://www.opengl.org/documentation/blue_book_1.0 Simple OpenGL Program Matrix Transformations <Initialize OpenGL state> <Load and define textures> <Specify lights and shading parameters> <Load projection matrix> For each frame <Load model view matrix> <Draw primitives> End frame Each of modelview and projection matrix is a 4x4 matrix OpenGL functions glmatrixmode() glloadidentity() glloadmatrixf() glmultmatrix() gltranslate() glscale() glrotate() glpushmatrix() glpopmatrix() 5

Matrix Transformations Simple Program glmatrixmode(gl_modelview); glmultmatrixf(n); /* apply transformation */ glmultmatrixf(m); /* apply transformation M */ glmultmatrixf(l); /* apply transformation L */ glbegin(gl_points); glvertex3f(v); /* draw transformed vertex v */ glend(); = draw transformed point N(M(Lv) #include <GL/gl.h> main() InitializeAWindowPlease(); glmatrixmode(gl_projection); glortho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); glclearcolor (0.0, 0.0, 0.0, 0.0); glclear (GL_COLOR_BUFFER_BIT); glcolor3f (1.0, 1.0, 1.0); glmatrixmode(gl_modelview); gltranslate3f(1.0, 1.0, 1.0): glbegin(gl_polygon); glvertex3f (0.25, 0.25, 0.0); glvertex3f (0.75, 0.25, 0.0); glvertex3f (0.75, 0.75, 0.0); glvertex3f (0.25, 0.75, 0.0); glend(); glflush(); UpdateTheWindowAndCheckForEvents(); GLUT Simple OpenGL + GLUT Program = Graphics Library Utility Toolkit Adds functionality such as windowing operations to OpenGL Event-based callback interface Display callback Resize callback Idle callback Keyboard callback Mouse movement callback Mouse button callback #include <> DisplayCallback() <Clear window> <Load matrix> <Load Modelview matrix> <Draw primitives> (<Swap buffers>) IdleCallback() <Do some computations> <Maybe force a window refresh> KeyCallback() <Handle key presses> KeyCallback() <Handle key presses> MouseMovementCallback <Handle mouse movement> MouseButtonsCallback <Handle mouse buttons> Main() <Initialize GLUT and callbacks> <Create a window> <Initialize OpenGL state> <Enter main event loop> Simple OpenGL + GLUT Program Example Program with #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> void init(void) glclearcolor (0.0, 0.0, 0.0, 0.0); glshademodel (GL_FLAT); void display(void) glclear (GL_COLOR_BUFFER_BIT); glcolor3f (1.0, 1.0, 1.0); glloadidentity (); glulookat (0, 0, 5, 0, 0, 0, 0, 1, 0); glscalef (1.0, 2.0, 1.0); glutwirecube (1.0); glflush (); void reshape (int w, int h) glviewport (0, 0, (GLsizei) w, (GLsizei) h); glmatrixmode (GL_PROJECTION); glloadidentity (); glfrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0); glmatrixmode (GL_MODELVIEW); int main(int argc, char** argv) glutinit(&argc, argv); glutinitdisplaymode (GLUT_SINGLE GLUT_RGB); glutinitwindowsize (500, 500); glutinitwindowposition (100, 100); glutcreatewindow (argv[0]); init (); glutdisplayfunc(display); glutreshapefunc(reshape); glutmainloop(); return 0; #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> void init(void) GLfloat mat_specular[] = 1.0, 1.0, 1.0, 1.0 ; GLfloat mat_shininess[] = 50.0 ; GLfloat light_position[] = 1.0, 1.0, 1.0, 0.0 ; glclearcolor (0.0, 0.0, 0.0, 0.0); glshademodel (GL_SMOOTH); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialfv(gl_front, GL_SHININESS, mat_shininess); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0); glenable(gl_depth_test); void display(void) glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glutsolidsphere (1.0, 20, 16); glflush (); void reshape (int w, int h) glviewport (0, 0, (GLsizei) w, (GLsizei) h); glmatrixmode (GL_PROJECTION); if (w <= h) glortho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w, 1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0); else glortho (-1.5*(GLfloat)w/(GLfloat)h, 1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0); glmatrixmode(gl_modelview); MODELVIEW); int main(int argc, char** argv) glutinit(&argc, argv); glutinitdisplaymode (GLUT_SINGLE GLUT_RGB GLUT_DEPTH); glutinitwindowsize (500, 500); glutinitwindowposition (100, 100); glutcreatewindow (argv[0]); init (); glutdisplayfunc(display); glutreshapefunc(reshape); glutmainloop(); return 0; 6

GLUI GLUI = Graphics Library User Interface = Graphics Library User Interface GLUI Alternative graphics pipeline? = Graphics Library User Interface Traditional pipelineok Parallel pipeline Cluster of PCs? Cluster of PS3? What must be coordinated? What changes? What are the bottlenecks? Sort-first vs. Sort-last pipeline PixelFlow Several hybrid designs 7