WO2006013849A1 - 描画装置 - Google Patents

描画装置 Download PDF

Info

Publication number
WO2006013849A1
WO2006013849A1 PCT/JP2005/014100 JP2005014100W WO2006013849A1 WO 2006013849 A1 WO2006013849 A1 WO 2006013849A1 JP 2005014100 W JP2005014100 W JP 2005014100W WO 2006013849 A1 WO2006013849 A1 WO 2006013849A1
Authority
WO
WIPO (PCT)
Prior art keywords
triangle
pixel
pixel block
data
block
Prior art date
Application number
PCT/JP2005/014100
Other languages
English (en)
French (fr)
Inventor
Naoki Ohtani
Original Assignee
Matsushita Electric Industrial Co., Ltd.
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 Matsushita Electric Industrial Co., Ltd. filed Critical Matsushita Electric Industrial Co., Ltd.
Priority to CN200580026323A priority Critical patent/CN100595794C/zh
Priority to US11/658,559 priority patent/US7995053B2/en
Priority to JP2006531482A priority patent/JP4777893B2/ja
Publication of WO2006013849A1 publication Critical patent/WO2006013849A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Definitions

  • the present invention relates to a drawing apparatus that performs drawing processing of computer graphics.
  • a drawing apparatus that performs drawing processing of computer graphics generally has a triangle strip, a triangle fan, and a mechanism for switching between them (hereinafter referred to as a snake (Triangle Snake)).
  • Triangle Snake Triangle Snake
  • t, U triangle graphics
  • Triangle Mesh triangle graphics
  • FIG. 1 is a diagram showing a data format of a triangle strip.
  • Vertex P for example, vertex P, vertex P, and vertex P
  • a triangle T is composed of three vertices U -1 NU NU +1 0 1 2 and a triangle is formed by three vertices of vertex P, vertex P, and vertex P.
  • T is constructed, and the triangle T is composed of three vertices: vertex P, vertex P, and vertex P
  • FIG. 2 is a diagram showing a data format of a triangular fan.
  • Vertex P, and vertex P for example, for vertex P, vertex P, and vertex P
  • Triangle T is composed of three vertices, and triangle T is composed of three vertices, vertex P, vertex P, and vertex P.
  • N is composed. This data format is also characterized in that the amount of data can be reduced similarly to the triangle strip.
  • FIG. 3 is a diagram showing a snake data format.
  • Snake is a data format that can freely switch between a triangle strip and a triangle fan on the way. Additional information is required to indicate the point of switching. The amount of data is the same as that of triangle strips and triangle fans. However, in the case of triangle strips and triangle fans, the connection state of triangles is uniquely determined, so that the number of connected triangles cannot be increased unless conditions are met. . On the other hand, this form has a feature that there is a high degree of freedom, and there is a high possibility that more consecutive triangles can be made.
  • FIG. 4A and FIG. 4B are diagrams showing a data format of a triangular mesh.
  • information on the vertices constituting the triangle is represented by an index Z pointer 501 of vertex data.
  • Data in this format often does not have information indicating triangles that share edges, but is used with that information added as needed.
  • In-process results and final results of computer graphics drawing processing are usually placed in external memory or internal memory.
  • This information includes distance information from the viewpoint for each pixel, power information, and transparency.
  • the intermediate results pixel color values, depth information, etc.
  • the current values are read from the memory, and the processed results are stored in the memory. It is necessary to write back to. If the pixel is opaque and the depth information (Z value) is ignored and there is no mixing processing with the intermediate result placed on the memory, the intermediate result placed on the memory is not read. Sometimes it can be done. In that case, the reading process is eliminated and only the writing process is performed, and although the time is halved, the essential processing contents are not changed. In the following description, it is assumed that the intermediate result is read.
  • Recent memories represented by DDR SDRAM Double Data Rate SDRAM
  • DDR SDRAM Double Data Rate SDRAM
  • DDR SDRAM Double Data Rate SDRAM
  • data must be read and written in a certain size. There are other restrictions. As the processing speed increases and the amount of data handled increases, this size is getting larger. This For this reason, the drawing device cannot read or write only the information of the desired pixel in one screen, and collects information of a size determined by the system (about 4 pixels to 256 pixels) as a pixel block. Must read and write.
  • the pixel area (pixel block) that must be read and written together is almost always one pixel in the vertical direction and long in the horizontal direction unless something is devised.
  • a computer graphics drawing device uses a substantially square pixel block as a data unit for reading and writing at a time.
  • the reason for being square is based on the reason that rasterization processing is performed in units of triangles and pixel-by-pixel processing is performed, and that, on average, there are more triangles than horizontal triangles. In other words, it is closer to a square than a horizontally long region, and if it is necessary to handle the region together outside the triangular region, the proportion of pixels is low, which in turn improves efficiency.
  • Patent Document 1 o
  • FIG. 5 is an explanatory diagram for explaining a case where the shape of the pixel block is horizontally long.
  • a region (pixel block) 601 of vertical 1 pixel ⁇ horizontal 64 pixels overlaps with the triangle 602, and there are only about 8 effective pixels.
  • FIG. 6 is an explanatory diagram for explaining a case where the pixel block has a square shape.
  • Patent Document 1 data is arranged in units of blocks of force 8 X 8 pixels, in which an invention relating to texture data pasted on a triangle is disclosed with respect to information in units of pixels. This is also based on the same reason.
  • Patent Document 1 Japanese Translation of Special Publication 2001-507836
  • the drawing apparatus of Patent Document 1 has a problem that the bandwidth of the memory bus is wasted. As a result, a wide bandwidth is required, and if the bandwidth is narrow, a problem occurs in the drawing process.
  • the amount of data to be read and written increases and can be used effectively.
  • the memory bus bandwidth is reduced. In other words, the total amount of data that can be read and written within a certain period of time is determined by the memory bus bandwidth, but by reading and writing the data of unnecessary pixels in it, it is effective among the total amount. Reduce the amount of data.
  • FIG. 7 is an explanatory diagram for explaining unnecessary data.
  • the pixel block Bk has pixel data of a region Bka not included in the triangle 710 and pixel data of a region Bk b included in the triangle 710. Therefore, although only the pixel data of the area Bkb in the pixel block Bk is necessary, the pixel data of the unnecessary area Bka is written to the memory.
  • FIG. 8 is an explanatory diagram for explaining how unnecessary data is written in a memory in the case of a triangular strip.
  • Pixel data of a pixel block having included pixels is written into the memory.
  • the drawing apparatus stores the pixel data of the pixel block having the pixels included in the triangle ⁇ in the memory.
  • each pixel block in a region 811 including a side shared by the triangle T and the triangle T, each pixel block
  • the pixel block Bkl of the region 811 is the pixel block of the region Bkla included in the triangle T.
  • Each pixel block included in 11, 812, and 813 is written twice in the memory with unnecessary data included in the pixel block.
  • the drawing device is included in the system LSI (Large Scale Integration). If you are in one unit, it is more serious. In such cases, quantitative regulation is often performed so that a specific unit (device) does not occupy the memory bus and obstruct the operation of other units. Therefore, in some cases, efforts to reduce the amount of memory access in a little time can be used to access more effective data and improve the performance of the drawing device in many cases.
  • LSI Large Scale Integration
  • the present invention has been made in view of a serious problem, and provides a drawing apparatus capable of effectively using a memory bus bandwidth without having an expensive and complicated circuit configuration. With the goal.
  • a drawing apparatus is a drawing apparatus that draws drawing data by rasterizing the drawing data.
  • the triangle specifying means for specifying the first triangular area, the block specifying means for specifying the pixel block having the pixels included in the first triangular area, and the pixel block specified by the block specifying means, Determining means for determining whether or not a pixel in the second triangular area connected to the first triangular area is included; and determining that a pixel in the second triangular area is included in the determining means;
  • Rasterizing means for generating pixel data by rasterizing a pixel block including the pixel block, writing means for writing pixel data of the pixel block generated by the rasterizing means to a memory, and an image corresponding to the pixel data written to the memory
  • Display control means for displaying
  • a pixel block including pixels in the first and second triangular regions is detected, and the pixel block is rasterized and written to the memory in a state including these pixels.
  • memory bus bandwidth can be effectively reduced by eliminating the waste of writing pixel data without developing and implementing large-sized cache memory and complex circuits that require a large number of development steps. It can be used. That is, it is possible to effectively use the memory bus bandwidth without having an expensive and complicated circuit configuration. In the first place, waste occurs at the time of memory access at the side of the triangle, but in the present invention, this waste can be reduced.
  • the determination unit determines whether or not the pixel block specified by the block specifying unit includes a pixel of the second triangle area to be drawn after the first triangle area. It is characterized by that.
  • the second triangle area is treated as a triangle to be processed next for the first processing.
  • the pixel block including the triangular pixel scheduled for the first processing is rasterized. Therefore, the triangular pixel data scheduled for the first processing can be written in the memory instead of the unnecessary data, and the memory bus bandwidth can be used effectively.
  • the determination unit determines whether or not the pixel block specified by the block specifying unit includes a pixel of the second triangular region that is a drawing target before the first triangular region. It is characterized by distinguishing ⁇ .
  • the second triangle area is treated as the processed triangle drawn immediately before, and the first triangle area
  • the pixel block including the processed triangular pixels is rasterized. Therefore, processed triangular pixel data can be written in the memory instead of unnecessary data, and the memory bus bandwidth can be used effectively.
  • the triangle specifying means further specifies the second triangle area to be subjected to rasterization processing from the drawing data
  • the block specifying means is further configured such that the triangle specifying means further includes the second triangle area.
  • the pixel block having the pixels included in the second triangular area is specified
  • the rasterizing means further specifies the triangular area when the triangular specifying means specifies the second triangular area.
  • the pixel block having the pixels of the first and second triangular regions determined by the determining means is excluded from the target of rasterization processing. Good.
  • the object of the second triangle area force rasterization process that is, the drawing object
  • the drawing object for example, a plurality of pixel blocks having pixels included in the second triangle area by the block specifying means are included.
  • the pixel block including the pixels in the first triangular area among the plurality of pixel blocks is excluded from the rasterization target. Therefore, it is possible to prevent the pixel block that is drawn when the first triangular area is the drawing target from being rasterized and written to the memory even when the second triangular area is the drawing target. Can be used more effectively.
  • the present invention can be realized not only as such a drawing apparatus but also as a method and program thereof, a storage medium storing the program, and an integrated circuit.
  • the drawing device of the present invention can reduce useless memory access, and thus can effectively use the memory bus bandwidth without having an expensive and complicated circuit configuration.
  • FIG. 1 is a diagram visually showing a data format of a triangle strip.
  • FIG. 2 is a diagram visually showing the data format of a triangular fan.
  • FIG. 3 is a diagram visually showing the data format of the snake.
  • FIG. 4A is a diagram visually showing the data format of a triangular mesh.
  • FIG. 4B is a diagram showing a data format of a triangular mesh.
  • FIG. 5 is an explanatory diagram for explaining a case where the shape of a pixel block is horizontally long.
  • FIG. 6 is an explanatory diagram for explaining a case where the pixel block has a square shape.
  • FIG. 7 is an explanatory diagram for explaining unnecessary data.
  • FIG. 8 is an explanatory diagram for explaining how unnecessary data is written in a memory in the case of a triangular strip.
  • FIG. 9 is a block diagram showing a configuration of a drawing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a conceptual diagram showing an algorithm of the drawing apparatus in the embodiment of the present invention.
  • FIG. 11 is a flowchart showing the operation of the drawing apparatus in the embodiment of the present invention.
  • FIG. 12 is an explanatory diagram for explaining processing of the drawing apparatus according to the sixth modified example of the embodiment of the present invention.
  • FIG. 13 is an explanatory diagram for explaining dummy vertices according to a sixth modification of the embodiment of the present invention. Explanation of symbols
  • FIG. 9 is a block diagram showing a configuration of the drawing apparatus according to the embodiment of the present invention.
  • the drawing apparatus 100 in the present embodiment can effectively use the memory bus bandwidth without having an expensive and complicated circuit configuration, and includes a control unit 111 and a triangle detection unit. 112, an A edge detection unit 113, a B edge detection unit 114, a C edge detection unit 115, a rasterization unit 116, a memory RZW unit 117, a memory 120 as a pixel recording module, and a drawing engine 130. .
  • Such a drawing apparatus 100 uses information of four vertices that are not three vertices when rasterizing is performed by the rasterizing unit 116, and a combination of the triangle detecting unit 112 and each of the edge detecting units 113, 11 4, and 115. The processing content is determined for each block and processing is performed. As a result, the amount of data read / write between the memory RZW unit 117 and the memory 120 can be reduced.
  • the control unit 111 acquires a drawing list expressed in three dimensions, and converts the drawing list into two-dimensional drawing data.
  • the drawing list includes each coordinate in 3D, the color at that coordinate, and the normal (nomal).
  • the control unit 111 converts such a drawing list into It is converted into two-dimensional drawing data indicating the coordinates in two dimensions and the color at the coordinates.
  • control unit 111 transmits two-dimensional drawing data to the triangle detection unit 112, the A edge detection unit 113, the B edge detection unit 114, and the C edge detection unit 115.
  • the detected triangle and pixel block to be drawn and the two-dimensional drawing data are output to the rasterizing unit 116.
  • the triangle detection unit 112 detects a triangle to be drawn from the two-dimensional drawing data and also detects a pixel block (triangle pixel block) having pixels included in the triangle to be drawn. That is, pixel blocks that are all included in the triangle to be drawn and pixel blocks that include a part of the sides of the triangle are detected as triangular pixel blocks.
  • a pixel block including a part of a triangle side includes a pixel of a triangle to be drawn, and also includes an unnecessary pixel in the triangle to be drawn.
  • the A edge detection unit 113 detects a pixel block on the side of the triangle (processed triangle) that is connected to the triangle to be drawn and that is the object of the drawing process immediately before, among the triangle pixel blocks. To do.
  • the A edge detection unit 113 determines whether or not any processed triangular pixel is included in any of the triangular pixel blocks, and detects the pixel block determined to be included.
  • the A edge detection unit 113 uses the three vertices of the triangle to be drawn and the single vertex of the processed triangle. To detect.
  • One vertex of a processed triangle is a vertex that is not on the side shared by the triangle to be drawn and the processed triangle.
  • the pixel block thus detected is referred to as an A pixel block.
  • the B edge detection unit 114 is connected to the triangle to be drawn in the triangle pixel block, and the pixel block on the side of the triangle to be drawn next (the triangle to be processed first). Is detected.
  • the B edge detection unit 114 determines whether any of the triangular pixel blocks includes a triangular pixel scheduled for the first processing, and detects the pixel block determined to be included.
  • the B edge detection unit 114 is a pixel including the triangular pixel scheduled for the first process described above.
  • a block is detected, it is detected using three vertices of the triangle to be drawn and one vertex of the triangle to be processed first.
  • One vertex of the triangle to be processed first is a vertex that is not on the side shared by the triangle to be drawn and the triangle to be processed first.
  • the pixel block thus detected is referred to as a B pixel block.
  • the C edge detection unit 115 is connected to the triangle scheduled for the first processing among the pixel blocks having the triangular pixels scheduled for the first processing, and the triangle to be drawn next (second processing) The pixel block on the side of the planned triangle) is detected. That is, the C edge detection unit 115 detects a pixel block including a triangular pixel scheduled for the second processing from among pixel blocks having triangular pixels scheduled for the first processing.
  • the pixel block thus detected is referred to as a C pixel block.
  • the rasterizing unit 116 is based on the two-dimensional drawing data, the drawing target triangle, the triangle pixel block, the A pixel block, the B pixel block, and the C pixel block! Rasterization processing is performed on the effective part of the pixel block to generate pixel data.
  • the rasterizing unit 116 omits the A pixel block from the processing target among the triangular pixel blocks. Then, the rasterizing unit 116 generates pixel data by rasterizing at least a part of each of the triangle to be drawn and the triangle to be processed in the range of the triangular pixel block from which the A pixel block is omitted. At this time, the B pixel block included in the triangular pixel block is rasterized in a state where the triangular pixel to be drawn and the triangular pixel to be processed first are included.
  • Memory RZW unit 117 writes the pixel data generated by the rasterizing process by rasterizing unit 117 to memory 120 in units of triangular pixel blocks excluding the A pixel block.
  • the drawing engine 130 is configured as display control means, and causes the display unit 200 to display an image (drawing target triangle) corresponding to the pixel data written in the memory 120.
  • the pixel of the triangle to be processed first is also included in the B pixel block and rasterized, and the pixel data of the B pixel block is processed. Write to memory 120.
  • a triangle to be drawn is drawn.
  • the triangular pixel to be processed first is not included in the B pixel block, but unnecessary data is included in the B pixel block instead, and the B pixel block is written in the memory 120. (Note that the unnecessary data is masked, and the unnecessary data is not actually written to the memory, but it is used by the bandwidth memory bus corresponding to the amount of data. ). Therefore, in this embodiment, it is possible to effectively use the memory bus bandwidth by preventing unnecessary data from being written to the memory 120.
  • the triangle targeted for the first process becomes the triangle to be drawn, so that the above-described B pixel block has an A for the triangle scheduled for the first process. It becomes a pixel block. Accordingly, in the present embodiment, the above-described B pixel block is omitted from the processing target during the triangular rendering process scheduled for the first process. On the other hand, conventionally, at the time of drawing processing of the triangle scheduled for the first processing, it is written in the B pixel block force S memory 120 including unnecessary data as described above. Therefore, in this embodiment, the memory bus bandwidth can be used more effectively.
  • FIG. 10 is a conceptual diagram showing an algorithm of the drawing apparatus 100 according to the embodiment of the present invention.
  • each triangle is represented by a triangle T, a triangle T, a triangle T, and a triangle T.
  • N-1 N N + 1 N + 2 are drawn in order.
  • the drawing apparatus 100 according to the present embodiment draws the triangle N when drawing the triangle T.
  • vertex P of the eye (N + 1) th vertex P, and (N + 2) th vertex P
  • the triangle that corresponds to the triangle T and is scheduled for the first processing corresponds to the triangle T and the second processing is scheduled.
  • the triangle corresponds to the triangle T.
  • the triangle detection unit 112 the triangle detection unit 112
  • the triangle T to be drawn is detected and each pixel block included in the block group GB is detected.
  • the A edge detection unit 113 detects the pixel block BA as the above-described A pixel block, and the B edge detection unit 114 detects the pixel block BB as described above. Detected as a B pixel block.
  • a pixel block is composed of, for example, a collection of 64 pixels. Therefore, in this embodiment, when drawing the triangle T to be drawn, the pixel of the triangle T to be drawn and the triangle T to be processed first
  • the drawing apparatus 100 includes the triangle T to be drawn and the triangle to be processed first in the range excluding the pixel block BA in the block group GB.
  • the memory 120 is required to be able to read and write a large amount of information as fast as possible in order to speed up the graphics system.
  • Recent high-speed large-capacity memory devices such as DDR SDRAM are designed to operate at higher speeds when data in a continuous address space is continuously read and written. This feature will be used.
  • the effective pixel (the pixel that overlaps the triangle 602) has an area of 1 pixel in the vertical direction and 64 pixels in the horizontal direction (pixel block) 601 and the triangle 602. There are only about 8 pixels. However, when the area (pixel block) 701 of 8 pixels x 8 pixels is used as shown in Fig. 6, the effective pixels in the same triangle 702 as the triangle 602 in Fig. 5 are 38 pixels. This clearly increases the number of effective pixels.
  • the pixel arrangement on the memory 120 is preferably arranged in a region (pixel block) of 8 vertical pixels ⁇ 8 horizontal pixels.
  • rasterization processing is not performed simply by processing from the upper part of the screen to the lower part, and the left end force is also directed to the right end. To do. This is because it is efficient.
  • the processing order within the block is arbitrary.
  • the drawing apparatus 100 When the drawing apparatus 100 is incorporated as a unit in the system LSI and operates in cooperation with another core, the specific unit occupies the memory bus and blocks the operation of the other unit. As is often the case, quantitative restrictions are imposed on memory access. For example, all useless accesses are accumulated as access amounts, and a penalty may be imposed such that access is not possible for a certain period of time if the limit is exceeded. For this reason, the problem is serious when the proportion of valid data mentioned above decreases.
  • the drawing apparatus 100 of the present invention has four vertices (vertex P, vertex P,
  • Vertex P 1 Vertex P, Vertex P information is used to determine the three objects to be drawn in the area (pixel block).
  • Processing of pixels of the shape is also performed simultaneously or sequentially. Such pixels
  • the block is the above-described B pixel block BB.
  • the timing for processing the B pixel block BB may be during the processing of the triangle T scheduled for the first processing. In this case, the drawing target When the triangle T is processed, the above pixel processing of the pixel block BB is not performed.
  • the former that is, the pixel of the triangle T to be processed first
  • the pixels of the triangle T to be processed first in the elementary block are processed simultaneously or sequentially.
  • N-1 N Detects whether or not at least part of the edge connecting N N + 1 is in the triangular pixel block.
  • the B edge detection unit 114 detects the triangle to be drawn (triangle T) and the next three to be drawn.
  • N + 1 N + 1 N + 2) is detected if it is in the triangular pixel block. Then, the C edge detection unit 115 is arranged between a triangle to be drawn next (triangle T scheduled for the first processing) and a triangle to be drawn next (triangle T scheduled for the second processing).
  • the pixel blocks detected by the A edge detection unit 113 are excluded and are subject to drawing processing. .
  • the pixel block detected by the B edge detector 114 (the above-mentioned B pixel block BB) is drawn next to the drawing target triangle (triangle T).
  • the triangle to be drawn next (triangle to be processed first)
  • the shape T) is also drawn in advance only in this ⁇ pixel block ⁇ . Often a drawing
  • pixel blocks to be drawn those that are not detected by the three edge detectors are pixel blocks included in the triangle to be drawn, and these pixel blocks are drawn as usual.
  • FIG. 11 is a flowchart showing the operation of the drawing apparatus 100 in the present embodiment.
  • the control unit 111 of the drawing apparatus 100 first acquires a drawing list (step S 100) and converts the drawing list into two-dimensional drawing data (step S 102). Then, the triangle detection unit 112 detects a drawing target triangle, for example, the triangle T in FIG. 10 from the two-dimensional drawing data (step S104).
  • the triangle detection unit 112 calculates pixels included in the triangle T to be drawn.
  • the pixel block having the pixel block is detected as the above-described triangular pixel block in the block group GB of FIG. 10 (step S106).
  • the A edge detection unit 113 is connected to the triangle T to be drawn in the triangular pixel block.
  • a pixel block containing the processed triangle T pixel is detected as A pixel block BA.
  • the rasterizing unit 116 performs the triangular pixel block belonging to the triangle T to be drawn.
  • the A pixel block BA is omitted from the processing target, and the remaining pixel blocks are set as the drawing processing target (step S110).
  • the B edge detection unit 114 performs the first processing target triangle T connected to the drawing target triangle T.
  • step S112 It is determined whether or not +1 N + 1 pixels are included and the force is low (step S112).
  • the rasterizing unit 116 includes at least one of the drawing target triangle T and the first processing scheduled triangle T within the range of the drawing processing target pixel block set in step S110. Rasterization processing is performed on the part (step SI 14). In other words, unlike the conventional example, the rasterizing unit 116 has B pixels as the pixels of the triangle T to be drawn and the triangle T to be processed first.
  • the rasterization unit 116 performs rasterization processing on at least a part of the triangle T to be drawn within the range of the pixel block to be drawn set in step S110 (step S110).
  • the memory RZW unit 117 writes the pixel data generated by the rasterizing process in step S114 or step S116 into the memory 120 in units of pixel blocks (step S118).
  • the drawing engine 130 displays an image corresponding to the pixel data written in the memory 120 on the display unit 200 (step S120).
  • the pixel block at the vertex (pixel block BX or pixel block BY shown in FIG. 10) usually contains three or more triangular pixels, even if only two triangles are used, the pixel block is used. In many cases, it is not possible to fill the entire area of the mark. Therefore, the processing described below may be performed. However, since the pixel block at the apex can be detected relatively easily, it is easier to implement it by holding about 2 pixel blocks and handling those 2 pixel blocks in a cache when drawing sequentially. Therefore, there is a possibility that the performance is slightly improved.
  • the triangle is small or if the angle is sharp, there may be three or more triangular pixels in one pixel block. This is the region (pixel block) force detected by the A edge detection unit 113 and the B edge detection unit 114, or the B edge detection unit 114 and the C edge detection unit 115 at the same time. Pixel block including pixels Corresponds to lock. It should be noted that there is a low frequency other than pixel blocks that contain vertices.
  • the part of the shape T is the one that has already been drawn the next time the triangle T is drawn.
  • the pixel block BY shown in Fig. 1 is drawn including part of the triangle when drawing the triangle T to be drawn.
  • the drawing apparatus 100 writes the pixel block BY into the memory 120 once and reads it out in a halfway state where the processing of the entire pixel block BY is not completed.
  • triangle T and part of triangle T are part of triangle T
  • N + 2 part is included in the pixel block BY. For this reason, the efficiency is not different from the conventional method. In such a case, if a dedicated cash system is introduced, the situation can be improved. is necessary.
  • triangle detection section 112 A edge detection section 113, B edge detection section 114, and C edge detection section 115 are mounted inside the force provided outside rasterization section 116. May be. Further, in the present embodiment, each of the triangle detection unit 112, the A edge detection unit 113, the B edge detection unit 114, and the C edge detection unit 115 is separated into a single module without time separation. Pixel block may be detected
  • the triangle T to be drawn and the triangle T to be drawn next are shared.
  • the B pixel block BB is drawn. That is, within the range of the B pixel block BB Thus, the pixels of both triangles are drawn simultaneously or successively.
  • the drawing apparatus draws the triangle T to be drawn.
  • the drawing device draws the triangle T when drawing the triangle T to be drawn.
  • N A-1 pixel block BA containing N-1 pixels is detected.
  • a pixel block BA including T pixels is rasterized and rendered.
  • the rendering apparatus 100 renders rendering data in a triangle strip data format by rasterizing.
  • the drawing apparatus draws the drawing data in the triangular fan data format by rasterizing the drawing data. Even in such a data format, the same effect as in the above embodiment can be obtained.
  • the rendering apparatus 100 renders rendering data in a triangle strip data format by rasterizing.
  • the rendering apparatus performs rendering by rendering the rendering data in a format that can change the triangle strip and the triangle fan in the middle (so-called Triangle Snake). Even in such a data format, it is possible to obtain the same effect as the above embodiment.
  • the rendering apparatus individually determines the timing for rendering the pixel block according to separately provided information, random numbers, or the like.
  • the rendering apparatus 100 renders rendering data in a triangle strip data format by rasterizing.
  • the rendering apparatus renders rendering data in a triangular mesh data format by rasterizing.
  • a triangular mesh there are a maximum of three triangles that share a side with a certain triangle, and they are not necessarily drawn continuously, so only the drawing order is used as in the above embodiment and modification 1. So, to decide which triangle to draw the pixel block on the above side is to be drawn.
  • the drawing apparatus when the drawing apparatus according to the present modification draws any one of the two triangles sharing the side for each side, the pixel block on the side is drawn together. Get information indicating what should be done. Based on the acquired information, the drawing apparatus determines which triangle is to be drawn when the pixel block on the side is drawn. Of course, the force such as the triangle number may be automatically determined by calculation.
  • the rendering apparatus uses information on up to six vertices and processes all three shared edges.
  • the drawing apparatus performs the processing as described in the above embodiment and its modifications 1 to 5 on three sides.
  • FIG. 12 is an explanatory diagram for explaining processing of the drawing apparatus according to the present modification.
  • the drawing apparatus leaves, for example, an edge connecting the vertex P and the vertex P.
  • Vertex P is stored for vertex P and vertex P. As a result, the drawing device
  • A can be specified and the data format can be simplified.
  • drawing information indicating which side of a pixel block on a side shared by each triangle is to be drawn may be separately provided. Further, when not drawing other triangles other than the triangle to be drawn, it may be used that information on the vertices of other triangles having sides shared with the triangle to be drawn is unnecessary. In other words, when processing a triangle to be drawn, only vertices of pixels that are on the side shared with other triangles are drawn, and the vertices of other triangles are included in the graphics data. Put dummy vertices in the fix data. As a result, the drawing device can specify other triangular vertices and dummy vertices, and the data format can be simplified.
  • vertex (OTHER) Two types of dummy vertices are provided, and "vertex (OTHER) indicating that pixel blocks on the side shared by the triangle to be drawn and other triangles are processed when drawing other triangles". It should be distinguished from “the vertex indicating that this edge is not shared (NONE)”. In other words, the vertex (NONE) is non-shared information indicating that there is no other triangle sharing one side of the triangle to be drawn, and the vertex (OTHER) is a pixel block that is determined to include pixels of other triangles. Is excluded information indicating that rasterization processing of the pixel block should be performed during processing of other triangles.
  • the rendering device prohibits rasterization processing for pixel blocks that contain other triangular pixels, that is, pixel blocks that contain shared edges. However, the area (pixel block) is not drawn. And the drawing device If the dummy vertex indicates a vertex (NONE), it is determined that the pixel block on one side of the triangle to be drawn corresponding to that vertex (NONE) does not contain pixels in other triangular regions. A pixel block including only a triangular pixel to be drawn is drawn.
  • FIG. 13 is an explanatory diagram for explaining dummy vertices.
  • Vertex P 0 A 1 Ol 2 C 3 Vertex P, Vertex P, NONE Vertex, Vertex P, Vertex P, Vertex P, and Vertex P including Vertex P
  • Vertex size can be minimized.
  • the dummy vertices need not necessarily have the same data size as normal vertices.
  • a triangle strip is taken as an example of the drawing data format, but a triangle fan, Snake, triangle mesh, or the like may be used.
  • drawing apparatus is a dedicated semiconductor integrated circuit.
  • LSI latitude, low-didirectional transistors and relay elements that can be configured as part of it.
  • An image device may be configured.
  • the drawing apparatus of the present invention can effectively use the memory bus bandwidth without having an expensive and complicated circuit configuration, and is not only effective as a process of 3D computer graphics but also a 2D process. It is also useful as a method. Therefore, it may be used in fields such as home appliances, game machines and personal computers that include these functions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Image Generation (AREA)

Abstract

 高価で複雑な回路構成を有することなくメモリバスバンド幅を有効に利用することができる描画装置を提供する。  描画データから描画対象の三角形を特定し、その三角形に含まれる画素を有する画素ブロックを特定するトライアングル検出部112と、トライアングル検出部112で特定された画素ブロックに、描画対象の三角形と連接する第1処理予定の三角形の画素が含まれるか否かを判別するBエッジ検出部114と、Bエッジ検出部114で含まれると判別されたときには、第1処理予定の三角形の画素を含む画素ブロックをラスタライズ処理して画素データを生成するラスタライズ部116と、ラスタライズ部116で生成された画素ブロックの画素データをメモリ120に書き込むメモリR/W部117と、メモリ120に書き込まれた画素データに応じた画像を表示させる描画エンジン130とを備える。

Description

技術分野
[0001] 本発明は、コンピューターグラフィクスの描画処理を行なう描画装置に関する。
背景技術
[0002] 従来のコンピューターグラフィクスの描画処理を行なう描画装置は、一般に、三角 形ストリップ (Triangle Strip)、三角形ファン (Triangle Fan)、それらを相互に切 り替えられる仕組み(以下、スネーク (Triangle Snake) t 、う)、および三角形メッシ ュ (Triangle Mesh)などの形式で与えられたグラフィクスデータを描画する際に、そ のグラフィックスデータを個別の三角形毎にラスタライズと呼ばれる画素毎の情報に 変換する処理を行なって 、る。
[0003] 図 1は、三角形ストリップのデータ形式を示す図である。
[0004] 三角形ストリップのデータ形式では、頂点 P、頂点 P、頂点 P、頂点 P、 ···、頂点 P
0 1 2 3 N
、頂点 P 、および頂点 P に対して、例えば、頂点 P、頂点 P、および頂点 P
U -1 NU NU +1 0 1 2 の 3頂点で三角形 Tが構成され、頂点 P、頂点 P、および頂点 Pの 3頂点で三角形
0 1 2 3
Tが構成され、頂点 P、頂点 P 、および頂点 P の 3頂点で三角形 Tが構成される
1 N N+1 N+2 N
。このデータ形式の特徴は、三角形を 3つの頂点の情報で表現すると、 NUM個の三 角形の情報を記述するのに 3 X NUM個の頂点の情報が必要になるのに対し、三角 形ストリップ形式なら (NUM + 2)個の頂点の情報だけで済み、データ量を減らせる ことである。
[0005] 図 2は、三角形ファンのデータ形式を示す図である。
[0006] 三角形ファンのデータ形式では、頂点 P、頂点 P、頂点 P、頂点 P、 ···、頂点 P
0 1 2 3 NU -
、頂点 P 、および頂点 P に対して、例えば、頂点 P、頂点 P、および頂点 Pの
1 NUM NU +1 0 1 2
3頂点で三角形 Tが構成され、頂点 P、頂点 P、および頂点 Pの 3頂点で三角形 T
0 0 2 3 1 が構成され、頂点 P 3
0、頂点 P
N+1、および頂点 P
N+2の 頂点で三角形 T
Nが構成される。 このデータ形式も三角形ストリップと同様にデータ量を減らせるのが特徴である。
[0007] 図 3は、スネークのデータ形式を示す図である。 [0008] スネークは、三角形ストリップと三角形ファンの相互を途中で自由に切り替えられる データ形式である。切り替えのポイントを示すために別途情報が必要である。データ 量は三角形ストリップや三角形ファンと同様であるが、三角形ストリップや三角形ファ ンの場合は、三角形の接続状態が一意に決められているため、条件が整わないと連 続する三角形をそれほど多くできない。これに対し、本形式では、自由度が有るため 、連続する三角形をより多くすることができる可能性が高いという特徴がある。
[0009] 図 4Aおよび図 4Bは、三角形メッシュのデータ形式を示す図である。
[0010] 三角形メッシュでは、三角形を構成する頂点の情報は、頂点データのインデックス Zポインタ 501で表現される。この形式のデータは、辺を共有する三角形を示す情報 を持たない場合が多いが、必要に応じてその情報を付加して使用される。
[0011] コンピューターグラフィクスの描画処理の途中結果や最終結果は通常、外部メモリ もしくは内部メモリに配置される。この情報には、画素毎の視点からの距離情報や力 ラー情報、透明度などが含まれる。ラスタライズ処理された画素毎の情報をメモリ上に 配置された中間結果 (画素のカラー値や奥行き情報など)に反映する処理を行なう際 には、現在の値をメモリから読み込み、処理した結果をメモリに書き戻す処理が必要 となる。画素が不透明で、奥行き情報 (Z値)を無視する場合で、かつメモリ上に配置 された中間結果との混ぜ合わせ処理などが無い場合には、メモリ上に配置された中 間結果を読み込まなくても済む場合も有る。その場合は、読み込み処理が無くなって 書き込み処理だけになり、時間が半分になるものの、本質的な処理内容は変わらな い。以下、中間結果は読み込むものとして説明する。
[0012] 一般に、 1画面の処理結果を得るためには画面のサイズの何倍もの量の画素を処 理しなければならず、さらにアニメーション処理の場合などには 1秒に数十回も画面 を更新することを要求される。そのため、非常に高速に画素のデータを読み込み、書 き戻さなければならず、この速度が描画装置の速度を決めてしまうことが多 、。
[0013] DDR SDRAM (Double Data Rate SDRAM)に代表される最近のメモリは非常に 高速にデータを出し入れできる力 最高性能を引き出すためにはある程度まとまった サイズでデータを読み書きしなければならな ヽと 、う制約が有る。処理速度が高速に なり、取り扱うデータ量が多くなるにつれ、このサイズがかなり大きくなつてきている。こ のため、描画装置は、 1画面中の所望の 1画素の情報だけを読み込んだり、書き込ん だりすることはできず、システムで決まるサイズ (4画素〜 256画素程度)の情報を画 素ブロックとしてまとめて読み書きしなければならない。
[0014] まとめて読み書きしなければならな 、画素の領域 (画素ブロック)は、何も工夫しな ければ縦方向が 1画素で横方向に長い領域になる場合がほとんどである。しかし、コ ンピューターグラフィクスの描画装置は、略正方形の画素ブロックを 1度に読み書き するデータ単位としている。正方形とされているのは、三角形の単位でラスタライズ処 理が施されて画素毎の処理が行われるからという理由と、平均すれば横長の三角形 よりもそうでない三角形が多いという理由とに基づく。つまり、横長の領域よりは正方 形に近 、領域をまとめて取り扱う方力 三角形の領域外で必要が無 ヽと 、う画素の 割合が低くなり、ひいては効率が良くなるからである。このことは一般的に知られてい る (例えば、特許文献 1参照。 ) o
[0015] 図 5は、画素ブロックの形状が横長である場合を説明するための説明図である。
[0016] この図 5に示すように、縦 1画素 X横 64画素の領域(画素ブロック) 601には、三角 形 602と重なって 、る有効な画素は 8画素程度しか無 、。
[0017] つまり、描画装置が画素ブロックの画素データをメモリに書き込んでも、殆ど不用な 画素データを書き込んでしまうことになる。
[0018] 図 6は、画素ブロックの形状が正方形である場合を説明するための説明図である。
[0019] この図 6に示すように、縦 8画素 X横 8画素の領域(画素ブロック) 701には、図 5に 示す三角形 602と同じ三角形 702と重なっている有効な画素は 38画素もある。この ように、正方形の画素ブロックの方が横長の画素ブロックに比べて明らかに有効な画 素が多くなる。
[0020] 上記特許文献 1では、画素単位の情報に関してではなぐ三角形に貼られるテクス チヤデータに関する発明が開示されている力 8 X 8画素のブロック単位でデータが 配置されている。これも同様の理由に基づく。
特許文献 1:特表 2001 - 507836号公報
発明の開示
発明が解決しょうとする課題 [0021] し力しながら、上記特許文献 1の描画装置では、メモリバスのバンド幅を無駄に使用 してしまうという問題がある。その結果、広いバンド幅が必要となり、バンド幅が狭い場 合には、描画処理に不具合が発生してしまう。
[0022] 即ち、画素ブロックの形状を略正方形にしても、三角形の辺の近くでは一部のデー タしか不用なのにその情報もまとめて取り扱うため、読み書きするデータ量が増大し、 有効に使用可能なメモリバスバンド幅を低下させている。言い換えれば、一定時間内 に読み書きできるデータの総量はメモリバスバンド幅で決まってしまうが、その中で無 駄な画素のデータを一緒に読み込んだり書き込んだりしてしまうことで、総量のうち有 効なデータ量を減らして 、ることになる。
[0023] 図 7は、不用なデータを説明するための説明図である。
[0024] 例えば、三角形 710が描画されるときには、三角形 710の辺の一部を含む画素ブ ロック Bkの全ての画素データがメモリに書き込まれる。し力し、その画素ブロック Bkは 、三角形 710に含まれない領域 Bkaの画素データと、三角形 710に含まれる領域 Bk bの画素データとを有する。したがって、画素ブロック Bkのうち領域 Bkbの画素データ だけが必要であるにも関わらず、不用な領域 Bkaの画素データまでメモリに書き込ん でしまう。
[0025] 図 8は、三角形ストリップの場合においてメモリに不用なデータが書き込まれる様子 を説明するための説明図である。
[0026] 描画装置は、三角形 Τ , Τ , Τ , Tを順に描画しょうとする場合、まず、三角形 Tに
0 1 2 3 0 含まれる画素を有する画素ブロックの画素データをメモリに書き込む。そして、次に、 描画装置は、三角形 τに含まれる画素を有する画素ブロックの画素データをメモリに
1
書き込む。
[0027] この場合、三角形 Tと三角形 Tの共有する辺を含む領域 811では、各画素ブロッ
0 1
クは、三角形 Tの書き込み時と、三角形 Tの書き込み時との 2回もメモリに書き込ま
0 1
れることとなる。
[0028] 例えば、領域 811の画素ブロック Bklは、三角形 Tに含まれる領域 Bklaの画素デ
0
ータと、三角形 Tに含まれる領域 Bklbの画素データとを有する。したがって、三角
1
形 Tの書き込み時には、不用な領域 Bklbを含む画素ブロック Bklの全ての画素デ 一タカ^モリに書き込まれ、三角形 Tの書き込み時にも、不用な領域 Bklaを含む画
1
素ブロック Bklの全ての画素データがメモリに書き込まれる。
[0029] このように、描画装置は、三角形 Τ , Τ , Τ , Tを順に描画しょうとする場合、領域 8
0 1 2 3
11, 812, 813に含まれる各画素ブロックを、無駄なデータがその画素ブロックに含 まれている状態で、 2度もメモリに書き込んでいる。
[0030] また、描画装置だけ力^モリを独占的に使用している場合よりも、他の装置にもその メモリが使用される場合、例えば描画装置がシステム LSI (Large Scale Integration)の 中にひとつのユニットとして入っている場合はより深刻である。このような場合は、特 定のユニット(装置)がメモリバスを占有して他のユニットの動作を阻害することがない ように、量的な規制などが行われることが多い。よって、場合によっては少し時間をか けてもメモリアクセス量を減らす努力をしたほう力 より多くの有効なデータにアクセス でき、描画装置の性能を向上することが可能になる場合が多い。
[0031] そこで、無駄なメモリアクセスを減らすために、まとめて処理する画素データのキヤッ シュシステムを構築することが想定される。三角形ストリップや三角形ファンはもちろ ん、三角形メッシュのような汎用性のあるデータ形式でも、近くに有る三角形が続けて 描画される場合が多ぐ局所性が有るため、一般的なキャッシュシステムを構成すれ ば効率をかなり改善できる。
[0032] し力しながら、上記特許文献 1の描画装置にキャッシュシステムを構築しても、キヤッ シュのサイズを力なり大きくしないと効果が少なぐさらに回路構成が複雑になるため 、キャッシュ回路を実装するのにかなりの開発工数が必要である。キャッシュのサイズ を大きくすれば回路規模が大きくなり、開発工数の問題と両方で、これを組み込んだ LSIや装置の価格を引き上げてしまうという課題を有する。
[0033] そこで、本発明は、力かる問題に鑑みてなされたものであって、高価で複雑な回路 構成を有することなくメモリバスバンド幅を有効に利用することができる描画装置を提 供することを目的とする。
課題を解決するための手段
[0034] 上記目的を達成するために、本発明に係る描画装置は、描画データをラスタライズ 処理して描画する描画装置であって、前記描画データからラスタライズ処理の対象と なる第 1の三角形領域を特定する三角形特定手段と、前記第 1の三角形領域に含ま れる画素を有する画素ブロックを特定するブロック特定手段と、前記ブロック特定手 段で特定された画素ブロックに、前記第 1の三角形領域と連接する第 2の三角形領 域の画素が含まれるか否かを判別する判別手段と、前記判別手段で含まれると判別 されたときには、前記第 2の三角形領域の画素を含む画素ブロックをラスタライズ処 理して画素データを生成するラスタライズ手段と、前記ラスタライズ手段で生成された 画素ブロックの画素データをメモリに書き込む書き込み手段と、前記メモリに書き込ま れた画素データに応じた画像を表示させる表示制御手段とを備えることを特徴とする
[0035] これにより、第 1及び第 2の三角形領域の画素を含む画素ブロックが検出されて、そ れらの画素を含んだ状態でその画素ブロックがラスタライズ処理されてメモリに書き込 まれるため、従来例のように、第 1の三角形領域の画素以外の不用なデータをメモリ に書き込むことを避けることができる。その結果、大きいサイズのキャッシュメモリや多 大な開発工数が必要な複雑な回路の開発および実装を行なうこと無ぐ画素データ の書き込みの際の無駄を排除することにより、メモリバスバンド幅を有効に利用するこ とができる。つまり、高価で複雑な回路構成を有することなぐメモリバスバンド幅を有 効に利用することができる。そもそもメモリアクセス時に無駄が生じるのは三角形の辺 の部分であるが、本発明では、この無駄を削減することができる。
[0036] 例えば、三角形ストリップ形式のデータの三角形の数が充分多い場合は、個別の 三角形について見ると、 3個の辺のうち、 2個の辺で問題が改善されるため、全体とし てかなりメモリバスバンド幅を低減することができる。図 8に示すように、三角形 Tや三
1 角形 Tでは 3つの辺のうち 2つの辺が共有される辺になっており、残り 1辺だけについ
3
てのみ無駄が解消されな 、こととなる。
[0037] また、前記判別手段は、前記ブロック特定手段で特定された画素ブロックに、前記 第 1の三角形領域の後に描画すべき前記第 2の三角形領域の画素が含まれる力否 かを判別することを特徴としてもょ ヽ。
[0038] これにより、第 1の三角形領域をラスタライズ処理の対象、つまり描画対象とするとき には、第 2の三角形領域が次に描画対象となる第 1処理予定の三角形として扱われ 、第 1の三角形領域を描画対象とするときに、第 1処理予定の三角形の画素も含めて 画素ブロックがラスタライズ処理される。したがって、不用なデータの代わりに、第 1処 理予定の三角形の画素データをメモリに書き込むことができ、メモリバスバンド幅を有 効に利用することができる。
[0039] また、前記判別手段は、前記ブロック特定手段で特定された画素ブロックに、前記 第 1の三角形領域の前に描画対象とされた前記第 2の三角形領域の画素が含まれる か否かを判別することを特徴としてもょ ヽ。
[0040] これにより、第 1の三角形領域をラスタライズ処理の対象、つまり描画対象とするとき には、第 2の三角形領域が直前に描画された処理済の三角形として扱われ、第 1の 三角形領域を描画対象とするときに、処理済の三角形の画素も含めて画素ブロック がラスタライズ処理される。したがって、不用なデータの代わりに、処理済の三角形の 画素データをメモリに書き込むことができ、メモリバスバンド幅を有効に利用すること ができる。
[0041] ここで、前記三角形特定手段は、さらに、前記描画データからラスタライズ処理の対 象となる前記第 2の三角形領域を特定し、ブロック特定手段は、さらに、前記三角形 特定手段が前記第 2の三角形領域を特定したときには、前記第 2の三角形領域に含 まれる画素を有する画素ブロックを特定し、前記ラスタライズ手段は、さらに、前記三 角形特定手段が前記第 2の三角形領域を特定したときには、前記ブロック特定手段 で特定された画素ブロックのうち、前記判別手段で判別された前記第 1及び第 2の三 角形領域の画素を有する画素ブロックを、ラスタライズ処理の対象から除くことを特徴 としてちよい。
[0042] これにより、第 2の三角形領域力ラスタライズ処理の対象、つまり描画対象になると きには、例えば、ブロック特定手段によって第 2の三角形領域に含まれる画素を有す る複数の画素ブロックが特定されると、その複数の画素ブロックのうち第 1の三角形領 域の画素を含む画素ブロックはラスタライズ処理の対象から除かれる。したがって、第 1の三角形領域が描画対象のときに描画される画素ブロックを、第 2の三角形領域が 描画対象となるときにもラスタライズ処理してメモリに書き込むことを防 、で、メモリバス バンド幅をさらに有効に利用することができる。 [0043] なお、本発明は、このような描画装置として実現することができるだけでなぐその方 法やプログラム、そのプログラムを格納する記憶媒体、集積回路としても実現すること ができる。
発明の効果
[0044] 本発明の描画装置は、無駄なメモリアクセスを減らすことができるため、高価で複雑 な回路構成を有することなくメモリバスバンド幅を有効に利用することができる。
図面の簡単な説明
[0045] [図 1]図 1は、三角形ストリップのデータ形式を視覚的に示す図である。
[図 2]図 2は、三角形ファンのデータ形式を視覚的に示す図である。
[図 3]図 3は、スネークのデータ形式を視覚的に示す図である。
[図 4A]図 4Aは、三角形メッシュのデータ形式を視覚的に示す図である。
[図 4B]図 4Bは、三角形メッシュのデータ形式を示す図である。
[図 5]図 5は、画素ブロックの形状が横長である場合を説明するための説明図である。
[図 6]図 6は、画素ブロックの形状が正方形である場合を説明するための説明図であ る。
[図 7]図 7は、不用なデータを説明するための説明図である。
[図 8]図 8は、三角形ストリップの場合においてメモリに不用なデータが書き込まれる 様子を説明するための説明図である。
[図 9]図 9は、本発明の実施の形態における描画装置の構成を示すブロック図である
[図 10]図 10は、本発明の実施の形態における描画装置のアルゴリズムを示す概念 図である。
[図 11]図 11は、本発明の実施の形態における描画装置の動作を示すフローチャート である。
[図 12]図 12は、本発明の実施の形態における第 6の変形例に係る描画装置の処理 を説明するための説明図である。
[図 13]図 13は、本発明の実施の形態における第 6の変形例に係るダミー頂点を説明 するための説明図である。 符号の説明
100 描画装置
111 制御部
112 トライアングル検出部
113 Aヱッジ検出部
114 Bエッジ検出部
115 Cエッジ検出部
116 ラスタライズ咅
117 メモリ R/W部
120 メモリ
130 描画エンジン
200 表示部
発明を実施するための最良の形態
[0047] 以下本発明の実施の形態について、図面を参照しながら説明する。
[0048] 図 9は、本発明の実施の形態における描画装置の構成を示すブロック図である。
[0049] 本実施の形態における描画装置 100は、高価で複雑な回路構成を有することなくメ モリバスバンド幅を有効に利用することができるものであって、制御部 111と、トライア ングル検出部 112と、 Aエッジ検出部 113と、 Bエッジ検出部 114と、 Cエッジ検出部 115と、ラスタライズ部 116と、メモリ RZW部 117と、画素記録モジュールたるメモリ 1 20と、描画エンジン 130とを備える。
[0050] このような描画装置 100は、ラスタライズ部 116でラスタライズ処理する際に 3頂点で はなぐ 4頂点分の情報を用い、トライアングル検出部 112と各エッジ検出部 113, 11 4, 115の組み合わせでブロック毎に処理内容を決定し、処理を行なう。これによつて 、メモリ RZW部 117とメモリ 120との間のデータの読み書きの量を減らすことができる
[0051] 制御部 111は、三次元で表現された描画リストを取得して、その描画リストを二次元 描画データに変換する。描画リストには、三次元上における各座標や、その座標にお ける色、法線 (nomal)などが含まれている。制御部 111は、このような描画リストを、 二次元上における座標と、その座標における色などとを示す二次元描画データに変 換する。
[0052] さらに、制御部 111は、トライアングル検出部 112、 Aエッジ検出部 113、 Bエッジ検 出部 114、および Cエッジ検出部 115に対して、二次元描画データを送信して、上記 各部によって検出された描画対象の三角形および画素ブロックと、二次元描画デー タとをラスタライズ部 116に出力する。
[0053] トライアングル検出部 112は、二次元描画データから描画対象の三角形を検出す るとともに、その描画対象の三角形に含まれる画素を有する画素ブロック(三角形画 素ブロック)を検出する。つまり、描画対象の三角形に全て含まれる画素ブロックと、 その三角形の辺の一部を含む画素ブロックとが三角形画素ブロックとして検出される 。三角形の辺の一部を含む画素ブロックには、描画対象の三角形の画素が含まれる と共に、その描画対象の三角形には不用な画素も含まれている。
[0054] Aエッジ検出部 113は、三角形画素ブロックのうち、描画対象の三角形に連接して 直前に描画処理の対象とされた三角形 (処理済の三角形)の辺上にある画素ブロッ クを検出する。
[0055] つまり、 Aエッジ検出部 113は、三角形画素ブロックの何れかに、処理済の三角形 の画素が含まれるか否かを判別し、含まれると判別された画素ブロックを検出する。こ こで、 Aエッジ検出部 113は、上述の処理済の三角形の画素を含む画素ブロックを 検出するときには、描画対象の三角形の 3つの頂点と、処理済の三角形の 1つの頂 点とを用いて検出する。処理済の三角形の 1つ頂点とは、描画対象の三角形と処理 済の三角形とで共有される辺上にない頂点である。以下、このように検出された画素 ブロックを A画素ブロックと 、う。
[0056] Bエッジ検出部 114は、三角形画素ブロックのうち、描画対象の三角形に連接して 次に描画処理される予定の三角形 (第 1処理予定の三角形)の辺上にある画素プロ ックを検出する。
[0057] つまり、 Bエッジ検出部 114は、三角形画素ブロックの何れかに、第 1処理予定の三 角形の画素が含まれるか否かを判別し、含まれると判別された画素ブロックを検出す る。ここで、 Bエッジ検出部 114は、上述の第 1処理予定の三角形の画素を含む画素 ブロックを検出するときには、描画対象の三角形の 3つの頂点と、第 1処理予定の三 角形の 1つの頂点とを用いて検出する。第 1処理予定の三角形の 1つ頂点とは、描画 対象の三角形と第 1処理予定の三角形とで共有される辺上にない頂点である。以下 、このように検出された画素ブロックを B画素ブロックと!/、う。
[0058] Cエッジ検出部 115は、第 1処理予定の三角形の画素を有する画素ブロックのうち 、第 1処理予定の三角形に連接してその次に描画処理される予定の三角形 (第 2処 理予定の三角形)の辺上にある画素ブロックを検出する。つまり、 Cエッジ検出部 115 は、第 1処理予定の三角形の画素を有する画素ブロックのうち、第 2処理予定の三角 形の画素を含む画素ブロックを検出する。以下、このように検出された画素ブロックを C画素ブロックという。
[0059] ラスタライズ部 116は、二次元描画データと、描画対象の三角形と、その三角形画 素ブロックと、 A画素ブロックと、 B画素ブロックと、 C画素ブロックとに基づ!/ヽて、三角 形画素ブロックのうち有効な部分に対してラスタライズ処理を行って画素データを生 成する。
[0060] 即ち、ラスタライズ部 116は、三角形画素ブロックのうち、 A画素ブロックを処理対象 から省く。そして、ラスタライズ部 116は、 A画素ブロックが省かれた三角形画素ブロッ クの範囲で、描画対象の三角形と第 1処理予定の三角形のそれぞれの少なくとも一 部をラスタライズ処理して画素データを生成する。このとき、その三角形画素ブロック に含まれる B画素ブロックは、描画対象の三角形の画素と、第 1処理予定の三角形の 画素とが含まれた状態でラスタライズ処理される。
[0061] メモリ RZW部 117は、ラスタライズ部 117によるラスタライズ処理によって生成され た画素データを、 A画素ブロックを除く三角形画素ブロックの単位でメモリ 120に書き 込む。
[0062] 描画エンジン 130は、表示制御手段として構成されており、メモリ 120に書き込まれ た画素データに応じた画像 (描画対象三角形)を表示部 200に表示させる。
[0063] このように本実施の形態では、描画対象の三角形の描画処理時に、第 1処理予定 の三角形の画素も B画素ブロックに含めてラスタライズ処理を行い、その B画素ブロッ クの画素データをメモリ 120に書き込む。一方、従来では、描画対象の三角形の描 画処理時には、第 1処理予定の三角形の画素が B画素ブロックに含められず、その 代わりに不用なデータが B画素ブロックに含められ、その B画素ブロックがメモリ 120 に書き込まれる。(なお、不用なデータの部分にはマスクがかけられ、その不用なデ ータが実際にメモリに書き込まれるわけではないが、そのデータ量に相当する分だけ の帯域カ^モリバスで使用される)。したがって、本実施の形態では、不用なデータの メモリ 120への書き込みを防いでメモリバスバンド幅を有効に利用することができる。
[0064] また、第 1処理予定の三角形の描画処理時には、この第 1処理予定の三角形が描 画対象の三角形となるため、上述の B画素ブロックは、この第 1処理予定の三角形に 対する A画素ブロックとなる。したがって、本実施の形態では、第 1処理予定の三角 形の描画処理時には、上述の B画素ブロックは処理対象から省かれる。一方、従来 では、第 1処理予定の三角形の描画処理時には、上述と同様に不用なデータを含む B画素ブロック力 Sメモリ 120に書き込まれる。したがって、本実施の形態では、さらにメ モリバスバンド幅を有効に利用することができる。
[0065] 図 10は、本発明の実施の形態における描画装置 100のアルゴリズムを示す概念図 である。
[0066] 図 10において、各三角形は、三角形 T 、三角形 T、三角形 T 、三角形 T の
N-1 N N+1 N+2 順に描画される。本実施の形態の描画装置 100は、三角形 Tを描画する際に、 N番
N
目の頂点 P、(N+ 1)番目の頂点 P 、および (N+ 2)番目の頂点 P の、 3つの頂
N N+1 N+2
点の情報に対して、さらに、次に描画する三角形 T の頂点である(N + 3)番目の頂
N+1
点 p の情報も加え、 4頂点分の情報カゝらラスタライズ処理を行なう。三角形ストリップ
N+3
(Triangle Strip)形式の特徴から、 1頂点分の情報をカ卩えるだけで 2つの連続 (連 接)した三角形の情報が得られることになる。
[0067] 図 10に示す三角形 Tを描画対象の三角形とする場合、上述の処理済の三角形は
N
三角形 T に相当し、第 1処理予定の三角形は三角形 T に相当し、第 2処理予定
N-1 N+1
の三角形は三角形 T に相当する。また、この場合、トライアングル検出部 112は、
N+2
描画対象の三角形 Tを検出すると共に、ブロック群 GBに含まれる各画素ブロックを
N
上述の三角形画素ブロックとして検出する。 Aエッジ検出部 113は、画素ブロック BA を上述の A画素ブロックとして検出し、 Bエッジ検出部 114は、画素ブロック BBを上述 の B画素ブロックとして検出する。なお、このような画素ブロックは、例えば 64個の画 素の集まりによって構成される。したがって、本実施の形態では、描画対象の三角形 Tを描画するときには、描画対象の三角形 Tの画素と第 1処理予定の三角形 T の
N N N+1 画素とを画素ブロック BBに含めて処理を行う。即ち、描画装置 100は、ブロック群 GB のうち画素ブロック BAを除く範囲で、描画対象の三角形 Tと第 1処理予定の三角形
N
T のそれぞれの一部をラスタライズ処理する。
N+1
[0068] 三角形をラスタライズ処理する場合、三角形の範囲に入る画素がどれかを選択し、 その画素毎のパラメータを計算することになる。伝統的な方法ではスクリーン上部か らスクリーン下部に向力つて、横一列に、左端力も右端に向力つて画素を選択し、そ れぞれの画素毎のパラメータを計算する。このようにすれば 1画素変化した時の各パ ラメータの変化量を最初に計算しておけば、後はそれを加算していくだけで各パラメ 一タの値を計算できるからである。グラフィクスシステムが開発された初期の頃は、画 面全体の情報を記録しておくだけの記憶素子を準備できな力つたので、画面の走査 線の方向に合わせた描画も意味を持っていた力 今日では処理の方向は意味を持 たなくなつている。スクリーン下部力も上部に向力つて処理しても良いし、右端から左 端に向力つて処理しても、ランダムに処理しても差し支えない。
[0069] メモリ 120には、グラフィクス 'システムを高速にするために、できるだけ高速に大量 の情報を読み書きできることが要求される。 DDR SDRAMに代表されるような最近 の高速大容量メモリ素子は、連続するアドレス空間のデータを連続して読み書きした 場合に、より高速に動作するようになっているため、最高性能を目指す場合はこの特 徴を利用することになる。
[0070] たとえば 1画素の情報を 4バイトで管理しているグラフィクスシステムで、 256バイト単 位で読み書きした場合に性能が出せるメモリを使う場合、 64画素分の情報をまとめて 読み書きすることになる。
[0071] 背景技術でも説明したように、図 5のように縦 1画素 X横 64画素の領域 (画素ブロッ ク) 601と三角形 602とでは、有効な画素(三角形 602と重なって 、る画素)が 8画素 程度しか無い。し力し、図 6のように縦 8画素 X横 8画素の領域(画素ブロック) 701に した場合は、図 5の三角形 602と同じ三角形 702において有効な画素は 38画素とな り、明らかに有効な画素が多くなる。
[0072] よって、メモリ 120上の画素配置は縦 8画素 X横 8画素の領域(画素ブロック)状に 配置するのが良い。
[0073] そのため、本実施の形態では、ラスタライズ処理は単純にスクリーン上部から下部、 左端力も右端に向力つて処理するのではなぐこの縦 8画素 X横 8画素の領域 (画素 ブロック)単位で処理を行なう。このようにすると効率が良いからである。なお、ブロック 内の処理順は任意である。
[0074] 三角形の内部で、領域(画素ブロック)内に三角形の辺がかかっていないものにつ いては、画素ブロック内の画素全てが処理対象になるので特に問題は起らない。 25 6バイト単位で読み込んだ画素データは全て有効に用いられ、結果として書き出され る 256バイトのデータも全て意味の有るデータである。
[0075] だ力 三角形の周辺部で、領域 (画素ブロック)内に三角形の辺がかかっているもの 、つまり領域の一部が三角形の内部で描画対象となり、それ以外の部分が三角形の 外部で従来手法では描画対象外となるようなブロックに関しては、 256バイト単位で 読み込んだデータのうち、三角形の外部の画素に関しては必要の無いデータである 。書き戻す際にもこのデータは本来不用であり、有効なデータの割合が小さくなる。
[0076] 描画装置 100がシステム LSIの中にユニットとして組み込まれ、他のコアと協調動作 して 、るような場合は、特定のユニットがメモリバスを占有して他のユニットの動作を阻 害することがな 、ように、メモリアクセスに対して量的な規制などが行われて 、ることが 多い。例えば、無駄なアクセスも全てアクセス量として積算され、限度を超えると一定 時間アクセスができなくなるなどのペナルティが課せられる場合がある。そのため、上 述の有効データの割合が少なくなると 、う問題は深刻である。
[0077] この問題を解決するため、本発明の描画装置 100では 4頂点 (頂点 P、頂点 P 、
N N+1 頂点 P 、頂点 P )の情報を利用して、領域 (画素ブロック)内にある描画対象の三
N+2 N+3
角形 (三角形 T )の画素に加えて、その画素ブロック内にある、第 1処理予定の三角
N
形 (三角形 T )の画素の処理も同時あるいは連続して行なう。なお、このような画素
N+1
ブロックは、上述の B画素ブロック BBである。その B画素ブロック BBを処理するタイミ ングは、第 1処理予定の三角形 T の処理時でも良い。この場合には、描画対象の 三角形 Tの処理時に、上述の Β画素ブロック BBの画素処理を行なわない。以下で
N
は前者、つまり第 1処理予定の三角形 T の画素が、描画対象の三角形 Tの画素を
N+1 N 有する画素ブロック内に含まれていたら、描画対象の三角形 Tの処理時に、その画
N
素ブロック内における第 1処理予定の三角形 T の画素も同時あるいは連続して処
N+1
理するものとして説明する。
[0078] 描画対象の三角形の 3頂点および次に描画する予定の三角形 (第 1処理予定の三 角形)の 1頂点の 4頂点の情報から、この 2つの三角形のパラメータを計算することが 可能である。即ち、上述のように、トライアングル検出部 112は、画素ブロックの全部 または一部が描画対象の三角形の内部であるものを上述の三角形画素ブロックとし て検出する。また、 Aエッジ検出部 113は、描画対象の三角形 (三角形 T )と一つ前
N
に描画した処理済の三角形 (三角形 T )との間で共有される辺 (頂点 Pと頂点 P
N-1 N N+1 とを結ぶ辺)の少なくとも一部が三角形画素ブロック内に入っているかどうかを検出す る。 Bエッジ検出部 114は、描画対象の三角形 (三角形 T )と次に描画する予定の三
N
角形 (第 1処理予定の三角形 T )との間で共有される辺 (頂点 P と頂点 P とを結
N+1 N+1 N+2 ぶ辺)の少なくとも一部が三角形画素ブロック内に入っているかどうかを検出する。そ して、 Cエッジ検出部 115は、次に描画する予定の三角形 (第 1処理予定の三角形 T )とさらにその次に描画する予定の三角形 (第 2処理予定の三角形 T )との間で
N+1 N+2 共有される辺 (頂点 P
N+2と頂点 P
N+3とを結ぶ辺)の少なくとも一部が、第 1処理予定の 三角形 T の画素を有する画素ブロック内に入っているかどうかを検出する。
N+1
[0079] したがって、トライアングル検出部 112で検出された三角形画素ブロックのうち、 A エッジ検出部 113で検出された画素ブロック(上述の A画素ブロック BA)を除 、たも のを描画処理対象にする。これは、一つ前に描画した処理済の三角形 (三角形 T )
N-1 の処理時点で既にこの A画素ブロック BAは描画済みであって、 2度描画するのを避 けるためである。
[0080] 上述の描画処理対象の画素ブロックのうち、 Bエッジ検出部 114で検出された画素 ブロック(上述の B画素ブロック BB)は、描画対象の三角形(三角形 T )と次に描画す
N
る三角形 (第 1処理予定の三角形 T )とで共有される辺上にある。このため、描画対
N+1
象の三角形 (三角形 T )に加えて次に描画する予定の三角形 (第 1処理予定の三角 形 T )も、この Β画素ブロック ΒΒ内だけは先行して描画しておく。多くの場合、 Β画
N+1
素ブロック ΒΒ内にはこの 2つの三角形しか存在せず、 2つの三角形だけを描画する だけで Β画素ブロック ΒΒ全体の処理を終えることができる。そのため、無駄なメモリア クセスを減らすことができる。
[0081] 描画処理対象の画素ブロックのうち、 3つのエッジ検出部に検出されないものは、 描画対象の三角形内部に含まれる画素ブロックであり、これらの画素ブロックは、従 来通り描画される。
[0082] 図 11は、本実施の形態における描画装置 100の動作を示すフローチャートである
[0083] 描画装置 100の制御部 111は、まず、描画リストを取得して (ステップ S 100)、その 描画リストを二次元描画データに変換する (ステップ S102)。そして、トライアングル 検出部 112は、二次元描画データから描画対象の三角形、例えば、図 10中の三角 形 Tを検出する (ステップ S104)。
N
[0084] さら〖こ、トライアングル検出部 112は、その描画対象の三角形 Tに含まれる画素を
N
有する画素ブロックを、図 10のブロック群 GB内にある上述の三角形画素ブロックとし て検出する (ステップ S 106)。
[0085] Aエッジ検出部 113は、三角形画素ブロックのうち、描画対象の三角形 Tに連接す
N
る処理済の三角形 T の画素を含む画素ブロックを、 A画素ブロック BAとして検出す
N-1
る(ステップ S 108)。
[0086] その結果、ラスタライズ部 116は、描画対象の三角形 Tに属する三角形画素ブロッ
N
クのうち、 A画素ブロック BAを処理対象から省き、その残りの画素ブロックを描画処理 対象に設定する (ステップ S 110)。
[0087] Bエッジ検出部 114は、描画対象の三角形 Tに連接する第 1処理予定の三角形 T
N N
がある力否力、つまり、三角形画素ブロックの何れかに、第 1処理予定の三角形 T
+1 N+1 の画素が含まれて 、る力否かを判別する (ステップ S 112)。
[0088] ここで、第 1処理予定の三角形 T があると判別したときには (ステップ S 112の Y)、
N+1
ラスタライズ部 116は、ステップ S 110で設定した描画処理対象の画素ブロックの範 囲で、描画対象の三角形 Tと第 1処理予定の三角形 T のそれぞれの少なくとも一 部に対してラスタライズ処理を行なう (ステップ SI 14)。つまり、ラスタライズ部 116は、 従来例と異なり、描画対象の三角形 Tと第 1処理予定の三角形 T の画素が B画素
N N+1
ブロック BBに含まれる形で、その B画素ブロック BBに対してラスタライズ処理を行なう [0089] 一方、第 1処理予定の三角形 T がないと判別したときには (ステップ S112の N)、
N+1
ラスタライズ部 116は、ステップ S 110で設定した描画処理対象の画素ブロックの範 囲で、描画対象の三角形 Tの少なくとも一部に対してラスタライズ処理を行なう (ステ
N
ップ S 116)。
[0090] そして、メモリ RZW部 117は、ステップ S114またはステップ S116によるラスタライ ズ処理により生成された画素データを、画素ブロック単位でメモリ 120に書き込む (ス テツプ S118)。描画エンジン 130は、メモリ 120に書き込まれた画素データに応じた 画像を表示部 200に表示させる (ステップ S 120)。
[0091] なお、ここまでの説明では簡単のために例外的な処理を省略したが、実際に描画 装置を実装するためにはそれらも考慮しなければならない。例えば、描画対象となる 最初の三角形 (N = 0)には一つ前の三角形は存在しないため、最初の三角形と直 前の三角形とで共有される辺は存在しない。また、最後の三角形 (N=NUM— 1)の 場合には次の三角形は存在しないため、最後の三角形と直後の三角形とで共有さ れる辺は存在しない。
[0092] また、頂点の画素ブロック(図 10に示す画素ブロック BXや画素ブロック BY)には通 常 3個以上の三角形の画素が入るため、 2個の三角形だけを用いてもその画素プロ ックの全ての領域を塗り潰せない場合が多い。そこで、次に説明する処理を行なえば よい。ただし、頂点の画素ブロックは比較的簡単に検出できるため、逐次的に描画処 理していく場合に 2画素ブロック程度を保持してキャッシュ的にその 2画素ブロックを 扱った方が実装が簡単になり、性能が少し向上する可能性が有る。
[0093] 三角形が小さい場合や、その角度が鋭い鋭角の場合は、 1個の画素ブロックに 3個 以上の三角形の画素が入る場合がある。これは、 Aエッジ検出部 113と Bエッジ検出 部 114、あるいは Bエッジ検出部 114と Cエッジ検出部 115によって同時に検出され るような領域 (画素ブロック)力 上述のような 3個以上の三角形の画素を含む画素ブ ロックに相当する。頂点が入っている画素ブロック以外でも頻度は少ないが有り得る ので注意が必要である。
[0094] このような場合は、その画素ブロック内に関しては描画対象の三角形 Tや、それ以
N
前に描画した三角形 T については既に描画済みである。一方、次に描画する三角
N-1
形 T の部分は、次に三角形 T を描画する際には既に描画が終わっているものと
N+1 N+2
して取り扱われるため、今回描画しておかないといけない。例えば、図 1に示す画素 ブロック BYを、描画対象の三角形 Tの描画時に、三角形 の一部を含めて描画し
N N+2
ておく。このような場合には、描画装置 100は、画素ブロック BY全体の処理が終わつ ていない中途半端な状態で、その画素ブロック BYを一度メモリ 120に書き込み、また それを読み出して続きを行なう。つまり、三角形 Tや三角形 T のそれぞれの一部を
N N+1
含む画素ブロック BYをメモリ 120に書き込み、またそれを読み出して三角形 T の一
N+2 部をその画素ブロック BYに含める。このため、従来の手法と効率は変わらないことに なる。このような場合専用にキャッシュシステムを導入すれば状況は改善されるが、頻 度が少ない場合は改善効果があまり見込めないうえに、開発工数も大きくなるので状 況に応じた総合的な判断が必要である。
[0095] なお、本実施の形態では、トライアングル検出部 112、 Aエッジ検出部 113、 Bエツ ジ検出部 114、および Cエッジ検出部 115を、ラスタライズ部 116の外部に設けた力 内部に実装してもよい。また、本実施の形態では、トライアングル検出部 112、 Aエツ ジ検出部 113、 Bエッジ検出部 114、および Cエッジ検出部 115をそれぞれ分離させ た力 分離させずに 1つのモジュールに時分割で各画素ブロックを検出させてもよい
[0096] (変形例 1)
上記実施の形態では、描画対象の三角形 Tと、次に描画予定の三角形 T とで共
N N+1 有される辺の一部が入って!/、る領域 (B画素ブロック BB)の描画処理を、描画対象の 三角形 Tを描画している際に同時に行なった。
N
[0097] 本変形例 1に係る描画装置は、描画対象の三角形 Tを描画する際には、その B画
N
素ブロック BBの描画処理をせずに、次に描画予定の三角形 T を描画する際に、そ
N+1
の B画素ブロック BBの描画処理を行なう。即ち、その B画素ブロック BBの範囲におい て、両三角形の画素を同時あるいは連続して描画する。
[0098] また、この場合には、本変形例 1に係る描画装置は、描画対象の三角形 Tを描画
N
する際には、トライアングル検出部 112で検出された三角形画素ブロックの何れかに 、その三角形 Tの前に描画対象とされた三角形 T の画素が含まれている力否かを
N N-1
判別する。つまり、描画装置は、描画対象の三角形 Tを描画する際に、三角形 T
N N-1 の画素が含まれている A画素ブロック BAを検出して、その三角形 Tの画素と三角形
N
T の画素とを含む A画素ブロック BAをラスタライズ処理して描画する。
N-1
[0099] (変形例 2)
上記実施の形態では、描画装置 100は、三角形ストリップのデータ形式の描画デ ータをラスタライズ処理して描画した。
[0100] 本変形例に係る描画装置は、三角形ファンのデータ形式の描画データをラスタライ ズ処理して描画する。このようなデータ形式であっても、上記実施の形態と同様の効 果を得ることができる。
[0101] (変形例 3)
上記実施の形態では、描画装置 100は、三角形ストリップのデータ形式の描画デ ータをラスタライズ処理して描画した。
[0102] 本変形例に係る描画装置は、三角形ストリップと三角形ファンとを途中で変更できる 形式 (所謂 Triangle Snake)の描画データをラスタライズ処理して描画する。このよ うなデータ形式であっても、上記実施の形態と同様の効果を得ることができる。
[0103] (変形例 4)
上記実施の形態および変形例 1では、 2つの三角形に共有される辺の一部が入つ て 、る領域 (画素ブロック)を、 2つの三角形のうち描画順が早 、方を描画して 、る時 に同時に描画したり、 2つの三角形のうち描画順が遅!、方を描画して 、る時に同時 に描画したりした。即ち、上記実施の形態および変形例 1では、上記画素ブロックを 描画するタイミングを、三角形の描画順に基づいて一意に決めた。
[0104] 本変形例に係る描画装置は、別途与えられた情報や乱数などに従って、上記画素 ブロックを描画するタイミングを個別に決定する。
[0105] なお、どちらの三角形を描画する際にも上記画素ブロックを同時には描画せず、別 途、辺の一部が入っている画素ブロックだけを描画するような構成も考えられるのは 言うまでもない。
[0106] (変形例 5)
上記実施の形態では、描画装置 100は、三角形ストリップのデータ形式の描画デ ータをラスタライズ処理して描画した。
[0107] 本変形例に係る描画装置は、三角形メッシュのデータ形式の描画データをラスタラ ィズ処理して描画する。三角形メッシュの場合は、ある三角形と辺を共有する三角形 は最大三個有り、必ずしもそれらを連続して描画していくわけではないので、上記実 施の形態や変形例 1のように描画順だけで、上記辺上にある画素ブロックを何れの三 角形の描画時に描画するかを決めるわけには 、かな 、。
[0108] そこで、本変形例に係る描画装置は、それぞれの辺について、その辺を共有する 2 つの三角形のうち何れの三角形を描画する際に、その辺上にある画素ブロックを一 緒に描画すべきかを示す情報を取得する。そして、描画装置は、その取得した情報 に基づいて、上記辺上にある画素ブロックを何れの三角形の描画時に描画するのか を決定する。もちろん、三角形の番号など力も計算で自動的に決めてもよい。
[0109] (変形例 6)
上記実施の形態およびその変形例 1〜5では 4個の頂点を扱うだけなので、同時に 処理できる辺は 1個だけである。大雑把に言えば、 3つの辺のうち 2個は共有させて 処理できる力 残り 1個はそのような処理ができない。
[0110] この問題を解決するために、本変形例に係る描画装置は、最大で 6個の頂点の情 報を利用し、共有する 3つの辺全てを処理する。即ち、描画装置は、上記実施の形 態およびその変形例 1〜5で行なってきたような処理を 3つの辺でそれぞれ行なう。
[0111] 図 12は、本変形例に係る描画装置の処理を説明するための説明図である。
[0112] この図 12に示すような三角形ストリップ (頂点 P、頂点 P、頂点 P、頂点 P、頂点 P
0 1 2 3 4
、頂点 P、および頂点 P )を考えた時、三角形ストリップを構成する三角形 (三角形 T
5 6 0
、三角形 T、三角形 T、三角形 T、および三角形 T )の間で共有される辺ではバス
1 2 3 4
帯域を無駄にする問題が回避される力 そのままではそれ以外の辺では従来通りで ある。 [0113] そこで本変形例に係る描画装置は、例えば頂点 Pと頂点 Pを結ぶ辺などの残され
0 1
た辺も処理するために、それらの辺を共有する三角形の頂点(頂点 P、頂点 P、頂
A B
点 P、頂点 P、頂点 P、頂点 P、および頂点 P )の情報を利用し、変形例 5のように
C D E F G
処理する。
[0114] 三角形ストリップ形式の場合、その三角形ストリップ形式のグラフィックスデータにお いて、三角形ストリップを構成する特定の三角形の頂点に対して、その三角形と共有 する辺を有する他の三角形の頂点を入れておけばよい。例えば、三角形 Tの頂点 P
0 0
、頂点 P、および頂点 Pに対して、頂点 Pを入れておく。これにより、描画装置は頂
1 2 A
点 P
Aを指定することができるとともに、データ形式を簡単にすることができる。
[0115] ここで、各三角形で共有される辺上にある画素ブロックを、どちら側の三角形を描画 する際に描画するのかを示す描画情報を別途与えても良い。また、描画対象の三角 形以外の他の三角形を描画しない場合は、描画対象の三角形と共有される辺を有 する他の三角形の頂点の情報は不用になることを利用してもよい。即ち、描画対象の 三角形の処理時に、他の三角形と共有される辺上にある画素ブロックを描画するもの だけ、グラフィックスデータに他の三角形の頂点を入れておき、そうでない場合は、グ ラフィックスデータにダミーの頂点を入れておく。これにより、描画装置は、他の三角 形の頂点やダミーの頂点を指定することができ、データ形式を簡単にすることができ る。
[0116] なお、ダミーの頂点に 2種類を設け、「描画対象の三角形と他の三角形とで共有さ れる辺上の画素ブロックは他の三角形を描く時に処理することを示す頂点(OTHER )」と、「この辺は共有されていないことを示す頂点(NONE)」とを区別しておくべきで ある。つまり、頂点 (NONE)は、描画対象の三角形の一辺を共有する他の三角形が ないことを示す非共有情報であり、頂点(OTHER)は、他の三角形の画素を含むと 判別された画素ブロックをラスタライズ処理の対象から除き、その画素ブロックのラス タラィズ処理を他の三角形の処理時に行なうべきことを示す除外情報である。したが つて、描画装置は、ダミーの頂点が頂点(OTHER)を示す場合には、他の三角形の 画素を含む画素ブロック、つまり共有される辺が入って 、る画素ブロックに対するラス タラィズ処理を禁止し、その領域 (画素ブロック)を描画しない。そして、描画装置は、 ダミーの頂点が頂点 (NONE)を示す場合には、その頂点 (NONE)に対応する描画 対象の三角形の一辺上にある画素ブロックには、他の三角形領域の画素は含まれな いと判別し、描画対象の三角形の画素のみを含む画素ブロックを描画する。
[0117] 図 13は、ダミーの頂点を説明するための説明図である。
[0118] 描画対象の三角形 Tに対して OTHER頂点 P がある場合、描画装置は、描画対
0 Ol
象の三角形 Tを描画するときに、頂点 Pと頂点 Pを結ぶ辺上にある画素ブロックを描
0 0 2
画処理せず、 OTHER頂点 P を有する三角形を描画するときに、先に描画対象で
Ol
あった三角形 τの一部をその画素ブロックに含めて、その画素ブロックを描画処理す
0
る。
[0119] また、描画対象の三角形 Tに対して NONE頂点がある場合、描画装置は、描画対
3
象の三角形 Tを描画するときに、頂点 Pと頂点 Pを結ぶ辺上にある画素ブロックを描
3 3 5
画処理する。
[0120] 頂点 P、頂点 P、頂点 P、 OTHER頂点 P 、頂点 P、頂点 P、頂点 P、 OTHER
0 A 1 Ol 2 C 3 頂点 P 、頂点 P、 NONE頂点、頂点 P、頂点 P、頂点 P、および頂点 Pを含む頂
02 4 5 F 6 G 点データを可変長データとする。そして、通常の頂点 (頂点 P
0、頂点 P
1、頂点 P
2、頂 点 P
3、頂点 P
4、頂点 P
5、および頂点 P )
6、および共有する三角形の頂点 (頂点 P
A、頂 点 P、頂点 P、および頂点 P )のデータの長さと、ダミー頂点(OTHER頂点 P 、 O
C F G Ol
THER頂点 P 、および NONE頂点)のデータの長さとを異なるようにすればダミー
02
頂点のサイズを最小にすることができる。必ずしもダミー頂点が通常の頂点と同じデ ータサイズを持つ必要は無 ヽ。
[0121] なお、本変形例では、描画データの形式として三角形ストリップを例に挙げて説明 したが、三角形ファンや、 Snake,三角形メッシュなどでもよい。
[0122] 以上、本発明について実施の形態およびその変形例を用いて説明した力 本発明 はこれらに限定されるものではない。
[0123] 例えば、本実施の形態およびその変形例では、全て三角形にっ 、て説明したが、 四角形以上の多角形でもよい。
[0124] また、本実施の形態およびその変形例に係る描画装置を、専用の半導体集積回路
(LSI)やその一部として構成してもよぐトランジスタやリレー素子など別の手段で描 画装置を構成してもよい。
産業上の利用可能性
本発明の描画装置は、高価で複雑な回路構成を有することなくメモリバスバンド幅 を有効に利用することができるものであって、 3次元コンピューターグラフィクスの処理 として有効なだけではなぐ 2次元の処理方法としても有用である。したがってこれら の機能を含む家電機器や、ゲーム機、パーソナルコンピュータなどの分野で利用さ れる可能性が有る。

Claims

請求の範囲
[1] 描画データをラスタライズ処理して描画する描画装置であって、
前記描画データ力 ラスタライズ処理の対象となる第 1の三角形領域を特定する三 角形特定手段と、
前記第 1の三角形領域に含まれる画素を有する画素ブロックを特定するブロック特 定手段と、
前記ブロック特定手段で特定された画素ブロックに、前記第 1の三角形領域と連接 する第 2の三角形領域の画素が含まれる力否かを判別する判別手段と、
前記判別手段で含まれると判別されたときには、前記第 2の三角形領域の画素を 含む画素ブロックをラスタライズ処理して画素データを生成するラスタライズ手段と、 前記ラスタライズ手段で生成された画素ブロックの画素データをメモリに書き込む書 き込み手段と、
前記メモリに書き込まれた画素データに応じた画像を表示させる表示制御手段と を備えることを特徴とする描画装置。
[2] 前記判別手段は、前記ブロック特定手段で特定された画素ブロックに、前記第 1の 三角形領域の後に描画すべき前記第 2の三角形領域の画素が含まれる力否かを判 別する
ことを特徴とする請求項 1記載の描画装置。
[3] 前記判別手段は、前記ブロック特定手段で特定された画素ブロックに、前記第 1の 三角形領域の前に描画対象とされた前記第 2の三角形領域の画素が含まれるか否 かを判別する
ことを特徴とする請求項 1記載の描画装置。
[4] 前記三角形特定手段は、さらに、前記描画データからラスタライズ処理の対象とな る前記第 2の三角形領域を特定し、
ブロック特定手段は、さらに、前記三角形特定手段が前記第 2の三角形領域を特 定したときには、前記第 2の三角形領域に含まれる画素を有する画素ブロックを特定 し、
前記ラスタライズ手段は、さらに、前記三角形特定手段が前記第 2の三角形領域を 特定したときには、前記ブロック特定手段で特定された画素ブロックのうち、前記判別 手段で判別された前記第 1及び第 2の三角形領域の画素を有する画素ブロックを、ラ スタライズ処理の対象から除く
ことを特徴とする請求項 1記載の描画装置。
[5] 前記判別手段は、
前記第 1の三角形領域の一辺を共有する前記第 2の三角形領域に含まれる、前記 一辺の両端にある頂点以外の頂点を、前記描画データ力 特定したときには、 前記第 1の三角形領域の一辺上にある、前記ブロック特定手段で特定された画素 ブロックには、前記第 2の三角形領域の画素が含まれると判別する
ことを特徴とする請求項 1記載の描画装置。
[6] 前記判別手段は、
前記第 1の三角形領域の一辺を共有する他の三角形領域がないことを示す非共有 情報を前記描画データから特定したときには、
前記非共有情報に対応する前記第 1の三角形領域の一辺上にある、前記ブロック 特定手段で特定された画素ブロックには、前記第 2の三角形領域の画素は含まれな いと判別する
ことを特徴とする請求項 1記載の描画装置。
[7] 前記ラスタライズ手段は、
前記判別手段で含まれると判別された画素ブロックをラスタライズ処理の対象から 除き、前記画素ブロックのラスタライズ処理を前記第 2の三角形領域の処理時に行な うべきことを示す除外情報を前記描画データから特定したときには、前記画素ブロッ クに対するラスタライズ処理を禁止する
ことを特徴とする請求項 1記載の描画装置。
[8] 前記描画データは三角形ストリップ形式により構成されている
ことを特徴とする請求項 1記載の描画装置。
[9] 前記描画データは三角形ファン形式により構成されている
ことを特徴とする請求項 1記載の描画装置。
[10] 前記描画データは三角形ストリップ形式と三角形ファン形式とにより構成されている ことを特徴とする請求項 1記載の描画装置。
[11] 前記描画データは三角形メッシュ形式により構成されている
ことを特徴とする請求項 1記載の描画装置。
[12] 描画データをラスタライズ処理して描画する集積回路であって、
前記描画データ力 ラスタライズ処理の対象となる第 1の三角形領域を特定する三 角形特定手段と、
前記第 1の三角形領域に含まれる画素を有する画素ブロックを特定するブロック特 定手段と、
前記ブロック特定手段で特定された画素ブロックに、前記第 1の三角形領域と連接 する第 2の三角形領域の画素が含まれる力否かを判別する判別手段と、
前記判別手段で含まれると判別されたときには、前記第 2の三角形領域の画素を 含む画素ブロックをラスタライズ処理して画素データを生成するラスタライズ手段と、 前記ラスタライズ手段で生成された画素ブロックの画素データをメモリに書き込む書 き込み手段と、
前記メモリに書き込まれた画素データに応じた画像を表示させる表示制御手段と を備えることを特徴とする集積回路。
[13] 描画データをラスタライズ処理して描画する方法であって、
前記描画データ力 ラスタライズ処理の対象となる第 1の三角形領域を特定する三 角形特定ステップと、
前記第 1の三角形領域に含まれる画素を有する画素ブロックを特定するブロック特 定ステップと、
前記ブロック特定ステップで特定された画素ブロックに、前記第 1の三角形領域と連 接する第 2の三角形領域の画素が含まれる力否かを判別する判別ステップと、 前記判別ステップで含まれると判別されたときには、前記第 2の三角形領域の画素 を含む画素ブロックをラスタライズ処理して画素データを生成するラスタライズステツ プと、
前記ラスタライズステップで生成された画素ブロックの画素データをメモリに書き込 む書き込みステップと、 前記メモリに書き込まれた画素データに応じた画像を表示させる表示制御ステップ と
を含むことを特徴とする描画方法。
描画データをラスタライズ処理して描画するためのプログラムであって、 前記描画データ力 ラスタライズ処理の対象となる第 1の三角形領域を特定する三 角形特定ステップと、
前記第 1の三角形領域に含まれる画素を有する画素ブロックを特定するブロック特 定ステップと、
前記ブロック特定ステップで特定された画素ブロックに、前記第 1の三角形領域と連 接する第 2の三角形領域の画素が含まれる力否かを判別する判別ステップと、 前記判別ステップで含まれると判別されたときには、前記第 2の三角形領域の画素 を含む画素ブロックをラスタライズ処理して画素データを生成するラスタライズステツ プと、
前記ラスタライズステップで生成された画素ブロックの画素データをメモリに書き込 む書き込みステップと、
前記メモリに書き込まれた画素データに応じた画像を表示させる表示制御ステップ と
をコンピュータに実行させることを特徴とするプログラム。
PCT/JP2005/014100 2004-08-04 2005-08-02 描画装置 WO2006013849A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN200580026323A CN100595794C (zh) 2004-08-04 2005-08-02 绘制装置
US11/658,559 US7995053B2 (en) 2004-08-04 2005-08-02 Drawing device
JP2006531482A JP4777893B2 (ja) 2004-08-04 2005-08-02 描画装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004-227926 2004-08-04
JP2004227926 2004-08-04

