Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.

Similar presentations


Presentation on theme: "CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA."— Presentation transcript:

1 CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA

2 LEARNING OBJECTIVES In this chapter you will learn about: – –The graphics system – –Input devices – –Output devices – –The frame buffer – –The elements of a 3D environment – –The graphics pipeline architecture – –Vertex processing – –Clipping and culling – –Rasterization and fragment processing – –Programmable pipelines – –The Direct3D 10 processing pipeline – –The input-assembler stage – –The vertex-shader stage – –The geometry-shader stage

3 LEARNING OBJECTIVES In this chapter you will learn about: – –The stream-output stage – –The pixel-shader stage – –The output-merger stage – –The OpenGL processing pipeline – –Evaluators and display lists – –The primitive assembly and rasterizer – –Pixel processing – –The fragment processor – –The OpenGL, GLUT, and DirectX programming interface – –Window creation and control – –Setting up a window and the main message loop – –Initializing Direct3D and generating output – –Setting up a window (GLUT), the main message loop and initializing OpenGL

4 THE GRAPHICS SYSTEM The term ‘graphics system’ formally describes any computing workstation with the ability to generate two- and/or three- dimensional images.

5 THE GRAPHICS SYSTEM Input Devices – –Request mode. – –Sample mode. – –Event mode.

6 THE GRAPHICS SYSTEM Output Devices

7 Frame Buffer The frame buffer, typically used to store the color information of individual pixels, is one of the most important components of any graphics system. – –accumulation buffer – –color indices – –overlay planes – –auxiliary buffers – –front and back buffer

8 ELEMENTS OF A 3D ENVIRONMENT Any three-dimensional environment, at its most basic level, consists of at least a viewer, one light source and a number of objects.

9 ELEMENTS OF A 3D ENVIRONMENT

10 THE GRAPHICS PIPELINE ARCHITECTURE A pipeline is a series of data processing units arranged in a chain-like manner with the output of the one unit read as the input of the next.

11 THE GRAPHICS PIPELINE ARCHITECTURE The graphics pipeline, also sometimes referred to as the rendering pipeline, implements the processing stages of the rendering process. These stages include: – –vertex processing – –clipping and culling – –Rasterization – –fragment processing

12 THE GRAPHICS PIPELINE ARCHITECTURE

13 Programmable Pipelines Today’s graphics cards all have pipelines built into their graphics processing units. The operations that could be performed by earlier graphics cards were standardized by the device manufacturer with only a number of parameters and properties available for modification. Modern graphics cards allow for not only the modification of a large number of parameters, but also for complete control over the vertex and fragment processors.

14 Programmable Pipelines These programmable vertex and fragment processors enable the real-time rendering of various advanced techniques only previously achievable using large rendering farms or not even possible in real-time at all.

15 Programmable Pipelines

16 The Direct3D 10 Processing Pipeline Each stage of the Direct3D 10 processing pipeline is configurable using the standard Direct3D application programming interface. The vertex shader, geometry shader, and pixel shader are programmable using either Microsoft’s proprietary High Level Shader Language (HLSL) or NVIDIA’s C for Graphics (Cg).

17 The Direct3D 10 Processing Pipeline The input-assembler stage The vertex-shader stage The geometry-shader stage The stream-output stage The pixel-shader stage The output-merger stage

18 The Direct3D 10 Processing Pipeline

19

20

21 The OpenGL processing pipeline Evaluators and Display Lists Primitive Assembly Rasterizer Pixel Processing Fragment Processor

22 The OpenGL processing pipeline

23

24

25

26 THE PROGRAMMING INTERFACE A programming interface refers to any API, such as OpenGL or DirectX, that provides an application programmer with a way to programmatically control low-level hardware subsystems (such as audio devices and graphics hardware). Direct3D and OpenGL programming interfaces facilitate interaction with the underlying graphics system, serving as software interfaces to graphics hardware.

27 THE PROGRAMMING INTERFACE OpenGL/GLUT

28 THE PROGRAMMING INTERFACE OpenGL/GLUT

29 THE PROGRAMMING INTERFACE OpenGL/GLUT

30 THE PROGRAMMING INTERFACE DirectX

31 THE PROGRAMMING INTERFACE DirectX

32 WINDOW CREATION AND CONTROL Setting up a Window and the Main Message Loop – –[see the source code “Window_Setup (win32)” on the book’s website for a detailed example].

33 WINDOW CREATION AND CONTROL Initializing Direct3D/OpenGL and Generating Output – –[see the source code “Initialization (Direct3D)” and “Initialization (OpenGL- GLUT)” on the book’s website for detailed examples].

34 WINDOW CREATION AND CONTROL


Download ppt "CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA."

Similar presentations


Ads by Google