1. Field of the Invention
This invention relates to computer display systems and, more particularly, to methods and apparatus for providing a graphics accelerator capable of selectively providing during any clock period color values for at least two pixels blended with a single texture or color values for a single pixel blended with a plurality of textures.
2. History of the Prior Art
In three dimensional graphics, surfaces are typically rendered by assembling a plurality of polygons in a desired shape. The polygons are conventionally triangles having vertices which are defined by three dimensional coordinates in world space, by color values, and by texture coordinates.
To display a surface on a computer monitor, the three dimensional world space coordinates are transformed into screen coordinates in which horizontal and vertical values (x, y) define screen position and a depth value (z) determines how near a vertex is to the screen and thus whether that vertex is viewed with respect to other points at the same screen coordinates. The color values (r, g, b) define the brightness of each of red/green/blue colors at each vertex and thus the color (often called diffuse color) at each vertex. Texture coordinates (u, v) define texture map coordinates for each vertex on a particular texture map defined by values stored in memory.
A texture map typically describes a pattern to be applied to the surface of the triangle to vary the color in accordance with the pattern. The texture coordinates of the vertices of a triangular surface area fix the position of the vertices of the triangle on the texture map and thereby determine the texture detail applied to each portion of the surface within the triangle in accordance with the particular texture. In turn, the three dimensional coordinates of the vertices of a triangle positioned on the texture map define the plane in which the texture map and the surface lie with respect to the screen surface.
A texture which is applied to a surface in space may have a wide variety of characteristics. A texture may define a pattern such as a stone wall. It may define light reflected from positions on the surface. It may describe the degree of transparency of a surface and thus how other objects are seen through the surface. A texture may provide characteristics such a dirt and scratches which make a surface appear more realistic. A number of other variations may be provided which fall within the general description of a texture. In theory, a number of different textures may be applied to any triangular surface.
In order to apply more than one texture to a surface, prior art graphics accelerators initially were designed to progress through a series of steps [is] in which pixel coordinates and color values describing each triangle are first generated one pixel at a time in sequence, a first texture is mapped to the triangle using the texture coordinates of the vertices and texture coordinates are generated for each pixel as the pixel coordinates are generated, texture values describing the variation of each pixel in the triangle for the first texture are generated using the texture coordinates for each pixel, the texture value describing the first texture for one pixel and the diffuse color values describing that pixel of the triangle are blended to produce a textured color value for the pixel, and the resulting triangle generated from all of the textured color values is blended with any image residing in a frame buffer from which the image may be presented on an output display. Then, texture values for a second texture mapped to the same triangle are generated and blended with the same sequence of pixel color values in the same manner, and the triangle blended with the second texture is blended with the image residing in the frame buffer.
The need to transit the graphics pipeline to blend each texture to the surface of each triangle defining an output image slows the process drastically. In many cases involving rapidly changing images, it has limited significantly the number of textures which can be applied. For this reason, a more recent development provides a pair of texture stages and a pair of texture blend stages in the pipeline. The first texture stage generates texture values describing a first texture from texture coordinates provided as each pixel is generated. These first texture values are blended with the pixel color values at the first texture blend stage as each set of pixel color values is generated. The textured color value output of the first texture blend stage is then furnished to the second texture blend stage. The textured color value output of the first texture blend stage is blended with texture values generated by the second texture stage using texture coordinates provided as each pixel is generated. The output of the second texture blend stage is ultimately transferred to the frame buffer blend stage to be blended with the image data already in the frame buffer. This more advanced pipeline allows two textures to be blended with a surface in a single pass through the graphics pipeline.
Although this most recent development is useful in accelerating texture blending in a graphics pipeline, it is limited to producing a single pixel having at most two textures during any clock of the graphics pipeline and cannot be utilized for any other purposes. More complicated functions require the use of the host processor and the frame buffer blending stage and drastically slow the rendering of surfaces by the graphics accelerator.
There are no prior art systems which have been capable of providing two or more textured pixels during each clock period.
It is desirable to provide a new computer graphics pipeline capable of rapidly selectively providing a plurality of textured pixels or a single pixel blended with a plurality of textures during any clock period.
The present invention is realized by a graphics accelerator pipeline including a rasterizer stage, a texture stage, and a combiner stage capable of producing output values during each clock interval of the pipeline which map an individual texture to a plurality of pixels.