Publications (1)

Publication Number Publication Date
WO2006013849A1 true WO2006013849A1 (ja) 2006-02-09

Family

ID=35787133

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2005/014100 WO2006013849A1 (ja) 2004-08-04 2005-08-02 描画装置

Country Status (4)

Country Link
US (1) US7995053B2 (ja)
JP (1) JP4777893B2 (ja)
CN (1) CN100595794C (ja)
WO (1) WO2006013849A1 (ja)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7671862B1 (en) * 2004-05-03 2010-03-02 Microsoft Corporation Systems and methods for providing an enhanced graphics pipeline
US7696993B2 (en) * 2007-02-08 2010-04-13 Via Technologies, Inc. Geometry primitive type conversion in a GPU pipeline
CN101221624B (zh) * 2007-12-29 2011-07-20 北大方正集团有限公司 一种数据的处理方法及装置
JP5279332B2 (ja) * 2008-04-28 2013-09-04 キヤノン株式会社 画像処理装置、画像処理方法及びプログラム
DE102008057512A1 (de) * 2008-11-15 2010-07-01 Diehl Aerospace Gmbh Verfahren zur Darstellung von Linienzügen
JPWO2011129090A1 (ja) * 2010-04-13 2013-07-11 パナソニック株式会社 符号化歪み除去方法、符号化方法、復号化方法、符号化歪み除去装置、符号化装置、および復号化装置
CN101976448B (zh) * 2010-10-22 2012-04-04 华为技术有限公司 绘图方法及装置
US9721363B2 (en) * 2014-05-19 2017-08-01 Google Inc. Encoding polygon data for fast retrieval and rendering

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09305777A (ja) * 1996-05-10 1997-11-28 Sony Computer Entertainment:Kk 描画処理装置および方法、並びに記録媒体
JP2003123082A (ja) * 2001-10-12 2003-04-25 Sony Corp 画像処理装置、および画像処理方法、並びにコンピュータ・プログラム

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5844576A (en) 1996-12-30 1998-12-01 Cirrus Logic, Inc. Tiled linear host texture storage
US6438266B1 (en) * 1998-08-27 2002-08-20 Lucent Technologies Inc. Encoding images of 3-D objects with improved rendering time and transmission processes
US7079133B2 (en) * 2000-11-16 2006-07-18 S3 Graphics Co., Ltd. Superscalar 3D graphics engine
JP2003263650A (ja) * 2002-03-12 2003-09-19 Sony Corp 画像処理装置およびその方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09305777A (ja) * 1996-05-10 1997-11-28 Sony Computer Entertainment:Kk 描画処理装置および方法、並びに記録媒体
JP2003123082A (ja) * 2001-10-12 2003-04-25 Sony Corp 画像処理装置、および画像処理方法、並びにコンピュータ・プログラム

