Drawing device and information processing apparatus

There are provided a drawing device and an information processing apparatus which are capable of reading out texture data from a memory at a high speed. A storage circuit stores respective information items of each of texture pixels constituting the texture data and at least one texture pixel in a vicinity of the each of the texture pixels, in a continuously-accessible region thereof. An address calculation circuit calculates, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored. A readout circuit reads out the corresponding set of the information items from the address calculated by the address calculation circuit. A synthesis circuit synthesizes the corresponding set of the information items read out by the readout circuit. A drawing circuit draws, based on texture pixel information synthesized by the synthesis circuit, a corresponding pixel of the polygons.

BACKGROUND OF THE INVENTION

(1) Field of the Invention

This invention relates to a drawing device and an information processing apparatus, and more particularly to a drawing device and an information processing apparatus that regard an object to be drawn as a collection of a plurality of polygons, and map texture data onto polygons, respectively, to thereby draw the object.

(2) Description of the Related Art

When an information processing apparatus draws a two-dimensional or three-dimensional image, the apparatus represents the image to be drawn as a collection of a plurality of polygons by modeling, and pastes image data called a texture onto each polygon by mapping, whereby the apparatus can draw the image such that it gives a real sense of texture.

Now, when such textures are enlarged and pasted to an object to be drawn, simple enlargement of the textures results in reproduction of a coarser image. To overcome this problem, colors surrounding each point (pixel) to be drawn are weighted and averaged in drawing the object. This blurs boundaries between colors of the textures, and hence the coarseness of the image can be made less conspicuous. This processing is called “bilinear filtering”.

For instance, a case in which the pixel P1is drawn will be considered. In bilinear filtering, the texels C00, C10, C01, C11are multiplied by respective weights determined according to the distances of the texels from the pixel P1, and the products of the multiplications are added up to determine a value indicative of the color information of the pixel P1. For instance, the color information of the pixel P1is determined by the following equation (1):
P1=C00×0.6+C10×0.5+C01×0.5+C11×0.4  (1)

where C00, C01, C10, C11represent respective information items of corresponding texels.

As described above, in bilinear filtering, the color of the pixel P1is determined by taking a weighed average of colors surrounding the pixel P1. This blurs the boundaries between the color of the texture corresponding to the pixel P1and the neighboring colors, whereby the coarseness of the image can be made less conspicuous.

FIG. 8is a diagram showing a form in which texture data having a size of 8 by 8 data is stored in a memory. As shown inFIG. 8, texture data having a size of 8 by 8 data is formed by 64 texel information items D00to D63, and hence these items are sequentially stored in respective addresses of the memory in this order of D00to D63.

Therefore, the texels and the texel information items has correspondence between them such that C00corresponds to D00, C10corresponds to D01, C01corresponds to D08, and so on.

In the above case, for instance, if texture coordinates corresponding to a pixel are (1.0, 1.0), four texel information items D00, D01, D08, D09are required for performing bilinear filtering processing. In this case, a pair of information items D00and D01, and a pair of information items D08and D09are stored in respective pairs of successive addresses, and hence there is a high possibility that each pair of information items can be read out by one readout operation. However, since one pair of addresses storing one pair of information items are remote from the other pair of addresses storing the other pair of information items, it is necessary to carry out at least two readout operations so as to read out all the four texel information items.

Further, if texel information items forming each pair are stored in addresses corresponding to two successive access units of the memory in a straddling fashion, it is necessary to access the memory three or four times.

Therefore, in the above conventional method, the need for accessing the memory a plurality of times arises to read out texel information items necessary for carrying out one bilinear filtering operation, so that it is difficult to enhance the operating speed of the information processing apparatus.

SUMMARY OF THE INVENTION

The present invention has been made in view of these circumstances, and an object thereof is to provide a drawing device and an information processing apparatus which are capable of carrying out high-speed bilinear filtering processing.

To attain the above object, there is provided a drawing device that regards an object to be drawn as a collection of a plurality of polygons, and maps texture data onto the polygons, to thereby draw the object. The drawing device comprises a storage circuit for storing respective information items of each of texture pixels constituting the texture data and at least one texture pixel in a vicinity of the each of the texture pixels, in a continuously-accessible region thereof, an address calculation circuit for calculating, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored, a readout circuit for reading out the corresponding set of the information items from the address calculated by the address calculation circuit, and a synthesis circuit for synthesizing the corresponding set of the information items read out by the readout circuit.

