Computer Graphics EECE 478 - University of British...

Post on 19-Jun-2020

1 views 0 download

transcript

Computer Graphics EECE 478

Gregor Miller!gregor{at}ece.ubc.ca

�1

Computer Graphics

• About this course

• Computer graphics introduction

• Brief code overview for basic renderer

�2

About this course

• Course and Prerequisites

• Lecture Layout

• Office Hours

• Examinations

• Assignments

�3

Course

• Interactive Computer Graphics - A Top-Down Approach Using OpenGL (fifth edition)

• Not available, now it’s the sixth edition; coding will follow both fifth and sixth editions.

• Concepts are the same, so either textbook is fine for course revision (no code in examinations)

• Web also has many resources, so textbook is optional

• If you find a good link to any material let me know and I’ll add it to the course web site

• Course contents

• Maths, graphics theory, practical application (OpenGL)

• Mid-term, individual assignments, final exam

�4

Prerequisites

• Good programming skills (C/C++)

• Abstract data types

• Geometry

• Linear algebra

�5

Lecture Layout

• Recap important principles

• Mathematics (linear algebra, geometry)

• Object oriented programming

• General programming

• Computer graphics pipelines

• Abstract graphics concepts

�6

Lecture Layout

• Graphics theory

• Drawing, viewing, clipping, etc.

• Application

• Principles of graphics programming, using OpenGL as an example

• Develop examples throughout the course

• Theory and application will be presented together

�7

Course Idea

• NOT an OpenGL course (plenty of those on the web)

• NOT a programming course

• Idea is to introduce the theory and practice of computer graphics

• Slides are my notes on what to tell you about, and what’s important

• Don’t rely on them for expansive notes

• The textbook and the web are the resources you should use

• Assignments will help solidify content from lectures

Office Hours

• By appointment

• Don’t ask me what will be in the exam

• Don’t ask me for a solution to the assignment

• Try to answer the question yourself before you ask me

• lmgtfy.com!

�9

Final Grade

• 40% Assignments

• 10% Mid-term

• 50% Final exam

�10

Examinations

• Mid-term - 10% of final grade

• Examines first 5 weeks of material

• End of term final exam - 50% of final grade

• Examines all material

• Supplemental exam - worth 50% of final grade (just a replacement for the exam, not the assignments and mid-term)

�11

Assignments

• Three assignments for the course

• Constitutes 40% of the final grade

• Distinct assessment of each

• All assignments together form a larger project

• A2 uses A1, and A3 builds on A1

• If you are unable to finish A1, a solution will be provided

• 5% A1, 15% A2 and 20% A3

�12

Assignments

• The course assignment project is to build a 3D city using models of buildings/monuments on the UBC campus and downtown Vancouver and direct your own fly-through movie

• Each assignment will be submitted in two parts, with approximately 2 weeks between submissions

• Assignment 1: write a basic graphics program using GLUT which can load and display a building model (with rotate, translate and zoom)

• Assignment 2: design your own model of a building or vehicle from anywhere in Vancouver, based on photographs

• Assignment 3: direct your own fly-through movie of a city you have designed using the class’s models

Assignments

• Have some good models from previous classes

• These will be released for you to test assignment 1

• You cannot do one of these buildings for assignment 2 (unless you want to make a better version)

• To avoid duplicates, the TA will arrange a sign up system for buildings

• Programming

• Be aware that if you can’t already code comfortably in C/C++, you should learn fast

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Examples from previous years

Computer Graphics

Introduction

�26

Computer Graphics

• Deals with all aspects of creating images with a computer

• Hardware

• Software

• Applications

Computer Graphics

• Games

• Movies

• TV

• Operating Systems

�28

How was this created? What hardware/software was needed to produce this image?

Preliminary Answer

• Application: The object is an artist’s rendition of the sun for an animation to be shown in a domed environment (planetarium)

• Software: Maya for modelling and rendering (but Maya is built on top of OpenGL)

• Hardware: PC with graphics card for modelling and rendering

Basic graphics system Input - Image Formation - Output

Raster graphicsImage produced as an array (the raster) of picture elements (pixels) in the frame buffer

Raster graphics Allows us to go from lines and wireframe models to filled polygons

Enhancing realism

Smooth Shading

Environment Mapping

Bump Mapping

Research into VFX Bullet-time

15

Research into VFX Bullet-time

�36

Research into games Customisable characters

�37

OpenGL

• Graphics concepts

• E.g. rendering a triangle

• Implementation using C++ and OpenGL

�38

Why OpenGL?

• Supported on most systems

• Provides abstraction over complicated operations

• GLUT allows simple development of OpenGL programs

�39

OpenGL Resources

• The OpenGL Programming Guide (The Red Book)

• The OpenGL Reference Manual (The Blue Book)

• Both freely available on the web (early editions)

�40

OpenGL Resources

• http://www.opengl.org

• Many tutorials, links, etc.

• http://nehe.gamedev.net/

• Excellent tutorials at all levels

�41

Outline

• Images

• Models

• Architectures

�42

Outline

• OpenGL

• GLUT

• 2D

• 3D

• Interaction

�43

Outline

• Geometry

• Transformations

• Homogeneous Coordinates

• Viewing

• Shading

�44

Outline

• Object space and image space

• Pipeline

• Clipping

• Line Drawing

• Polygon Fill

�45

Outline

• Buffers

• Textures and texture mapping

• Compositing and transparency

�46

Outline

• Programmable Pipelines

• Shading Languages

• Vertex Shaders

• Fragment Shaders

• Scene Graphs

�47