Also Published As

Publication number Publication date
US7995053B2 (en) 2011-08-09
JP4777893B2 (ja) 2011-09-21
JPWO2006013849A1 (ja) 2008-05-01
CN101014982A (zh) 2007-08-08
CN100595794C (zh) 2010-03-24
US20090009518A1 (en) 2009-01-08

Similar Documents

Publication Publication Date Title
WO2006013849A1 (ja) 描画装置
JP3840014B2 (ja) グラフィックス表示システムの走査変換実施装置
JP4499292B2 (ja) 3次元コンピュータ生成画像のシェーディング
CN103793893B (zh) 采用限缓冲区处理的世界和屏幕空间管线间基元重新排序
US6961065B2 (en) Image processor, components thereof, and rendering method
US9013479B2 (en) Apparatus and method for tile-based rendering
EP2596471B1 (en) Split storage of anti-aliased samples
TWI297469B (en) Mechanism for reducing z buffer traffic in three dimensional graphics processing
EP2854037A1 (en) Cache memory system and operating method for the same
MXPA01010828A (es) Dispositivo de produccion de imagenes.
EP3333806B1 (en) Tiling a primitive in a graphics processing system
CN106067188B (zh) 在图形处理系统中对基元进行图块化
KR20150025594A (ko) 멀티 이미지 레이어 컴포지트 방법
JP2882465B2 (ja) 画像生成方法およびその装置
KR20030005253A (ko) 타일형 그래픽스 아키텍쳐
EP2587454B1 (en) Drawing device and drawing method
JP2012048402A (ja) パターン識別装置及びその制御方法、プログラム
US6940519B2 (en) Graphics processor, graphics card and graphics processing system
JP2003323339A (ja) メモリアクセス装置、半導体デバイス、メモリアクセス制御方法、コンピュータプログラム及び記録媒体
US11748933B2 (en) Method for performing shader occupancy for small primitives
KR100393305B1 (ko) 컴퓨터 판독 가능 기록 매체, 묘화 방법 및 그래픽 묘화장치
US7372466B2 (en) Image processing apparatus and method of same
JP2005346605A (ja) アンチエイリアス描画方法およびこれを用いた描画装置
CN101620743A (zh) 用隐藏面消除的图形处理
US20050052459A1 (en) Method and system for rendering macropixels in a graphical image

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KM KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NG NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SM SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LT LU LV MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

WWE Wipo information: entry into national phase

Ref document number: 2006531482

Country of ref document: JP

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 11658559

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 200580026323.7

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase