Table 10-1 lists the parameters to use with glGetIntegerv() to query your OpenGL system about per-pixel buffer storage for a particular visual. Additionally, you can have multiple visuals, or window types, that have different buffers available. Your particular OpenGL implementation determines which buffers are available and how many bits per pixel each holds. Color buffers: front-left, front-right, back-left, back-right, and any number of auxiliary color buffers.These techniques include antialiasing an entire scene, using motion blur, and simulating photographic depth of field.Īn OpenGL system can manipulate the following buffers: #Color pixel tester how to#"The Accumulation Buffer" describes how to perform several advanced techniques using the accumulation buffer.Several operations - blending, dithering, and logical operations - can also be performed before a fragment updates the screen. "Testing and Operating on Fragments" explains the scissoring, alpha, stencil, and depth-buffer tests that occur after a pixel's position and color have been calculated but before this information is drawn on the screen."Buffers and Their Uses" describes the possible buffers, what they're for, and how to clear them and enable them for writing.This chapter has the following major sections. Finally, it explains how to use the accumulation buffer, which is used to accumulate images that are drawn into the color buffer. #Color pixel tester series#It also discusses the series of tests and pixel operations that are performed before any data is written to the viewable color buffer. This chapter describes all the buffers that can exist in an OpenGL implementation and how they're used. With the exception of the color buffer(s), you don't view these other buffers directly instead, you use them to perform such tasks as hidden-surface elimination, antialiasing of an entire scene, stenciling, drawing smooth motion, and other operations. The framebuffer on a system comprises all of these buffers. The color buffer itself can consist of several subbuffers. For example, in "A Hidden-Surface Removal Survival Kit" in Chapter 5, you learned that the depth buffer holds depth information for each pixel. The color buffer is only one of several buffers that hold information about a pixel. Any particular color buffer, however, has the same amount of data saved for each pixel on the screen. A particular hardware system might have more or fewer pixels on the physical screen as well as more or less color data per pixel. Since 24 bits translates to 3 bytes (8 bits/byte), the color buffer in this example has to store at least 3 bytes of data for each of the 1,310,720 (1280*1024) pixels on the screen. #Color pixel tester full#Assume that the screen is 1280 pixels wide and 1024 pixels high and that it's a full 24-bit color screen - in other words, there are 224 (or 16,777,216) different colors that can be displayed. In general, pixel ( x, y) fills the region bounded by x on the left, x+1 on the right, y on the bottom, and y+1 on the top.Īs an example of a buffer, let's look more closely at the color buffer, which holds the color information that's to be displayed on the screen. A buffer that stores a single bit of information about pixels is called a bitplane.Īs shown in Figure 10-1, the lower-left pixel in an OpenGL window is pixel (0, 0), corresponding to the window coordinates of the lower-left corner of the 1 ´ġ region occupied by this pixel. Different buffers might contain different amounts of data per pixel, but within a given buffer, each pixel is assigned the same amount of data. Whenever data is stored uniformly for each pixel, such storage for all the pixels is called a buffer. To draw these pixels, you need to know what color they are, which is the information that's stored in the color buffer. If the tests and operations are survived, the fragment values are ready to become pixels. Then each fragment undergoes a series of tests and operations, some of which have been previously described (See "Blending" in Chapter 6) and others that are discussed in this chapter. Each fragment has coordinate data which corresponds to a pixel, as well as color and depth values. After the rasterization stage (including texturing and fog), the data are not yet pixels, but are fragments. The screen is composed of a rectangular array of pixels, each capable of displaying a tiny square of color at that point in the image. Use the accumulation buffer for such purposes as scene antialiasingĪn important goal of almost every graphics program is to draw pictures on the screen.Perform dithering and logical operations.Control the parameters of the scissoring, alpha, stencil, and depth-buffer tests that are applied to pixels.Clear selected buffers and enable them for writing.Understand what buffers make up the framebuffer and how they're used.After reading this chapter, you'll be able to do the following:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |