advanced computer graphics - Introduction

48
February 5, 2015 1 [email protected] ADVANCED COMPUTER GRAPHICS Introduction

Transcript of advanced computer graphics - Introduction

Page 1: advanced computer graphics - Introduction

February 5, 2015

1

[email protected]

ADVANCED COMPUTER GRAPHICS

Introduction

Page 2: advanced computer graphics - Introduction

February 5, 2015 2 [email protected]

• Introduction

What is this course about?

• Review

What background will I need?

• Syllabus

What will I learn in this course?

• Mechanics

How with the course work?

OVERVIEW

Page 3: advanced computer graphics - Introduction

February 5, 2015 [email protected] 3

This course is intended to provide a graduate-level introduction to modern

computer graphics. We will cover some of the basic background of 3D

computer graphics

The course is intended to bring incoming graduate students up to the

research frontier, and prepare them for further work in the field.

Course module description

Page 4: advanced computer graphics - Introduction

February 5, 2015 [email protected] 4

• Good programming background

– C/C++

– Preferably some previous OpenGL exposure

• Basic computer science

– Data structures, algorithms

• Basic math

– Numerical integration

– Linear algebra, systems of linear equations

– Vectors, matrices

• Keeping up with the text(s) is very important

What Is It I Expect?

Page 5: advanced computer graphics - Introduction

February 5, 2015 [email protected] 5

• Teach C/C++

• Teach data structures

• Teach linear algebra and basic numerical methods

• Questions about C/C++ are low priority

• Lab procedures are your responsibility

I Am Not Going To ...

Page 6: advanced computer graphics - Introduction

February 5, 2015 [email protected] 6

Basic and support material to be covered

Lighting

Reflecting

Shading

Animation

Rendering

Ray tracing

Hidden surfaces removal

Visibility

Page 7: advanced computer graphics - Introduction

February 5, 2015 7 [email protected]

Text Book

Page 8: advanced computer graphics - Introduction

February 5, 2015 [email protected] 8

• Using a computer as a rendering tool for the generation (from models)

and manipulation of images is called computer graphics

• More precisely: image synthesis

What Is Computer Graphics?

• Computer graphics is an art of drawing pictures, lines, charts, etc

using computers with the help of programming. Computer graphics is

made up of number of pixels.

Page 9: advanced computer graphics - Introduction

February 5, 2015 [email protected] 9

Differences between digital image and graphics

CG (Computer Graphics ) refers to processing of creating a new image

from Geometry , Lighting parameters , Materials and Textures .Using a

Computer or any other digital media.

While DIP(Digital Image Processing) is the process of manipulating an

image acquired through some device . The image too often will be

acquired from photographs, scanners , medical equipments.

Page 10: advanced computer graphics - Introduction

February 5, 2015 [email protected] 10

What Is Computer Graphics?

Page 11: advanced computer graphics - Introduction

February 5, 2015 11 [email protected]

• What is computer graphics?

Imaging = representing 2D images

Modeling = representing 3D objects

Rendering = constructing 2D images from 3D models

Animation = simulating changes over time

What Is Computer Graphics?

Page 12: advanced computer graphics - Introduction

February 5, 2015 [email protected] 12

Basically there are two types of computer graphics namely

1) Interactive computer graphics: It is the computer graphics in

which user can interact with the image on the computer screen.

2) Non-interactive computer graphics: it is the computer graphics in

which user does not have any kind of control over the image.

Types of computer graphics

Page 13: advanced computer graphics - Introduction

February 5, 2015 [email protected] 13

How are pictures actually stored and displayed?

Page 14: advanced computer graphics - Introduction

February 5, 2015 14 [email protected]

1- Modeling: Defining objects in terms of primitives, coordinates and

characteristics.

2- Storing: storing scenes and images in memory and on disk.

3- Manipulating: changing the shape, position and characteristics of

objects.

4- Rendering: applying physically based procedures to generate

(photorealistic) images from scenes (using lighting and shading).

5-Viewing: displaying images from various viewpoints on various

device.

Components of Computer Graphics

Page 15: advanced computer graphics - Introduction

February 5, 2015 [email protected] 15

There are two kinds of computer graphics: Bit Mapped and Object Oriented.

•In bitmap no way to edit some thing drawing in

image.

•When you enlarge a bit mapped image, you

will get a pixelated look.

• Bit mapped graphics are usually easier to

work with.

• Bit mapped graphics tend to create larger files

than object oriented graphics. There are some

exceptions to that rule.

Computer Graphics

Page 16: advanced computer graphics - Introduction

February 5, 2015 [email protected] 16

You create object oriented graphics in a drawing program.

•When you create objects in a drawing

program, you can still edit them after you

have done something else.

• object oriented graphic files (drawing

files) are usually much smaller in size than

bitmapped graphics.

• you can enlarge a object oriented graphic

to any size, and it will not loose detail.

• that there are usually harder to create,

and can not have many interesting special

effects done to them, such as blurring for

example.

Computer Graphics

Page 17: advanced computer graphics - Introduction

February 5, 2015 [email protected] 17

What are Computer Graphics and Image Processing ?

Page 18: advanced computer graphics - Introduction

February 5, 2015 [email protected] 18

Areas of Computer Graphics

Design and Drawing: In almost all areas of engineering such as: civil,

mechanical, electronic etc.

Making the pictures to move: on the graphical screen is called

animation. Animation really makes the use of computers and computer

graphics interesting.

Multimedia applications: The use of sound cards to make computers

produce sound effect led to other uses of graphics. The concept of virtual

reality, where in one can be taken through an unreal experience, like going

through an un-built house (to see how it feels inside, once it is built) are

possible by the use of computer graphics technology.

Simulation: The other revolutionary change that graphics made was

in the area of simulation.

Page 19: advanced computer graphics - Introduction

February 5, 2015 [email protected] 19

Computer Graphics Applications

• Video games

increasingly use sophisticated 3D models and rendering algorithms.

• Cartoons

are often rendered directly from 3D models. Many traditional 2D cartoons

use backgrounds rendered from 3D models, which allows a continuously

moving viewpoint without huge amounts of artist time.

• Visual effects

use almost all types of computer graphics technology. Al- most every

modern film uses digital compositing to superimpose backgrounds with

separately filmed foregrounds. Many films also use 3D modeling and

animation to create synthetic environments, objects, and even characters

that most viewers will never suspect are not real.

• Animated films

use many of the same techniques that are used for visual effects, but

without necessarily aiming for images that look real.

Page 20: advanced computer graphics - Introduction

February 5, 2015 [email protected] 20

• CAD/CAM stands for computer-aided design and computer-aided

manufacturing. These fields use computer technology to design parts and

products on the computer and then, using these virtual designs, to guide the

manufacturing process. For example, many mechanical parts are designed

in a 3D computer modeling package and then automatically produced on a

computer controlled milling device.

• Simulation can be thought of as accurate video gaming. For example, a

flight simulator uses sophisticated 3D graphics to simulate the experience of

flying an airplane. Such simulations can be extremely useful for initial

training in safety-critical domains such as driving, and for scenario training

for experienced users such as specific fire fighting situations that are too

costly or dangerous to create physically.

Computer Graphics Applications

Page 21: advanced computer graphics - Introduction

February 5, 2015 [email protected] 21

• Information visualization creates images of data that do not necessarily

have a “natural” visual depiction. For example, the temporal trend of the

price of ten different stocks does not have an obvious visual depiction, but

clever graphing techniques can help humans see the patterns in such data.

• Medical imaging creates meaningful images of scanned patient data.

For example, a computed tomography (CT) dataset is composed of a

large 3D rectangular array of density values. Computer graphics is used

to create shaded images that help doctors extract the most salient

information from such data.

Computer Graphics Applications

Page 22: advanced computer graphics - Introduction

February 5, 2015 [email protected] 22

is the number of bits used to store information about each pixel. The

higher the depth, the more colors are stored in an image. For example,

the lowest bit-depth, 1 bit graphics are only capable of showing two

colors, black & white.

bitmap

Bit depth Useful Terms:

Page 23: advanced computer graphics - Introduction

February 5, 2015 [email protected] 23

Keyframe

When someone creates a 3D animation on a computer, they usually don't

specify the exact position of any given object on every single frame. They

create keyframes.

2 frames drawn by user

In-between frames generated by computer

Useful Terms:

Page 24: advanced computer graphics - Introduction

February 5, 2015 [email protected] 24

Key frame Useful Terms:

Page 25: advanced computer graphics - Introduction

February 5, 2015 [email protected] 25

Key frame Useful Terms:

Page 26: advanced computer graphics - Introduction

February 5, 2015 [email protected] 26

Mesh

A mesh is a collection of faces which describe an object. An object can

be anything, a sphere, a pyramid, a car tire, or an elephant. The faces

are arranged in such a way that they form the outside surface of that

object. It could be thought of as the skin of the object.

Useful Terms:

Page 27: advanced computer graphics - Introduction

February 5, 2015 [email protected] 27

Contouring

Contouring is the loss of detail when converting a gradient image into

a image with a smaller number of colors. An example is shown below.

Useful Terms:

Page 28: advanced computer graphics - Introduction

February 5, 2015 [email protected] 28

Dithering

Dithering is the process of converting an image with a certain bit depth

to one with a lower bit depth. For example:

Original image Dithered to 256 colors

A gradient of grays Same gradient converted to B&W

Useful Terms:

Page 29: advanced computer graphics - Introduction

February 5, 2015 [email protected] 29

Face

A face is a collection of 3 or more vertices tied together to form a

small triangle surface. Most 3D programs use 3 sided faces, but some

support 4 sided ones too. A collection of faces is referred to as a

mesh. Each face also has a special entity tied to it called a normal.

The normal defines which side of the face is considered to be the

inside of an object, and which is the outside. Faces are very often

referred to as polygons.

Useful Terms:

Page 30: advanced computer graphics - Introduction

February 5, 2015 [email protected] 30

Hierarchy

When modeling a character, it is often useful to establish a hierarchy

between all the objects making up the character.

Onion skinning

Onion skinning is a term that commonly refers to a graphic process in which

an image or an animation is composed of a couple of different layers.

Useful Terms:

Page 31: advanced computer graphics - Introduction

February 5, 2015 [email protected] 31

Primitives

If you really look around, you might realize that many objects around you

are made up of very simple objects.

Most 3D programs provide the user with a number of primitives from

which they can model more complex objects. These primitives most

often include a sphere, a box, a cylinder, a cone, and a torus. Some

programs have more, like tube or hemisphere.

Useful Terms:

Page 32: advanced computer graphics - Introduction

February 5, 2015 [email protected] 32

Image synthesis or image generation refers to the construction of

images from scratch, rather than processing of existing images

Synthesis of a 2D image from a 3D scene description is more commonly

called rendering

Computer Vision

A central goal in computer vision is to take a set of 2D images (usually from a

video or set of photos) and infer from that a 3D description of what is being

viewed, This is a very different process than rendering, and is more of a form of

artificial intelligence

Useful Terms:

Page 33: advanced computer graphics - Introduction

February 5, 2015 [email protected] 33

An animation is just a sequence of individual images, Basically, the

subject of computer animation focuses on how things change over time.

Usually, this refers to motion, but can also refer to other properties

changing over time.

Animation Useful Terms:

Page 34: advanced computer graphics - Introduction

February 5, 2015 [email protected] 34

most computers have a special piece of memory reserved for storage of the

current image being displayed

the frame buffer normally consists of dual- ported Dynamic RAM (DRAM)

sometimes referred to as Video RAM (VRAM)

Frame Buffer

The framebuffer refers to the memory dedicated to storing the image, It would

generally be a 2D array of pixels, where each pixel stores a color , Color is

typically stored as a 24 bit RGB value. This offers 8 bits (256 levels) for red,

green, and blue, for a total of 16,777,216 different colors

Useful Terms:

Page 35: advanced computer graphics - Introduction

February 5, 2015 [email protected] 35

•if we allow the currently displayed image to be updated then we may see

bits of the image being displayed halfway through the update

•this can be visually disturbing, especially if we want the illusion of smooth

animation

• double buffering solves this problem: we draw into one frame buffer and

display from the other

•when drawing is complete we flip buffers

Double buffering Useful Terms:

Page 36: advanced computer graphics - Introduction

February 5, 2015 [email protected] 36

Computer images are classified into two general types: those defined as a

pixel map and those defined as one or more vector commands. In the first

case we refer to raster graphics and in the second case to vector

graphics.

Vectors have an arrow over their variable name: . . Points are denoted with a bar

instead: . . Matrices are represented by an uppercase letter.

The set of real numbers is represented by . The real Euclidean plane is and

similarly Euclidean three-dimensional space is . The set of natural numbers

(non-negative integers) is represented by .

Vector and Raster Data

Page 37: advanced computer graphics - Introduction

February 5, 2015 [email protected] 37

Vector VS Raster Graphics

Page 38: advanced computer graphics - Introduction

February 5, 2015 [email protected] 38

Vector VS Raster Graphics

Page 39: advanced computer graphics - Introduction

February 5, 2015 [email protected] 39

Raster Graphics

•Image is represented as an rectangular grid of coloured squares

•Image processing techniques

•Geometric Transformation: loss of information

•Realistic images, textures, ...

•Examples: Paint, Photoshop

•Raster graphics are also sometimes called bitmapped graphics

Vector Graphics

•Image is represented by continuous geometric objects: points, lines,

curves, etc.

•Graphics objects: geometry + colour

•Geometric transformation possible without loss of information (zoom,

rotate, …)

•Examples: PowerPoint, CorelDraw, AutoCAD...

Vector VS Raster Graphics

Page 40: advanced computer graphics - Introduction

February 5, 2015 40 [email protected]

is the process of converting basic, low level objects into their corresponding

pixel map representations. This is often an approximation to the object, since the

frame buffer is a discrete grid.

Scan Conversion

Page 41: advanced computer graphics - Introduction

February 5, 2015 [email protected] 41

Modeling refers to the techniques involved with creating, scanning,

editing, and manipulating 3D geometric data, Modeling is often

done by a human user with an interactive editing program, More

complex objects, such as trees, can be constructed with automatic

procedural modeling algorithms, 3D models are also often acquired

from real world objects using laser scanning or computer vision

techniques, Modeling also includes the use of curved surfaces and

other higher order primitives, which are often converted into

triangles using various tessellation algorithms, Another important

area of modeling includes mesh reconstruction for surface

simplification

Modeling

Page 42: advanced computer graphics - Introduction

February 5, 2015 [email protected] 42

A basic 3D model might consist of a simple array of triangles,

Each triangle stores 3 vertices, Each vertex contains an xyz

position, and possibly some other information (color, normal…)

3D Models

Page 43: advanced computer graphics - Introduction

February 5, 2015 [email protected] 43

Aliasing is the jagged effect seen on lines and polygon boundaries after

rasterization and it is the process of getting rid of the jaggedness of

rasterized geometric primitives.

Anti-aliasing

Page 44: advanced computer graphics - Introduction

February 5, 2015 [email protected] 44

The Computer Graphics Pipeline

The process that goes into the production of a fully realized 3D movie

character or environment is known by industry professionals as the

“computer graphics pipeline.”

In order to take an animated movie character from an idea or

storyboard drawing to a fully polished 3D rendering, the character

passes through six major phases:

1. Pre-production

2. 3D Modeling

3. Shading & Texturing

4. Lighting

5. Animation

6. Rendering & Post-production

Page 45: advanced computer graphics - Introduction

February 5, 2015 [email protected] 45

At the end of pre-production, finalized design sheets will be sent to the

modeling team to be developed.

Every Idea Counts: Dozens, or even hundreds of drawings & paintings

are created and reviewed on a daily basis by the director, producers, and

art leads.

Color Palette: A character's color scheme, or palette, is developed in

this phase, but usually not finalized until later in the process.

Concept Artists may work with digital sculptors to produce preliminary

digital mock-ups for promising designs.

Character Details are finalized, and special challenges (like fur and

cloth) are sent off to research and development.

Pre-Production

Page 46: advanced computer graphics - Introduction

February 5, 2015 [email protected] 46

Shading & Texturing

In this phase, materials, textures, and colors are added to the 3D model.

Every component of the model receives a different shade-material to

give it an appropriate look.

Realistic materials: If the object is made of plastic, it will be given a

reflective, glossy shade. If it is made of glass, the material will be partially

transparent and refract light like real-world glass.

Textures and colors are added by either projecting a two dimensional

image onto the model, or by painting directly on the surface of the model

as if it were a canvas.

Page 47: advanced computer graphics - Introduction

February 5, 2015 [email protected] 47

In order for 3D scenes to come to life, digital lights must be placed in the

scene to illuminate models

Lighting

Proper lighting must be realistic enough to be believable, but dramatic

enough to convey the director’s intended mood.

Mood Matters: Believe it or not, lighting specialists have as much, or

even more control than the texture painters when it comes to a shot’s

color scheme, mood, and overall atmosphere.

Back-and-Forth: There is a great amount of communication between

lighting and texture artists. The two departments work closely together

to ensure that materials and lights fit together properly, and that shadows

and reflections look as convincing as possible.

Page 48: advanced computer graphics - Introduction

February 5, 2015 48 [email protected]