US20020135587A1 - System and method for implementing accumulation buffer operations in texture mapping hardware - Google Patents

System and method for implementing accumulation buffer operations in texture mapping hardware Download PDF

Info

Publication number
US20020135587A1
US20020135587A1 US10/100,416 US10041602A US2002135587A1 US 20020135587 A1 US20020135587 A1 US 20020135587A1 US 10041602 A US10041602 A US 10041602A US 2002135587 A1 US2002135587 A1 US 2002135587A1
Authority
US
United States
Prior art keywords
texture
accumulation
accumulation buffer
frame buffer
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US10/100,416
Inventor
Ross Cunniff
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hewlett Packard Development Co LP
Original Assignee
Ross Cunniff
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ross Cunniff filed Critical Ross Cunniff
Priority to US10/100,416 priority Critical patent/US20020135587A1/en
Publication of US20020135587A1 publication Critical patent/US20020135587A1/en
Assigned to HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P. reassignment HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: HEWLETT-PACKARD COMPANY
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Definitions

  • the present invention relates to computer graphics systems and, more particularly to a system and method for implementing accumulation operations in hardware.
  • Computer graphics systems commonly are used for displaying graphical representations of objects on a two dimensional display screen.
  • Current computer graphics systems can provide highly detailed representations and are used in a variety of applications.
  • an object to be represented on the display screen is broken down into a plurality of graphics primitives.
  • Primitives are basic components of a graphics picture and may include points, lines, vectors and polygons, such as triangles.
  • a hardware/software scheme is implemented to render, or draw, on the two-dimensional display screen, the graphics primitives that represent the view of one or more objects being represented on the screen.
  • the primitives that define the three-dimensional object to be rendered are provided from a host computer, which defines each primitive in terms of primitive data.
  • the host computer may define the primitive in terms of the x,y,z coordinates of its vertices, as well as the R,G,B color values of each vertex.
  • Rendering hardware interpolates the primitive data to compute the display screen pixels that are turned on to represent each primitive, and the R,G,B values for each pixel.
  • accumulation buffers have been used in graphical image processing to accomplish a number of effects, including anti-aliasing, motion blur, enhanced depth perception, and soft shading.
  • an accumulation buffer is used to combine multiple frames to produce a composite frame.
  • Each of the multiple frames is typically combined with the accumulation buffer by calculating, for each pixel of the frame, a weighted average of the pixel with a corresponding pixel of the accumulation buffer.
  • Each of the above-listed effects are achieved by altering a single graphical image slightly to produce a number of slightly different frames and accumulating the frames in the accumulation buffer.
  • aliasing refers to jagged edges on graphical objects represented in a rasterized image. For example, a line which is slanted, i.e., neither fully horizontal nor fully vertical, appears to be jagged when displayed in a rectangular grid of pixels of a computer display device. The jagged quality is a result of rounding floating point values to integer pixel addresses.
  • Anti-aliasing generally refers to graphical alteration of a graphical object or image to remove the appearance of jagged edges.
  • An accumulation buffer is used to produce an anti-aliased image by “jittering” the image. In other words, the graphical image is rendered into the accumulation buffer.
  • the graphical image is translated (i.e., moved) by a fraction of a pixel and is rendered again to produce a slightly translated frame. Rendering the graphical image as translated causes the jags in the various edges of the various graphical objects rendered to appear in slightly different places.
  • the slightly translated frame is then accumulated with the previously rendered frame in the accumulation buffer and the resulting frame is stored in the accumulation buffer.
  • the translation, rendering and accumulation of frames of the graphical image is repeated a number of times. The result is an averaging of a number of frames in which jags in the edges of graphical objects in a graphical image are smoothed, providing the appearance of smooth edges.
  • An accumulation buffer may also be used in a similar fashion to blur graphical objects in motion.
  • objects in motion often nave no blur, i.e., appear to have very sharp edges.
  • an object with sharp edges moves quickly across a television or movie screen or across a computer display device in a motion video display, the appearance is very unnatural and disturbing to the viewer.
  • a graphical image in which an object is in motion is repeatedly rendered with the object in different position along the path of motion of the object and the resulting frames are accumulated in the accumulation buffer.
  • the resulting accumulated frame includes an image of the moving graphical object which is blurred along the path of motion of the graphical object and a considerably more natural and pleasing animated video display.
  • An accumulation buffer may also be used to enhance depth perception in a three-dimensional graphical image. Depth perception is enhanced by blurring graphical objects distant from the viewer while preserving sharpness in graphical objects nearer the viewer. This result is achieved by repeatedly rendering the three-dimensional image from slightly varying perspectives. Altering the perspective of a three-dimensional graphical image results in greater movement of graphical object further from the viewer relative to movement of objects nearer the viewer. Accumulation of frames corresponding to slightly varied perspectives therefore results in blurring of graphical objects substantially proportional to the distance of the graphical objects from the viewer. Thus, depth perception in the rendered and accumulated graphical image is enhanced substantially.
  • An accumulation buffer may further be used to soften shadows in a rendered graphical image. Because of the precision of computers in rendering three-dimensional graphical images, shadows portrayed in such rendered graphical images are particularly sharp, resulting in an unnatural, surreal appearance of the graphical image. Shadows in such a graphical image are softened by repeatedly rendering the graphical image with the respective positions of various virtual light sources, which define the lighting characteristics of the graphical image, varied slightly and the resulting frames are accumulated in the accumulation buffer. Since each frame corresponds to a slightly different light source position, shadows in each frame are in a slightly different position. The accumulated frame in the accumulation buffer therefore has softer shadows, as if from a more diffused light source. The resulting displayed graphical image is more natural and realistic.
  • the OpenGL specification includes an accumulation buffer, which is a per-pixel screen resource, which allows applications to periodically accumulate partially rendered scenes, and then, when the full scene has rendered, put the final result back into the frame buffer.
  • applications for the accumulation buffer include full scene antialiasing, motion blur, enhanced depth perception, and soft shading.
  • some of the operations which may be performed by the accumulation buffer are: Clear, Load, Accumulate, Multiply, Add, and Return.
  • the Clear operation clears the entire contents of the accumulation buffer to a specified color (typically black).
  • the Load operation copies the contents of the frame buffer into the accumulation buffer.
  • the Accumulate operation multiplies the contents of the frame buffer (on a per-pixel basis) by a supplied number and adds the results to the contents of the accumulation buffer.
  • the Multiply operation multiplies the contents of the accumulation buffer by a supplied number.
  • the Add operation adds a supplied number to each component of the accumulation buffer.
  • the Return operation multiplies the contents of the accumulation buffer by a supplied number and returns the number to the frame buffer.
  • the accumulation buffer operations listed above are implemented in software. As should be appreciated, particularly for high resolution applications, the foregoing operations require the execution of a large number of instructions. Therefore, implementing these operations in software is relatively time consuming. However, adding dedicated hardware to an existing system to accelerate the execution of these operations is costly.
  • the present invention is generally directed to a system and method for performing accumulation buffer operations using texture mapping hardware.
  • a method is provided that operates by allocating a texture map of equal size as a display screen and copying contents of a frame buffer to the allocated texture map. The method then identifies an accumulation buffer operation and performs the accumulation buffer operation in a fragment unit.
  • the fragment unit includes an arithmetic logic unit (ALU) to perform high-speed mathematical operations.
  • ALU arithmetic logic unit
  • FIG. 1 is a block diagram illustrating the principal hardware components of a system constructed in accordance with the invention
  • FIG. 2 is a block diagram of a computer having graphics hardware and a device driver that cooperate to carry out the enhanced graphic accumulation operations of the present invention
  • FIG. 3 is a flow chart illustrating the top-level operation of the initialization associated with a system constructed in accordance with the invention
  • FIGS. 4A and 4B collectively comprise a flow-chart illustrating the top-level functional operation of a method constructed in accordance with the invention
  • FIG. 5 is a flow chart that illustrates the top-level operation of a clear operation
  • FIG. 6 is a diagram similar to FIG. 1, but illustrating certain flags that may be utilized to gain performance enhancements
  • one aspect of the present invention relates to the utilization of high-speed texture mapping graphics hardware to implement certain operations of an accumulation buffer. Utilizing texture mapping hardware in this fashion allows certain operations, otherwise performed in the accumulation buffer, to be performed much faster. In this respect, it was discovered that certain accumulation operations are performed much like a blend operation performed in texture mapping hardware. Texture mapping and blending are well known in the art, and need not be described herein, in order to gain an understanding of the present invention. Nevertheless, for completeness, certain basic aspects of texture mapping and blending will be described herein.
  • Texture mapping is a term that refers to a method for displaying images with improved surface detail. Texture mapping involves mapping a source image, referred to as a texture, onto a surface of a three-dimensional object, and thereafter mapping the textured three-dimensional object to the two-dimensional graphics display screen to display the resulting image.
  • Surface detail attributes commonly texture mapped include color, specular reflection, vector perturbation, specularity, transparency, shadows, surface irregularities and grading.
  • Texture mapping involves applying one or more point elements (texels) of a texture to each point element (pixel) of the displayed portion of the object to which the texture is being mapped.
  • Texture mapping hardware is conventionally provided with information indicating the manner in which the texels in a texture map correspond to the pixels on the display screen that represent the object.
  • Each texel in a texture map is defined by S and T coordinates which identify its location in the two-dimensional texture map. For each pixel, the corresponding texel or texels that map to it are accessed from the texture map, and incorporated into the final R,G,B values generated for the pixel to represent the textured object on the display screen.
  • each pixel in an object primitive may not map in one-to-one correspondence with a single texel in the texture map for every view of the object. For example, the closer the object is to the view port represented on the display screen, the larger the object will appear. As the object appears larger on the display screen, the representation of the texture becomes more detailed. Thus, when the object consumes a fairly large portion of the display screen, a large number of pixels is used to represent the object on the display screen, and each pixel that represents the object may map in one-to-one correspondence with a single texel in the texture map, or a single texel may map to multiple pixels.
  • each pixel may map to multiple texels.
  • Each pixel may also map to multiple texels when a texture is mapped to a small portion of an object.
  • Resultant texel data is calculated for each pixel that maps to more than one texel, and typically represents an average of the texels that map to that pixel.
  • Texture mapping hardware is well known for performing texture mapping operations at very high speed.
  • One such operation performed by texture mapping hardware is a blend operation.
  • Blending is a technique that combines the R, G, B color values of a pixel (the “source” pixel) being processed with the R, G, B color values of a corresponding pixel (the “destination” pixel), previously computed and stored for example in a buffer (such as a frame buffer).
  • the source pixel and the destination pixel have the same x, y screen coordinates.
  • An alpha ( ⁇ ) value, associated with the source pixel controls how much of the destination pixel color values should be combined with those of the source pixel.
  • the color values of the source pixel overwrite the existing color values of the destination pixel, as though the source pixel is opaque.
  • a user may control, to a limited degree of resolution, how much of the existing destination pixel color value should be combined with that of a source pixel.
  • blending is used to create a translucent image, one that enables a portion of a previously stored color value “show through” a source color value.
  • Color blending lies at the heart of techniques such as transparency, digital compositing, and painting.
  • Blending can be understood with reference to the following analogous example. If one is viewing a destination object through colored glass, then the color seen is partly the color of the glass and partly the color of the object. The percentage of one color seen versus the other, varies depending on the transmission properties of the glass. If the glass transmits 80% of the light that strikes it, for example, then the glass has a transparency of 80% (an opacity of 20%), and the color seen is a combination of 20% glass color and 80% object color. Objects also can be viewed through multiple translucent (or transparent) surfaces such as multiple pieces of glass. Similarly, computer graphics blending operations can be performed with multiple source images.
  • color values of source pixels are combined with color values of corresponding destination pixels (on a pixel-by-pixel basis) in a two-stage process.
  • the color values typically are combined by blending hardware in computer graphics systems.
  • the source R s , and destination R d values are combined separately from the source G s , and destination G d values, which are combined separately from the source B s , and destination B d values.
  • Each of the values is combined using digital arithmetic hardware according to standard blending equations that involve the color values and the source ⁇ value.
  • one aspect of the present invention relates to the implementation of certain accumulation operations in texture mapping hardware.
  • the preferred embodiment of the invention is compatible in all OpenGL-compliant systems.
  • the “OpenGL” standard is a very important software standard for graphics applications. In any computer system that supports this standard, the operating system(s) and application software programs can make calls according to the OpenGL standards. without knowing exactly what the hardware configuration of the system is.
  • OpenGL provides a complete library of low-level graphics manipulation commands, which can be used to implement three-dimensional graphics operations. This standard was originally based on the proprietary standards of Silicon Graphics, Inc., but was later transformed into an open standard. It is now becoming extremely important, not only in high-end graphics-intensive workstations, but also in high-end PCs. OpenGL is supported by Windows NT, which makes it accessible to many PC applications.
  • the OpenGL specification provides some constraints on the sequence of operations. For instance, the color DDA (digital differential analyzer) operations must be performed before the texturing operations, which must be performed before the alpha operations.
  • a DDA is a conventional piece of hardware used to produce linear gradation of color (or other) values over an image area.
  • the invention may be implemented through the use of standard OpenGL commands.
  • the invention may be implemented as a device driver, and operates by identifying certain OpenGL commands that would ordinarily result in the performance of operations in the accumulation buffer, and instead performs those operations in the higher performance texture mapping hardware.
  • FIG. 1 is a block diagram illustrating certain components in a computer graphics system.
  • the principal components illustrated in FIG. 1 include a texture engine 102 , RAM 104 , a fragment unit (or pixel processor) 106 the frame buffer 108 and a display 110 .
  • the RAM 104 includes texture maps, which may be exchanged with the texture engine 102 during texture processing.
  • the fragment unit 106 is also utilized (in communication with the texture engine 102 ) during texture processing.
  • an arithmetic logic unit (ALU) 107 is incorporated into the fragment unit 106 , and a utilized to execute various mathematical operations.
  • the ALU 107 may be utilized when performing accumulation and blending functions.
  • OpenGL As is known, and defined in the OpenGL standard, various texture and blend operations may be performed and are supported by the OpenGL standard instruction set. Blending is enabled or disabled simply by using the commands “Enable Blend” and “Disable Blend.” In this regard, OpenGL includes blending instructions that utilize the texture mapping hardware to perform functions such as blend operations.
  • OpenGL specifies the following blend instructions, which may be utilized by the present invention: “glBlendEquation(GL 13 FUNC 13 ADD)” and “glBlendFunc(GL 13 SRC ALPHA, GL 13 ONE 13 MINUS 13 SRC 13 ALPHA)”. OpenGL specifies other blend instructions, but these are the most pertinent to the preferred embodiment of the invention.
  • the instruction glBlendFunc( ) src specifies how to compute a source blending factor, while glBlendFunc( ) dst specifies how to compute a destination blending factor.
  • the path of data processing from the texture unit 102 through the fragment unit 106 to the frame buffer 108 is the direction of high-speed or high-performance processing.
  • a reverse path 12 is provided within the texture mapping hardware, and is supported by the OpenGL instruction set. Specifically, OpenGL specifies a “glCopyTexSubImage2( )” instruction, which copies pixels from the frame buffer 108 into a portion of the current texture.
  • OpenGL instructions may be coded to specifically utilize the texture mapping hardware to perform certain accumulation functions. For example, rather than use the standard glAccumulate instruction to multiply the contents of the frame buffer by a number and add that result to the contents of the accumulation buffer, one could code OpenGL instructions to copy contents of the frame buffer 108 to the texture engine 102 , along path 112 (using the “glCopyTexSubImage2D( ) instruction). Then, one could code OpenGL blending instructions to perform the multiply and accumulation operations using the high-speed ALU 107 in the pixel processor 106 , and write the resulting pixels to the frame buffer 108 . It should be understood that utilizing the texture mapping hardware in this novel manner greatly accelerates the processing of certain operations normally performed by the accumulation buffer.
  • An accumulation buffer 115 is also illustrated in FIG. 1 in dashed line.
  • This accumulation buffer 115 has been illustrated merely for the purpose depicting the contrasting data-flow of the present invention.
  • the accumulation buffer 115 as a feature of OpenGL, in the past has been generally implemented in software, and data is exchanged between the frame buffer 108 and the accumulation buffer 115 in a relatively low-performance fashion. Instead, and in accordance with the present invention, data from the frame buffer 108 is transferred to the texture engine. Thereafter, blend operations are performed on the data and it is written back into the frame buffer 108 .
  • the present invention is implemented as a device driver.
  • texture mapping hardware is utilized in certain accumulation operations, without being specifically coded in the OpenGL code.
  • a device driver implementing the inventive features recognizes certain instructions that would normally invoke the accumulation buffer, and instead control the execution of these instructions through C (or other coded) functions.
  • FIG. 2 depicts a computer 120 having internal graphics hardware 124 , including a texture engine 102 , a fragment unit 106 , a RAM 104 , and a frame buffer 108 .
  • a device driver 122 is also illustrated.
  • a device driver may be implemented in programmed code. The dashed line pointing from the device driver 122 to the graphics hardware 124 is provided to illustrate the notion that the device driver 122 controls at least some operations of the graphics hardware.
  • FIGS. 3, 4A, and 4 B which collectively depict the top-level operation of a system constructed in accordance with the present invention.
  • step 302 upon power-up or program initiation, certain initialization routines may be performed, and are broadly denoted by step 302 . Thereafter, a variable called “accumWeight” is initialized to a value of 0 (step 304 ). The significance and operation of this variable will be discussed below.
  • step 306 generates the accumulation texture ID. As is known in texture mapping, a plurality of different texture maps may be created and assigned unique texture ID numbers for later reference. Step 306 creates a texture ID that is uniquely assigned to the accumulation buffer. This ID may be generated using the OpenGL instruction “glGenTextures( )”.
  • step 308 the accumulation texture is bound and made into an RGB texture of maximum possible window size (rounded up to the next power of 2). That is, if the screen size of the display is 800 ⁇ 600 pixels, then the texture will be sized as a 1,024 ⁇ 1,024 texture map. This step may be performed by using the OpenGL instruction “glBindTexture( ).”
  • FIGS. 4A and 4B comprise a flow chart illustrating the top-level functional operation of the present invention.
  • the present invention operates to implement certain accumulation buffer operations within the texture mapping hardware.
  • the genesis of the present invention was the recognition that certain accumulation buffer operations were implemented using multiplication and addition operations that closely resemble the blend operation performed in texture mapping hardware.
  • the accumulate instruction of OpenGL multiplies the contents of the frame buffer by a number supplied by the programmer and adds that resulting value to the contents of the accumulation buffer (on a per-pixel basis). Once this accumulate instruction was implemented in the texture mapping hardware, it was discovered that certain other accumulation buffer operations could be conveniently and efficiently performed using the texture mapping hardware as well.
  • Step 322 represents an entry point into the method of the present invention by a call or invocation of an OpenGL instruction that implements an accumulation buffer is operation in texture mapping hardware.
  • an OpenGL instruction that implements an accumulation buffer is operation in texture mapping hardware.
  • glAccum receives the variables “op” and “frac”.
  • the “op” variable denotes the operation (e.g., gl 13 Add, gl 13 Accumulate, etc.) that is passed to the glAccum routine.
  • frac is a variable that indicates how much accumulation has occurred. Again, this value may be controlled by a programmer, and an example will be presented below to better illustrate the use and purpose of this value.
  • step 324 alpha (the transparency value) is set to 0 and the destination pixel value is set to 1-alpha (the alpha value of the source pixel).
  • Step 326 is a decisional block, which determines whether the variable op is either gl 13 Add or gl 13 Return. If so, no operation needs to be performed (step 328 ).
  • Decision block 330 determines whether the variable op is gl 13 Multiply. If so, the factor accumWeight is set equal to the product of accumWeight and the frac variable (step 332 ). The variable accumWeight is a floating point scale factor that will be further illustrated in connection with the frac variable in the example that will be presented below. Decision block 334 determines whether the op variable is gl 13 Load. If so, the accumWeight variable is set to 0 and the method proceeds to step 344 (the operation of step 344 and the ensuing steps will be discussed below).
  • step 340 determines whether the variable frac exceeds the value of 1 (generally the variable frac will be a value less than 1). If, however, the value exceeds 1, step 340 sets the alpha value equal to the lesser of 1 or the value of the accumWeight variable. It also sets the destination factor equal to 1. Since alpha is defined as a value from 0.0 to 1.0, step 340 ensures that the value used is appropriately clamped to that range.
  • step 338 resolves to NO, then the alpha value is set equal to the accumWeight variable divided by the sum of the accumWeight variable the frac variable.
  • the method then proceeds to step 344 , where it determines whether alpha is greater than 0. If the alpha value is not greater than 0 (i. e., alpha equals 0) there is complete transparency, and no blending operations need to be performed. Therefore, the method may proceed to step 350 , where contents of the frame buffer are copied back to the accumulation texture object contained within the texture engine. This step is preferably executed using the “glCopyTexSubimage2D( )” instruction. Thereafter the accumWeight variable is increased by an amount equal to the frac variable (step 362 ).
  • step 344 determines that the alpha value is greater than 0, then the method establishes identity modelview and projection matrices, and sets up blending within the texture hardware (step 346 ). It then sets up a texture state (gl 13 Decal) with the accumulation texture object (step 348 ). The method then sets up a transparency value using “glColor4f” with each R, G, and B value set to 1, and using the current alpha value (step 350 ). The method then draws a full-window textured quad to blend the texture ID associated with the accumulation buffer with the frame buffer. Thereafter, the method proceeds to step 360 , and continues operation from there in the manner described above.
  • the alpha value increases in an useful way each time.
  • the first time through, alpha is zero, because of the need to accumulate entirely the frame buffer pixels.
  • the second pass through, the frame buffer and the accumulation buffer are equally weighted (since both buffers have a 1 pass in them).
  • the accumulation pixels begin having higher weight on the third pass through, since the accumulation buffer now has 2 passes in it, while the frame buffer still only has the current pass in it.
  • alpha is 0.6667. This progresses exactly the same way when frac is equal to 1/numPasses, no matter how large numPasses gets.
  • FIG. 5 is a flow chart illustrating the top-level operation of a gl 13 Clear instruction.
  • the gl 13 Clear instruction operates to clear the contents of the accumulation buffer, or to write a constant value to all pixel locations of the accumulation buffer.
  • this instruction may be carried out simply by setting the accumWeight variable to a value of zero (step 380 ).
  • the gl 13 Clear instruction is executed extremely rapidly (as opposed to writing a constant value to each of the memory locations of the accumulation buffer).
  • FIG. 6 is a diagram similar to FIG. 1, but further illustrates two additional “flags” 420 and 422 .
  • a first flag 420 labeled as “Return Needed Flag” may be provided to indicate whether a “gl 13 Return” instruction is needed. As is known, the gl 13 Return instruction operates to transfer the contents from the OpenGL accumulation buffer back to the frame buffer.
  • the gl 13 Return instruction need not be executed. Stated, another way, the gl 13 Return operation need only be carried out if the contents of the frame buffer 108 are overwritten. Therefore, the value of this flag 420 may generally be set to FALSE. Thus, and the end of most interim accumulation operations, the contents of the frame buffer 108 will be copied back to the texture engine 102 , to prepare for the next pass, or next accumulation.
  • the flag 420 may be set to TRUE, however, if any command is subsequently executed that modifies the contents of the frame buffer 108 . In response to a gl 13 Return operation, a return is needed only if the Return Needed flag is TRUE.
  • a second flag 422 labeled as “Accum. Incomplete Flag” is provided to indicate a status of the current, ongoing accumulation operation. This flag may be utilized to avoid the final copy-back of the contents of the frame buffer 108 to the texture engine 102 , after the final accumulation operation.
  • the glCopyTexSubimage2D( ) instruction is used to copy the contents of the frame buffer 108 back to the texture engine after each interim accumulation instruction.
  • this flag 422 may be set to TRUE. After each interim accumulation operation, the contents of the frame buffer 108 are copied back to the texture engine 102 , so long as the value of this flag is TRUE.
  • this flag may be set to FALSE, and the final copy-back (e.g., glCopyTexSubimage2D( ) instruction) need not be performed.
  • additional control circuitry 424 may be provided to achieve carryout these features, in connection with the status of the flags 420 and 422 .
  • FIGS. 3, 4A, 4 B, and 5 show the top-level operation of only one possible implementation of the methods of the present invention.
  • each block represents a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s).

Abstract

The present invention is generally directed to a system and method for performing accumulation buffer operations using texture mapping hardware. In accordance with one aspect of the invention, a method is provided that operates by allocating a texture map of equal size as a display screen and copying contents of a frame buffer to the allocated texture map. The method then identifies an accumulation buffer operation and performs the accumulation buffer operation in a fragment unit. Preferably, the fragment unit includes an arithmetic logic unit (ALU) to perform high-speed mathematical operations. Finally, the method directs results of the accumulation buffer operation to the frame buffer, and copies contents of the frame buffer to the allocated texture map.

Description

    BACKGROUND OF THE INVENTION
  • 1. Field of the Invention [0001]
  • The present invention relates to computer graphics systems and, more particularly to a system and method for implementing accumulation operations in hardware. [0002]
  • 2. Discussion of the Related Art [0003]
  • Computer graphics systems commonly are used for displaying graphical representations of objects on a two dimensional display screen. Current computer graphics systems can provide highly detailed representations and are used in a variety of applications. [0004]
  • In typical computer graphics systems, an object to be represented on the display screen is broken down into a plurality of graphics primitives. Primitives are basic components of a graphics picture and may include points, lines, vectors and polygons, such as triangles. Typically, a hardware/software scheme is implemented to render, or draw, on the two-dimensional display screen, the graphics primitives that represent the view of one or more objects being represented on the screen. [0005]
  • Typically, the primitives that define the three-dimensional object to be rendered are provided from a host computer, which defines each primitive in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitive in terms of the x,y,z coordinates of its vertices, as well as the R,G,B color values of each vertex. Rendering hardware interpolates the primitive data to compute the display screen pixels that are turned on to represent each primitive, and the R,G,B values for each pixel. [0006]
  • Early graphics systems failed to display images in a sufficiently realistic manner to represent or model complex three-dimensional objects. The images displayed by such systems sometimes exhibited extremely smooth surfaces absent textures, bumps, scratches, shadows and other surface details present in the object being modeled. In addition, early graphics systems often suffered from poor image quality, due to phenomenon such as aliasing. [0007]
  • As is known, accumulation buffers have been used in graphical image processing to accomplish a number of effects, including anti-aliasing, motion blur, enhanced depth perception, and soft shading. In general, an accumulation buffer is used to combine multiple frames to produce a composite frame. Each of the multiple frames is typically combined with the accumulation buffer by calculating, for each pixel of the frame, a weighted average of the pixel with a corresponding pixel of the accumulation buffer. Each of the above-listed effects are achieved by altering a single graphical image slightly to produce a number of slightly different frames and accumulating the frames in the accumulation buffer. [0008]
  • To more particularly illustrate the foregoing, aliasing refers to jagged edges on graphical objects represented in a rasterized image. For example, a line which is slanted, i.e., neither fully horizontal nor fully vertical, appears to be jagged when displayed in a rectangular grid of pixels of a computer display device. The jagged quality is a result of rounding floating point values to integer pixel addresses. Anti-aliasing generally refers to graphical alteration of a graphical object or image to remove the appearance of jagged edges. An accumulation buffer is used to produce an anti-aliased image by “jittering” the image. In other words, the graphical image is rendered into the accumulation buffer. Then the graphical image is translated (i.e., moved) by a fraction of a pixel and is rendered again to produce a slightly translated frame. Rendering the graphical image as translated causes the jags in the various edges of the various graphical objects rendered to appear in slightly different places. The slightly translated frame is then accumulated with the previously rendered frame in the accumulation buffer and the resulting frame is stored in the accumulation buffer. The translation, rendering and accumulation of frames of the graphical image is repeated a number of times. The result is an averaging of a number of frames in which jags in the edges of graphical objects in a graphical image are smoothed, providing the appearance of smooth edges. [0009]
  • An accumulation buffer may also be used in a similar fashion to blur graphical objects in motion. In computer generated animation, objects in motion often nave no blur, i.e., appear to have very sharp edges. When an object with sharp edges moves quickly across a television or movie screen or across a computer display device in a motion video display, the appearance is very unnatural and disturbing to the viewer. To achieve a more natural blurring of the object in motion, a graphical image in which an object is in motion is repeatedly rendered with the object in different position along the path of motion of the object and the resulting frames are accumulated in the accumulation buffer. The resulting accumulated frame includes an image of the moving graphical object which is blurred along the path of motion of the graphical object and a considerably more natural and pleasing animated video display. [0010]
  • An accumulation buffer may also be used to enhance depth perception in a three-dimensional graphical image. Depth perception is enhanced by blurring graphical objects distant from the viewer while preserving sharpness in graphical objects nearer the viewer. This result is achieved by repeatedly rendering the three-dimensional image from slightly varying perspectives. Altering the perspective of a three-dimensional graphical image results in greater movement of graphical object further from the viewer relative to movement of objects nearer the viewer. Accumulation of frames corresponding to slightly varied perspectives therefore results in blurring of graphical objects substantially proportional to the distance of the graphical objects from the viewer. Thus, depth perception in the rendered and accumulated graphical image is enhanced substantially. [0011]
  • An accumulation buffer may further be used to soften shadows in a rendered graphical image. Because of the precision of computers in rendering three-dimensional graphical images, shadows portrayed in such rendered graphical images are particularly sharp, resulting in an unnatural, surreal appearance of the graphical image. Shadows in such a graphical image are softened by repeatedly rendering the graphical image with the respective positions of various virtual light sources, which define the lighting characteristics of the graphical image, varied slightly and the resulting frames are accumulated in the accumulation buffer. Since each frame corresponds to a slightly different light source position, shadows in each frame are in a slightly different position. The accumulated frame in the accumulation buffer therefore has softer shadows, as if from a more diffused light source. The resulting displayed graphical image is more natural and realistic. [0012]
  • The OpenGL specification includes an accumulation buffer, which is a per-pixel screen resource, which allows applications to periodically accumulate partially rendered scenes, and then, when the full scene has rendered, put the final result back into the frame buffer. As previously mentioned, applications for the accumulation buffer include full scene antialiasing, motion blur, enhanced depth perception, and soft shading. [0013]
  • As is known, some of the operations which may be performed by the accumulation buffer are: Clear, Load, Accumulate, Multiply, Add, and Return. The Clear operation clears the entire contents of the accumulation buffer to a specified color (typically black). The Load operation copies the contents of the frame buffer into the accumulation buffer. The Accumulate operation multiplies the contents of the frame buffer (on a per-pixel basis) by a supplied number and adds the results to the contents of the accumulation buffer. The Multiply operation multiplies the contents of the accumulation buffer by a supplied number. The Add operation adds a supplied number to each component of the accumulation buffer. Finally, the Return operation multiplies the contents of the accumulation buffer by a supplied number and returns the number to the frame buffer. [0014]
  • Typically. the accumulation buffer operations listed above are implemented in software. As should be appreciated, particularly for high resolution applications, the foregoing operations require the execution of a large number of instructions. Therefore, implementing these operations in software is relatively time consuming. However, adding dedicated hardware to an existing system to accelerate the execution of these operations is costly. [0015]
  • Accordingly, it is desired to provide a system and method that provide improved performance in the execution of accumulation buffer operations, particularly in an OpenGL compliant system. [0016]
  • SUMMARY OF THE INVENTION
  • Certain objects, advantages and novel features of the invention will be set forth in part in the description that follows and in part will become apparent to those skilled in the art upon examination of the following or may be learned with the practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out in the appended claims. [0017]
  • To achieve the advantages and novel features, the present invention is generally directed to a system and method for performing accumulation buffer operations using texture mapping hardware. In accordance with one aspect of the invention, a method is provided that operates by allocating a texture map of equal size as a display screen and copying contents of a frame buffer to the allocated texture map. The method then identifies an accumulation buffer operation and performs the accumulation buffer operation in a fragment unit. Preferably, the fragment unit includes an arithmetic logic unit (ALU) to perform high-speed mathematical operations. Finally, the method directs results of the accumulation buffer operation to the frame buffer, and copies contents of the frame buffer to the allocated texture map.[0018]
  • DESCRIPTION OF THE DRAWINGS
  • The accompanying drawings incorporated in and forming a part of the specification, illustrate several aspects of the present invention, and together with the description serve to explain the principles of the invention. In the drawings: [0019]
  • FIG. 1 is a block diagram illustrating the principal hardware components of a system constructed in accordance with the invention; [0020]
  • FIG. 2 is a block diagram of a computer having graphics hardware and a device driver that cooperate to carry out the enhanced graphic accumulation operations of the present invention; [0021]
  • FIG. 3 is a flow chart illustrating the top-level operation of the initialization associated with a system constructed in accordance with the invention; [0022]
  • FIGS. 4A and 4B collectively comprise a flow-chart illustrating the top-level functional operation of a method constructed in accordance with the invention; [0023]
  • FIG. 5 is a flow chart that illustrates the top-level operation of a clear operation; and [0024]
  • FIG. 6 is a diagram similar to FIG. 1, but illustrating certain flags that may be utilized to gain performance enhancements[0025]
  • DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
  • Having summarized the present invention above, reference will now be made in detail to the description of the invention as illustrated in the drawings. While the invention will be described in connection with these drawings, there is no intent to limit it to the embodiment or embodiments disclosed therein. On the contrary, the intent is to cover all alternatives, modifications and equivalents included within the spirit and scope of the invention as defined by the appended claims. [0026]
  • It should be appreciated from the summary presented above, that one aspect of the present invention relates to the utilization of high-speed texture mapping graphics hardware to implement certain operations of an accumulation buffer. Utilizing texture mapping hardware in this fashion allows certain operations, otherwise performed in the accumulation buffer, to be performed much faster. In this respect, it was discovered that certain accumulation operations are performed much like a blend operation performed in texture mapping hardware. Texture mapping and blending are well known in the art, and need not be described herein, in order to gain an understanding of the present invention. Nevertheless, for completeness, certain basic aspects of texture mapping and blending will be described herein. [0027]
  • Texture Mapping [0028]
  • Texture mapping is a term that refers to a method for displaying images with improved surface detail. Texture mapping involves mapping a source image, referred to as a texture, onto a surface of a three-dimensional object, and thereafter mapping the textured three-dimensional object to the two-dimensional graphics display screen to display the resulting image. Surface detail attributes commonly texture mapped include color, specular reflection, vector perturbation, specularity, transparency, shadows, surface irregularities and grading. [0029]
  • Texture mapping involves applying one or more point elements (texels) of a texture to each point element (pixel) of the displayed portion of the object to which the texture is being mapped. Texture mapping hardware is conventionally provided with information indicating the manner in which the texels in a texture map correspond to the pixels on the display screen that represent the object. Each texel in a texture map is defined by S and T coordinates which identify its location in the two-dimensional texture map. For each pixel, the corresponding texel or texels that map to it are accessed from the texture map, and incorporated into the final R,G,B values generated for the pixel to represent the textured object on the display screen. [0030]
  • It should be understood that each pixel in an object primitive may not map in one-to-one correspondence with a single texel in the texture map for every view of the object. For example, the closer the object is to the view port represented on the display screen, the larger the object will appear. As the object appears larger on the display screen, the representation of the texture becomes more detailed. Thus, when the object consumes a fairly large portion of the display screen, a large number of pixels is used to represent the object on the display screen, and each pixel that represents the object may map in one-to-one correspondence with a single texel in the texture map, or a single texel may map to multiple pixels. However, when the object takes up a relatively small portion of the display screen, a much smaller number of pixels is used to represent the object, resulting in the texture being represented with less detail, so that each pixel may map to multiple texels. Each pixel may also map to multiple texels when a texture is mapped to a small portion of an object. Resultant texel data is calculated for each pixel that maps to more than one texel, and typically represents an average of the texels that map to that pixel. [0031]
  • Texture mapping hardware is well known for performing texture mapping operations at very high speed. One such operation performed by texture mapping hardware is a blend operation. [0032]
  • Blending [0033]
  • Blending is a technique that combines the R, G, B color values of a pixel (the “source” pixel) being processed with the R, G, B color values of a corresponding pixel (the “destination” pixel), previously computed and stored for example in a buffer (such as a frame buffer). The source pixel and the destination pixel have the same x, y screen coordinates. An alpha (∝) value, associated with the source pixel, controls how much of the destination pixel color values should be combined with those of the source pixel. [0034]
  • Without blending, the color values of the source pixel overwrite the existing color values of the destination pixel, as though the source pixel is opaque. With blending, a user may control, to a limited degree of resolution, how much of the existing destination pixel color value should be combined with that of a source pixel. Thus, blending is used to create a translucent image, one that enables a portion of a previously stored color value “show through” a source color value. Color blending lies at the heart of techniques such as transparency, digital compositing, and painting. [0035]
  • One way to understand blending operations is to consider the R, G, B values of a source pixel as representing its color, and the alpha.alpha. value as representing its transparency (or opacity). Levels of transparency range from completely transparent to somewhat transparent (translucent) to opaque. In standard computer graphics systems that employ blending, ∝ is a digital word of a certain number of bits that has a value between 0 and 1. If ∝=0, then the pixel is transparent. If ∝=1, then the pixel is opaque. If ∝ has some value between 0 and 1, then the pixel is translucent. [0036]
  • Blending can be understood with reference to the following analogous example. If one is viewing a destination object through colored glass, then the color seen is partly the color of the glass and partly the color of the object. The percentage of one color seen versus the other, varies depending on the transmission properties of the glass. If the glass transmits 80% of the light that strikes it, for example, then the glass has a transparency of 80% (an opacity of 20%), and the color seen is a combination of 20% glass color and 80% object color. Objects also can be viewed through multiple translucent (or transparent) surfaces such as multiple pieces of glass. Similarly, computer graphics blending operations can be performed with multiple source images. During blending, color values of source pixels are combined with color values of corresponding destination pixels (on a pixel-by-pixel basis) in a two-stage process. The color values typically are combined by blending hardware in computer graphics systems. The source R[0037] s , and destination Rd values are combined separately from the source Gs, and destination Gd values, which are combined separately from the source Bs, and destination Bd values. Each of the values is combined using digital arithmetic hardware according to standard blending equations that involve the color values and the source ∝ value. Such blending equations are standard in the industry and are listed in the OpenGL Programming Guide The Official Guide to Learning OpenGL, Release, by Neider, Davis and Woo (OpenGL Architecture Review Board), Addison-Wesley Publishing Company, Second Printing, August 1994, which reference herein is incorporated by reference in its entirety.
  • Implementing Accumulation Operations in Texture Mapping Hardware [0038]
  • As previously mentioned, one aspect of the present invention relates to the implementation of certain accumulation operations in texture mapping hardware. The preferred embodiment of the invention is compatible in all OpenGL-compliant systems. The “OpenGL” standard is a very important software standard for graphics applications. In any computer system that supports this standard, the operating system(s) and application software programs can make calls according to the OpenGL standards. without knowing exactly what the hardware configuration of the system is. [0039]
  • The OpenGL standard provides a complete library of low-level graphics manipulation commands, which can be used to implement three-dimensional graphics operations. This standard was originally based on the proprietary standards of Silicon Graphics, Inc., but was later transformed into an open standard. It is now becoming extremely important, not only in high-end graphics-intensive workstations, but also in high-end PCs. OpenGL is supported by Windows NT, which makes it accessible to many PC applications. [0040]
  • The OpenGL specification provides some constraints on the sequence of operations. For instance, the color DDA (digital differential analyzer) operations must be performed before the texturing operations, which must be performed before the alpha operations. A DDA is a conventional piece of hardware used to produce linear gradation of color (or other) values over an image area. [0041]
  • In one embodiment, the invention may be implemented through the use of standard OpenGL commands. In another embodiment, the invention may be implemented as a device driver, and operates by identifying certain OpenGL commands that would ordinarily result in the performance of operations in the accumulation buffer, and instead performs those operations in the higher performance texture mapping hardware. [0042]
  • To better appreciate these implementations, reference is now made to FIG. 1, which is a block diagram illustrating certain components in a computer graphics system. Specifically, the principal components illustrated in FIG. 1 include a [0043] texture engine 102, RAM 104, a fragment unit (or pixel processor) 106 the frame buffer 108 and a display 110. The RAM 104 includes texture maps, which may be exchanged with the texture engine 102 during texture processing. The fragment unit 106 is also utilized (in communication with the texture engine 102) during texture processing. Typically, an arithmetic logic unit (ALU) 107 is incorporated into the fragment unit 106, and a utilized to execute various mathematical operations. For example, the ALU 107 may be utilized when performing accumulation and blending functions.
  • As is known, and defined in the OpenGL standard, various texture and blend operations may be performed and are supported by the OpenGL standard instruction set. Blending is enabled or disabled simply by using the commands “Enable Blend” and “Disable Blend.” In this regard, OpenGL includes blending instructions that utilize the texture mapping hardware to perform functions such as blend operations. [0044]
  • For example, OpenGL specifies the following blend instructions, which may be utilized by the present invention: “glBlendEquation(GL[0045] 13FUNC13ADD)” and “glBlendFunc(GL13SRC ALPHA, GL13ONE13MINUS13SRC13ALPHA)”. OpenGL specifies other blend instructions, but these are the most pertinent to the preferred embodiment of the invention.
  • The glBlendEquation(GL[0046] 13FUNC13ADD) instruction defines the blending equation as C=CsS+CdD, where Cs and Cd are the source and destination colors, and S and D are quadruplets of weighting factors, as specified by glBlendFunc. The instruction glBlendFunc( ) src specifies how to compute a source blending factor, while glBlendFunc( ) dst specifies how to compute a destination blending factor.
  • As is known, the path of data processing from the [0047] texture unit 102 through the fragment unit 106 to the frame buffer 108 is the direction of high-speed or high-performance processing. A reverse path 12, however, is provided within the texture mapping hardware, and is supported by the OpenGL instruction set. Specifically, OpenGL specifies a “glCopyTexSubImage2( )” instruction, which copies pixels from the frame buffer 108 into a portion of the current texture.
  • Therefore, and in accordance with one aspect of the invention, OpenGL instructions may be coded to specifically utilize the texture mapping hardware to perform certain accumulation functions. For example, rather than use the standard glAccumulate instruction to multiply the contents of the frame buffer by a number and add that result to the contents of the accumulation buffer, one could code OpenGL instructions to copy contents of the [0048] frame buffer 108 to the texture engine 102, along path 112 (using the “glCopyTexSubImage2D( ) instruction). Then, one could code OpenGL blending instructions to perform the multiply and accumulation operations using the high-speed ALU 107 in the pixel processor 106, and write the resulting pixels to the frame buffer 108. It should be understood that utilizing the texture mapping hardware in this novel manner greatly accelerates the processing of certain operations normally performed by the accumulation buffer.
  • An [0049] accumulation buffer 115 is also illustrated in FIG. 1 in dashed line. This accumulation buffer 115 has been illustrated merely for the purpose depicting the contrasting data-flow of the present invention. For example, the accumulation buffer 115, as a feature of OpenGL, in the past has been generally implemented in software, and data is exchanged between the frame buffer 108 and the accumulation buffer 115 in a relatively low-performance fashion. Instead, and in accordance with the present invention, data from the frame buffer 108 is transferred to the texture engine. Thereafter, blend operations are performed on the data and it is written back into the frame buffer 108.
  • Preferably, the present invention is implemented as a device driver. In such an implementation, texture mapping hardware is utilized in certain accumulation operations, without being specifically coded in the OpenGL code. Rather, a device driver implementing the inventive features recognizes certain instructions that would normally invoke the accumulation buffer, and instead control the execution of these instructions through C (or other coded) functions. Reference is made briefly to FIG. 2, which depicts a [0050] computer 120 having internal graphics hardware 124, including a texture engine 102, a fragment unit 106, a RAM 104, and a frame buffer 108. A device driver 122 is also illustrated. As is known, a device driver may be implemented in programmed code. The dashed line pointing from the device driver 122 to the graphics hardware 124 is provided to illustrate the notion that the device driver 122 controls at least some operations of the graphics hardware.
  • To better illustrate the function and operation of the preferred embodiment of the present invention, reference is made to the flowcharts of FIGS. 3, 4A, and [0051] 4B, which collectively depict the top-level operation of a system constructed in accordance with the present invention.
  • Referring first to FIG. 3, a flow chart depicts certain initiation routines performed by the present invention. In this regard, upon power-up or program initiation, certain initialization routines may be performed, and are broadly denoted by [0052] step 302. Thereafter, a variable called “accumWeight” is initialized to a value of 0 (step 304). The significance and operation of this variable will be discussed below. Then, step 306 generates the accumulation texture ID. As is known in texture mapping, a plurality of different texture maps may be created and assigned unique texture ID numbers for later reference. Step 306 creates a texture ID that is uniquely assigned to the accumulation buffer. This ID may be generated using the OpenGL instruction “glGenTextures( )”. Finally at step 308, the accumulation texture is bound and made into an RGB texture of maximum possible window size (rounded up to the next power of 2). That is, if the screen size of the display is 800×600 pixels, then the texture will be sized as a 1,024×1,024 texture map. This step may be performed by using the OpenGL instruction “glBindTexture( ).”
  • Reference is now made collectively to FIGS. 4A and 4B, which comprise a flow chart illustrating the top-level functional operation of the present invention. As summarized above, the present invention operates to implement certain accumulation buffer operations within the texture mapping hardware. The genesis of the present invention was the recognition that certain accumulation buffer operations were implemented using multiplication and addition operations that closely resemble the blend operation performed in texture mapping hardware. For example, the accumulate instruction of OpenGL multiplies the contents of the frame buffer by a number supplied by the programmer and adds that resulting value to the contents of the accumulation buffer (on a per-pixel basis). Once this accumulate instruction was implemented in the texture mapping hardware, it was discovered that certain other accumulation buffer operations could be conveniently and efficiently performed using the texture mapping hardware as well. These instructions included the following instructions: “gl[0053] 13Clear”, “gl13Add”, “gl13Return”, “gl13Multiply”, “gl13Load”, and “gl13Accumulate”. As previously mentioned, OpenGL could be coded to specifically implement these instructions using texture mapping hardware. Alternatively, a device driver may be written that recognizes these instructions and controls their execution so that they are carried out in texture mapping hardware. It should be appreciated that the execution of these instructions has been presented merely for purposes of illustration and variants of this method may be implemented consistent with the scope and spirit of the present invention.
  • [0054] Step 322 represents an entry point into the method of the present invention by a call or invocation of an OpenGL instruction that implements an accumulation buffer is operation in texture mapping hardware. Once one of these instructions has been identified, it may be passed to a routine called “glAccum”, which receives the variables “op” and “frac”. The “op” variable denotes the operation (e.g., gl13Add, gl13Accumulate, etc.) that is passed to the glAccum routine. frac is a variable that indicates how much accumulation has occurred. Again, this value may be controlled by a programmer, and an example will be presented below to better illustrate the use and purpose of this value. In step 324, alpha (the transparency value) is set to 0 and the destination pixel value is set to 1-alpha (the alpha value of the source pixel). Step 326 is a decisional block, which determines whether the variable op is either gl13Add or gl13Return. If so, no operation needs to be performed (step 328).
  • [0055] Decision block 330 determines whether the variable op is gl13Multiply. If so, the factor accumWeight is set equal to the product of accumWeight and the frac variable (step 332). The variable accumWeight is a floating point scale factor that will be further illustrated in connection with the frac variable in the example that will be presented below. Decision block 334 determines whether the op variable is gl13Load. If so, the accumWeight variable is set to 0 and the method proceeds to step 344 (the operation of step 344 and the ensuing steps will be discussed below). If decision blocks 326, 330, and 334 have all resolved to NO, then it is assumed that the variable op is gl13Accumulate, and decision block 338 determines whether the variable frac exceeds the value of 1 (generally the variable frac will be a value less than 1). If, however, the value exceeds 1, step 340 sets the alpha value equal to the lesser of 1 or the value of the accumWeight variable. It also sets the destination factor equal to 1. Since alpha is defined as a value from 0.0 to 1.0, step 340 ensures that the value used is appropriately clamped to that range.
  • If [0056] step 338 resolves to NO, then the alpha value is set equal to the accumWeight variable divided by the sum of the accumWeight variable the frac variable. The method then proceeds to step 344, where it determines whether alpha is greater than 0. If the alpha value is not greater than 0 (i. e., alpha equals 0) there is complete transparency, and no blending operations need to be performed. Therefore, the method may proceed to step 350, where contents of the frame buffer are copied back to the accumulation texture object contained within the texture engine. This step is preferably executed using the “glCopyTexSubimage2D( )” instruction. Thereafter the accumWeight variable is increased by an amount equal to the frac variable (step 362).
  • If, however, step [0057] 344 determines that the alpha value is greater than 0, then the method establishes identity modelview and projection matrices, and sets up blending within the texture hardware (step 346). It then sets up a texture state (gl13Decal) with the accumulation texture object (step 348). The method then sets up a transparency value using “glColor4f” with each R, G, and B value set to 1, and using the current alpha value (step 350). The method then draws a full-window textured quad to blend the texture ID associated with the accumulation buffer with the frame buffer. Thereafter, the method proceeds to step 360, and continues operation from there in the manner described above.
  • Having described the flow charts of FIGS. 4A and 4B, consider an example of is a multi-pass accumulation rendering. Assume, for example, that a programmer configures code to perform a four-pass accumulation (again, the purpose of the accumulation could be any of a variety). Further assume that the programmer sets the frac variable equal to 0.25. The values set out in Table 1 below show the values of the accumWeight variable before the pass, after the pass, and the value of alpha. [0058]
    TABLE 1
    Accum Weight Accum Weight
    Pass (before) (after) Alpha
    1 0.0 0.25 0.0
    2 0.25 0.5 0.5
    3 0.5 0.75 0.6667
    4 0.75 1.00 0.75
  • As can be readily verified, in an “equal weight” accumulation algorithm (like most antialiasing or motion blur algorithms), the alpha value increases in an useful way each time. The first time through, alpha is zero, because of the need to accumulate entirely the frame buffer pixels. The second pass through, the frame buffer and the accumulation buffer are equally weighted (since both buffers have a 1 pass in them). As a result, the alpha value is ½, or 0.5 (alpha accumWeight/(accumWeight+frac or alpha 0.5/0.25+0.25 =0.5). The accumulation pixels begin having higher weight on the third pass through, since the accumulation buffer now has 2 passes in it, while the frame buffer still only has the current pass in it. After the third pass, alpha is 0.6667. This progresses exactly the same way when frac is equal to 1/numPasses, no matter how large numPasses gets. [0059]
  • Reference is made briefly to FIG. 5, which is a flow chart illustrating the top-level operation of a gl[0060] 13Clear instruction. As is known, the gl13Clear instruction operates to clear the contents of the accumulation buffer, or to write a constant value to all pixel locations of the accumulation buffer. In the implementation of the present invention, this instruction may be carried out simply by setting the accumWeight variable to a value of zero (step 380). As a result, the gl13Clear instruction is executed extremely rapidly (as opposed to writing a constant value to each of the memory locations of the accumulation buffer).
  • Having described the preferred embodiment of the present invention, it should be appreciated that there are various alternative embodiments that may be implemented, consistent with the scope and spirit of the present invention. Indeed, various alternative configurations may be implemented to achieve certain performance advantages. In this regard, reference is made to FIG. 6, which is a diagram similar to FIG. 1, but further illustrates two additional “flags” [0061] 420 and 422. A first flag 420, labeled as “Return Needed Flag” may be provided to indicate whether a “gl13Return” instruction is needed. As is known, the gl13Return instruction operates to transfer the contents from the OpenGL accumulation buffer back to the frame buffer. However, since the accumulated result of the present invention is already in the frame buffer 108 at the end of an accumulation operation, the gl13Return instruction need not be executed. Stated, another way, the gl13Return operation need only be carried out if the contents of the frame buffer 108 are overwritten. Therefore, the value of this flag 420 may generally be set to FALSE. Thus, and the end of most interim accumulation operations, the contents of the frame buffer 108 will be copied back to the texture engine 102, to prepare for the next pass, or next accumulation. The flag 420 may be set to TRUE, however, if any command is subsequently executed that modifies the contents of the frame buffer 108. In response to a gl13Return operation, a return is needed only if the Return Needed flag is TRUE.
  • A [0062] second flag 422, labeled as “Accum. Incomplete Flag” is provided to indicate a status of the current, ongoing accumulation operation. This flag may be utilized to avoid the final copy-back of the contents of the frame buffer 108 to the texture engine 102, after the final accumulation operation. As described above, the glCopyTexSubimage2D( ) instruction is used to copy the contents of the frame buffer 108 back to the texture engine after each interim accumulation instruction. When a multi-pass accumulation operation is set up by a programmer/user, this flag 422 may be set to TRUE. After each interim accumulation operation, the contents of the frame buffer 108 are copied back to the texture engine 102, so long as the value of this flag is TRUE. When, however, the final pass of a multi-pass accumulation is initiated, this flag may be set to FALSE, and the final copy-back (e.g., glCopyTexSubimage2D( ) instruction) need not be performed.
  • As illustrated, [0063] additional control circuitry 424 may be provided to achieve carryout these features, in connection with the status of the flags 420 and 422.
  • Having described the method of the present invention, it will be appreciated that the steps illustrated in the flow charts of FIGS. 3, 4A, [0064] 4B, and 5 are provided for purposes of illustration and is not deemed to be limiting on the broader aspects of the present invention. Indeed, the broader aspects of the present invention may be implemented using a variety of different approaches that are still consistent with the scope and content of the present invention. In this regard, it should be appreciated that the flow charts of FIGS. 3, 4A, 4B, and 5 show the top-level operation of only one possible implementation of the methods of the present invention. In this regard, each block represents a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks may occur out of the order noted in FIGS. 3A and 3B. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • The foregoing description has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obvious modifications or variations are possible in light of the above teachings. The embodiment or embodiments discussed were chosen and described to provide the best illustration of the principles of the invention and its practical application to thereby enable one of ordinary skill in the art to utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated. All such modifications and variations are within the scope of the invention as determined by the appended claims when interpreted in accordance with the breadth to which they are fairly and legally entitled. [0065]

Claims (18)

What is claimed is:
1. A method for performing an accumulation buffer operation using texture mapping hardware comprising the steps of:
allocating a texture map of equal size as a display screen;
copying contents of a frame buffer to the allocated texture map;
identifying an accumulation buffer operation;
performing the accumulation buffer operation in a fragment unit, the fragment unit having an arithmetic logic unit (ALU);
directing results of the accumulation buffer operation to the frame buffer; and
copying contents of the frame buffer to the allocated texture map.
2. The method as defined in claim 1, wherein the step of allocating a texture map includes generating an accumulation texture ID.
3. The method as defined in claim 2, wherein the step of generating an accumulation texture ID is performed by using an OpenGL call of glGenTextures( ).
4. The method as defined in claim 2, wherein the step of allocating a texture map includes the steps of binding the accumulation texture ID and making it an RGB texture of maximum possible window size, rounded up to a power of 2.
5. The method as defined in claim 4, wherein the step of binding the accumulation texture ID is performed by using an OpenGL call of glBindTexture( ).
6. The method as defined in claim 1, wherein the step of copying contents of a frame buffer to the allocated texture map is performed by using an OpenGL call of glCopyTexSubImage2D( ).
7. The method as defined in claim 1, wherein the step of identifying an accumulation buffer operation includes identifying an accumulate operation.
8. The method as defined in claim 7, wherein the step of performing the accumulation buffer operation in a fragment unit includes determining whether a transparency value is greater than zero.
9. The method as defined in claim 8, further including the steps of establishing identity modelview and projection matrices, and setting up blending.
10. The method as defined in claim 8, further including the step of setting up a texture state with an accumulation texture object.
11. The method as defined in claim 10, wherein the step of setting up the texture state is performed by using an OpenGL call of GL13DECAL.
12. The method as defined in claim 8, further including the step of setting up transparency using an OpenGL call of glColor4f(1, 1, 1, alpha), where alpha is the transparency value.
13. In a computer graphics system having texture mapping hardware, a system for computing accumulation buffer operations, the improvement comprising using the texture graphics hardware to carryout an accumulation buffer operation in hardware.
14. The system as defined in claim 13, wherein the texture graphics hardware is configured to perform multiplies in an accumulation buffer operation like texture mapping blend operations.
15. A computer readable medium for controlling the operation of a computer graphics system to perform an accumulation buffer operation using texture mapping hardware comprising:
a first code segment configured to allocate a texture map of equal size as a display screen;
a second code segment configured to copy contents of a frame buffer to the allocated texture map;
a third code segment configured to identify an accumulation buffer operation;
a fourth code segment configured to perform the accumulation buffer operation in a fragment unit, the fragment unit having an arithmetic logic unit (ALU);
a fifth code segment configured to direct results of the accumulation buffer operation to the frame buffer; and
a sixth code segment configured to copy contents of the frame buffer to the allocated texture map.
16. A computer system configured to execute the code segments contained on the computer readable medium as defined in claim 15.
17. The computer readable medium as defined in claim 15, the first code segment is further configured to generate an accumulation texture ID.
18. The computer readable medium as defined in claim 17, wherein the first code segment is further configured to bind the accumulation texture ID and make it an RGB texture of maximum possible window size, rounded up to a power of 2.
US10/100,416 1999-10-15 2002-03-18 System and method for implementing accumulation buffer operations in texture mapping hardware Abandoned US20020135587A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US10/100,416 US20020135587A1 (en) 1999-10-15 2002-03-18 System and method for implementing accumulation buffer operations in texture mapping hardware

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US09/419,373 US6396502B1 (en) 1999-10-15 1999-10-15 System and method for implementing accumulation buffer operations in texture mapping hardware
US10/100,416 US20020135587A1 (en) 1999-10-15 2002-03-18 System and method for implementing accumulation buffer operations in texture mapping hardware

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US09/419,373 Continuation US6396502B1 (en) 1999-10-15 1999-10-15 System and method for implementing accumulation buffer operations in texture mapping hardware

Publications (1)

Publication Number Publication Date
US20020135587A1 true US20020135587A1 (en) 2002-09-26

Family

ID=23661981

Family Applications (2)

Application Number Title Priority Date Filing Date
US09/419,373 Expired - Lifetime US6396502B1 (en) 1999-10-15 1999-10-15 System and method for implementing accumulation buffer operations in texture mapping hardware
US10/100,416 Abandoned US20020135587A1 (en) 1999-10-15 2002-03-18 System and method for implementing accumulation buffer operations in texture mapping hardware

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US09/419,373 Expired - Lifetime US6396502B1 (en) 1999-10-15 1999-10-15 System and method for implementing accumulation buffer operations in texture mapping hardware

Country Status (1)

Country Link
US (2) US6396502B1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040017937A1 (en) * 2002-07-29 2004-01-29 Silverstein D. Amnon Robot having an imaging capability
US20050134591A1 (en) * 2003-12-23 2005-06-23 Baxter Brent S. Spatio-temporal generation of motion blur
US20050138569A1 (en) * 2003-12-23 2005-06-23 Baxter Brent S. Compose rate reduction for displays
KR100612890B1 (en) 2005-02-17 2006-08-14 삼성전자주식회사 Multi-effect expression method and apparatus in 3-dimension graphic image
US20070038842A1 (en) * 2003-03-27 2007-02-15 Graham Kirsch Data recording processor and method for use in an active memory device
US20080222503A1 (en) * 2007-03-06 2008-09-11 Wildtangent, Inc. Rendering of two-dimensional markup messages
CN108279959A (en) * 2017-01-05 2018-07-13 杭州海康威视数字技术股份有限公司 Implementation method, device and the hard disk video recorder of the boot animation of hard disk video recorder

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2831978B1 (en) * 2001-11-07 2004-08-20 Neopost Ind POSTAL PRODUCT STATISTICAL MONITORING SYSTEM
US20030164842A1 (en) * 2002-03-04 2003-09-04 Oberoi Ranjit S. Slice blend extension for accumulation buffering
US6906720B2 (en) * 2002-03-12 2005-06-14 Sun Microsystems, Inc. Multipurpose memory system for use in a graphics system
US7096432B2 (en) * 2002-05-14 2006-08-22 Microsoft Corporation Write anywhere tool
GB2392072B (en) * 2002-08-14 2005-10-19 Autodesk Canada Inc Generating Image Data
US7324113B1 (en) * 2005-03-09 2008-01-29 Nvidia Corporation Perspective correction computation optimization
US8004515B1 (en) * 2005-03-15 2011-08-23 Nvidia Corporation Stereoscopic vertex shader override
US8063914B1 (en) * 2007-08-02 2011-11-22 Adobe Systems Incorporated Rendering antialiased geometry to an image buffer using jittering
US9704272B2 (en) 2014-11-21 2017-07-11 Microsoft Technology Licensing, Llc Motion blur using cached texture space blur
CN112200712B (en) * 2020-09-08 2023-10-27 成都安易迅科技有限公司 GLES image rendering method and device, storage medium and computer equipment

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5673374A (en) * 1992-04-28 1997-09-30 Hitachi, Ltd. Method and apparatus for non-disturbed specular reflections on textured surfaces
US5805782A (en) * 1993-07-09 1998-09-08 Silicon Graphics, Inc. Method and apparatus for projective texture mapping rendered from arbitrarily positioned and oriented light source
US5835096A (en) * 1995-03-24 1998-11-10 3D Labs Rendering system using 3D texture-processing hardware for accelerated 2D rendering
US6108007A (en) * 1997-10-09 2000-08-22 Silicon Graphics, Inc. Method, system, and computer program product for increasing interpolation precision using multi-channel texture mapping
US6111584A (en) * 1995-12-18 2000-08-29 3Dlabs Inc. Ltd. Rendering system with mini-patch retrieval from local texture storage
US6252608B1 (en) * 1995-08-04 2001-06-26 Microsoft Corporation Method and system for improving shadowing in a graphics rendering system
US6259462B1 (en) * 1998-12-09 2001-07-10 Ati International Srl Method and apparatus for texture blending in a video graphics circuit
US6292194B1 (en) * 1995-08-04 2001-09-18 Microsoft Corporation Image compression method to reduce pixel and texture memory requirements in graphics applications
US20010045955A1 (en) * 1997-05-26 2001-11-29 Masaaki Oka Image generating method and apparatus
US6333743B1 (en) * 1997-10-23 2001-12-25 Silicon Graphics, Inc. Method and apparatus for providing image and graphics processing using a graphics rendering engine
US20020180747A1 (en) * 2001-05-18 2002-12-05 Sun Microsystems, Inc. Graphics primitive size estimation and subdivision for use with a texture accumulation buffer
US20030058249A1 (en) * 2001-09-27 2003-03-27 Gabi Malka Texture engine state variable synchronizer
US20030142104A1 (en) * 2002-01-30 2003-07-31 Lavelle Michael G. Batch processing of primitives for use with a texture accumulation buffer
US20030201994A1 (en) * 1999-07-16 2003-10-30 Intel Corporation Pixel engine
US6677957B2 (en) * 2001-01-09 2004-01-13 Intel Corporation Hardware-accelerated visualization of surface light fields
US6697062B1 (en) * 1999-08-06 2004-02-24 Microsoft Corporation Reflection space image based rendering
US20040179020A1 (en) * 1999-05-07 2004-09-16 Lewis Michael C. Method and system for providing programmable texture processing

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2673101B2 (en) 1994-08-29 1997-11-05 インターナショナル・ビジネス・マシーンズ・コーポレイション Computer graphics equipment
JP2637931B2 (en) 1994-12-01 1997-08-06 インターナショナル・ビジネス・マシーンズ・コーポレイション Computer system for texture mapping
JP3647487B2 (en) 1994-12-02 2005-05-11 株式会社ソニー・コンピュータエンタテインメント Texture mapping device
US5751292A (en) 1995-06-06 1998-05-12 Hewlett-Packard Company Texture mapping method and system
DE69635638T2 (en) 1995-06-06 2006-07-20 Hewlett-Packard Development Co., L.P., Houston Buffer memory for texture data
US5977977A (en) * 1995-08-04 1999-11-02 Microsoft Corporation Method and system for multi-pass rendering
US5990904A (en) * 1995-08-04 1999-11-23 Microsoft Corporation Method and system for merging pixel fragments in a graphics rendering system
US5872729A (en) 1995-11-27 1999-02-16 Sun Microsystems, Inc. Accumulation buffer method and apparatus for graphical image processing
US5896136A (en) 1996-10-30 1999-04-20 Hewlett Packard Company Computer graphics system with improved blending
AU5686299A (en) * 1998-08-20 2000-03-14 Raycer, Inc. Method and apparatus for generating texture

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5673374A (en) * 1992-04-28 1997-09-30 Hitachi, Ltd. Method and apparatus for non-disturbed specular reflections on textured surfaces
US5805782A (en) * 1993-07-09 1998-09-08 Silicon Graphics, Inc. Method and apparatus for projective texture mapping rendered from arbitrarily positioned and oriented light source
US5835096A (en) * 1995-03-24 1998-11-10 3D Labs Rendering system using 3D texture-processing hardware for accelerated 2D rendering
US6292194B1 (en) * 1995-08-04 2001-09-18 Microsoft Corporation Image compression method to reduce pixel and texture memory requirements in graphics applications
US6252608B1 (en) * 1995-08-04 2001-06-26 Microsoft Corporation Method and system for improving shadowing in a graphics rendering system
US6111584A (en) * 1995-12-18 2000-08-29 3Dlabs Inc. Ltd. Rendering system with mini-patch retrieval from local texture storage
US20010045955A1 (en) * 1997-05-26 2001-11-29 Masaaki Oka Image generating method and apparatus
US6108007A (en) * 1997-10-09 2000-08-22 Silicon Graphics, Inc. Method, system, and computer program product for increasing interpolation precision using multi-channel texture mapping
US6333743B1 (en) * 1997-10-23 2001-12-25 Silicon Graphics, Inc. Method and apparatus for providing image and graphics processing using a graphics rendering engine
US6259462B1 (en) * 1998-12-09 2001-07-10 Ati International Srl Method and apparatus for texture blending in a video graphics circuit
US20040179020A1 (en) * 1999-05-07 2004-09-16 Lewis Michael C. Method and system for providing programmable texture processing
US20030201994A1 (en) * 1999-07-16 2003-10-30 Intel Corporation Pixel engine
US6697062B1 (en) * 1999-08-06 2004-02-24 Microsoft Corporation Reflection space image based rendering
US6677957B2 (en) * 2001-01-09 2004-01-13 Intel Corporation Hardware-accelerated visualization of surface light fields
US20020180747A1 (en) * 2001-05-18 2002-12-05 Sun Microsystems, Inc. Graphics primitive size estimation and subdivision for use with a texture accumulation buffer
US20030058249A1 (en) * 2001-09-27 2003-03-27 Gabi Malka Texture engine state variable synchronizer
US20030142104A1 (en) * 2002-01-30 2003-07-31 Lavelle Michael G. Batch processing of primitives for use with a texture accumulation buffer

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040017937A1 (en) * 2002-07-29 2004-01-29 Silverstein D. Amnon Robot having an imaging capability
US7310439B2 (en) * 2002-07-29 2007-12-18 Hewlett-Packard Development Company, L.P. Robot having an imaging capability
US7584343B2 (en) * 2003-03-27 2009-09-01 Micron Technology, Inc. Data reordering processor and method for use in an active memory device
US20070038842A1 (en) * 2003-03-27 2007-02-15 Graham Kirsch Data recording processor and method for use in an active memory device
US20050134591A1 (en) * 2003-12-23 2005-06-23 Baxter Brent S. Spatio-temporal generation of motion blur
US20050138569A1 (en) * 2003-12-23 2005-06-23 Baxter Brent S. Compose rate reduction for displays
US7616220B2 (en) 2003-12-23 2009-11-10 Intel Corporation Spatio-temporal generation of motion blur
US7506267B2 (en) * 2003-12-23 2009-03-17 Intel Corporation Compose rate reduction for displays
KR100612890B1 (en) 2005-02-17 2006-08-14 삼성전자주식회사 Multi-effect expression method and apparatus in 3-dimension graphic image
US20080222503A1 (en) * 2007-03-06 2008-09-11 Wildtangent, Inc. Rendering of two-dimensional markup messages
US8117541B2 (en) * 2007-03-06 2012-02-14 Wildtangent, Inc. Rendering of two-dimensional markup messages
US9171397B2 (en) 2007-03-06 2015-10-27 Wildtangent, Inc. Rendering of two-dimensional markup messages
CN108279959A (en) * 2017-01-05 2018-07-13 杭州海康威视数字技术股份有限公司 Implementation method, device and the hard disk video recorder of the boot animation of hard disk video recorder

Also Published As

Publication number Publication date
US6396502B1 (en) 2002-05-28

Similar Documents

Publication Publication Date Title
US6038031A (en) 3D graphics object copying with reduced edge artifacts
Merritt et al. [26] Raster3D: Photorealistic molecular graphics
US6664959B2 (en) Method and apparatus for culling in a graphics processor with deferred shading
US6396502B1 (en) System and method for implementing accumulation buffer operations in texture mapping hardware
US5966134A (en) Simulating cel animation and shading
CN111508052B (en) Rendering method and device of three-dimensional grid body
US7095419B2 (en) Applying multiple texture maps to objects in three-dimensional imaging processes
US6650323B2 (en) Graphics system having a super-sampled sample buffer and having single sample per pixel support
US6064393A (en) Method for measuring the fidelity of warped image layer approximations in a real-time graphics rendering pipeline
US7982734B2 (en) Spatially-varying convolutions for rendering soft shadow effects
US8223149B2 (en) Cone-culled soft shadows
US7889205B1 (en) Frame buffer based transparency group computation on a GPU without context switching
Segovia et al. Non-interleaved deferred shading of interleaved sample patterns
US20070139408A1 (en) Reflective image objects
US7970237B2 (en) Spatially-varying convolutions for rendering glossy reflection effects
WO2000011613A2 (en) Performing hidden surface removal in a graphics processor with deferred shading
WO1999049417A1 (en) Fog simulation for partially transparent objects
US20040085310A1 (en) System and method of extracting 3-D data generated for 2-D display applications for use in 3-D volumetric displays
US6771263B1 (en) Processing volumetric image data with shadows
US7508390B1 (en) Method and system for implementing real time soft shadows using penumbra maps and occluder maps
McReynolds et al. Programming with opengl: Advanced rendering
US6906729B1 (en) System and method for antialiasing objects
US7116333B1 (en) Data retrieval method and system
US6894696B2 (en) Method and apparatus for providing refractive transparency in selected areas of video displays
US11908069B2 (en) Graphics processing

Legal Events

Date Code Title Description
AS Assignment

Owner name: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P., COLORAD

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HEWLETT-PACKARD COMPANY;REEL/FRAME:013776/0928

Effective date: 20030131

Owner name: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.,COLORADO

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HEWLETT-PACKARD COMPANY;REEL/FRAME:013776/0928

Effective date: 20030131

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION