Graphics Pipeline What Is Graphics API - Carnegie Mellon University

1y ago
46 Views
2 Downloads
1.11 MB
7 Pages
Last View : 1d ago
Last Download : 6m ago
Upload by : Luis Waller
Transcription

What is graphics API ? Graphics Pipeline A low-level interface to graphics hardware OpenGL About 120 commands to specify 2D and 3D graphics OS independent Graphics API and Graphics Pipeline Efficient Rendering and Data transfer Event Driven Programming OpenGL What it isn’ isn’t: A windowing program or input driver because How many of you have programmed in OpenGL? How extensively? OpenGL GLUT: window management, keyboard, mouse, menue GLU: higher level library, complex objects Primitives: drawing a polygon How does it work? From the implementor’s perspective: geometric objects properties: color move camera and objects around pixels graphics pipeline Primitives Primitives material properties Rotate Translate Scale Is it visible? 3D to 2D Build models in appropriate units (microns, meters, etc.). From simple shapes: triangles, polygons, Convert to pixels Primitives 1

Primitives: drawing a polygon Primitives: drawing a polygon Put GL into draw-polygon state glBegin(GL POLYGON); Send it the points making up the polygon glVertex2f(x0, y0); glVertex2f(x1, y1); glVertex2f(x2, y2) . Tell it we’re finished glEnd(); Primitives Primitives Triangle Strips Polygon Restrictions Minimize number of vertices to be processed OpenGL Polygons must be simple OpenGL Polygons must be convex (a) simple, but not convex convex TR1 p0, p1, p2 TR2 p1, p2, p3 Strip p0, p1, p2, p3, p4, (b) non-simple 9 10 Material Properties: Color Primitives: Material Properties glColor3f (r, g, b); Red, green & blue color model Components are 0-1 color, transparency, reflection properties, shading properties RGB (Red, Green, Blue) red 1 0 0 black 0 0 0 white 1 1 1 magenta 1 0 1 Primitives Primitives 2

Specifying Primitives Primitives: Material Properties Many other material properties available: glEnable(GL POLYGON STIPPLE); glPolygonStipple(MASK); /* 32x32 pattern of bits */ glDisable (GL POLYGON STIPPLE); run shapes.exe Code for all of today’s examples available from http://www.xmission.com/ nate/tutors.html Primitives Primitives Primitives: Material Properties Light Sources Most often point light sources Diffuse: scattered light independent of angle (rough) Specular: dependent on angle (shiny) run lightposition.exe Primitives Primitives Transforms Different views of the objects in the world Rotate Translate Scale glRotate(x,y,z); glTranslate(x,y,z); draw geometry Position it relative to the camera Y X Z run transformation.exe Primitives Primitives 3

Position it relative to the camera Position it relative to the camera Perspective projection eye Primitives view plane Primitives Position it relative to the camera Position it relative to the camera Perspective projection Orthographic projection Flat but preserving distances and shapes. All the projectors are now parallel. glFrustum (left, right, bottom, top, near, far); glOrtho (left, right, bottom, top, near, far); Primitives Primitives Clipping Camera Transformations Not everything should be visible on the screen Camera positioning just results in more transformations on the objects: transformations that position the object wrt to the camera any vertices that lie outside of the viewing volume are clipped Primitives Primitives 4

Rasterizer Drawing A Box Go from pixel value in world coordinates to pixel value in screen coordinates void DrawBox() { MakeWindow("Box", 400, 400); Box glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0); glClearColor(1.0, 0.0, 0.0, 1.0); glClear(GL COLOR BUFFER BIT); glColor3f(0.0, 1.0, 0.0); glBegin(GL POLYGON); /* or GL LINES or GL POINTS. */ (GLUT library) glVertex2f(-0.5, -0.5); glVertex2f( 0.5, -0.5); glVertex2f( 0.5, 0.5); glVertex2f(-0.5, 0.5); glEnd(); } Primitives Getting Started Example Code We will give you example code for each assignment. Graphics API and Graphics Pipeline Efficient Rendering and Data transfer Event Driven Programming Documentation: Book OpenGL pages are on the web. 28 Graphics Hardware: Goal Graphics Hardware: Goal Pioneered by Silicon Graphics, picked up by graphics chips companies (Nvidia, 3dfx, S3, ATI,.). OpenGL library was designed for this architecture (and vice versa) Changed a lot over last years Programmable pixel and vertex shaders Very fast frame rate on scenes with lots of interesting visual complexity Nvidia person in class February 8 5

Efficient Rendering and Data transfer State Machine Large set of state variables: color current viewing position line width material properties. Minimize number of OpenGL calls Minimize number of Vertices Minimize data transfer from CPU to GPU These variables (the state) then apply to every subsequent drawing command Billions of vertices per second Every six month the speed doubles 31 32 State Machine State Machine Minimize changes to the state and number of calls Minimize changes to the state and number of calls glBegin(GL POLYGON); glColor3f(0.0, 1.0, 0.0) glBegin(GL POLYGON); glColor3f(0.0, 1.0, 0.0) glVertex2f(x0, y0); glVertex2f(x0, y0); glVertex2f(x1, y1); glVertex2f(x2, y2) . glColor3f(0.0, 1.0, 0.0) glVertex2f(x1, y1); glColor3f(0.0, 1.0, 0.0) glVertex2f(x2, y2) . glEnd(); glEnd(); 33 34 Display Lists Transfer of data from CPU to GPU Store object in graphics card memory Immediate transfer Encapsulate a sequence of drawing commands Optimize and store glBegin(GL TRIANGLES); glColor3f(0.0, 1.0, 0.0) glVertex2f(x0, y0); GLuint listName glGenLists(1); /* new name */ glNewList (listName, GL COMPILE); /* new list */ glColor3f(0.0, 1.0, 0.0) glVertex2f(x1, y1); define object (glColor, glVertex, ) glColor3f(0.0, 1.0, 0.0) glVertex2f(x2, y2) glEnd(); glEndList(); Disadvantage: static geometry – send the same data every frame better to store geometry on graphics card memory glCallList(listName); /* draw one */ Vertex buffer objects 35 36 6

Assignment 1 Height Fields Why? Get started with OpenGL Some room for creativity Height Fields Where? Wean 5336 or your machine at your risk! How? Cross-realm authentication via andrew Send problems to me or to the TA’s (soon) Make sure that you made directory with correct permissions—most common problem 37 38 Next Class Height Fields What? Graphics API and Graphics Pipeline Efficient Rendering and Data transfer Event Driven Programming When? -- Due midnight February 1st 39 40 7

Graphics API and Graphics Pipeline Efficient Rendering and Data transfer Event Driven Programming Graphics Hardware: Goal Very fast frame rate on scenes with lots of interesting visual complexity Pioneered by Silicon Graphics, picked up by graphics chips companies (Nvidia, 3dfx, S3, ATI,.). OpenGL library was designed for this .

Related Documents:

Pipeline device hardware, Pipeline network, the Pipeline host hardware, the Pipeline application software and the Pipeline media disk storage systems. Each of these components is described below. Pipeline device hardware Pipeline device hardware has up to four independent channels with SDI I/O for capture and play out. The SDI

Page 2 of 22 ODNR‐DSWR Pipeline Standard 12‐3‐13 Pipeline ‐ The pipeline and its related appurtenances. Pipeline Company ‐ The entity responsible for installing the pipeline, its successors, and assigns, on its own behalf and as operator of the company. Right‐of‐Way ‐ Includes the permanent and temporary easements that the pipeline company acquires

and Hazardous Liquid pipeline risk models. Operators establish risk models to address risk and improve safety within their respective pipeline systems. Pipeline risk models are a foundational part of the assessment of operational pipeline risk. Federal pipeline safety integrity management (IM) regulations require pipeline operators to use risk

Page 2 of 22 ODNR‐DSWR Pipeline Standard 12‐3‐13 Pipeline ‐ The pipeline and its related appurtenances. Pipeline Company ‐ The entity responsible for installing the pipeline, its successors, and assigns, on its own behalf and as operator of the company. Right‐of‐Way ‐ Includes the permanent and temporary easements that the pipeline company acquires

Optimising the Graphics Pipeline Koji Ashida Hi. My name is Koji Ashida. I'm part of the developer technology group at NVIDIA and we are the guys who tend to assist game developers in creating new effects, optimizing their graphics engine and taking care of bugs. Today, I'm going to talk to you about optimizing the graphics pipeline.

Pipeline Conventions DEFINITION: a K-Stage Pipeline(“K-pipeline”) is an acyclic circuit having exactly K registers on everypath from an input to an output. a COMBINATIONAL CIRCUIT is thus an 0-stage pipeline. CONVENTION: Every pipeline stage, hence every K-Stage pipeline, has a register on its OUTPUT(not on its input). ALWAYS:

ONEOK NGL Pipeline, L.L.C. ONEOK Rockies Midstream, LLC Phillips 66 Pipelines LLC Plains Pipeline – Belfield Pipeline Silver Creek Midstream TC Energy / Bison Pipeline Pipeline LLC TC Energy / Northern Border Pipeline Company WBI Energy Midstream WBI Energy Transmission Pipelin

ANSI A300 Purpose: To provide performance standards for developing written specifications for tree management. Currently nine individual parts . ANSI Z60 American Nurseryman and Landscape Association began developing this standard back in 1929 Became an ANSI document in 1949 Current version is 2004 . ANSI A300 The Tree Care Industry Association convened a consensus body .