Download - 3D Graphics Rendering

Transcript
  • 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 fast videosubsystem.

    The computer special effects market was locked-in

    to SGIs hardware. Most of the 3D rendering software was developed

    for IRIX (SGIs UNIX OS).

  • 8/12/2019 3D Graphics Rendering

    43/55

    SGIs workstations are expensive.

    Historically FX houses purchased largeamount of SGIs, which were amortized overseveral movies (usually 5 years).

  • 8/12/2019 3D Graphics Rendering

    44/55

    Causes: The development of Linux (an open source UNIX

    clone for the PC) during the 90s.

    The continuous performance increase of the IntelCPUs.

    The development of consumer-level 3Dacceleration hardware for the PC driven by thegrowing video game market.

  • 8/12/2019 3D Graphics Rendering

    45/55

    Lintel platform provides a highercost/performance ratio.

    Linux is a POSIX complaint UNIX clone,porting the software from IRIX is trivial.

    Linux is open-source and runs in multiple-architectures which greatly limits thepossibility of vendor lock-in.

  • 8/12/2019 3D Graphics Rendering

    46/55

    Using Lintel, a large portion of the hardware

    costs can be recouped with every movie.

    Buying a new render-farm for each newmovie is economically viable.

  • 8/12/2019 3D Graphics Rendering

    47/55

    Initially Linux was used for render-farm.

    Now it is used for the graphic workstation aswell.

    It is even displacing Apple computers as the

    standard platform for video/film editing andcompositing.

  • 8/12/2019 3D Graphics Rendering

    48/55

    Movies created using Lintel:

    Titanic

    Star Wars Prequel Trilogy The Harry Potter Movies

    The Lord of the Rings Trilogy

    Shrek and Shrek 2

    Practically every movie involving special-effectsmade after the year 2000

  • 8/12/2019 3D Graphics Rendering

    49/55

    The Lintel cost/performance also benefits theacademic/scientific applications of 3D

    computer graphics.

    Heavily used in automotive and aeronauticsindustries for solid modeling and simulations.

  • 8/12/2019 3D Graphics Rendering

    50/55

    The first film produced by Pixar in 1986. It demonstrates the use of ray tracing to

    simulate the shifting light and shadow givenby the animated lamps as well as simplesurface textures.

    It was the first CGI film to be nominated for

    an Academy Award.

  • 8/12/2019 3D Graphics Rendering

    51/55

    16 years after the debut of Luxo Jr., Steve Jobs

    demonstrated the same animation running in real-

    time on a Apple G5 computer with an Nvidia

    Geforce 3 GPU (Graphics Processor Unit). On 1985 - Rendering each frame of the original

    animation took 55 hours of processing on a Cray

    Supercomputer

    On 2001 Rendering each frame took 1/30 of a

    second on a personal computer

  • 8/12/2019 3D Graphics Rendering

    52/55

    Rendering 2D/3DFirst Project

  • 8/12/2019 3D Graphics Rendering

    53/55

    Frame

    Buffer

    Object

    2D

  • 8/12/2019 3D Graphics Rendering

    54/55

    Frame

    Buffer

    Object

    3D

  • 8/12/2019 3D Graphics Rendering

    55/55

    Wikipidia The Free Encyclopedia http://www.wikipedia.org/

    OpenGL - The Industry Standard for High PerformanceGraphics

    http://www.opengl.org/ Google Image Search

    http://images.google.com Overview of 3D Interactive Graphics

    http://www.siggraph.org/project-grants/com97/com97-tut.html Linux Journal - Industry of Change: Linux Storms Hollywood

    http://www.linuxjournal.com/article/5472 3D Graphics Rendering and Terrain Modeling, Ricardo

    Veguilla

    http://www.wikipedia.org/http://www.opengl.org/http://images.google.com/http://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.linuxjournal.com/article/5472http://www.linuxjournal.com/article/5472http://www.linuxjournal.com/article/5472http://www.linuxjournal.com/article/5472http://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://www.siggraph.org/project-grants/com97/com97-tut.htmlhttp://images.google.com/http://www.opengl.org/http://www.wikipedia.org/