Cs5500 computer graphics l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 35

CS5500 Computer Graphics PowerPoint PPT Presentation

CS5500 Computer Graphics April 19, 2007 Today’s Topic Overview of 3D pipelines. Scope of the next 2 or 3 assignments. Many Views of Graphics Pipeline Simple “Front-End/Back-End” view. Textbook version in [Foley/van Dam].

Download Presentation

CS5500 Computer Graphics

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Cs5500 computer graphics l.jpg

CS5500 Computer Graphics

April 19, 2007

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Today s topic l.jpg

Today’s Topic

  • Overview of 3D pipelines.

  • Scope of the next 2 or 3 assignments.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Many views of graphics pipeline l.jpg

Many Views of Graphics Pipeline

  • Simple “Front-End/Back-End” view.

  • Textbook version in [Foley/van Dam].

  • David Kirk’s (nVidia CTO) version presented in EG Hardware Workshop 1998: (slide 05) http://www.merl.com/hwws98/presentations/kirk/index.htm

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Simplified view l.jpg

Simplified View

  • The Data Flow:

    3D Polygons (+Colors, Lights, Normals, Texture Coordinates…etc.)

    • 2D Polygons

    • 2D Pixels (I.e., Output Images)

Transform

(& Lighting)

Rasterization

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


A quick review l.jpg

A Quick Review

By default, graphic pipeline will do the following:

  • Take as input various per-vertex quantities (color, light source, eye point, texture coordinates, etc.)

  • Calculate a final color for each vertex using a basic lighting model (OpenGL uses Phong lighting)

  • For each pixel, linearly interpolate the three surrounding vertex colors to shade the pixel (OpenGL uses Gouraud shading)

  • Write the pixel color value to the frame buffer

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


The view of directx 8 l.jpg

The View of DirectX 8

(Note: This figure is overly crowded, so don’t worry about it if you can’t understand it at the first look. The next slide might give you a better idea of the pipeline.)

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide7 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide8 l.jpg

And a really scary one…

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide9 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide10 l.jpg

The next 6 slides are borrowed from UNC-CH COMP236 Course Slides (Spring 2003) http://www.unc.edu/courses/2003spring/comp/236/001/handouts.html

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide11 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide12 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide13 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide14 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide15 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide16 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide17 l.jpg

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Implementing a 3d pipeline l.jpg

Implementing a 3D Pipeline

  • A case study -- MESA.

  • Mesa 3D Graphics Library

    • A famous open source effort to implement OpenGL.

    • Pure software implementation, meaning all computation is done on CPU, not on GPU.

    • Used to call MesaGL, but SGI complained about it due to customer support issues.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Two different approaches l.jpg

Two Different Approaches

  • Consider how you expect the users to create the contents to your 3D pipeline.

  • Method 1: by providing 3D model files (e.g., in the OBJ or VRML format)

    • Our approach since it’s easier to implement.

  • Method 2: by writing an OpenGL program.

    • MESA’s approach.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Slide20 l.jpg

3D Models

3D Renderer

MESA

OpenGL commands

OpenGLDrivers

CPU & GPU

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Input file format l.jpg

Input File Format

  • Very similar to an OpenGL “command stream,” for example:

Rotate angle, x, y, z

Translate x, y, z

Color R, G, B, A

Begin Triangle

Vertex x, y, z

...

End

...

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Major components l.jpg

Major Components

  • Data structures for:

    • Points, vectors, matrices

    • Lines and polygons (or just triangles)

    • Frame buffer and textures

  • Transformation

  • Lighting

  • Clipping & Projection

  • Rasterization & texture mapping

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Don t reinvent the wheel l.jpg

Don’t Reinvent the Wheel

  • A few useful 3D vector and matrix code: http://www.cs.nthu.edu.tw/~chunfa/code/algebra3.zip

  • Or borrow one from your friends, or find a good one from the Internet.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Graphics hardware l.jpg

Graphics Hardware

  • Why do we study the graphics pipeline in such depth? Why not teaching more Cg or shader programming?

  • You’ve got to know some hardware!

  • They are all built upon the traditional 3D pipeline.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Why need hardware l.jpg

Why Need Hardware

  • All parts of graphics pipeline can be done in software.

    • But very slowly.

    • Example: mesaGL

  • For some applications, speed is beauty

    • Games

    • Walkthrough

    • Visualization

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Evolutions of graphics hardware l.jpg

Evolutions of Graphics Hardware

  • Gouraud-shaded polygons.

  • Then came antialiasing.

  • Then came texture mapping.

  • Now comes programmable shading.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


John poulton s chart l.jpg

John Poulton’s Chart

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Fixed vs programmable l.jpg

Fixed vs. Programmable

  • Starting in 1999 some graphics cards used the standard lighting model and Gouraud shading to draw polygon fragments entirely in hardware

  • Implementing the pipeline in hardware made processing polygons much faster, but the developer could not modify the pipeline (hence “fixed function pipeline”)

  • New programmable hardware allows programmers to write vertex and pixel programs to change the pipeline

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Opengl fixed function vertex l.jpg

OpenGLFixed Function Vertex

Vertex (object)

Vertex (clip)

Transform[MVP],[MV],[MV]-T

Normal

Vertex (eye)

ColorSecondaryColor

Front&BackColor

[0,1]

Lighting

Front&BackSecondaryColor

[0,1]

Texgen

TextureMatrixn

TexCoordn

TexCoordn

EdgeFlag

EdgeFlag

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Gl2 vertex processor l.jpg

GL2 Vertex Processor

Vertex (object)

Vertex (clip)

Uniform

Normal

Vertex (eye)

ColorSecondaryColor

VertexShader

Front&BackColor

Front&BackSecondaryColor

TexCoordn

Temporaries

TexCoordn

EdgeFlag

EdgeFlag

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Programmable shaders l.jpg

Programmable Shaders

  • A concept made popular by Pixar’s RenderMan.

  • First appeared in hardware: UNC PixelFlow

    • See SIGGRAPH papers by Molnar 1995 and Olano 1997.

  • Made affordable by nVidia GeForce3 and XBox.

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Faked global illumination l.jpg

Faked Global Illumination

  • Shadow, Reflection, BRDF…etc.

  • In theory, real global illumination is not possible in current graphics pipeline:

    • Conceptually a loop of individual polygons.

    • No interaction between polygons.

  • Can this be changed by multi-pass rendering?

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Future trends l.jpg

Future Trends

  • Vertex/Pixel shaders will become more and more flexible

    • Less limits on program size

    • Able to execute branch instructions

    • Capable of moving complicated effects (like those in Renderman) onto the GPU

  • More and more operations executed per-pixel rather than per-vertex

  • As people get more creative with the hardware we will see more techniques for non-photorealistic rendering

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Future trends34 l.jpg

Future Trends

  • Real-time fur

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


Future trends35 l.jpg

Future Trends

  • More realistic skin

    • Subsurface scattering approximation

CS5500 Computer Graphics

© Chun-Fa Chang, Spring 2007


  • Login