Further, to attain the above object, there is provided an information processing apparatus that regards an object to be drawn as a collection of a plurality of polygons, and maps texture data onto the polygons, to thereby draw the object. The information processing apparatus comprises a storage unit for storing respective information items of each of texture pixels constituting the texture data and at least one texture pixel in a vicinity of the each of the texture pixels, in a continuously-accessible region thereof, an address calculation unit for calculating, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored, a readout unit for reading out the corresponding set of the information items from the address calculated by the address calculation unit, and a synthesis unit for synthesizing the corresponding set of the information items read out by the readout unit.

The above and other objects, features and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate a preferred embodiment of the present invention by way of example.

DESCRIPTION OF THE PREFERRED EMBODIMENT

The invention will now be described in detail with reference to drawings showing a preferred embodiment thereof.

FIG. 1is a block diagram showing the operating principles of the present invention. As shown inFIG. 1, a drawing device1according to the present invention is comprised of an address calculation circuit1a, a storage circuit1b, a readout circuit1c, a synthesis circuit1d, and a drawing circuit1e.

The storage circuit1bstores respective information items of each of texture pixels (hereinafter, “texture pixel” is referred to as “texel”) constituting the texture data and at least one texel in a vicinity of the each of the texels, in a continuously-accessible region thereof.

The address calculation circuit1acalculates, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored.

The readout circuit1creads out the corresponding set of the information items from the address calculated by the address calculation circuit1a.

The synthesis circuit1dsynthesizes the corresponding set of the information items read out by the readout circuit1c.

The drawing circuit1edraws, based on texel information synthesized by the synthesis circuit1d, a corresponding pixel of the polygons.

Next, the operations of the drawing device whose operating principles are illustrated inFIG. 1will be described in detail hereinafter.

First, in a stage prior to performing a drawing process, texture data for use in the drawing process is stored in the storage circuit1b. The storing of the texture data having information items of texture pixels is performed similar to bilinear filtering described above in connection with the prior art. For example, when texture coordinates are (1.0, 1.0), it is necessary to read out four texture information items D00, D01, D08, D09appearing inFIG. 8so as to carry out bilinear filtering. However, according to an aspect of the present invention, the four data (information) items, D00, D01, D08, D09for instance, are packed, and stored in advance in a region of the storage circuit1bsuch that they can be read out by accessing the storage circuit1bonly once. It should be noted that in the following, each set of packed texel information items is simply referred to as a “packed texel”.

Further, four data items D01, D02, D09, D10corresponding to texture coordinates (2.0, 1.0) are stored as a packed texel in an area next to the region where the first-mentioned four data items are stored. The packed texels corresponding to areas from the texture coordinates (1.0, 1.0) to texture coordinates (8.0, 8.0) are thus sequentially stored in the storage circuit1b.

In this state, when texture coordinates (S, T) corresponding to a polygon to be drawn are input, the address calculation circuit1acalculates an address of a region where a corresponding packed texel is stored, based on the input texture coordinates (S, T). The address calculation circuit1acalculates the address of the region where the corresponding packed texel is stored by pointing to a start address of a packed texel corresponding to texture coordinates (S, T).

For instance, if coordinates (1.0. 1.0) are input as texture coordinates, the address calculation circuit is calculates a start address of a region where the packed texel formed by the four texel information items of D00, D01, D08, D09is stored by pointing to the start address of the corresponding region of texture coordinates (1.0. 1.0) that is determined by the storage circuit1bfor storing the four texel information items of D00, D01, D08, D09. Similarly, if coordinates (2.0. 1.0) are input as texture coordinates, the address calculation circuit1acalculates a start address of a region where the packed texel formed by the four texel information items of D01, D02, D03, D10is stored by pointing to the start address of the corresponding region of texture coordinates (2.0. 1.0) that is determined by the storage circuit1bfor storing the four texel information items of D01, D02, D03, D10.

The readout circuit1cis supplied with the start address for the packed texel from the address calculation circuit1a, and reads out the packed texel from the corresponding addresses of the storage circuit1b. More specifically, the readout circuit1cobtains the four texel information items of D00, D01, D08, D09.

The synthesis circuit1dtakes a weighted average of the four texel information items read out by the readout circuit1c, thereby producing color information of a pixel corresponding to the texture coordinates (S, T).

The drawing circuit1elooks up the color information produced by the synthesis circuit1dto draw the corresponding pixel.

As described hereinabove, according to the drawing device of the present invention, four texel information items required for bilinear filtering processing are packed to form a packed texel, and then the packed texel is stored in a region of the storage circuit1b, which permits the texel information items to be read out continuously such that they can be read out by accessing the storage circuit only once. This makes it possible to shorten a time period required for each readout operation, thereby attaining an increased speed of the drawing process.

Next, the embodiment according to the invention will be described hereinafter.

FIG. 2shows an example of the arrangement of an information processing apparatus according to the embodiment of the invention. As shown inFIG. 2, the information processing apparatus20according to the embodiment is comprised of a CPU (Central Processing Unit)20a, a GDC (Graphic Display Controller)20b, a texture memory20c, an HDD (Hard Disk Drive)20d, a bus20e, and a frame buffer20f. The information processing apparatus20is connected to an external display device21. It should be noted that the information processing apparatus20means an information processing apparatus having a drawing processing function, such as a personal computer (PC), a cellular phone, and a car navigation system.

Here, the CPU20acarries out various kinds of arithmetic operations according to programs stored in the HDD20dand controls operations of components of the apparatus.

The GDC20bdraws an object to be drawn, as a collection of a plurality of polygons according to drawing instructions provided by the CPU20a, and pastes textures stored in the texture memory20conto polygons.

As will be described in detail hereinafter, the texture memory20cstores packed texels each formed by packing four texel information items in a manner associated with predetermined texture coordinates, and responsive to a readout request from the GDC20b, reads out a corresponding one of the packed texels to supply the same to the GDC20b.

The HDD20dstores packed texels, and programs for execution by the CPU20a.

The bus20econnects the CPU20a, the GDC20b, the texture memory20c, and the HDD20dto each other, thereby enabling transfer of data therebetween.

The frame buffer20fstores image data produced by a drawing process carried out by the GDC20b, frame by frame, and converts the image data to a video signal to deliver the video signal to the display device21.

The display device21is implemented e.g. by a CRT (Cathode Ray Tube) monitor or an LCD (Liquid Crystal Display), and displays an image based on the video signal output from the frame buffer20f.

Next, details of the arrangement of the GDC20billustrated inFIG. 2will be described with reference toFIG. 3.

As shown inFIG. 3, the GDC20bis comprised of an address calculation section30, a 2-bit left shifter31, a texture-requesting section32, a texture-receiving section33, and a blending processing section34. The GDC20baccesses the texture memory20c, and writes color information obtained through a blending process in the frame buffer20f.

During the above process, the address calculation section30receives a texture coordinate S and a texture coordinate T, and calculates data specifying a corresponding texel to output the data.

The 2-bit left shifter31obtains data by shifting left by two bits the data specifying the texel, which is received from the address calculation section30, and outputs the obtained data as address data.

The texture-requesting section32requests the texture memory20cto read out a packed texel from a region the start address of which corresponds to the address data output from the 2-bit left shifter31.

The texture memory20creads out packed texels each formed by packing four texel information items, as described above, from the HDD20dfor storage.

FIG. 4shows an example of packed texels stored in the texture memory20c. InFIG. 4, boxes at intersections of columns and rows correspond to respective addresses in the texture memory20c, and respective information texel items which are associated with the respective boxes are stored in this order in the texture memory20c. Further, in the illustrated example, the packed texel corresponding to the texture coordinates (1.0, 1.0) is stored in addresses corresponding to respective boxes on the first to fourth columns in the first row, while the packed texel corresponding to the texture coordinates (2.0, 1.0) is stored in addresses corresponding to respective boxes on the fifth to eighth columns in the first row. A packed texel corresponding to the texture coordinates (8.0, 1.0) is stored in addresses corresponding to respective boxes on the fourth to last columns from the end of the first row. Further, a packed texel corresponding to the texture coordinates (1.0, 2.0) is stored in addresses corresponding to respective boxes on the first to fourth columns in the second row. The following packed texels are stored in a similar order.

It should be noted that packed texels as described above are also stored in the HDD20din the same manner as illustrated inFIG. 4, and the texture memory20creads out the same as required from the HDD20dfor storage in a predetermined region thereof.

The texture-receiving section33receives a packed texel read out from the texture memory20cto supply the same to the blending processing section34.

The blending processing section34takes a weighted average of four texel information items forming a packed texel supplied from the texture-receiving section33, thereby producing color information of a pixel to deliver the same to the frame buffer20f.

The frame buffer20fstores the color information of the pixel supplied from the blending processing section34in a corresponding address, and synthesizes image data corresponding to one frame, followed by delivering the image data to the display device21.

Next, the operations carried out by the embodiment constructed as above will be described.

Responsive to an instruction from the CPU20arequesting mapping of predetermined textures onto predetermined polygons, the HDD20dreads out corresponding packed texels to store the same in a predetermined region of the texture memory20c. Further, as described hereinbefore, the packet texels stored in the HDD20dare in a form as shown inFIG. 4, and hence the data read out from the HDD20dare stored in the texture memory20cas they are.

Next, the GDC20bcalculates texture coordinates (S, T) based on the coordinates of a vertex of a polygon to be drawn, and supplies the texture coordinates (S, T) to the address calculation section30.

The address calculation section30calculates the address of a corresponding texel based on the supplied texture coordinates (S, T). For instance, if the texture coordinates (2.0, 1.0) are input, the address calculation section30outputs a number “1” as the address S′ for the 2-bit left shifter31.

The 2-bit left shifter31shifts the address S′ output from the address calculation section30left by two bits. In the above example, since the number “1” is output from the address calculation section30, the 2-bit left shifter31provides the texture-requesting section32with a number “4” obtained by shifting the number “1” left by two bits. This number “4” is to be used as a horizontal address of the texture memory20cofFIG. 4.

The texture-requesting section32requests the texture memory20cto read out a packed texel corresponding to the horizontal address “4” output from the 2-bit left shifter31.

The texture memory20creads out a packed texel from a region starting at the horizontal address of which is “4”, that is, the four texel information items D01, D02, D09, D10, and supplies the same to the texture-receiving section33. At this time, for instance, if information of one packed texel is formed by 32 bits, and the texture memory20cis compatible with an access data width of 32 bits, it is possible to read out the whole information of the one packed texel by one readout operation.

The texture-receiving section33receives the packed texel read out from the texture memory20cto supply the same to the blending processing section34.

The blending processing section34takes a weights data items of the packed texel read out from the texture memory20caccording to the position of the pixel to be drawn, to thereby take a weighted average of the packed texel.FIG. 5shows an example of weighted average processing carried out on a packed texel. In the illustrated example, texel information items D00, D01, D08, D09corresponding to respective texels C00, C10, C01, C11of the packed texel corresponding to the pixel P1are read out, and multiplied by respective weighting coefficients W1, W2, W3, W4defined according to the respective positions of the texels with respect to the pixel P1. Then, the respective products of the multiplications are added up to determine a value indicative of the color information of the pixel P1.

The color information thus determined is written in an address of the frame buffer20fcorresponding to the pixel P1. When the above processing is carried out on all the polygons, forming of image data corresponding to one frame is completed, and the frame buffer20fconverts the image data to a video signal and delivers the same to the display device21.

As a result, an image thus drawn is displayed on the display device21.

As described hereinabove, according to the present embodiment, as shown inFIG. 4, four texel information items corresponding to texture coordinates are packed, and stored in a sequence of successive addresses in the texture memory20cas a packed texel such that all the information items in the packed texel can be read out by one readout operation. This makes it possible to shorten a time period required for each readout operation, thereby attaining an increased speed of the drawing process.

FIG. 6shows another example of the arrangement of the GDC20b.

This arrangement is distinguished from the example illustrated inFIG. 3in that the GDC20bincludes the additional components of a buffer memory40and a packing conversion section41. Further, a form for storing texel information (data) items in the HDD20dis different from the above-described example. The remainder of theFIG. 6arrangement is the same as theFIG. 3arrangement.

The buffer memory40receives texture data for temporary storage, and then supplies the same to the packing conversion section41.

