Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003.

Similar presentations


Presentation on theme: "Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003."— Presentation transcript:

1 Chapter 2 Getting Started: Drawing Figures

2 The Framebuffer Lecture 2 Fri, Aug 29, 2003

3 The Viewport The viewport is the computer screen. More specifically, it is the portion that is inside the program’s window. It consists of a rectangular array of pixels. Typical screen sizes 800 x 600 1024 x 768 1280 x 1024 1600 x 1200

4 Pixels Black and White Monitors Each pixel is either black or white, or Each pixel produces a single gray level determined by the brightness of the pixel. Color Monitors Each pixel has three components (red, green, blue) that together determine the color and brightness.

5 The Framebuffer The framebuffer consists of several buffers.framebuffer The color buffer. The depth buffer. The stencil buffer. The accumulation buffer. Not every computer has all of these buffers.

6 The Color Buffer We will use only the color buffer and the depth buffer. Most color buffers contain 3 bytes per pixel. 1 byte for each of the colors red, green, and blue. The depth buffer contains one 32-bit floating-point value per pixel.

7 The Color Buffer On many computers the color buffer includes an additional byte representing opaqueness. This value is called “alpha.”  = 1.0 – completely opaque.  = 0.0 – completely transparent.

8 The Color Buffer For a simple black and white monitor, only one bit per pixel is required. 1 bit: 0 = black, 1 = white. Or there could be gray levels. 4 bits: 16 gray levels. 8 bits: 256 gray levels.

9 The Color Buffer Color monitor. 16 bits: red (5 bits), green (6 bits), blue (5 bits).  2 16 = 65536 colors. 24 bits: red, green, blue (8 bits each).  2 24 = 16 million colors.

10 Example A picture

11 The Illusion of Roundness

12 The Color Buffer On most LCD displays and on many monitors, a color pixel consists of three separate colors.

13 The Color Buffer

14 The standard on most computers is 24 color bits per pixel. Framebuffer size. 800 x 600 = 480000 pixels = 1.4 Mb. 1024 x 768 = 786432 pixels = 2.3 Mb. 1280 x 1024 = 1310720 pixels = 3.8 Mb. 1600 x 1200 = 1920000 pixels = 5.6 Mb.

15 The Color Buffer To store a movie with 60 frames per second would require from 5 to 20 gigabytes of storage for every one minute of the movie. How is it possible to store a two-hour movie on a DVD?

16 The Framebuffer Most computers provide a double buffer. While one buffer is displayed, the next frame is being drawn in the other buffer. This techniques eliminates flicker in animations. It also doubles the memory requirements.

17 The Framebuffer Requirements of the framebuffer memory. Very fast, and therefore very expensive. Able to refresh the screen independently of the CPU at 60 fps.


Download ppt "Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003."

Similar presentations


Ads by Google