The present invention relates in general to image graphics and more particularly to a table indexing system and method.
Graphics rendering and other visualization applications typically utilize accelerated hardware, firmware, and sometimes even software modules to perform compute-intensive rendering operations. These applications also utilize a graphics system interface such as OPENGL® or DIRECT3D® to control low-level graphics drawing operations in these accelerated modules. These operations include, but are not limited to, polygon specification and transformations, basic lighting control, and frame buffer operations such as blending and depth-buffering. Transformations usually correctly position one or more three-dimensional objects and then apply lighting and/or textures using the correct size and angles. OPENGL® utilizes a variety of low-level models such as textures, which may be defined for objects within scenes, and lighting models, which may define light sources and the manner in which surfaces in the scenes reflect light therefrom. Unfortunately, any increase in the quality of an object's appearance is typically associated with a decrease in processing speed. This decrease in processing speed is undesirable, especially for interactive applications.
Although these interfaces provide low-level models of graphics operations that may be performed by accelerated modules, they typically process geometry-based data, and thus limit the flexibility with which pixel-based complex effects may be programmed. For example, programmable or procedural shading applications usually involve pixel-based manipulation of the appearances of objects within a scene by an artist or technical director. Controlling the appearance of these objects typically requires the use of complex effects such as blending, shading, and texturing. For example, the artist may desire that a portion of a reflecting pool appear rippled and bright. These applications are desirably programmable to improve the flexibility and speed of manipulating the objects to achieve the desired result.
Many graphics systems may utilize lookup tables to compute appearance parameters that include, for example, colors and/or textures. Unfortunately, values computed in these systems are typically limited in range, or compressed by scaling, biasing, and/or clamping. This compression of values typically limits the accuracy and flexibility with which the appearances of objects may be computed.
From the foregoing, it may be appreciated that a need has arisen for improving the accuracy with which table indices may be determined from floating point data values. In accordance with the present invention, a table indexing system and method are provided that substantially eliminate or reduce disadvantages and problems of conventional systems.
One aspect of the invention is a system for implementing an extended range texture. The system includes a memory and a graphics system interface. The graphics system interface is operable to control receiving a plurality of floating point pixel values. Each of the pixel values comprises a plurality of bits, which comprise a plurality of mantissa bits and a plurality of exponent bits. The graphics system interface is also operable to control interpreting for at least one of the pixel values a contiguous subset of the bits as a fixed point value to produce a second data value. The graphics system interface is also operable to control reading the second data value from a data structure resident in the memory.
The invention provides several important advantages. Various embodiments of the invention may have none, some, or all of these advantages. For example, the invention may be used to implement higher resolution values for operations such as texturing. The invention may also represent pixel values as an index to a texture value. Such an advantage allows more detailed features such as colors and/or textures to be applied to image data and avoids these texture values from being clamped in the graphics pipeline. Such an advantage may also minimize any loss in the precision of computed colors and/or texture values, improve the quality of the resultant images by improving the accuracy to which light and/or color may be displayed and/or processed. The invention may implement any monadic function by using, for example, a one-dimensional texture in conjunction with a graphics system interface such as OPENGL®. The invention may be used with a variety of existing systems and maximize a speed of processing while maintaining a minimum loss in precision of extended range pixel values. Other technical advantages may be readily ascertainable by those skilled in the art from the following figures, description, and claims.
For a more complete understanding of the present invention and the advantages thereof, reference is now made to the following description taken in conjunction with the accompanying drawings, wherein like reference numerals represent like parts, and in which:
Interface 15 may be any software graphics or firmware interface such as OPENGL® or DIRECT3D® that includes procedures and functions and that may be used to control low-level operations in graphics pipeline 17. In operation, interface 15 is operable to control the processing of image data in graphics pipeline 17 in response to selected commands that are passed from application software 11 such as a programmable shader. Data is passed through some or all of the elements in graphics pipeline 17 and may then be transferred from frame buffer 70 to display 90 for viewing. For example, pixels may be written to and read from frame buffer 70 using OPENGL® function calls such as the DrawPixels and ReadPixels command, and the function CopyPixels can be used to copy a block of pixels from one region of frame buffer 70 to another.
More specifically, graphics pipeline 17 includes a vertex operations module 30 and a pixel operations module 40. Vertex operations module 30 and pixel operations module 40 are each coupled to a rasterization hardware 50. Rasterization hardware 50 is coupled to a frame buffer operations module 60, which in turn is coupled to a frame buffer 70. Frame buffer 70 may couple to pixel operations module 40. Pixel operations module 40 is also coupled to a texture memory 80, which is also coupled to rasterization hardware 50. Graphics pipeline 17 may include software, firmware, hardware, or a combination thereof. Interface 15 may be a standalone module, reside on host 20, or a combination thereof.
It may be helpful to illustrate a single pass through graphics pipeline 17. Because interfaces 15 such as OPENGL® are procedurally based, graphics pipeline 17 performs those low-level operations on all of the pixels passed in response to the OPENGL® procedure or function call. Host 20 sends image data to pixel operations module 40, which may utilize a lookup table to apply a scale or bias such as a color contrast or brightness to pixels passed thereto. Host 20 also sends geometry data to vertex operations module 30. The geometry data usually includes texture coordinates or vertices (s,t,r,q) that are projected points that correspond to a location (x,y,z,w) in an image plane. The geometry data may also include normals at each of these vertices for each of the three channels (usually red, green, and blue). Vertex operations module 30 transforms geometry into a raster coordinate system. Usually, this includes tessellation, or breaking down a continuously smooth surface into triangular surfaces. Rasterization hardware 50 usually interpolates the tessellated vertices to populate the pixels within each of these surfaces. In some applications, rasterization hardware 50 may also request a texture map from texture memory 80 which is then applied to all of the pixels in rasterization hardware 50. These pixels are then passed to frame buffer 70.
Frame buffer operations module 60 then may perform a variety of functions on the data passed from rasterization hardware 50 and then pass this data to frame buffer 70. Some of these functions include, but are not limited to, a depth test, stencil test, and blending, and are performed on all of the pixels passed to frame buffer operations module 60. A depth test typically discards portions of an image region that fail a depth comparison. For example, the depth test may be used to clip surfaces that are further from, or are obstructed by, an object that is nearer in a field of view. A stencil test may be used as an arbitrary comparison that allows selected pixels to be rejected based on the outcome of a comparison between the value in the stencil buffer and the reference value, usually an integer. For example, one stencil test may include using a mask that may be used to compare with the reference so that the selected pixels may be passed. Another example may include indicating an action to take if the stencil test fails. For example, stencil bits may be incremented, decremented, or cleared to zero. Blending usually includes operations that may be performed on the pixels in the frame buffer, such as adds, subtracts, multiplies, or clears, and is typically used when assigning color values to pixels. An operation may be performed for each of the three color channels. When frame buffer 70 has performed this operation on all of the pixels, the pixels are usually sent to a display 90.
Where programmable applications 11 such as shading algorithms are used to model the appearance of objects, an artist typically describes the appearance of one or more portions of an image by selecting those pixels that should be altered. For example, a programmable shading algorithm may be used to provide various atmospheric, light, shading, surface details, textures, and/or colors. These functions may parameterize the appearance of selected objects.
These complex appearance effects typically result in different operations being performed on each resultant geometry-based vertex. One example may be a three-D lighting operation that models the diffuse reflection of colored, directional light sources from colored surfaces. Algorithms may use an illumination function that calculates the diffuse reflection of colored directional light for each vertex of a colored surface. For example, the illumination function for a single vertex is a vector dot product of the light source coordinates and the vertex normal, multiplied by the light color, the vertex material color, and the attenuation.
Application software 11 may reside on host 20 or may be a separate module. Any data upon which application software may operate, including scenes and any objects therein, may be referred to as image data. This image data may originate from memory in host 20 or in a separate storage medium (not explicitly shown). Application software 11 and image data residing on host 20 are used to illustrate one aspect of the invention. Interface 15 may couple host 20 to graphics pipeline 17 in some embodiments or couple a separate application program 11 to host 20 in others.
Application 11 may process one or more pixel-based portions of an image for a given geometry-based vertex by passing selected portions of image data through graphics pipeline 17 multiple times with different parameters. This allows interface 15 such as OPENGL® to be used as a single-instruction, multiple-data (SIMD) computing surface by using several basic OPENGL® functions in multi-pass operations that are called by application 11. One such function may include, for example, CopyTexImage which may be used to define a texture array from frame buffer 70. One such application 11 that may utilize interface 15 as a SIMD computing surface is one that utilizes the RenderMan shading language. Details for translating a shading language such as RenderMan into multiple passes through a graphics pipeline 17 driven by a graphics interface 15 such as OPENGL®, may be found in co-pending U.S. patent application Ser. No. 09/056,583, entitled “System and Method for High-Speed Execution of Graphics Application Programs Including Shading Language Instructions”, filed Apr. 8, 1998.
Bits of image pixel values may be preserved in this process to improve computational accuracy within graphics pipeline 17. For example, floating point values may be represented in at least a portion of graphics pipeline 17. One method for such representation is discussed in U.S. patent application Ser. No. 09/098,041, entitled “Display System Having Floating Point Rasterization and Floating Point Framebuffering”, filed Jun. 16, 1998. In addition, textures and/or colors may be applied to objects using interface 15 and retaining floating point pixel values rather than fixed-point data restricted to a range between zero to one. One example of a method that may be used to index textures and/or colors by using a lookup table is graphically illustrated in conjunction with
For each value x in region 72, a new texture value y=sin(x) may be applied thereto. Lookup table 300 includes extended range texture values for each pixel operation y=sin(x). That is, each x value entry may be used as an index to the contents of lookup table 300 that correspond to the texture values for that x entry, in this case a value of sin(x). In this embodiment, lookup table 300 includes 64K entries, one entry for each bit combination of sixteen-bit extended range pixel values x.
Lookup table 300 may be downloaded into pixel operations module 40 and/or saved in texture memory 80. For example, texture may be applied while image data is processed in rasterization module 50 and/or frame buffer 70 by utilizing lookup table 300 stored in either texture memory 80 or pixel operations module 40. In addition, a plurality of lookup tables 300 may be implemented for some or all monadic functions that may be used to alter the appearance of image data.
In addition, lookup table 300 may also utilize a subset of the one-dimensional texture that is represented by the 64K entries illustrated in
The invention contemplates a variety of methods for implementing lookup table 300. For example, lookup table 300 may be implemented in firmware or software and/or in data structures such as tables, files, databases, or the like. Lookup table 300 may be implemented by using an interface 15 such as OPENGL® or DIRECT3D®. For example, an application program 11 that utilizes the Renderman shading language may use an OPENGL® CopyPixels call with pixel texgen bits enabled to invoke the indexed value y=sin(x) within lookup table 300.
Thus, it is apparent that there has been provided in accordance with the present invention, a table indexing system and method that satisfies the advantages set forth above. For example, the present invention allows the use of extended range pixel values with a graphics system interface. These values may be used to encode any monadic function (i.e., a function with a single operand) using a one-dimensional texture and to facilitate an improved appearance of scenes. Although the present invention has been described in detail, it should be understood that various changes, substitutions, and alterations may be readily ascertainable by those skilled in the art and may be made herein without departing from the spirit and scope of the present invention as defined in the following claims.
Number | Date | Country | |
---|---|---|---|
Parent | 09569650 | May 2000 | US |
Child | 10985229 | Nov 2004 | US |