The packing conversion section41packs texture data supplied from the buffer memory40to generate packed texels, and sequentially stores the packed texels in the texture memory20c.

Further, texture data items stored in the HDD20dare not packed texels the example of which is shown inFIG. 4, but texture data items before packing the example of which is shown inFIG. 8.

Next, operations carried out by theFIG. 6GDC20bwill be described.

When the CPU20aissues an instruction requesting mapping of predetermined textures onto predetermined polygons to the GDC20b, the GDC20breads out corresponding textures from the HDD20dto write them into the buffer memory40.

Texture data items read into the buffer memory40are converted into packed texels by the packing conversion section41. In other words, the packing conversion section41reads out texture data stored in the buffer memory40in the form as shown inFIG. 8, in a predetermined order, to thereby convert the texture data into packed texels as shown inFIG. 4.

The packed texels output from the packing conversion section41are supplied to the texture memory20cand sequentially stored therein.

After the process described above has been terminated to complete storage of the packed texels in the texture memory20c, the address calculation section30receives texture coordinates (S, T) and converts the same to address data.

The 2-bit left shifter31shifts the address data output from the address calculation section30left by two bits, and supplies the resulting data to the texture-requesting section32.

The texture-requesting section32requests the texture memory20cto read out a packed texel corresponding to the address data supplied from the 2-bit left shifter31, from a region of the texture memory20can start address of which is an address corresponding to the address data.

The texture memory20creads out the packed texel requested by the texture-requesting section32, and supplies the same to the texture-receiving section33.

The texture-receiving section33receives the packed texel read out from the texture memory20cto supply the same to the blending processing section34.

The blending processing section34carries out weighted average processing, as shown inFIG. 5, on the packed texel which is supplied from the texture-receiving section33and contains four texel information items, thereby generating the color information of a corresponding pixel. Then, the blending processing section34writes the color information thus obtained into an address of the frame buffer20fcorresponding to the pixel.

After the drawing processing is carried out on all the polygons to complete forming of image data, the frame buffer20fconverts the image data to a video signal and delivers the same to the display device21.

The display device21outputs the video signal supplied from the frame buffer20ffor display.

According to the above embodiment, texture data are converted to packed texels by the packing conversion section41, and the packed texels are stored in the texture memory20c. Hence, there is no need to prepare packed texels corresponding to all the textures in advance, which makes it possible to reduce the capacity of the HDD20d.

Although in the above embodiment, texture data having a size of 8 by 8 data is described by way of example, it goes without saying that the present invention is by no means limited to such an example.

Further, although in the above embodiment, texture data are stored in the HDD20d, this is not limitative, but texture data can be stored in a recording medium, such as a CD-ROM, and a semiconductor memory.

Further, the packed texels as shown inFIG. 4are described only by way of example, and needless to say, the present invention is by no means limited to the example.

Furthermore, it goes without saying that the GDC20bshown inFIG. 3or6can be constructed as a semiconductor device or an expansion board, and products thereof can be merchandised as single or separate items.

As described hereinabove, according to the present invention, there is provided a drawing device that regards an object to be drawn as a collection of a plurality of polygons, and maps texture data onto the polygons, to thereby draw the object. The drawing device comprises a storage circuit for storing respective information items of each of texture pixels constituting the texture data and at least one texture pixel in a vicinity of the each of the texture pixels, in a continuously-accessible region thereof, an address calculation circuit for calculating, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored, a readout circuit for reading out the corresponding set of the information items from the address calculated by the address calculation circuit, and a synthesis circuit for synthesizing the corresponding set of the information items read out by the readout circuit.

Further, according to the present invention, there is provided an information processing apparatus that regards an object to be drawn as a collection of a plurality of polygons, and maps texture data onto the polygons, to thereby draw the object. The information processing apparatus comprises a storage unit for storing respective information items of each of texture pixels constituting the texture data and at least one texture pixel in a vicinity of the each of the texture pixels, in a continuously-accessible region thereof, an address calculation unit for calculating, based on texture coordinates corresponding to each pixel of the polygons, an address where a corresponding set of the information items are stored, a readout unit for reading out the corresponding set of the information items from the address calculated by the address calculation unit, and a synthesis unit for synthesizing the corresponding set of the information items read out by the readout unit.