# 3D Graphics Rendering

date post

03-Jun-2018Category

## Documents

view

219download

0

Embed Size (px)

### Transcript of 3D Graphics Rendering

8/12/2019 3D Graphics Rendering

1/55

Technology and Historical Overview

8/12/2019 3D Graphics Rendering

2/55

Introduction to 3D Computer Graphics OpenGL

SGI vs Linux 3D Animation Terrain Modeler: Project Status

8/12/2019 3D Graphics Rendering

3/55

3D computer graphics is the science, study,and method of projecting a mathematical

representation of 3D objects onto a 2D imageusing visual tricks such as perspective andshading to simulate the eye's perception ofthose objects.

8/12/2019 3D Graphics Rendering

4/55

3D graphic software is largely based onsimulating physical interactions.

Generally: Space relations.

Light interactions.

In particular cases: Material properties. Object Movement.

8/12/2019 3D Graphics Rendering

5/55

Practical goal:Visualization - to generate images(usually of recognizable subjects) that are

useful in some way.

Ideal goal:

Photorealism - to produce imagesindistinguishable from photographs.

8/12/2019 3D Graphics Rendering

6/55

3D Modeling:

A way to describe the 3D world or scene, which is

composed of mathematical representations of 3Dobjects called models.

3D Rendering:

A mechanism responsible for producing a 2Dimage from 3D models.

8/12/2019 3D Graphics Rendering

7/55

Simple 3D objects can be modeled usingmathematical equations operating in the 3-dimensional Cartesian coordinate system.

Example:

the equationx2+ y2+ z2= r2

is a model of a perfect

sphere with radius r.

8/12/2019 3D Graphics Rendering

8/55

Pure mathematical equations to represent 3D

objects requires a great deal of computing power

Impractical for real-time applications such as games

or interactive simulations.

8/12/2019 3D Graphics Rendering

9/55

Modeling objects by sampling only certain points on

the object, retaining no data about the curvature in

between

More efficient, but less detailed.

8/12/2019 3D Graphics Rendering

10/55

Technique used to addsurface color detailwithout increasing thecomplexity of a model.

An image is mapped to

the surface of a model.

8/12/2019 3D Graphics Rendering

11/55

A 3D world or scene is composed ofcollection of 3d models

Three different coordinates systems (orspaces) are defined for different modelrelated operations:

Object Space World Space

Screen Space

8/12/2019 3D Graphics Rendering

12/55

The coordinate system in which a specific 3Dobject is defined.

Each object usually have its own object spacewith the origin at the object's center

The object center is the point about whichthe object is moved and rotated.

8/12/2019 3D Graphics Rendering

13/55

World space is the coordinate system of the3D world to be rendered.

The position and orientation of all the modelsare defined relative to the center of the worldspace.

The position and orientation of the virtualcamera is also defined relative to the worldspace.

8/12/2019 3D Graphics Rendering

14/55

2D space that represents the boundaries ofthe image to be produced.

Many optimization techniques are performedon screen space.

8/12/2019 3D Graphics Rendering

15/55

3D operations like translation, rotation andscaling are performed using matrices and

lineal algebra.

Each operation is performed by multiplyingthe 3D vertices by a specific transformationmatrix.

8/12/2019 3D Graphics Rendering

16/55

The process of taking the mathematical model of

the world and producing the output image.

The core of the rendering process involves

projecting the 3D models onto a 2D image plane.

8/12/2019 3D Graphics Rendering

17/55

Two general approaches:

Pixel-oriented rendering: Ray tracers

Polygon-oriented rendering:

Scan-line renderers

8/12/2019 3D Graphics Rendering

18/55

Operates by tracingtheoretical light raysas they intersectobjects in the sceneand the projectionplane.

8/12/2019 3D Graphics Rendering

19/55

Processor intensive. A full ray tracer isimpractical for real-time applications.

Does not take into account inter-reflectionsof diffuse light, resulting in hard shadows.

8/12/2019 3D Graphics Rendering

20/55

Technique that models the inter-reflectionsof diffuse light between surfaces of the world

or environment. Produces more photorealistic illumination

and shadows.

8/12/2019 3D Graphics Rendering

21/55

Operate on an object-by-object basis, directly

drawing each polygon to the screen.

Requires all objects including those modeled

with continuous curvature to be tessellated into

polygons.

Polygons are eventually tessellated into pixels.

8/12/2019 3D Graphics Rendering

22/55

Lighting and shading is calculatedusing the normal vector.

The color is linearly interpolated across

the polygon surface.

8/12/2019 3D Graphics Rendering

23/55

Flat shading

Gouraud Shading

Phong Shading

8/12/2019 3D Graphics Rendering

24/55

The color of the polygon is calculated at thecenter of the polygon by using the normal

vector. The complete polygon surface is uniformly

lighted.

8/12/2019 3D Graphics Rendering

25/55

A normal vector is calculated at each vertex. Color is calculated for each vertex and

interpolated across the polygon

8/12/2019 3D Graphics Rendering

26/55

The normal vectors are interpolatedacross the surface of the polygon

The color of each point within the

polygon is calculated from itscorresponding normal vector

8/12/2019 3D Graphics Rendering

27/55

8/12/2019 3D Graphics Rendering

28/55

Segment of the 3D world to be rendered Objects outside the viewing volume are

ignored.

8/12/2019 3D Graphics Rendering

29/55

Not all objects inside the viewing frustum are

always visible from the point of view of the camera.

Not all polygons of a particular object are visiblefrom the point of view of the camera.

Common Techniques

Painters Algorithm

Z-Buffering

8/12/2019 3D Graphics Rendering

30/55

Polygon-oriented. All the polygons are sorted by their depth and

then displayed in this order.

8/12/2019 3D Graphics Rendering

31/55

Pixel-oriented. When multiple objects overlap

(from the point of view of thecamera) on a particular pixel, only

the value of the pixel closest tothe camera is used. Implemented by saving the depth

value of each displayed pixel in abuffer, and comparing the depth

of each new overlapping pixelagainst the value in the buffer.

8/12/2019 3D Graphics Rendering

32/55

Projects the 3D world to a 2D image

8/12/2019 3D Graphics Rendering

33/55

The Open Graphics Language

8/12/2019 3D Graphics Rendering

34/55

De facto Application Programming Interface(API) for cross-platform development of 3Dgraphics applications.

Implementations available for all majorOperating Systems and hardware platforms.

Support for hardware accelerated 3D

rendering. Scalable, high-level, easy to use, well

documented.

8/12/2019 3D Graphics Rendering

35/55

Originally released by SGI in the early 90s. Descendant of IRIX GL.

Previous 3D graphics APIs were generallyplatform dependant. Born out of market pressure for a cross-

platform 3D API during the late 80s.

8/12/2019 3D Graphics Rendering

36/55

How to define a triangle:

glBegin (GL_TRIANGLES);

glVertex (0,0,0);

glVertex (1,1,0);

glVertex (2,0,0);

glEnd ();

8/12/2019 3D Graphics Rendering

37/55

OpenGL API designed only for drawingimages.

Auxiliary visual toolkits are required fordeveloping OpenGL applications for modernwindowed desktop environments.

Potential options: GLUT, SDL, GTK+

8/12/2019 3D Graphics Rendering

38/55

GLUT: Specifically designed for developingOpenGL demo applications.

SDL (Simple DirectMedia Layer): Library formultimedia and game development. GTK+: General purpose toolkit for creating

graphical user interfaces with OpenGL

extensions available.

8/12/2019 3D Graphics Rendering

39/55

VS

8/12/2019 3D Graphics Rendering

40/55

Linux is quickly becoming the preferred OSfor OpenGL and 3D computer graphicsdevelopment.

Today Linux dominates one of SGIs mostcontrolled market: Movie Special Effects.

Why?

8/12/2019 3D Graphics Rendering

41/55

Special effects production pipeline involves:

The graphic workstation Used by the artists to

create the models and textures used in the visualeffects sequence.

The render-farm A computer cluster dedicatedfor rendering the images or animations that formthe visual effect sequence.

8/12/2019 3D Graphics Rendering

42/55

SGI dominated the market of 3D graphics solutionsduring the 80s and 90s.

SGI hardware provided excellent performance forrendering calculations combined with a fa