[go: up one dir, main page]

JP3872056B2 - Drawing method - Google Patents

Drawing method Download PDF

Info

Publication number
JP3872056B2
JP3872056B2 JP2003379646A JP2003379646A JP3872056B2 JP 3872056 B2 JP3872056 B2 JP 3872056B2 JP 2003379646 A JP2003379646 A JP 2003379646A JP 2003379646 A JP2003379646 A JP 2003379646A JP 3872056 B2 JP3872056 B2 JP 3872056B2
Authority
JP
Japan
Prior art keywords
polygon
pixel
line segment
drawn
adjacent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003379646A
Other languages
Japanese (ja)
Other versions
JP2004078994A (en
Inventor
正昭 岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Interactive Entertainment Inc
Original Assignee
Sony Computer Entertainment Inc
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 Sony Computer Entertainment Inc filed Critical Sony Computer Entertainment Inc
Priority to JP2003379646A priority Critical patent/JP3872056B2/en
Publication of JP2004078994A publication Critical patent/JP2004078994A/en
Application granted granted Critical
Publication of JP3872056B2 publication Critical patent/JP3872056B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Description

本発明は、コンピュータを用いた映像機器であるコンピュータグラフィックスシステム、特殊効果装置、ビデオゲーム機等に用いられる描画方法に関するものである。   The present invention relates to a drawing method used for a computer graphics system, a special effects device, a video game machine, and the like, which are video equipment using a computer.

例えば、家庭用TVゲーム機やパーソナルコンピュータあるいはコンピュータグラフィックスシステム等において、テレビジョン受像機やモニタ受像機あるいは陰極線管(CRT:Cathode
Ray Tube)ディスプレイ装置等に出力して表示する画像のデータ、すなわち表示出力画像データを生成する画像生成装置では、中央演算処理装置(CPU:Central
Processing Unit) とフレームバッファの間に専用の描画装置を設けることにより、高速処理を可能にしている。
For example, in a television game machine for home use, a personal computer, or a computer graphics system, a television receiver, a monitor receiver, or a cathode ray tube (CRT)
Ray Tube) In an image generation apparatus that generates image data to be output and displayed on a display device, that is, display output image data, a central processing unit (CPU: Central
High-speed processing is possible by providing a dedicated drawing device between the Processing Unit) and the frame buffer.

すなわち、上記画像生成装置で3次元の画像を生成する際、CPUは、直接フレームバッファをアクセスするのではなく、座標変換やクリッピング、光源計算等のジオメトリ処理を行い、三角形や4角形等の多角形(ポリゴン)の組み合わせとして3次元の形状を定義して3次元の画像を描画するための描画命令を生成し、その描画命令を描画装置に転送する。   That is, when generating a three-dimensional image with the image generating apparatus, the CPU does not directly access the frame buffer, but performs geometric processing such as coordinate conversion, clipping, and light source calculation, and performs various processes such as triangles and quadrangles. A three-dimensional shape is defined as a combination of polygons (polygons), a drawing command for drawing a three-dimensional image is generated, and the drawing command is transferred to the drawing device.

具体的に説明すると、例えば、図11に示すような3次元の物体200の画像を生成する場合、先ず、CPUは、物体200をポリゴンP201,202,P203の組み合わせとして定義する。 Specifically, for example, when generating an image of a three-dimensional object 200 as shown in FIG. 11, first, the CPU defines the object 200 as a combination of polygons P 201, P 202 , and P 203 .

そして、CPUは、物体200に基いた3次元画像を描画するための各ポリゴンP201,P202,P203に対応した描画命令を生成し、その描画命令を描画装置に転送する。 Then, the CPU generates a drawing command corresponding to each polygon P 201 , P 202 , P 203 for drawing a three-dimensional image based on the object 200 and transfers the drawing command to the drawing device.

描画装置は、CPUから転送されてきた描画命令を解釈して、頂点の色データと奥行きを示すZ値からポリゴンを構成する全ての画素の色とZ値を考慮して、画素データをフレームバッファに書き込むレンダリング処理を行い、フレームバッファに図形を描画する。   The drawing apparatus interprets the drawing command transferred from the CPU, and considers the color and Z value of all the pixels constituting the polygon from the vertex color data and the Z value indicating the depth, and stores the pixel data in the frame buffer. A rendering process is performed to write to the frame buffer, and a figure is drawn in the frame buffer.

尚、上記Z値は、視点からの奥行き方向の距離を示す情報である。   The Z value is information indicating the distance in the depth direction from the viewpoint.

すなわち、描画装置は、例えば、物体200を構成するポリゴンP201,P202,P203のうち図12に示すポリゴンP201を描画する場合、先ず、CPUからの描画命令を解釈することにより、図13に示すように、ポリゴンP201の4頂点(x1,y1),(x2,y2),(x3,y3),(x4,y4)のY座標y1,y2,y3,y4を求め、Y座標の最大値Ymax(=y3)及び最小値Ymin(=y1)を求める。 That is, for example, when drawing the polygon P 201 shown in FIG. 12 among the polygons P 201 , P 202 and P 203 constituting the object 200, the drawing apparatus first interprets the drawing command from the CPU, thereby 13, Y coordinates y 1 , y of the four vertices (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), (x 4 , y 4 ) of the polygon P 201 2 , y 3 , y 4 are obtained, and the maximum value Y max (= y 3 ) and the minimum value Y min (= y 1 ) of the Y coordinate are obtained.

ここで、図14に示すように、フレームバッファ300における画素Dnは格子状に並んでいるが、ポリゴンP201の4頂点(x1,y1),(x2,y2),(x3,y3),(x4,y4)は、格子点と必ずしも一致していない。 Here, as shown in FIG. 14, the pixels Dn in the frame buffer 300 are arranged in a lattice pattern, but the four vertices (x 1 , y 1 ), (x 2 , y 2 ), (x 3 ) of the polygon P 201 are arranged. , Y 3 ), (x 4 , y 4 ) do not necessarily match the lattice points.

そこで、描画装置は、Y座標の最小値Yminと最大値Ymaxに対して、値の切捨処理及び切上処理を行い、ポリゴンP201と交差する水平画素ラインLH2〜LH17を求める。そして、描画装置は、ポリゴンP201と水平画素ラインLH2〜LH17の交点を求める。 Therefore, the drawing apparatus performs a value truncation process and a round-up process on the minimum value Y min and the maximum value Y max of the Y coordinate to obtain horizontal pixel lines L H2 to L H17 that intersect with the polygon P 201. . Then, the drawing apparatus obtains intersections between the polygon P 201 and the horizontal pixel lines L H2 to L H17 .

次に、描画装置は、交点のX座標の値に対して、値の切捨処理を行い、ポリゴンP201に含まれる画素のX座標の最大値Xmax及び最小値Xminを求める。 Next, the drawing apparatus performs a value truncation process on the value of the X coordinate of the intersection, and obtains the maximum value X max and the minimum value X min of the X coordinate of the pixel included in the polygon P 201 .

そして、描画装置は、水平画素ラインLH2〜LH17において、X座標の最小値Xmin〜最大値Xmaxの範囲内に含まれる画素を各水平画素ライン毎にフレームバッファに書き込む。 Then, the drawing apparatus writes, in the horizontal pixel lines L H2 to L H17 , pixels included in the range of the X coordinate minimum value X min to the maximum value X max in the frame buffer for each horizontal pixel line.

しかし、従来の描画装置により、上述のようにしてポリゴンP201がフレームバッファに描画された結果、図15に示すように、ポリゴンP201の境界(エッジ)Eは、ギザギザの状態(以下、ギザリと言う。)であった。 However, as a result of the polygon P 201 being drawn in the frame buffer by the conventional drawing apparatus as described above, the boundary (edge) E of the polygon P 201 is in a jagged state (hereinafter referred to as jagged) as shown in FIG. Say.)

そこで、上記描画装置では、ギザリを除去する方法として、例えば、サブピクセル法や背景混合法等が採用されていた。   Therefore, in the above drawing apparatus, for example, a subpixel method, a background mixing method, or the like has been adopted as a method for removing the roughness.

サブピクセル法とは、実際の表示解像度より高い解像度でポリゴンをフレームバッファに描画し、最後にローバスフィルタをかけて実際の表示解像度に落とすことにより、ギザリを除去する方法である。   The sub-pixel method is a method for removing a roughness by drawing a polygon in a frame buffer at a higher resolution than the actual display resolution and finally applying a low-pass filter to lower the actual display resolution.

具体的に説明すると、まず、図16(a)は、上記図12に示したポリゴンP201を、水平(H)方向及び垂直(V)方向各々表示解像度に対して2倍の解像度でフレームバッファに描画した状態を示した図である。すなわちフレームバッファの1画素(ピクセル)Dnは、2×2画素のサブピクセルSDn1〜SDn4に対応している。したがって、サブピクセルSDn1〜SDn4の中には、複数の色が含まれている。そこで、各ピクセル毎に、サブピクセルSDn1〜SDn4の中に含まれる複数の色の平均値を求め、その平均値を表示画素の色とする。 Specifically, first, FIG. 16A shows the frame buffer of the polygon P 201 shown in FIG. 12 at a resolution twice as high as the display resolution in each of the horizontal (H) direction and the vertical (V) direction. It is the figure which showed the state drawn in. That is, one pixel (pixel) D n of the frame buffer corresponds to 2 × 2 sub-pixels SD n1 to SD n4 . Therefore, the subpixels SD n1 to SD n4 include a plurality of colors. Therefore, for each pixel, an average value of a plurality of colors included in the subpixels SD n1 to SD n4 is obtained, and the average value is set as the color of the display pixel.

例えば、上記図16(a)に示すように、背景B及びポリゴンP201の各色が各々1色である場合、サブピクセルSDn1〜SDn4の中に含まれる複数の色の平均値は、サブピクセルSDn1〜SDn4全てが背景Bの色、サブピクセルSDn1〜SDn4のうち1サブピクセルのみがポリゴンP201の色、サブピクセルSDn1〜SDn4のうち2サブピクセルのみがポリゴンP201の色、サブピクセルSDn1〜SDn4のうち3サブピクセルのみがポリゴンP201の色、及びサブピクセルSDn1〜SDn4全てがポリゴンP201の色から得られる5段階の色のうちの何れかをとる。 For example, as shown in FIG. 16A, when each color of the background B and the polygon P 201 is one color, the average value of the plurality of colors included in the sub-pixels SD n1 to SD n4 is pixels SD n1 to SD n4 color of all the background B, the sub-pixels SD n1 to SD 1 only subpixel polygon P 201 colors out of n4, 2 only subpixel polygon P 201 of the sub-pixels SD n1 to SD n4 color, either 3 colors only subpixels polygon P 201, and the sub-pixels SD n1 to SD n4 all of the color out of 5 obtained from the color of the polygon P 201 of the sub-pixels SD n1 to SD n4 Take.

したがって、上記図16(b)に示すように、ポリゴンP201は、5段階の色を有する表示画素によりフレームバッファに描画されることとなる。 Therefore, as shown in FIG. 16B, the polygon P 201 is drawn in the frame buffer by display pixels having five levels of colors.

しかし、上述のようなサブピクセル法を採用した従来の描画装置では、実際の表示解像度より高い解像度で描画を行う必要があるため、実際の表示解像度より高い解像度のフレームバッファを設ける必要があった。これにより、上記描画装置のハードウェア規模が大きくなってしまっていた。   However, in the conventional drawing apparatus adopting the subpixel method as described above, it is necessary to perform drawing at a resolution higher than the actual display resolution, so it is necessary to provide a frame buffer having a resolution higher than the actual display resolution. . As a result, the hardware scale of the drawing apparatus has increased.

一方、背景混合法とは、ポリゴンの真のエッジが画素と交差するとき、ポリゴンの内部がその画素の中に占める割合を求め、その割合でポリゴンの色と背景の色の混合を行うことにより、ギザリを除去する方法である。   On the other hand, in the background mixing method, when the true edge of a polygon intersects with a pixel, the ratio of the polygon's interior to the pixel is calculated, and the polygon color and background color are mixed at that ratio. This is a method for removing the gap.

具体的に説明すると、まず、図17は、背景混合法によりギザリを除去して上記図12に示したポリゴンP201をフレームバッファに描画した状態を示した図である。 Specifically, FIG. 17 is a diagram showing a state where the polygon P 201 shown in FIG. 12 is drawn in the frame buffer after removing the gap by the background mixing method.

例えば、上記図17に示すように、背景Bの色が「緑」であり、ポリゴンP201の色が「青」であった場合、ポリゴンP201のエッジE1の画素の色は、「緑青」となる。 For example, as shown in FIG. 17, when the color of the background B is “green” and the color of the polygon P 201 is “blue”, the color of the pixel at the edge E1 of the polygon P 201 is “green blue”. It becomes.

また、図18に示すように、「赤」色のポリゴンP202をポリゴンP201に隣接して描画した場合、ポリゴンP202のエッジE2の画素の色は、「緑赤」となり、ポリゴンP201とポリゴンP202が共有するエッジE12の画素の色は、エッジE1の画素の色「緑青」に「赤」を加えた「緑青赤」となる。 As shown in FIG. 18, when the “red” polygon P 202 is drawn adjacent to the polygon P 201 , the color of the pixel of the edge E 2 of the polygon P 202 is “green red”, and the polygon P 202 The color of the pixel of the edge E 12 shared by 201 and the polygon P 202 is “green blue red” obtained by adding “red” to the color “green blue” of the pixel of the edge E 1.

ここで、ポリゴンP201とポリゴンP202が共有するエッジE12では、背景Bは見えないはずであるため、エッジE12の画素の色は「青赤」となるべきであるが、上述したように、エッジE12の画素の色は「緑青赤」となり、背景Bの色が現れてしまっていた。 Here, since the background B should not be visible at the edge E 12 shared by the polygon P 201 and the polygon P 202 , the pixel color of the edge E 12 should be “blue-red”. In addition, the color of the pixel at the edge E12 is “green blue red”, and the color of the background B appears.

すなわち、上述のような背景混合法を採用した従来の描画装置では、見えるはずのない背景の色までエッジの色と混合されることにより、背景の色のにじみが生じてしまっていた。   That is, in the conventional drawing apparatus employing the background mixing method as described above, the background color is blurred by being mixed with the edge color up to the background color that should not be seen.

そこで、本発明は、上述の如き従来の実情に鑑みてなされたものであり、次のような目的を有するものである。   Accordingly, the present invention has been made in view of the above-described conventional situation and has the following objects.

即ち、本発明の目的は、小規模のハードウェアで高精度の描画を行うことができる描画方法を提供することにある。   That is, an object of the present invention is to provide a drawing method capable of performing high-precision drawing with small-scale hardware.

上述の課題を解決するために、本発明に係る描画方法は、コンピュータグラフィックスにより生成された多角形からなる形状データをフレームメモリ上に描画する描画方法であって、上記フレームメモリに描画された多角形の輪郭部分に対して、上記多角形の輪郭部分に対応する頂点を結ぶ線分を上書きすることを特徴とする。
例えば、本願発明の描画方法は、CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置が実行する描画方法であって、前記描画装置が、前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の過程と、描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の過程と、を実行するものであり、前記第1の過程で、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分の一部が隣接するポリゴンの輪郭部分と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするとともに、前記第2の過程では、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うものとする。
或いは、CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置が実行する描画方法であって、前記描画装置が、前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の過程と、描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の過程と、を実行するものであり、前記第1の過程で、前記ポリゴンが複数、順に描画される場合において、描画されるポリゴンの一部が隣接するポリゴンの一部と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンの一部を上書きするようにするとともに、前記第2の過程では、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行う、ものとすることもできる。
また、本願発明の描画装置は、例えば、CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、を備えてなり、前記第1の手段は、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分が隣接するポリゴンの輪郭部分と重複する場合には、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするようになっているとともに、前記第2の手段は、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっているものとすることができる。
或いは、PUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、を備えてなり、前記第1の手段は、前記ポリゴンが複数、順に描画される場合において、描画されるポリゴンの一部が隣接するポリゴンの一部と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンの一部を上書きするようになっているともに、
前記第2の手段は、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっている、ものとすることもできる。
これらは、ギザリ除去なしの描画処理を行った後に、ギザリ除去処理を行うものであるため、背景の色等本来見えるべきでない色の現れを防ぐことができる。
In order to solve the above-described problems, a drawing method according to the present invention is a drawing method for drawing shape data composed of polygons generated by computer graphics on a frame memory, and is drawn in the frame memory. A line segment connecting vertices corresponding to the polygon outline portion is overwritten on the polygon outline portion.
For example, the drawing method of the present invention is a drawing method executed by a drawing device that draws an image including a polygon that is a polygon on a frame memory based on a drawing command from a CPU, and the drawing device includes: Based on the drawing command from the CPU, the first process of drawing the polygon on the frame memory and the line segment of the predetermined width connecting the vertices of the polygon are overwritten on the drawn outline of the polygon. In the first process, the polygons are drawn in order so that a plurality of the polygons are adjacent to each other, and those adjacent to each other share a vertex. When a part of the outline part of the polygon overlaps with the outline part of the adjacent polygon, the polygon drawn earlier is overwritten by the polygon drawn later. In the second process, the pixel value of the pixel on which the line segment of the predetermined width is drawn is determined based on the pixel value of the pixel on the two polygons adjacent to the pixel, and the determined value It is assumed that overwriting with the line segment is performed using a pixel value.
Alternatively, a drawing method executed by a drawing device that draws an image including a polygon that is a polygon on a frame memory based on a drawing command from the CPU, wherein the drawing device is based on the drawing command from the CPU. A first process of drawing a polygon on the frame memory, a second process of overwriting a line segment of a predetermined width connecting the vertices of the polygon with respect to the drawn outline portion of the polygon, In the first process, when a plurality of polygons are drawn in order in the first step, when a part of the drawn polygon overlaps with a part of the adjacent polygon, the polygon drawn later In the second process, the pixel value of the pixel on which the line segment having the predetermined width is drawn is changed to be overwritten. It determined based on the pixel values of the pixels of two polygons that are adjacent to the element, overwriting by the line segment using the determined its pixel value may be a thing.
The drawing device of the present invention is a drawing device that draws an image including a polygon, which is a polygon, on a frame memory based on a drawing command from the CPU, for example, and is based on the drawing command from the CPU. A first means for drawing a polygon on a frame memory; and a second means for overwriting a line segment having a predetermined width connecting the vertices of the polygon with respect to the contour portion of the drawn polygon. In the case where a plurality of the polygons are adjacent to each other and are drawn in order so that the adjacent polygons share a vertex, the first means includes the polygons whose contour portions are adjacent to each other. In the case where it overlaps with the contour portion, the polygon drawn earlier is overwritten by the polygon drawn later, and the second means A pixel value of a pixel on which the line segment having the predetermined width is drawn is determined based on pixel values of pixels on two polygons adjacent to the pixel, and the determined pixel value is used to determine the pixel value. It can be assumed to be overwritten.
Alternatively, the drawing apparatus draws an image including a polygon, which is a polygon, on the frame memory based on a drawing command from the PU, and draws the polygon on the frame memory based on the drawing command from the CPU. First means and second means for overwriting a line segment having a predetermined width connecting the vertices of the polygons with respect to the contour portion of the drawn polygons. In the case where a plurality of polygons are drawn in order and a part of the drawn polygon overlaps with a part of the adjacent polygon, a part of the polygon drawn earlier by the polygon drawn later is Both are overwritten,
The second means determines a pixel value of a pixel on which the line segment having the predetermined width is drawn based on pixel values of two polygon pixels adjacent to the pixel, and determines the determined pixel value. It is also possible to use the above-mentioned line segment for overwriting.
Since these perform the removal process after performing the drawing process without the removal of the gap, it is possible to prevent the appearance of a color that should not be visible such as the background color.

前記描画装置は、前記所定の幅の線分が描画される前記画素の画素値を、当該画素に隣接する画素の画素値と、前記ポリゴンの前記頂点同士を結んだ線分上の理想点に配されるはずだった画素値とに基いて決定するようになっていてもよい。   The drawing apparatus sets the pixel value of the pixel on which the line segment of the predetermined width is drawn to an ideal point on the line segment connecting the pixel value of a pixel adjacent to the pixel and the vertices of the polygon. It may be determined based on the pixel value that should have been arranged.

前記描画方法では、前記所定の幅の線分を、前記ポリゴンの前記頂点同士を結んだ線分が通る画素と、それに隣接する画素とにより描画するようにしてもよい。   In the drawing method, the line segment having the predetermined width may be drawn by a pixel through which a line segment connecting the vertices of the polygon passes and a pixel adjacent thereto.

前記描画方法では、上記線分上の各画素の画素値に重み付けし、その重みに応じて、上記線分上の画素値と内挿する画素を選択するようにしてもよい。   In the drawing method, the pixel value of each pixel on the line segment may be weighted, and a pixel to be interpolated with the pixel value on the line segment may be selected according to the weight.

本発明に係る描画方法では、フレームメモリに描画された多角形の輪郭部分に対して、上記多角形の輪郭部分に対応する頂点を結ぶ線分を上書きする。これにより、上記描画方法は、多角形で構成される物体全体のギザリを容易に除去することができ、背景の色等本来見えるべきでない色の現れを防ぐことができる。したがって、上記描画方法は、小規模のハードウェアで高精度の描画を行うことができる。   In the drawing method according to the present invention, the line segment connecting the vertices corresponding to the polygonal outline part is overwritten on the polygonal outline part drawn in the frame memory. As a result, the drawing method can easily remove the entire object composed of polygons, and can prevent the appearance of colors that should not be visible, such as the background color. Therefore, the drawing method can perform high-precision drawing with small-scale hardware.

また、本発明に係る描画方法では、上記輪郭部分に隣接した画素値を用いて、上記線分を上記輪郭部分に上書きする。これにより、上記描画方法は、背景のにじみを防ぐことができる。したがって、上記描画方法は、さらに高精度の描画を行うことができる。   In the drawing method according to the present invention, the line segment is overwritten on the contour portion using a pixel value adjacent to the contour portion. Thereby, the drawing method can prevent background blur. Therefore, the drawing method can perform drawing with higher accuracy.

また、本発明に係る描画方法では、隣接する多角形により重複した輪郭部分に対しては、上記輪郭部分の画素値に背景の画素値を混合させた画素値を上書きする。これにより、上記描画方法は、隣接する多角形により完全に上書きされる画素が発生する場合でも、多角形で構成される物体全体のギザリを除去することができ。したがって、上記描画方法は、さらに高精度の描画を行うことができる。   In the drawing method according to the present invention, the pixel value obtained by mixing the pixel value of the background with the pixel value of the contour portion is overwritten on the contour portion overlapped by the adjacent polygon. As a result, the drawing method can remove the entire object composed of polygons even when pixels that are completely overwritten by adjacent polygons are generated. Therefore, the drawing method can perform drawing with higher accuracy.

また、本発明に係る描画方法では、上記線分上の各画素値に重み付けし、その重みに応じて、上記線分上の画素値と内挿する画素値を選択する。これにより、上記描画方法では、同じ画素を隣接する多角形が共有する場合でも、必ず異なる値をとる。したがって、上記描画方法は、背景のにじみを防ぐことができるため、さらに高精度の描画を行うことができる。   In the drawing method according to the present invention, each pixel value on the line segment is weighted, and a pixel value to be interpolated with the pixel value on the line segment is selected according to the weight. Thus, in the above drawing method, even when adjacent polygons share the same pixel, different values are always taken. Therefore, since the drawing method can prevent background blurring, drawing with higher accuracy can be performed.

以下、発明の実施の形態について、図面を参照して詳細に説明する。   Hereinafter, embodiments of the invention will be described in detail with reference to the drawings.

本発明に係る描画方法は、図1に示すような描画装置100により実施される。   The drawing method according to the present invention is implemented by a drawing apparatus 100 as shown in FIG.

この描画装置100は、ピクセルエンジン101と、ピクセルエンジン101の出力が供給されるFIFO(First in First out)バッファ102と、FIFOバッファ102の出力が供給される演算回路104及びキャッシュメモリ制御回路103と、演算回路104及びキャッシュメモリ制御回路103の各出力が供給されるキャッシュメモリ105と、キャッシュメモリ105と接続されたフレームメモリ106とを備えている。   The drawing apparatus 100 includes a pixel engine 101, a FIFO (First in First Out) buffer 102 to which an output of the pixel engine 101 is supplied, an arithmetic circuit 104 and a cache memory control circuit 103 to which an output of the FIFO buffer 102 is supplied. , A cache memory 105 to which outputs of the arithmetic circuit 104 and the cache memory control circuit 103 are supplied, and a frame memory 106 connected to the cache memory 105.

まず、描画装置100の一連の動作について説明する。   First, a series of operations of the drawing apparatus 100 will be described.

ピクセルエンジン101には、例えば、図示していないCPUからの描画命令が供給される。この描画命令は、3角形や4角形などの基本的な単位図形(ポリゴン)や線分の組み合わせとして3次元モデルを定義して3次元画像を描画するための各ポリゴンに対応する命令である。   For example, a drawing command from a CPU (not shown) is supplied to the pixel engine 101. This drawing command is a command corresponding to each polygon for drawing a three-dimensional image by defining a three-dimensional model as a combination of basic unit graphics (polygons) such as triangles and quadrangles and line segments.

そこで、ピクセルエンジン101は、上記CPUからの描画命令を解釈して、描画する画素データをFIFOバッファ102に一旦格納する。この画素データは、例えば、画素を書き込む位置、Z値、及びカラー値からなるデータである。   Therefore, the pixel engine 101 interprets the drawing command from the CPU and temporarily stores the pixel data to be drawn in the FIFO buffer 102. The pixel data is, for example, data including a pixel writing position, a Z value, and a color value.

演算回路104は、FIFOバッファ102から画素データを読み出し、ポリゴンを構成する全ての画素の色とZ値を考慮して、FIFOバッファ102から読み出した画素データをキャッシュメモリ105を介してフレームメモリ106に書き込む。また、演算回路104は、キャッシュメモリ105を介してフレームメモリ106に画素データを書き込む際に、Zバッファ処理、半透明処理、アンチアリシング処理、及びフィルタリング処理等を行う。   The arithmetic circuit 104 reads out the pixel data from the FIFO buffer 102 and takes the pixel data read out from the FIFO buffer 102 into the frame memory 106 via the cache memory 105 in consideration of the colors and Z values of all the pixels constituting the polygon. Write. The arithmetic circuit 104 performs Z buffer processing, translucent processing, anti-aliasing processing, filtering processing, and the like when writing pixel data to the frame memory 106 via the cache memory 105.

また、演算回路104は、キャッシュメモリ105を介してフレームメモリ106から画素データを読み出し、読み出した画素データに対してギザリ除去処理を行う。   Further, the arithmetic circuit 104 reads out pixel data from the frame memory 106 via the cache memory 105, and performs a removal process on the read out pixel data.

尚、演算回路104が行うギザリ除去処理についての詳細な説明は後述する。   A detailed description of the jaggedness removal processing performed by the arithmetic circuit 104 will be described later.

このとき、キャッシュメモリ105を制御するキャッシュメモリ制御回路103は、FIFOメモリ102に一旦格納された画素データを予め読み出すことにより、キャッシュメモリ105で必要とされるデータ領域を予め認識する。そして、キャッシュメモリ制御回路103は、フレームメモリ106のワード境界及びページ境界にまたがらずに上記データ領域に対応する画素データをまとめてフレームメモリ106から読み出すように、また、上記データ領域に対応する画素データをまとめてフレームメモリ106に書き込むようにキャッシュメモリ105を制御する。これにより、キャッシュメモリ105は、アクセス時間を短縮してフレームメモリ106をアクセスすると共に、フレームメモリ106に対するアクセスを少ない回数で行うようになされている。   At this time, the cache memory control circuit 103 that controls the cache memory 105 reads in advance the pixel data once stored in the FIFO memory 102, thereby recognizing in advance a data area required in the cache memory 105. Then, the cache memory control circuit 103 reads the pixel data corresponding to the data area from the frame memory 106 without crossing the word boundary and page boundary of the frame memory 106, and also corresponds to the data area. The cache memory 105 is controlled so that the pixel data is collectively written in the frame memory 106. As a result, the cache memory 105 accesses the frame memory 106 by shortening the access time, and performs access to the frame memory 106 with a small number of times.

フレームメモリ106は、図示していないが、Zバッファ及びフレームバッファからなる。上記Zバッファは、画素データに含まれるZ値を格納するバッファであり、上記フレームバッファは、画素データに含まれるカラー値を格納するバッファである。   Although not shown, the frame memory 106 includes a Z buffer and a frame buffer. The Z buffer is a buffer that stores a Z value included in pixel data, and the frame buffer is a buffer that stores a color value included in pixel data.

そこで、フレームメモリ106は、キャッシュメモリ制御回路103の制御に基いてキャッシュメモリ105からアクセスされることにより、演算回路104からキャッシュメモリ105を介して画素データが書き込まれると共に、書き込まれた画素データをキャッシュメモリ105を介して演算回路104に対して出力する。   Therefore, the frame memory 106 is accessed from the cache memory 105 based on the control of the cache memory control circuit 103, so that the pixel data is written from the arithmetic circuit 104 via the cache memory 105, and the written pixel data is stored in the frame memory 106. The data is output to the arithmetic circuit 104 via the cache memory 105.

また、フレームメモリ106は、書き込まれた画素データ、すなわち描画された画素データをビデオ信号として、図示していないテレビジョン受像機やモニタ受像機等に供給する。   The frame memory 106 supplies the written pixel data, that is, the drawn pixel data, as a video signal to a television receiver, a monitor receiver, or the like (not shown).

これにより、上記テレビジョン受像機やモニタ受像機等は、フレームメモリ106からの画素データに基いた画像を表示出力する。   As a result, the television receiver, the monitor receiver, and the like display and output an image based on the pixel data from the frame memory 106.

つぎに、演算回路104が行うギザリ除去処理について具体的に説明する。   Next, the grind removal process performed by the arithmetic circuit 104 will be specifically described.

例えば、図2に示すような4つのポリゴンP1〜P4から構成される3次元モデルをフレームメモリ106に描画する場合、先ず、演算回路104は、ギザリ除去処理を行わずにポリゴンP1〜P4をキャッシュメモリ105を介してフレームメモリ106に描画する。 For example, when a three-dimensional model composed of four polygons P 1 to P 4 as shown in FIG. 2 is drawn in the frame memory 106, first, the arithmetic circuit 104 performs polygon P 1 to P 4 is drawn in the frame memory 106 via the cache memory 105.

ここで、フレームメモリ106に描画されたポリゴンP1〜P4は、例えば、ポリゴンP3とポリゴンP4が共有するエッジE34では、ポリゴンP3のエッジの画素とポリゴンP4のエッジの画素が重複し、ポリゴンP2とポリゴンP3が共有するエッジE23では、ポリゴンP2のエッジの画素とポリゴンP3のエッジの画素が重複せずに隣接した状態である。すなわち、各ポリゴンの頂点を共有しているエッジでは、ポリゴンがすきまなく並んでいる状態である。 Here, the frame polygon P 1 to P 4 which is drawn in the memory 106, for example, the edge E 34 polygon P 3 and a polygon P 4 share an edge pixel and the edge of the pixel of the polygon P 4 of the polygon P 3 Are overlapped, and the edge E 23 shared by the polygon P 2 and the polygon P 3 is a state in which the pixel of the edge of the polygon P 2 and the pixel of the edge of the polygon P 3 are adjacent without overlapping. That is, at the edge sharing the vertexes of the polygons, the polygons are arranged without gaps.

したがって、ポリゴンP1,P2,P3,P4の順に各ポリゴンをフレームメモリ106に描画した場合、図3に示すように、各ポリゴンの頂点を共有しているエッジには、後に描画されたポリゴンの画素が書き込まれる。 Therefore, when the polygons are drawn in the frame memory 106 in the order of the polygons P 1 , P 2 , P 3 , and P 4 , as shown in FIG. 3, the polygons are drawn later on the edges sharing the vertices of the polygons. Polygon pixels are written.

次に、演算回路104は、ギザリ除去処理を行わずにフレームメモリ106に描画したポリゴンP1〜P4に対して、ポリゴンP1〜P4の各エッジを構成する頂点を結ぶ。 Next, the arithmetic circuit 104 connects the vertices constituting the edges of the polygons P 1 to P 4 to the polygons P 1 to P 4 drawn in the frame memory 106 without performing the removal processing.

すなわち、演算回路104は、例えば、ポリゴンP1とポリゴンP4が隣接した部分のエッジを構成する頂点Q1とQ2を結ぶ。これらの頂点Q1とQ2を結んで得られた線分L12は、1画素分の幅を有するスムーズな線分である。 That is, the arithmetic circuit 104 connects, for example, the vertices Q 1 and Q 2 constituting the edge of the portion where the polygon P 1 and the polygon P 4 are adjacent to each other. A line segment L 12 obtained by connecting these vertices Q 1 and Q 2 is a smooth line segment having a width of one pixel.

そして、演算回路104は、線分L12を、線分L12に最も近い2つの画素と線分L12の距離により内挿されたスムーズな線分としてキャッシュメモリ105を介してフレームメモリ106に描画する。 Then, the arithmetic circuit 104, the line segment L 12, the frame memory 106 via cache memory 105 as a smooth line segment interpolated by the distance of the nearest two pixel line segment L 12 to the line segment L 12 draw.

また、演算回路104は、他のエッジを構成する頂点を結んで得られた線分についても、図4に示すように頂点Q1とQ2を結んで得られた線分L12と同様にして、キャッシュメモリ105を介してフレームメモリ106に描画する。 Further, the arithmetic circuit 104 makes the line segment obtained by connecting the vertices constituting other edges the same as the line segment L 12 obtained by connecting the vertices Q 1 and Q 2 as shown in FIG. Then, the image is drawn in the frame memory 106 via the cache memory 105.

上述のように、演算回路104は、ギザリ除去処理を行わずにフレームメモリ106にポリゴンを描画した後、上記ポリゴンのエッジを構成する頂点を結んで得られるスムーズな線分を上書きすることにより、上記ポリゴンのギザリを除去するようになされている。   As described above, the arithmetic circuit 104 draws a polygon in the frame memory 106 without performing the removal process, and then overwrites a smooth line segment obtained by connecting the vertices constituting the edge of the polygon, The above-mentioned polygonal burrs are removed.

図5は、演算回路104のギザリ除去処理を具体的に示したフローチャートである。以下、上記図5を用いて、演算回路104のギザリ除去処理について具体的に説明する。   FIG. 5 is a flowchart specifically showing the jagged removal processing of the arithmetic circuit 104. Hereinafter, with reference to FIG. 5 described above, the grind removal processing of the arithmetic circuit 104 will be specifically described.

例えば、ポリゴンのエッジを構成する頂点を結んで得られたスムーズな線分が、図6に示すような垂直に近い線分Lnであり、線分Lnを上から下に描画する場合、先ず、上記図6に示すように、線分Lnの始点を(X1,Y1)とし、終点を(X2,Y2)とする。そして、始点(X1,Y1)と終点(X2,Y2)のX座標における差分dx及びY座標における差分dyを、dx
= X2−X1dy = Y2−Y1なる演算式により求める(ステップS1)。
For example, when a smooth line segment obtained by connecting the vertices constituting the edge of a polygon is a line segment L n close to the vertical as shown in FIG. 6 and the line segment L n is drawn from the top to the bottom, first, as shown in FIG. 6, the starting point of the line segment L n and (X1, Y1), to the end point as (X2, Y2). Then, the difference dx in the X coordinate between the start point (X1, Y1) and the end point (X2, Y2) and the difference dy in the Y coordinate are expressed as dx.
= X2−X1dy = Y2−Y1 is obtained by an arithmetic expression (step S1).

次に、ステップS1で得られた差分dx,dyを用いて、線分Lnの傾きSを、 S = dx/dyなる演算式により求める(ステップS2)。 Next, using the difference dx, dy obtained in step S1, the slope S of the line segment L n is obtained by an arithmetic expression of S = dx / dy (step S2).

次に、理想点(Fx,Fy)の初期値を、Fx = X1、Fy = Y1に設定する(ステップS3)。   Next, initial values of ideal points (Fx, Fy) are set to Fx = X1, Fy = Y1 (step S3).

次に、理想点(Fx,Fy)を整数化した(Nx,Ny)を、Nx = [Fx]
Ny = [Fy]
なる演算式により求める(ステップS4)。
Next, the ideal point (Fx, Fy) is converted into an integer (Nx, Ny), and Nx = [Fx]
Ny = [Fy]
It calculates | requires by the computing equation which becomes (step S4).

尚、ステップS4の演算式において、"[]"は、ガウス記号を示す。   In the arithmetic expression in step S4, “[]” indicates a Gaussian symbol.

次に、ステップS4で得られた(Nx,Ny)に書き込む画素の値を求めて、求めた画素値を(Nx,Ny)に書き込む(ステップS5)。   Next, the value of the pixel written in (Nx, Ny) obtained in step S4 is obtained, and the obtained pixel value is written in (Nx, Ny) (step S5).

例えば、(Nx,Ny)の隣の(Nx−1,Ny)の画素値をCol1とし、線分Ln上の理想点(Fx,Fy)の画素値をCol0とした場合、(Nx,Ny)に書き込む画素値Col_Lは、Col_L=(Fx−Nx)*Col1+(1−Fx+Nx)*Col0なる演算式により求められる。   For example, when the pixel value of (Nx−1, Ny) next to (Nx, Ny) is Col1, and the pixel value of the ideal point (Fx, Fy) on the line segment Ln is Col0, (Nx, Ny) The pixel value Col_L to be written to is obtained by the following equation: Col_L = (Fx−Nx) * Col1 + (1−Fx + Nx) * Col0.

次に、(Nx,Ny)の隣の(Nx+1,Ny)に書き込む画素の値を求めて、求めた画素値を(Nx+1,Ny)に書き込む(ステップS6)。   Next, the value of the pixel to be written to (Nx + 1, Ny) next to (Nx, Ny) is obtained, and the obtained pixel value is written to (Nx + 1, Ny) (step S6).

例えば、(Nx+1,Ny)の隣の(Nx+2,Ny)の画素値をCol2とし、線分Ln上の理想点(Fx,Fy)の画素値をCol0とした場合、(Nx+1,Ny)に書き込む画素値Col_Rは、Col_R=(Fx−Nx)*Col0+(1−Fx+Nx)*Col2なる演算式により求められる。   For example, when the pixel value of (Nx + 2, Ny) next to (Nx + 1, Ny) is Col2 and the pixel value of the ideal point (Fx, Fy) on the line segment Ln is Col0, the pixel value is written to (Nx + 1, Ny). The pixel value Col_R is obtained by the following equation: Col_R = (Fx−Nx) * Col0 + (1−Fx + Nx) * Col2.

次に、次の理想点(Fx,Fy)を、Fx = Fx+(dx/dy)
Fy = Fy+1なる演算式により求める(ステップS7)。
Next, the next ideal point (Fx, Fy) is expressed as Fx = Fx + (dx / dy)
Fy = Fy + 1 is obtained by an arithmetic expression (step S7).

そして、ステップS7で得られた"Fy"の値が線分Lnの終点(X2,Y2)のY座標(=Y2)の値以下であるか否か判断する。すなわち、線分Lnの終点(X2,Y2)までの各理想点(Fx,Fy)に対する画素の書込処理を終了したか否かを判断する(ステップS8)。 Then, the obtained value of "Fy" in step S7, it is determined whether or not less than the value of the Y coordinate of the end point of the line segment L n (X2, Y2) ( = Y2). That is, it is determined whether to exit the writing process of the pixel with respect to the end point of the line segment L n (X2, Y2) each ideal point to (Fx, Fy) (step S8).

ステップS8にて、線分Lnの終点(X2,Y2)までの各理想点(Fx,Fy)に対する画素の書込処理が終了していないと判断した場合には、ステップS4の処理に戻り、ステップS4〜ステップS8の各処理を行う。 In step S8, if the end point of the line segment L n (X2, Y2) each ideal point to (Fx, Fy) writing process of pixels to have been determined not to be finished, the process returns to step S4 Each process of step S4 to step S8 is performed.

一方、ステップS8にて、線分Lnの終点(X2,Y2)までの各理想点(Fx,Fy)に対する画素の書込処理が終了した判断した場合には、本フローチャートの処理を終了する。 On the other hand, in step S8, if it is determined the end point of the line segment L n (X2, Y2) each ideal point to (Fx, Fy) writing process of pixels to have been completed, and terminates the processing of this routine .

上述のように、演算回路104では、線分Lnの方向に垂直で理想点(Fx,Fy)に最も近い2画素(=(Nx,Ny),(Nx+1,Ny))を、線分Ln上の理想点(Fx,Fy)に描画するようになされている。 As described above, in the arithmetic circuit 104, an ideal point perpendicular to the direction of the line segment Ln (Fx, Fy) closest to 2 pixels (= (Nx, Ny), (Nx + 1, Ny)) and the line segment L n Drawing is performed at the upper ideal point (Fx, Fy).

また、演算回路104では、理想点(Fx,Fy)に描画する2画素(=(Nx,Ny),(Nx+1,Ny))としてどの2画素を用いるかは、線分Lnの方向が水平に近いか、又は垂直に近いかにより決定するようになされている。 Further, the arithmetic circuit 104, two pixels to be drawn in ideal point (Fx, Fy) (= ( Nx, Ny), (Nx + 1, Ny)) is the method of using the two pixels as the direction of the line segment L n horizontal It is determined depending on whether it is close to or vertical.

したがって、演算回路104でギザリ除去処理が行われた結果、上記図3に示したポリゴンP1〜P4は、図7に示すように、全てのポリゴンP1〜P4の各エッジがスムーズな線分で上書きされた状態となる。 Therefore, as a result of the removal processing performed by the arithmetic circuit 104, the polygons P 1 to P 4 shown in FIG. 3 have smooth edges at all the polygons P 1 to P 4 as shown in FIG. The line is overwritten by the line segment.

すなわち、演算回路104により、スムーズな線分で描画される各画素の位置には、上記線分の方向に垂直な2画素を用いて描画されるため、例えば、ポリゴンP4において、スムーズな線分L4nで描画される任意の画素D4nの位置には、線分L4nの方向に垂直な2画素d1,d2を用いて描画される。 That is, since the arithmetic circuit 104 draws two pixels perpendicular to the direction of the line segment at the position of each pixel drawn by the smooth line segment, for example, a smooth line in the polygon P 4 the position of an arbitrary pixel D 4n drawn in minutes L 4n is drawn using the two pixels directions perpendicular line segment L 4n d 1, d 2.

上述のように、描画装置100では、全てのポリゴンの各エッジをスムーズな線分で上書きするようになされてるため、描画装置100は、ポリゴンで構成される物体全体のギザリを容易に除去することができる。   As described above, in the drawing apparatus 100, each edge of all polygons is overwritten with a smooth line segment. Therefore, the drawing apparatus 100 can easily remove the entire object composed of polygons. Can do.

また、描画装置100では、ギザリ除去なしの描画処理を行った後に、上記図5のフローチャートで示したギザリ除去処理を行うため、描画装置100は、背景の色等本来見えるべきでない色の現れを防ぐことができる。   Further, since the rendering apparatus 100 performs the removal process shown in the flowchart of FIG. 5 after performing the rendering process without the removal of the roughness, the rendering apparatus 100 displays the appearance of a color that should not be visible such as the background color. Can be prevented.

したがって、描画装置100は、ハードウェア規模を大きくすることなく、高精度の描画を行うことができる。   Therefore, the drawing apparatus 100 can perform high-precision drawing without increasing the hardware scale.

尚、上記図5のフローチャートで示したギザリ除去処理において、上書きするスムーズな線分上の各画素の色は、線分全体で共通の色としてもよいが、各画素毎に異なる色としてもよい。これにより、上記ギザリ除去処理を、テクスチャマッピングが行われた線分に対して適用することができると共に、テクスチャマッピングが行われたポリゴンにも適用することができる。   Note that in the greaking removal process shown in the flowchart of FIG. 5, the color of each pixel on the smooth line segment to be overwritten may be a common color for the entire line segment, or may be a different color for each pixel. . Accordingly, the above-described jaggedness removal processing can be applied to the line segment on which texture mapping has been performed, and can also be applied to the polygon on which texture mapping has been performed.

また、上記図5のフローチャートで示したギザリ除去処理において、ポリゴンのエッジにスムーズな線分を上書きする際、上記ポリゴンの外側の画素と内挿されるような線分の画素が他のポリゴンにより上書きされる場合には、各ポリゴン毎に対してスムーズな線分の上書きを行うようにしてもよい。   In addition, in the removal processing shown in the flowchart of FIG. 5, when a smooth line segment is overwritten on the edge of the polygon, the pixel of the line segment interpolated with the pixel outside the polygon is overwritten by another polygon. In this case, smooth line segments may be overwritten for each polygon.

具体的に説明すると、例えば、図8に示すように、2つのポリゴンP5,P6を描画する場合、ポリゴンP5のエッジE5とポリゴンP6のエッジE6が一致するため、ポリゴンP6に対するスムーズな線分L6のポリゴンP5のエッジE5と一致した部分L56は、ポリゴンP5に対するスムーズな線分L5により上書きされてしまう。 Specifically, for example, as shown in FIG. 8, when drawing a two polygons P 5, P 6, since the edge E 6 of the edge E 5 and the polygon P 6 of the polygon P 5 matches, polygon P The portion L 56 that coincides with the edge E 5 of the polygon P 5 of the smooth line segment L 6 for 6 is overwritten by the smooth line segment L 5 for the polygon P 5 .

このような場合、上記ギザリ除去処理では、各ポリゴンP5,P6毎にスムーズな線分L5,L6の上書きを行うようにする。これにより、描画装置100は、背景のにじみを防ぐことができる。 In such a case, in the above-described jagged removal processing, smooth line segments L 5 and L 6 are overwritten for each polygon P 5 and P 6 . Thereby, the drawing apparatus 100 can prevent the background from blurring.

また、この場合、スムーズな線分の画素の色を背景の画素の色と内挿してもよい。これにより、描画装置100は、任意のポリゴンに対して上書きするスムーズな線分の画素が他のポリゴンで上書きされる場合に、背景のにじみを防ぐことができる。   In this case, the pixel color of the smooth line segment may be interpolated with the color of the background pixel. As a result, the drawing apparatus 100 can prevent blurring of the background when a pixel of a smooth line segment to be overwritten on an arbitrary polygon is overwritten with another polygon.

また、上記図5のフローチャートで示したギザリ除去処理において、隣接するポリゴンで完全に上書きされる画素に対しては、上記画素の色と背景の画素の色を混合して得られた画素の色を書き込み、隣接するポリゴンで完全に上書きされる画素以外の画素に対しては、スムーズな線分の上書きを行うようにしてもよい。   In addition, in the removal processing shown in the flowchart of FIG. 5 above, for the pixel that is completely overwritten by the adjacent polygon, the color of the pixel obtained by mixing the color of the pixel and the color of the background pixel. And a smooth line segment may be overwritten on pixels other than those completely overwritten by adjacent polygons.

具体的に説明すると、例えば、図9に示すように、2つのポリゴンP7,P8を描画する場合、ポリゴンP7のエッジE7とポリゴンP8のエッジE8が重複するため、ポリゴンP8に対するスムーズな線分L8のポリゴンP7のエッジE7と重複した部分L78は、ポリゴンP7により完全に上書きされてしまう。 Specifically, for example, as shown in FIG. 9, when drawing a two polygons P 7, P 8, since the edge E 8 of the edge E 7 and the polygon P 8 of the polygon P 7 overlap, the polygon P portions L 78 and duplicate edge E 7 of the polygon P 7 a smooth line segment L 8 for 8, would be completely overwritten by the polygon P 7.

このような場合、上記ギザリ除去処理では、部分L78に対しては、部分L78の画素の色と背景の画素の色を混合して得られた画素の色を書き込み、部分L78以外の画素に対しては、スムーズな線分L8の上書きを行うようにする。すなわち、上記ギザリ除去処理では、水平なエッジに対してのみスムーズな線分の上書きを行うようにする。 In this case, in the above removing jaggies, for portions L 78, writing the color of the pixels obtained by mixing the color pixels of the color and the background pixel portions L 78, other than the portion L 78 for pixels, to perform the overwriting of smooth line segments L 8. That is to say, in the above-described jaggedness removal processing, smooth line segments are overwritten only on horizontal edges.

また、上記図5のフローチャートで示したギザリ除去処理において、スムーズな線分を上書きする際、線分の色と内挿する画素の色を以下のようにして選出するようにしてもよい。   Further, when the smooth line segment is overwritten in the jagged removal process shown in the flowchart of FIG. 5, the color of the line segment and the color of the pixel to be interpolated may be selected as follows.

例えば、図10に示すように、スムーズな線分Ln上の各画素D(x,y)に対して、各々、線分Lnの交差面積により重み付けし、画素D(x,y)の交差面積が「0.5」以上の場合には、画素D(x,y)の隣の画素D(x−1,y)と内挿する。 For example, as shown in FIG. 10, each pixel D (x, y) on the smooth line segment L n is weighted by the intersection area of the line segment L n , and the pixel D (x, y) When the crossing area is “0.5” or more, it is interpolated with the pixel D (x−1, y) adjacent to the pixel D (x, y).

このようにして、線分の色の重みに応じて内挿する画素を選出することにより、同じ画素を隣接するポリゴンが共有する場合でも、必ず異なる値をとることとなるため、背景のにじみを防ぐことができる。   In this way, by selecting pixels to be interpolated according to the color weight of the line segment, even if adjacent polygons share the same pixel, it always takes different values, so background blurring Can be prevented.

本発明に係る描画方法を適用した描画装置の構成を示すブロック図である。It is a block diagram which shows the structure of the drawing apparatus to which the drawing method which concerns on this invention is applied. 描画しようとするポリゴンにおいて、エッジ重複が存在した状態を説明するための図である。It is a figure for demonstrating the state where edge duplication existed in the polygon which is going to draw. ギザリ除去処理を行わずに描画されたポリゴンを説明するための図である。It is a figure for demonstrating the polygon drawn without performing a burrow removal process. 上記ギザリ除去処理において、エッジを構成する頂点を結んだ状態を説明するための図である。It is a figure for demonstrating the state which tied the vertex which comprises an edge in the said removal processing. 上記ギザリ除去処理を説明するためのフローチャートである。It is a flowchart for demonstrating the said removal process. 上記ギザリ除去処理により、垂直に近い線分を描画する場合を説明するための図である。It is a figure for demonstrating the case where a line segment near perpendicular | vertical is drawn by the said removal process. 上記ギザリ除去処理により、ポリゴンが描画された状態を説明するための図である。It is a figure for demonstrating the state by which the polygon was drawn by the said clearance removal process. ポリゴンの外側のスムーズな線分が他のポリゴンにより上書きされる場合のギザリ除去処理を説明するための図である。It is a figure for demonstrating the jaggedness removal process in case the smooth line segment outside a polygon is overwritten by another polygon. ポリゴンの内側のスムーズな線分が他のポリゴンにより上書きされる場合のギザリ除去処理を説明するための図である。It is a figure for demonstrating the jaggedness removal process in case the smooth line segment inside a polygon is overwritten by another polygon. 交差面積により内挿する画素を変える場合を説明するための図である。It is a figure for demonstrating the case where the pixel to interpolate is changed with an intersection area. ポリゴンから構成される3次元の形状を説明するための図である。It is a figure for demonstrating the three-dimensional shape comprised from a polygon. 上記ポリゴンを説明するための図である。It is a figure for demonstrating the said polygon. 上記ポリゴンの各頂点のY座標の最大値及び最小値を求める処理を説明するための図である。It is a figure for demonstrating the process which calculates | requires the maximum value and minimum value of the Y coordinate of each vertex of the said polygon. 上記ポリゴンと水平画素ラインの交点を求める処理を説明するための図である。It is a figure for demonstrating the process which calculates | requires the intersection of the said polygon and a horizontal pixel line. 上記ポリゴンを描画した結果、ギザリが存在する状態を説明するための図である。It is a figure for demonstrating the state where a jaggedness exists as a result of drawing the said polygon. 上記ギザリを除去するためのサブピクセル法を説明するための図である。It is a figure for demonstrating the subpixel method for removing the said roughness. 上記ギザリを除去するための背景混合法を説明するための図である。It is a figure for demonstrating the background mixing method for removing the said roughness. 隣接する2つのポリゴンに対して上記背景混合法によりギザリの除去を行った場合を説明するための図である。It is a figure for demonstrating the case where the removal of a gap is performed with respect to two adjacent polygons by the said background mixing method.

符号の説明Explanation of symbols

100 描画装置、101 ピクセルエンジン、102 FIFOバッファ、103 キャッシュメモリ制御回路、104 演算回路、105 キャッシュメモリ、106 フレームメモリ
100 drawing device, 101 pixel engine, 102 FIFO buffer, 103 cache memory control circuit, 104 arithmetic circuit, 105 cache memory, 106 frame memory

Claims (8)

CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置が実行する描画方法であって、
前記描画装置が、
前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の過程と、
描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の過程と、
を実行するものであり、
前記第1の過程で、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分の一部が隣接するポリゴンの輪郭部分と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするとともに、
前記第2の過程では、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行う、
描画方法。
A drawing method executed by a drawing apparatus that draws an image including a polygon that is a polygon on a frame memory based on a drawing command from a CPU,
The drawing device is
A first process of drawing a polygon on a frame memory based on a drawing command from the CPU;
A second step of overwriting a line segment having a predetermined width connecting the vertices of the polygon with respect to the drawn outline portion of the polygon;
Is to execute
In the first process, when a plurality of polygons are adjacent to each other and are drawn in order so that those adjacent to each other share a vertex, a part of the polygon outline part is adjacent to the polygon outline When it overlaps with the part, the polygon drawn earlier is overwritten by the polygon drawn later,
In the second step, a pixel value of a pixel on which the line segment having the predetermined width is drawn is determined based on pixel values of pixels on two polygons adjacent to the pixel, and the determined pixel value Overwrite with the line segment using
Drawing method.
前記描画装置は、前記所定の幅の線分が描画される前記画素の画素値を、当該画素に隣接する画素の画素値と、前記ポリゴンの前記頂点同士を結んだ線分上の理想点に配されるはずだった画素値とに基づいて決定する、
請求項1記載の描画方法。
The drawing apparatus sets the pixel value of the pixel on which the line segment of the predetermined width is drawn to an ideal point on the line segment connecting the pixel value of a pixel adjacent to the pixel and the vertices of the polygon. Decide based on the pixel values that should have been placed,
The drawing method according to claim 1.
前記描画装置は、前記所定の幅の線分を、前記ポリゴンの前記頂点同士を結んだ線分が通る画素と、それに隣接する画素とにより描画する、
請求項1記載の描画方法。
The drawing apparatus draws the line segment having the predetermined width by a pixel through which a line segment connecting the vertices of the polygon passes and a pixel adjacent thereto.
The drawing method according to claim 1.
前記描画装置は、上記線分上の各画素の画素値に重み付けし、その重みに応じて、上記線分上の画素値と内挿する画素を選択する、
請求項1記載の描画方法。
The drawing device weights the pixel value of each pixel on the line segment, and selects a pixel to be interpolated with the pixel value on the line segment according to the weight.
The drawing method according to claim 1.
CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置が実行する描画方法であって、
前記描画装置が、
前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の過程と、
描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の過程と、
を実行するものであり、
前記第1の過程で、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、描画されるポリゴンの一部が隣接するポリゴンの一部とすきまなく並ぶようにして複数のポリゴンのうちの少なくとも2つを描画するとともに、
前記第2の過程では、すきまなく並ぶようにされた2つの前記ポリゴンの隣合う部分に位置する、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行う、
描画方法。
A drawing method executed by a drawing apparatus that draws an image including a polygon that is a polygon on a frame memory based on a drawing command from a CPU,
The drawing device is
A first process of drawing a polygon on a frame memory based on a drawing command from the CPU;
A second step of overwriting a line segment having a predetermined width connecting the vertices of the polygon with respect to the drawn outline portion of the polygon;
Is to execute
In the first step, when a plurality of the polygons are adjacent to each other and are drawn in order so that those adjacent to each other share a vertex, a part of the drawn polygon is a part of the adjacent polygon Draw at least two of the polygons so that they line up without any gaps ,
In the second step, the pixel value of the pixel on which the line segment having the predetermined width is drawn, which is located in an adjacent portion of the two polygons arranged without gaps , is set to two adjacent pixels. It is determined based on the pixel value of the pixel of the polygon, and overwriting with the line segment is performed using the determined pixel value.
Drawing method.
CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、
前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、
描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、
を備えてなり、
前記第1の手段は、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分の一部が隣接するポリゴンの輪郭部分と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするようになっているとともに、
前記第2の手段は、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっている、
描画装置。
A drawing device for drawing an image including a polygon which is a polygon on a frame memory based on a drawing command from a CPU,
A first means for drawing a polygon on a frame memory based on a drawing command from the CPU;
A second means for overwriting a line segment of a predetermined width connecting the vertices of the polygon with respect to the drawn outline portion of the polygon;
With
In the case where a plurality of the polygons are adjacent to each other and the adjacent ones are drawn in order so that the adjacent ones share a vertex, the first means includes a polygon outline in which a part of the polygon outline part is adjacent. When it overlaps with the part, the polygon drawn earlier is overwritten by the polygon drawn later,
The second means determines a pixel value of a pixel on which the line segment having the predetermined width is drawn based on pixel values of pixels on two polygons adjacent to the pixel, and the determined pixel value Overwrite with the line segment using
Drawing device.
CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、
前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、
描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、
を備えてなり、
前記第1の手段は、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、描画されるポリゴンの一部が隣接するポリゴンの一部とすきまなく並ぶようにして複数のポリゴンのうちの少なくとも2つを描画するようになっているとともに、
前記第2の手段は、すきまなく並ぶようにされた2つの前記ポリゴンの隣合う部分に位置する、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっている、
描画装置。
A drawing device for drawing an image including a polygon which is a polygon on a frame memory based on a drawing command from a CPU,
A first means for drawing a polygon on a frame memory based on a drawing command from the CPU;
A second means for overwriting a line segment of a predetermined width connecting the vertices of the polygon with respect to the drawn outline portion of the polygon;
With
The first means is that when a plurality of the polygons are adjacent to each other and the adjacent polygons are sequentially drawn so that they share a vertex, a part of the polygon to be drawn is a part of the adjacent polygon And draw at least two of the polygons so that they line up without any gaps ,
The second means calculates a pixel value of a pixel on which the line segment having the predetermined width , which is located in an adjacent portion of the two polygons arranged without gaps , is adjacent to the pixel. It is determined based on the pixel value of the pixel of the polygon, and the line segment is overwritten using the determined pixel value.
Drawing device.
前記描画装置は、上記線分上の各画素の画素値に重み付けし、その重みに応じて、上記線分上の画素値と内挿する画素を選択する、The drawing device weights the pixel value of each pixel on the line segment, and selects a pixel to be interpolated with the pixel value on the line segment according to the weight.
請求項5記載の描画方法。The drawing method according to claim 5.
JP2003379646A 2003-11-10 2003-11-10 Drawing method Expired - Fee Related JP3872056B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003379646A JP3872056B2 (en) 2003-11-10 2003-11-10 Drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003379646A JP3872056B2 (en) 2003-11-10 2003-11-10 Drawing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP06691596A Division JP3547250B2 (en) 1996-03-22 1996-03-22 Drawing method

Publications (2)

Publication Number Publication Date
JP2004078994A JP2004078994A (en) 2004-03-11
JP3872056B2 true JP3872056B2 (en) 2007-01-24

Family

ID=32025940

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003379646A Expired - Fee Related JP3872056B2 (en) 2003-11-10 2003-11-10 Drawing method

Country Status (1)

Country Link
JP (1) JP3872056B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE528578C2 (en) * 2005-04-13 2006-12-19 Whitelines Ab Writing paper with guides
JP5172523B2 (en) * 2008-07-31 2013-03-27 株式会社東芝 Image data processing method, image data processing apparatus, and compression circuit
JP5956875B2 (en) * 2012-08-30 2016-07-27 キヤノン株式会社 Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP2004078994A (en) 2004-03-11

Similar Documents

Publication Publication Date Title
EP2973423B1 (en) System and method for display of a repeating texture stored in a texture atlas
US7884825B2 (en) Drawing method, image generating device, and electronic information apparatus
US7348996B2 (en) Method of and system for pixel sampling
KR20050030595A (en) Image processing apparatus and method
JP2010102713A (en) Method of and apparatus for processing computer graphics
KR20150039495A (en) Apparatus and Method for rendering a current frame using an image of previous tile
JP4462132B2 (en) Image special effects device, graphics processor, program
KR20050030569A (en) Image processing apparatus and method thereof
KR20170031479A (en) Method and apparatus for performing a path stroke
US20070097145A1 (en) Method and system for supersampling rasterization of image data
JP3547250B2 (en) Drawing method
KR101030825B1 (en) Methods of using sampling patterns, methods of generating sampling patterns, anti-aliasing systems, and computer-readable recording media
US20080284780A1 (en) Method for enabling alpha-to-coverage transformation
US7528839B1 (en) Faster clears for three-dimensional modeling applications
JP3872056B2 (en) Drawing method
US8115780B2 (en) Image generator
JP2003504697A (en) Anti-aliasing of subsampled texture edges
US20020051016A1 (en) Graphics drawing device of processing drawing data including rotation target object and non-rotation target object
EP1431920A1 (en) Low-cost supersampling rasterization
US20160321835A1 (en) Image processing device, image processing method, and display device
JP3898426B2 (en) Graphic drawing device
JPH09319892A (en) Image processor and its processing method
JP2011028641A (en) Image processing device and image processing method
JP4433525B2 (en) Image processing device
JPH10187124A (en) Plotting device and plotting method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060718

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060725

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060925

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061017

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061018

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101027

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111027

Year of fee payment: 5

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121027

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131027

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees