Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Lecture 32

Similar presentations


Presentation on theme: "Computer Graphics Lecture 32"— Presentation transcript:

1 Computer Graphics Lecture 32

2 Introduction to OpenGL Taqdees A. Siddiqi cs602@vu.edu.pk

3 Most Widely Adopted Graphics Standard
Inception – 1992 Multi-platform Rendering, texture mapping, special effects, and other powerful visualization functions

4 High-quality high-performance
Markets: Broadcasting, CAD/CAM/CAE, Entertainment, Medical imaging, and Virtual reality

5 Developer-Driven Advantages
Industry standard OpenGL Architecture Review Board (ARB) Broad industry support, The only truly open, vendor-neutral, multiplatform graphics standard Stable Available for more than a decade on a wide variety of platforms Well controlled Additions to the specification, Proposed updates announced in time Backward compatibility

6 Developer-Driven Advantages
Reliable and portable Consistent visual display results on any OpenGL API-compliant hardware regardless of operating system or windowing system Evolving Thorough and forward-looking design, Allows new hardware innovations to be accessible through the API (OpenGL extension mechanism)

7 Developer-Driven Advantages
Scalable OpenGL API-based applications can run on : consumer electronics PCs Workstations Supercomputers. As a result, applications can scale to any class of machine that the developer chooses to target.

8 Developer-Driven Advantages
Easy to use Well structured Intuitive design Logical commands Efficient routines Compact programs/code Hardware features independent coding possible Well-documented Many 3rd party books A lot of sample code

9 As a software interface for graphics hardware, OpenGL renders multidimensional objects into a framebuffer.

10 OpenGL is industry standard graphics software with which programmers can create high-quality still and animated three-dimensional color images.

11 Where Applicable: OpenGL is built for compatibility across hardware and operating systems. This architecture makes it easy to port OpenGL programs from one system to another.

12 Developer Audience: C/C++ programmers

13 All 32 bit versions of Microsoft Windows
Run Time Requirements OpenGL can run on: Linux All 32 bit versions of Microsoft Windows

14 Main purpose of OpenGL Purpose of OpenGL is to render two- and three-dimensional objects into a framebuffer.

15 These objects are described as sequences of vertices (that define geometric objects) or pixels (that define images).

16 OpenGL performs several processes on this data to convert it to pixels to form the final desired image in the framebuffer.

17 How OpenGL Works

18 The following topics present a global view of how OpenGL works:
Primitives and Commands OpenGL Graphic Control Execution Model Basic OpenGL Operations

19 Primitives and Commands

20 OpenGL draws primitive:
points line segments polygons

21 OpenGL draw these primitives subject to several selectable modes.
User can control modes independently of one another.

22 Primitives are defined by a group of one or more vertices
Primitives are defined by a group of one or more vertices. A vertex defines: a point an end point of a line or a corner of a polygon where two edges meet

23 Following data is associated with a vertex:
its coordinates colour normal texture coordinates and flags

24 Each vertex and its data is processed independently and in the same way.

25 Exceptions are cases in which the group of vertices must be clipped so that a particular primitive fits within a specified region. In this case, vertex data may be modified and new vertices created.

26 Commands Commands are always processed in order. Though there may be an indeterminate delay before a command takes effect.

27 Therefore state-querying commands return inconsistent data.
Each primitive is completed before next command Therefore state-querying commands return inconsistent data.

28 OpenGL Graphic Control

29 OpenGL provides you with fairly direct control over the fundamental operations of two- and three-dimensional graphics.

30 This includes specification of such parameters as:
transformation matrices lighting equation coefficients antialiasing methods and pixel-update operators

31 OpenGL commands specify how a certain result should be produced (The procedure to be followed).
OpenGL is fundamentally procedural rather than descriptive.

32 Execution Model

33 Client/server model Application code issues commands and these are processed by OpenGL.

34 OpenGL is network-transparent.
A server can maintain several OpenGL contexts. A client can connect to any context.

35 Network protocol may be an already existing protocol (as X Window System) or an independent protocol. No OpenGL commands are provided for obtaining user input.

36 The window system that allocates framebuffer resources ultimately controls the effects of OpenGL commands on the framebuffer.

37 The window system: determines the portions to be accessed at any given time communicates to OpenGL how those portions are structured

38 No OpenGL commands to configure the framebuffer or initialize OpenGL.
Configuration is done outside of OpenGL in conjunction with the window system.

39 Basic OpenGL Operation

40 The OpenGL Visualization Programming Pipeline
OpenGL operates on image data as well as geometric primitives

41 Display list Rather than having all commands proceed immediately through the pipeline, you can choose to accumulate some of them in a display list for processing later.

42 Evaluator Provides an efficient way to approximate curve and surface geometry by evaluating polynomial commands of input values.

43 Per-vertex operations and primitive assembly
OpenGL processes geometric primitives—points. Vertices are transformed and lit, and primitives are clipped to the viewport in preparation for rasterization.

44 Rasterization The rasterization stage produces a series of frame-buffer addresses and associated values using a two-dimensional description of a point, line segment, or polygon.

45 Rasterization Each fragment so produced is fed into the last stage, per-fragment operations

46 Per-fragment operations These are the final operations performed on the data before it's stored as pixels in the framebuffer.

47 Per-fragment operations include conditional updates to the framebuffer based on incoming and previously stored z values.

48 for z buffering and blending of incoming pixel colors with stored colors, as well as masking and other logical operations on pixel values

49 Data can be input in the form of pixels rather than vertices.

50 Following pixel operations, the pixel data is either:
Stored as texture memory, for use in the rasterization stage. Resulting fragments merged into the framebuffer just as if they were generated from geometric data.

51 OpenGL Processing Pipeline

52 Many OpenGL functions are used specifically for drawing objects such as points, lines, polygons, and bitmaps.

53 Some functions control the way that some of this drawing occurs (such as those that enable antialiasing or texturing). Other functions are specifically concerned with framebuffer manipulation.

54 The topics discussed here describe how all of the OpenGL functions work together to create the OpenGL processing pipeline. Here we also take a closer look at the stages in which data is actually processed, and tie these stages to OpenGL functions.

55 The following diagram details the OpenGL processing pipeline
The following diagram details the OpenGL processing pipeline. For most of the pipeline, you can see three vertical arrows between the major stages.

56 These arrows represent vertices and the two primary types of data that can be associated with vertices: color values and texture coordinates.

57

58 Computer Graphics Lecture 32


Download ppt "Computer Graphics Lecture 32"

Similar presentations


Ads by Google