![]() Blending is a highly configurable stage in OpenGL and will be covered in detail in its own section. If the content of the framebuffer is either floating-point or normalized integer values, then blending is applied. Next, the fragment’s color is sent to either the blending or logical operation stage, depending on whether the framebuffer is considered to store floating-point, normalized, or integer values. The result of the depth test also affects what OpenGL does to the stencil buffer. For example, you can ask OpenGL to let fragments through that have a z coordinate that is greater than, equal to, or not equal to the content of the depth buffer. The sense of this test can also be changed. If this value is less than what’s already there, then the fragment is visible. To determine whether a fragment is closer than other fragments that have already been rendered in the same place, OpenGL can compare the z component of the fragment’s window-space coordinate against the value already in the depth buffer. Normally, the values in the depth buffer range from 0 to 1, with 0 being the closest possible point in the depth buffer and 1 being the furthest possible point in the depth buffer. The depth buffer is a region of memory that, like the stencil buffer, is part of the framebuffer with enough space for a single value for each pixel it contains the depth (which is related to distance from the viewer) of each pixel. The depth test is an operation that compares the fragment’s z coordinate against the contents of the depth buffer. ![]() The content of the stencil buffer has no particular semantic meaning and can be used for any purpose.Īfter the stencil test has been performed, the depth test is performed. This compares a reference value provided by your application with the contents of the stencil buffer, which stores a single 4 value per pixel. If it’s inside the rectangle, then it will be processed further if it’s outside, it will be thrown away. The first thing that could happen is the scissor test, which tests your fragment against a rectangle that you can define. Each of these things may be turned on or off by your application. Pixel OperationsĪfter the fragment shader has produced an output, several things may happen to the fragment before it is written to the window, such as a determination of whether it even belongs in the window. Also considered part of the framebuffer, but not stored per framebuffer object, is the pixel operation state. This state is stored in a framebuffer object. The state held by the framebuffer includes information such as where the data produced by your fragment shader should be written, what the format of that data should be, and so on. The framebuffer provided by the windowing system is known as the default framebuffer, but it is possible to provide your own if you wish to do things like render into off-screen areas. On most platforms, this means the window you see on your desktop (or possibly the whole screen if your application covers it), which is owned by the operating system (or windowing system to be more precise). It can represent the visible content of the screen and a number of additional regions of memory that are used to store per-pixel values other than color. The framebuffer is the last stage of the OpenGL graphics pipeline. OpenGL Superbible: Comprehensive Tutorial and Reference, 7th Edition
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |