JP2004078994A - Drawing method - Google Patents

Drawing method Download PDF

Info

Publication number
JP2004078994A
JP2004078994A JP2003379646A JP2003379646A JP2004078994A JP 2004078994 A JP2004078994 A JP 2004078994A JP 2003379646 A JP2003379646 A JP 2003379646A JP 2003379646 A JP2003379646 A JP 2003379646A JP 2004078994 A JP2004078994 A JP 2004078994A
Authority
JP
Japan
Prior art keywords
polygon
pixel
drawn
line segment
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.)
Granted
Application number
JP2003379646A
Other languages
Japanese (ja)
Other versions
JP3872056B2 (en
Inventor
Masaaki Oka
岡 正昭
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)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a drawing method for performing highly precise drawing with small-scale hardware. <P>SOLUTION: Indentation of an object constituted of a polygon is eliminated by overwriting a segment connecting apexes corresponding to a contour part of the polygon for the contour part of the polygon drawn in a frame memory. <P>COPYRIGHT: (C)2004,JPO

Description

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

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

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

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

 そして、CPUは、物体200に基いた3次元画像を描画するための各ポリゴンP201,P202,P203に対応した描画命令を生成し、その描画命令を描画装置に転送する。 Then, CPU generates a drawing instruction 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 instructions to the drawing device.

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

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

 すなわち、描画装置は、例えば、物体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, the drawing apparatus, for example, when drawing a polygon P 201 shown in among 12 of the polygon P 201, P 202, P 203 constituting the object 200, first, by interpreting the drawing command from CPU, FIG. As shown in FIG. 13, the Y coordinates y 1 , y of the four vertices (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ) and (x 4 , y 4 ) of the polygon P 201 2 , y 3 and 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 grid, but the four vertices (x 1 , y 1 ), (x 2 , y 2 ), (x 3 ) of the polygon P 201 , Y 3 ), (x 4 , y 4 ) do not always match the grid 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, and obtains horizontal pixel lines L H2 to L H17 that intersect the polygon P 201. . The drawing device obtains an intersection of the polygon P 201 and the horizontal pixel line L H2 ~L H17.

 次に、描画装置は、交点のX座標の値に対して、値の切捨処理を行い、ポリゴンP201に含まれる画素のX座標の最大値Xmax及び最小値Xminを求める。 The rendering device, for values of X-coordinate of the intersection point, performs truncation processing of the values, the maximum value X max and minimum value X min of the X coordinates of pixels included in the polygon P 201.

 そして、描画装置は、水平画素ラインLH2〜LH17において、X座標の最小値Xmin〜最大値Xmaxの範囲内に含まれる画素を各水平画素ライン毎にフレームバッファに書き込む。 Then, the drawing apparatus writes pixels included in the range of the minimum value X min to the maximum value X max of the X coordinate in the horizontal pixel lines L H2 to L H17 into 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, as shown in FIG. 15, the boundary (edge) E of the polygon P 201 is in a jagged state (hereinafter referred to as a jagged state). .)

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

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

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

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

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

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

 例えば、上記図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 of the edge E1 of the polygon P 201 is “green”. It becomes.

 また、図18に示すように、「赤」色のポリゴンP202をポリゴンP201に隣接して描画した場合、ポリゴンP202のエッジE2の画素の色は、「緑赤」となり、ポリゴンP201とポリゴンP202が共有するエッジE12の画素の色は、エッジE1の画素の色「緑青」に「赤」を加えた「緑青赤」となる。 Further, 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 becomes “green-red” and the polygon P 202 the color of the pixel of the edge E 12 to 201 and the polygon P 202 is shared, the addition of "red" color of a pixel of the edge E1 "patina""patinared".

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

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

 そこで、本発明は、上述の如き従来の実情に鑑みてなされたものであり、次のような目的を有するものである。 Therefore, the present invention has been made in view of the above-described conventional circumstances, 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 problem, 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, wherein the drawing data is drawn on the frame memory. A line segment connecting vertices corresponding to the polygonal contour portion is overwritten on the polygonal contour portion.
For example, the drawing method according to the present invention is a drawing method executed by a drawing device that draws an image including a polygon, which is a polygon, on a frame memory based on a drawing command from a CPU. A first process of drawing a polygon on a frame memory based on a drawing command from a CPU, and overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting vertices of the polygon. And in the first step, in the first step, 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, When a part of the outline of these polygons overlaps the outline of an adjacent polygon, the polygon drawn earlier is overwritten by the polygon drawn later. In both cases, 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 is determined. It is assumed that the line segment is overwritten using the pixel value.
Alternatively, a drawing method executed by 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, wherein the drawing device performs A first step of drawing a polygon on a frame memory, a second step of overwriting a drawn line of the polygon with a line segment having a predetermined width connecting the vertices of the polygon, When a plurality of polygons are sequentially drawn in the first step, when a part of the polygon to be drawn overlaps a part of an adjacent polygon, a polygon to be drawn later is used. In the second step, the pixel value of the pixel on which the line segment having the predetermined width is drawn is set in the second step. 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.
Further, the drawing apparatus of the present invention is a drawing apparatus that draws an image including polygons on a frame memory based on a drawing command from a CPU, for example, based on a drawing command from the CPU. A first means for drawing a polygon on a frame memory, and a second means for overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting vertices of the polygon. The first means may include, when the plurality of polygons are adjacent to each other, and are drawn in order so that adjacent ones share vertices, when the outline portions of the polygons are adjacent polygons. When overlapping with the outline portion, the polygon drawn earlier is overwritten by the polygon drawn later, and the second means is 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 of the line segment. Overwriting can be performed.
Alternatively, 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 PU, and drawing the polygon on the frame memory based on a drawing command from the CPU. First means, and second means for overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting the vertices of the polygon, wherein the first means When part of the polygon to be drawn overlaps with part of an adjacent polygon when a plurality of polygons are drawn in order, a part of the polygon drawn first by the polygon drawn later is While 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 pixels of two polygons adjacent to the pixel, and determines the determined pixel value. Overwriting with the line segment.
In these methods, the drawing processing without the jagged removal is performed, and then the jagged removal processing is performed. Therefore, it is possible to prevent the appearance of colors that should not be seen, such as the background color.

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

 前記描画方法では、前記所定の幅の線分を、前記ポリゴンの前記頂点同士を結んだ線分が通る画素と、それに隣接する画素とにより描画するようにしてもよい。 In the drawing method, the line segment having the predetermined width may be drawn by a pixel passing through a line segment connecting the vertices of the polygon 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 value 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 connecting the vertices corresponding to the outline of the polygon is overwritten on the outline of the polygon drawn in the frame memory. Thus, the drawing method can easily remove the jaggedness of the entire polygonal object, and can prevent the appearance of colors that should not be seen, such as the background color. Therefore, the above-described drawing method can perform high-precision drawing with small-scale hardware.

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

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

 また、本発明に係る描画方法では、上記線分上の各画素値に重み付けし、その重みに応じて、上記線分上の画素値と内挿する画素値を選択する。これにより、上記描画方法では、同じ画素を隣接する多角形が共有する場合でも、必ず異なる値をとる。したがって、上記描画方法は、背景のにじみを防ぐことができるため、さらに高精度の描画を行うことができる。 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-described drawing method, different values are always taken even when adjacent polygons share the same pixel. Therefore, the above-described drawing method can prevent the background from bleeding, and can perform drawing with higher precision.

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

 本発明に係る描画方法は、図1に示すような描画装置100により実施される。 描画 The drawing method according to the present invention is performed 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 respective 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次元画像を描画するための各ポリゴンに対応する命令である。 描画 The pixel engine 101 is supplied with a drawing command from, for example, a CPU (not shown). 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 figures (polygons) such as a triangle and a quadrangle 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. When writing pixel data to the frame memory 106 via the cache memory 105, the arithmetic circuit 104 performs a Z-buffer process, a translucent process, an anti-aliasing process, a filtering process, and the like.

 また、演算回路104は、キャッシュメモリ105を介してフレームメモリ106から画素データを読み出し、読み出した画素データに対してギザリ除去処理を行う。 {Circle around (4)} The arithmetic circuit 104 reads pixel data from the frame memory 106 via the cache memory 105 and performs a jagged removal process on the read 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 previously recognizes the data area required in the cache memory 105 by reading out the pixel data once stored in the FIFO memory 102 in advance. Then, the cache memory control circuit 103 reads the pixel data corresponding to the data area from the frame memory 106 collectively without straddling the word boundary and the page boundary of the frame memory 106, and corresponds to the data area. The cache memory 105 is controlled so that pixel data is collectively written to the frame memory 106. As a result, the cache memory 105 accesses the frame memory 106 by shortening the access time, and accesses the frame memory 106 a small number of times.

 フレームメモリ106は、図示していないが、Zバッファ及びフレームバッファからなる。上記Zバッファは、画素データに含まれるZ値を格納するバッファであり、上記フレームバッファは、画素データに含まれるカラー値を格納するバッファである。 The frame memory 106 includes a Z buffer and a frame buffer (not shown). 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 under 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 Output to the arithmetic circuit 104 via the cache memory 105.

 また、フレームメモリ106は、書き込まれた画素データ、すなわち描画された画素データをビデオ信号として、図示していないテレビジョン受像機やモニタ受像機等に供給する。 {Circle around (4)} 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, and the like (not shown).

 これにより、上記テレビジョン受像機やモニタ受像機等は、フレームメモリ106からの画素データに基いた画像を表示出力する。 Thereby, 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 jaggedness removal processing performed by the arithmetic circuit 104 will be specifically described.

 例えば、図2に示すような4つのポリゴンP1〜P4から構成される3次元モデルをフレームメモリ106に描画する場合、先ず、演算回路104は、ギザリ除去処理を行わずにポリゴンP1〜P4をキャッシュメモリ105を介してフレームメモリ106に描画する。 For example, when drawing a three-dimensional model composed of four polygon P 1 to P 4 as shown in FIG. 2 in the frame memory 106, first, the arithmetic circuit 104, the polygon P 1 ~ without removing jaggies the P 4 is drawn in the frame memory 106 via 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 There duplicate, the edge E 23 polygons P 2 and the polygon P 3 share a state in which the edge pixels of the edge pixel and polygon P 3 of the polygon P 2 are adjacent without overlap. That is, the polygons are arranged without gaps at the edges sharing the vertices of the polygons.

 したがって、ポリゴンP1,P2,P3,P4の順に各ポリゴンをフレームメモリ106に描画した場合、図3に示すように、各ポリゴンの頂点を共有しているエッジには、後に描画されたポリゴンの画素が書き込まれる。 Therefore, when each polygon is 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. The pixel of the polygon is written.

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

 すなわち、演算回路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 forming the edge of the portion where the polygon P 1 and the polygon P 4 are adjacent to each other. These vertices Q 1, a line segment L 12 obtained by connecting the 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に描画する。 The arithmetic circuit 104, for the line segments obtained by connecting the vertices of the other edge, in the same manner as the line segment L 12 obtained by connecting the apexes Q 1, Q 2, as shown in FIG. 4 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 jaggedness removal processing, and then overwrites a smooth line segment obtained by connecting the vertices constituting the edge of the polygon. The jaggedness of the polygon is removed.

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

 例えば、ポリゴンのエッジを構成する頂点を結んで得られたスムーズな線分が、図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, a smooth line segment obtained by connecting the vertices composing the polygon edges are nearly vertical line L n as shown in FIG. 6, when drawing down the line segment L n from the top, 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 at the X coordinate and the difference dy at the Y coordinate between the start point (X1, Y1) and the end point (X2, Y2) are represented by dx
= X2-X1dy = Y2-Y1 (step S1).

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

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

 次に、理想点(Fx,Fy)を整数化した(Nx,Ny)を、Nx = [Fx]
Ny = [Fy]
なる演算式により求める(ステップS4)。
Next, (Nx, Ny) obtained by converting the ideal point (Fx, Fy) into an integer is represented by Nx = [Fx]
Ny = [Fy]
It is obtained by the following arithmetic expression (step S4).

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

 次に、ステップS4で得られた(Nx,Ny)に書き込む画素の値を求めて、求めた画素値を(Nx,Ny)に書き込む(ステップS5)。 Next, the value of the pixel to be 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, if 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 in is calculated by the following formula: 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 in (Nx + 1, Ny) next to (Nx, Ny) is obtained, and the obtained pixel value is written in (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, if 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, write to (Nx + 1, Ny). The pixel value Col_R is obtained by an arithmetic expression of 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 calculated as Fx = Fx + (dx / dy)
It is obtained by an arithmetic expression of Fy = Fy + 1 (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 , And perform the processes of steps S4 to S8.

 一方、ステップ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 The 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 Or near vertical.

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

 すなわち、演算回路104により、スムーズな線分で描画される各画素の位置には、上記線分の方向に垂直な2画素を用いて描画されるため、例えば、ポリゴンP4において、スムーズな線分L4nで描画される任意の画素D4nの位置には、線分L4nの方向に垂直な2画素d1,d2を用いて描画される。 That is, the arithmetic circuit 104, the position of each pixel to be drawn in a smooth line segments, because it is drawn using the vertical two pixels in the direction of the line segment, for example, in the polygon P 4, smooth lines 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, since the drawing apparatus 100 overwrites each edge of all polygons with smooth line segments, the drawing apparatus 100 can easily remove the jaggedness of the entire object composed of polygons. Can be.

 また、描画装置100では、ギザリ除去なしの描画処理を行った後に、上記図5のフローチャートで示したギザリ除去処理を行うため、描画装置100は、背景の色等本来見えるべきでない色の現れを防ぐことができる。 Further, in the drawing apparatus 100, after performing the drawing processing without jagged removal, the jagged removal processing shown in the flowchart of FIG. 5 is performed. Can be prevented.

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

 尚、上記図5のフローチャートで示したギザリ除去処理において、上書きするスムーズな線分上の各画素の色は、線分全体で共通の色としてもよいが、各画素毎に異なる色としてもよい。これにより、上記ギザリ除去処理を、テクスチャマッピングが行われた線分に対して適用することができると共に、テクスチャマッピングが行われたポリゴンにも適用することができる。 In the jaggedness removal processing 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 a line segment on which texture mapping has been performed, and can also be applied to a polygon on which texture mapping has been performed.

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

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

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

 また、上記図5のフローチャートで示したギザリ除去処理において、隣接するポリゴンで完全に上書きされる画素に対しては、上記画素の色と背景の画素の色を混合して得られた画素の色を書き込み、隣接するポリゴンで完全に上書きされる画素以外の画素に対しては、スムーズな線分の上書きを行うようにしてもよい。 Also, in the jaggedness removal processing shown in the flowchart of FIG. 5, for a pixel completely overwritten by an adjacent polygon, the color of the pixel obtained by mixing the color of the pixel with the color of the background pixel May be written, and smooth line segment overwriting may be performed on pixels other than pixels 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, in the above-described jaggedness removal processing, smooth line segments are overwritten only on horizontal edges.

 また、上記図5のフローチャートで示したギザリ除去処理において、スムーズな線分を上書きする際、線分の色と内挿する画素の色を以下のようにして選出するようにしてもよい。 In the jaggedness removal processing shown in the flowchart of FIG. 5, when overwriting a smooth line segment, 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, the pixel D (x, y) of the smooth line segment L n with respect to each weighted by the intersection area of the line segment L n, the pixel D (x, y) of If the intersection area is “0.5” or more, the pixel 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 weight of the color of the line segment, even if adjacent polygons share the same pixel, they always take different values, so that background bleeding occurs. Can be prevented.

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

符号の説明Explanation of reference numerals

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

Claims (7)

 CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置が実行する描画方法であって、
 前記描画装置が、
 前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の過程と、
 描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の過程と、
 を実行するものであり、
 前記第1の過程で、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分の一部が隣接するポリゴンの輪郭部分と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするとともに、
 前記第2の過程では、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行う、
 描画方法。
A drawing method executed by a drawing device that draws an image including polygons on a frame memory based on a drawing command from a CPU,
The drawing device,
A first step of drawing a polygon on a frame memory based on a drawing command from the CPU;
A second step of overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting the vertices of the polygon,
And execute
In the first step, when a plurality of polygons are drawn adjacent to each other and the adjacent polygons are sequentially drawn so as to share vertices, a part of a contour portion of the polygon is a contour of an adjacent polygon. When overlapping with a part, the polygon drawn first 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 is determined. Performing overwriting by the line segment using
Drawing method.
 前記描画装置は、前記所定の幅の線分が描画される前記画素の画素値を、当該画素に隣接する画素の画素値と、前記ポリゴンの前記頂点同士を結んだ線分上の理想点に配されるはずだった画素値とに基づいて決定する、
 請求項1記載の描画方法。
The drawing device sets the pixel value of the pixel on which the line segment having the predetermined width is drawn to a pixel value of a pixel adjacent to the pixel and an ideal point on a line segment connecting the vertexes of the polygon. Determined based on the pixel value that was supposed to be allocated,
The drawing method according to claim 1.
 前記描画装置は、前記所定の幅の線分を、前記ポリゴンの前記頂点同士を結んだ線分が通る画素と、それに隣接する画素とにより描画する、
 請求項1記載の描画方法。
The drawing device draws the line segment having the predetermined width by using 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 apparatus weights the pixel value of each pixel on the line segment, and selects a pixel value 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つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行う、
  描画方法。
A drawing method executed by a drawing device that draws an image including polygons on a frame memory based on a drawing command from a CPU,
The drawing device,
A first step of drawing a polygon on a frame memory based on a drawing command from the CPU;
A second step of overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting the vertices of the polygon,
And execute
In the first process, when a plurality of polygons are sequentially drawn, when a part of the polygon to be drawn overlaps a part of an adjacent polygon, the polygon is drawn first by a polygon drawn later. While overwriting a part of the polygon,
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 of two polygons adjacent to the pixel, and the determined pixel value is determined. Performing overwriting by the line segment using
Drawing method.
 CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、
 前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、
 描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、
 を備えてなり、
 前記第1の手段は、前記ポリゴンが複数、互いに隣接され、且つ互いに隣接するもの同士が頂点を共有するように順に描画される場合において、それらポリゴンの輪郭部分の一部が隣接するポリゴンの輪郭部分と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンを上書きするようになっているとともに、
 前記第2の手段は、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴン上の画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっている、
 描画装置。
A drawing device that draws an image including a polygon, which is a polygon, on a frame memory based on a drawing command from a CPU,
First means for drawing a polygon on a frame memory based on a drawing command from the CPU;
Second means for overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting the vertices of the polygon,
Equipped with
The first means is that, when the plurality of polygons are sequentially drawn so as to be adjacent to each other and the mutually adjacent ones share vertices, a part of the outline portion of the polygon is adjacent to the outline of the adjacent polygon. When overlapping with a part, the polygon drawn later overwrites the polygon drawn earlier,
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 determines the determined pixel value. Is used to overwrite with the line segment,
Drawing device.
 CPUからの描画命令に基づいて、多角形であるポリゴンを含む画像をフレームメモリ上に描画する描画装置であって、
 前記CPUからの描画命令に基づいて、フレームメモリ上にポリゴンを描画する第1の手段と、
 描画された前記ポリゴンの輪郭部分に対して、前記ポリゴンの頂点同士を結ぶ所定の幅の線分を上書きする第2の手段と、
 を備えてなり、
 前記第1の手段は、前記ポリゴンが複数、順に描画される場合において、描画されるポリゴンの一部が隣接するポリゴンの一部と重複するときには、後に描画されるポリゴンによって先に描画されているポリゴンの一部を上書きするようになっているともに、
 前記第2の手段は、前記所定の幅の線分が描画される画素の画素値を、当該画素に隣接する2つのポリゴンの画素の画素値に基づいて決定し、決定されたその画素値を用いて前記線分による上書きを行うようになっている、
 描画装置。
A drawing device that draws an image including a polygon, which is a polygon, on a frame memory based on a drawing command from a CPU,
First means for drawing a polygon on a frame memory based on a drawing command from the CPU;
Second means for overwriting a contour portion of the drawn polygon with a line segment having a predetermined width connecting the vertices of the polygon,
Equipped with
The first means is configured such that, when a plurality of polygons are sequentially drawn, when a part of a drawn polygon overlaps a part of an adjacent polygon, the polygon is drawn first by a polygon drawn later. While part of the polygon is 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 pixels of two polygons adjacent to the pixel, and determines the determined pixel value. Using the line segment to overwrite,
Drawing device.
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 true JP2004078994A (en) 2004-03-11
JP3872056B2 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008536715A (en) * 2005-04-13 2008-09-11 ストックホルム イノヴェーション インコーポレイテッド Writing paper
JP2010041122A (en) * 2008-07-31 2010-02-18 Toshiba Corp Image data processing method, image data processor, and data structure
JP2014048847A (en) * 2012-08-30 2014-03-17 Canon Inc Image processing device, and image processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008536715A (en) * 2005-04-13 2008-09-11 ストックホルム イノヴェーション インコーポレイテッド Writing paper
JP2010041122A (en) * 2008-07-31 2010-02-18 Toshiba Corp Image data processing method, image data processor, and data structure
JP2014048847A (en) * 2012-08-30 2014-03-17 Canon Inc Image processing device, and image processing method

Also Published As

Publication number Publication date
JP3872056B2 (en) 2007-01-24

Similar Documents

Publication Publication Date Title
JP6678209B2 (en) Gradient adjustment for texture mapping to non-orthonormal grid
JP4327105B2 (en) Drawing method, image generation apparatus, and electronic information device
US7348996B2 (en) Method of and system for pixel sampling
RU2312404C2 (en) Hardware acceleration of graphical operations during construction of images based on pixel sub-components
KR20160051154A (en) Rendering method and apparatus, and electronic apparatus
US10783696B2 (en) Gradient adjustment for texture mapping to non-orthonormal grid
JP3547250B2 (en) Drawing method
KR20060007054A (en) Method and system for supersampling rasterization of image data
US6501474B1 (en) Method and system for efficient rendering of image component polygons
US7495672B2 (en) Low-cost supersampling rasterization
EP1431920B1 (en) Low-cost supersampling rasterization
JP3872056B2 (en) Drawing method
WO2010134124A1 (en) Vector graphic drawing device
JP3898426B2 (en) Graphic drawing device
US6900804B1 (en) Method of forming polygon image and image processing apparatus using the same
JP6861910B2 (en) Information processing equipment, programs and information processing methods
JP4766576B2 (en) Drawing method, image generation apparatus, and electronic information device
JP2016212468A (en) Image processing apparatus, image processing method, and display device
JPH08235380A (en) Method and device for displaying polyhedron
JPH0350686A (en) Graphic processing system
JP2001109896A (en) Edge drawing method and image processor using same
JPH09231381A (en) Plotting device
JPH06203171A (en) Device and method for forming image

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 or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101027

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111027

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121027

Year of fee payment: 6

FPAY Renewal fee payment (event 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