JP2007141196A - Polygon/silhouette line/anti-aliasing circuit - Google Patents

Polygon/silhouette line/anti-aliasing circuit Download PDF

Info

Publication number
JP2007141196A
JP2007141196A JP2005359568A JP2005359568A JP2007141196A JP 2007141196 A JP2007141196 A JP 2007141196A JP 2005359568 A JP2005359568 A JP 2005359568A JP 2005359568 A JP2005359568 A JP 2005359568A JP 2007141196 A JP2007141196 A JP 2007141196A
Authority
JP
Japan
Prior art keywords
information
buffer
polygon
outline
line
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.)
Pending
Application number
JP2005359568A
Other languages
Japanese (ja)
Inventor
Tsuneo Ikedo
恒雄 池戸
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.)
KAADEIKKU CORP KK
Original Assignee
KAADEIKKU CORP KK
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 KAADEIKKU CORP KK filed Critical KAADEIKKU CORP KK
Priority to JP2005359568A priority Critical patent/JP2007141196A/en
Publication of JP2007141196A publication Critical patent/JP2007141196A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To allow high quality anti-aliasing drawing to a shadow and a polygon contour line at comparatively slight costs. <P>SOLUTION: This polygon/silhouette line/anti-aliasing circuit is provided with a means for storing the contour line of a polygon and a means for storing contour line information in which the contour line crosses a grid, a means for performing hidden surface removal by a coordinate point inside the polygon and the contour line information, deleting the contour line to be a polygon sharing side from a buffer to store only the contour line information of a silhouette line pixel, a means for reading the stored contour line information to judge positions inside and outside the polygon when the point is on the silhouette line and a means for attenuating a luminance value in order to determine luminance of the shadow. As for anti-aliasing of a viewpoint coordinate system, silhouette line information of the polygon is stored, color information is further stored in the contour line information, the contour line information is read for the luminance of the pixel in which a drawing point becomes the silhouette line and the color information is proportionally distributed from each area ratio crossing in pixel grid to determine the luminance. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

この発明は、コンピュータグラフィックス描画技術に関し、可視投影図形のシルエットラインのジャギー現象を軽減するアンチエイリアス処理の論理回路分野に属する。  The present invention relates to a computer graphics drawing technique, and belongs to the logic circuit field of antialiasing processing for reducing the jaggy phenomenon of a silhouette line of a visible projection figure.

ラスター型ディスプレーで生じる表示図形のジャギーあるいはエイリアス(階段状波形)現象を軽減するためのコンピュータグラフィックス技術として、スーパーサンプリング、マルチサンプリングあるいはバウンダリーエッジ法等が知られている。これらは影のシルエットライン上のエイリアスを軽減するためにも利用されている。最も低コスト方式(ハードウエア、ソフトウエア共に)として知られる前記バウンダリーエッジ法では、画素をグリッド空間(正方形)と見なし、このグリッドにポリゴンの外郭線が交差して分割されたグリッド、すなわちポリゴン内外の面積を求め、外部と内部の輝度(色)を、その面積比で比例半分し、画素点の輝度とする。外郭線とグリッドの関係から輝度を決定する手法として、外郭線の傾き、グリッドとの外郭線交差座標値(直線発生器小数点部)、長軸短軸値、始点終点等を用いたものとして特開昭57−191687および特開昭58−55981がある。またポリゴンエッジのアンチエイリアスとして前記直線情報を利用した特開2002−352253がある。前記特開2002−352253では、描画空間に等しいサイズをもつ2次元バッファを設け、外郭線情報をこのバッファに記憶し、ポリゴン描画後に、外郭線画素とその周辺画素の輝度を合成してシルエットライン上の輝度を決定した。この方法では、画素当たり最大何本の外郭線が交差するか描画前に予測できないため、バッファの画素当たりのワードサイズ(ビットフィールド)を予め決定することはできない。前記特開では、画素当たり複数の外郭線情報を記憶可能とするものの、ある数を超えればマルチ交差フラグを立て、描画後にこのフラグを検出すると、画素の輝度を、面積比で配分する手段から、周辺輝度の平均値を取る手段に切り替えて輝度を決定した。この方法では所定の交差数を超える映像では正確な輝度を決定することは出来ず、一部の図形ではエイリアスが残っていた。
また、影のシルエットラインのスムージングを行うシステムでは、描画点がグリッド内で外郭線の内側(影)か外側(照射)のいずれに位置するかの正確な境界判定が必要となり、平均化では求められない。さらに前記特開では、グリッド内のポリゴン交差面積の計算は、全ての描画が終了した後のビデオ走査段階で行われ、輝度の決定には、一つのグリッド内情報だけでなく、周辺のグリッドの輝度も参照しなければならず回路規模が大きくなった。
一方、ポリゴンレンダリング法では、物体をサーフェイスモデルとしてポリゴン(主として3角形)の集合で表現する。曲面内にあるポリゴンは隣接するポリゴンと辺を共有しており、よって大半のポリゴン辺はシルエットラインではない。投影された物体のポリゴン辺が、シルエットラインか曲面内の共有辺かの判断は、ポリゴン面の法線が視点方向に対して背面となるものが隠面消去されるシステムにおいては、共有辺を持たない辺がシルエットラインとなる。言い換えれば、同一のポリゴン外郭線が2度書きされた場合には、その辺は隣接するポリゴンと接していると見なすことができる。共有辺の検出のために、前記特開では、外郭線情報を2次元バッファに記憶し、これと後書き情報とを比較する方法が示されているが、複数の外郭線の交差情報を保存可能な描画空間分のバッファを設けることはコストの問題が生じる共に、後記
Supersampling, multi-sampling, boundary edge method, and the like are known as computer graphics techniques for reducing the jaggy or alias (stepped waveform) phenomenon of a display figure that occurs in a raster display. They are also used to reduce aliases on shadow silhouette lines. In the boundary edge method, which is known as the lowest cost method (both hardware and software), a pixel is regarded as a grid space (square), and a polygon is obtained by dividing a polygon outline by intersecting the grid, that is, a polygon. The inner and outer areas are obtained, and the luminance (color) between the outside and inside is proportionally halved by the area ratio to obtain the luminance of the pixel point. As a method of determining the brightness from the relationship between the contour line and the grid, the method using the slope of the contour line, the coordinate value of the contour line intersection with the grid (straight line generator decimal point), the major axis minor axis value, the start point end point, etc. No. 57-191687 and Japanese Patent Laid-Open No. 58-55981. Japanese Patent Laid-Open No. 2002-352253 using the straight line information as anti-aliasing of a polygon edge is known. In Japanese Patent Laid-Open No. 2002-352253, a two-dimensional buffer having the same size as the drawing space is provided, outline line information is stored in this buffer, and after drawing a polygon, the luminance of the outline line pixel and its surrounding pixels is synthesized to create a silhouette line. The upper brightness was determined. In this method, since the maximum number of contour lines per pixel cannot be predicted before drawing, the word size (bit field) per pixel of the buffer cannot be determined in advance. In the above-mentioned Japanese Patent Application, a plurality of contour line information per pixel can be stored, but if a certain number is exceeded, a multi-intersection flag is set, and when this flag is detected after drawing, the means for distributing the luminance of the pixel by area ratio The luminance was determined by switching to a means for taking the average value of the peripheral luminance. With this method, it is impossible to determine an accurate luminance for an image exceeding a predetermined number of intersections, and aliases remain in some graphics.
In addition, in a system that performs smoothing of shadow silhouette lines, it is necessary to accurately determine whether the drawing point is located inside (shadow) or outside (irradiation) of the outline in the grid. I can't. Furthermore, in the above-mentioned JP, the calculation of the polygon crossing area in the grid is performed at the video scanning stage after all the drawing is completed, and not only the information in one grid but also the surrounding grids are determined for luminance. The circuit scale has been increased because luminance must also be referenced.
On the other hand, in the polygon rendering method, an object is represented by a set of polygons (mainly triangles) as a surface model. Polygons within a curved surface share sides with neighboring polygons, so most polygon sides are not silhouette lines. To determine whether the polygon side of the projected object is a silhouette line or a shared side in a curved surface, in the system in which the hidden surface is deleted when the normal of the polygon surface is the back of the viewpoint direction, the shared side is Sides that do not have become silhouette lines. In other words, when the same polygon outline is written twice, it can be considered that the side is in contact with the adjacent polygon. For the detection of shared edges, the above-mentioned Japanese Patent Application discloses a method for storing outline information in a two-dimensional buffer and comparing this with postscript information, but it is possible to store intersection information of a plurality of outlines. Providing a buffer for a large drawing space causes a cost problem and will be described later.

の1−4項までの、より複雑なそれぞれの交差条件に対する個別の解決手段に対応できない。さらに前記特開では直線発生器あるいはDDA等の内挿補間回路は、整数部と小数点部とに分離された加減算器(いわゆる従来のDDA構造)で構成しており、この構成法では回路が整数演算処理となり精度範囲に限界があった。It is not possible to cope with individual solutions for each of the more complicated intersection conditions up to 1-4. Further, in the above-mentioned Japanese Patent Application Laid-Open No. 2004-208, an interpolation circuit such as a linear generator or DDA is composed of an adder / subtracter (so-called conventional DDA structure) separated into an integer part and a decimal point part. There was a limit to the accuracy range because it was an arithmetic process.

またポリゴン描画のために通常設けられる従来の直線発生器では、ポリゴンの外郭線が交差する全てのグリッドを特定できない。これは直線発生器からの座標値が、最近傍法により出力値が丸められるためであり、外郭線がグリッドをかすめるような場合は、実際の交差グリッドではなく、丸めにより隣接するグリッドが外郭線通過画素と見なされてしまう。外郭線が交差するグリッドの輝度を、交差面積比から求める限り、前記直線式やDDAから得られる座標値ではなく、シルエットラインが実際交差するグリッドを対象としなければならない。これは最近傍法を計算する従来の直線発生器(補間回路)やDDAでは得ることができない。  In addition, the conventional straight line generator normally provided for drawing a polygon cannot identify all grids where polygon outlines intersect. This is because the output value of the coordinate value from the straight line generator is rounded by the nearest neighbor method, and when the outline line grazes the grid, the adjacent grid is not the actual intersection grid but rounded. It is regarded as a passing pixel. As long as the luminance of the grid intersecting the contour lines is obtained from the intersection area ratio, it is necessary to target the grid where the silhouette lines actually intersect, not the coordinate values obtained from the linear equation or DDA. This cannot be obtained by a conventional straight line generator (interpolation circuit) or DDA that calculates the nearest neighbor method.

本発明は、シルエットラインの検出と、シルエットラインとなるグリッドにおける描画点のポリゴン内外判定を行う手段と、その論理回路化を課題とする。  It is an object of the present invention to detect a silhouette line, to determine a polygon inside / outside of a drawing point in a grid serving as a silhouette line, and to form a logic circuit thereof.

課題を解決する手段を開示するにあたり、本発明が扱うポリゴンの外郭線がグリッドに交差する様態を下記に示す。グリッド内を通過する外郭線がシルエットラインとなるか、隣接ポリゴンとの共有辺であるかは、外郭線情報で判定する。グリッド内の外郭線の交差様態の大半は、1−4項までの状態例とそれらの組み合わせとなる。
1.グリッド内に1辺が交差する場合
2.グリッド内に2辺以上ある場合
2−1. 同一ポリゴンで辺が一致しない場合
2−2. 同一ポリゴンで辺が一致する場合
2−3. それぞれのポリゴンが異なり且つ辺が一致しない場合
2−4. それぞれのポリゴンが異なり且つ辺が一致する場合
3.グリッド内に1つの頂点がある場合:
3−1. 左右それぞれのエッジの接続による頂点(始点/終点V字型)
3−2. 左右いずれか一方の辺による頂点(鈍角V字型)
3−3. 左右それぞれの辺が同一のグリッド交差点と傾きをもつ場合(完全重複型)
4.同一グリッドに複数のポリゴン頂点が存在する場合
4−1. それぞれのポリゴンは1辺を他のポリゴンと共有し、他辺のグリッド交差点が異なる場合(開平面)
4−2. それぞれのポリゴンは1辺を他のポリゴンと共有して閉じている場合(閉平面)
4−3. すべてのポリゴン辺が同一のグリッド交差点および傾きをもつ(重複)場合
4−4. それぞれのポリゴン辺がそれぞれ独立して頂点のみを共有している場合
4−5. 2つ以上のそれぞれ異なるポリゴン頂点がそれぞれ独立して存在する場合
In disclosing means for solving the problems, the manner in which the outline of the polygon handled by the present invention intersects the grid is shown below. Whether outlines passing through the grid are silhouette lines or shared sides with adjacent polygons is determined by outline line information. Most of the crossing states of the contour lines in the grid are state examples up to 1-4 and combinations thereof.
1. 1. When one side intersects in the grid 2. When there are two or more sides in the grid 2-1. When the sides do not match in the same polygon 2-2. When the sides are the same in the same polygon 2-3. When each polygon is different and the sides do not match 2-4. 2. When each polygon is different and the sides match If there is one vertex in the grid:
3-1. Vertex by connecting the left and right edges (start / end V-shaped)
3-2. Vertex by either left or right side (obtuse angle V shape)
3-3. When the left and right sides have the same grid intersection and slope (complete overlap type)
4). When multiple polygon vertices exist in the same grid 4-1. Each polygon shares one side with another polygon and the grid intersections on the other side are different (open plane)
4-2. Each polygon is closed with one side shared with other polygons (closed plane)
4-3. When all polygon sides have the same grid intersection and slope (overlap) 4-4. When each polygon side independently shares only the vertex 4-5. When two or more different polygon vertices exist independently

の1−4項までの交差様態において、本発明ではシルエットライン情報とシルエットラインの交差グリッドを特定するため、ポリゴン外郭線は左辺・右辺それぞれ同時に補間して水平軸毎に左辺および右辺座標点の順あるいは同時に出力し、次に左右両端点間を水平に補間するものとする。In order to identify the silhouette line information and the intersection grid of the silhouette lines, the polygon outline is interpolated at the same time for each of the left side and the right side and the coordinates of the left side and right side coordinate points for each horizontal axis. Output sequentially or simultaneously, and then horizontally interpolate between the left and right end points.

本発明では外郭線情報を記憶するバッファ(シルエットラインバッファ)を設け、外郭線の通過を示す外郭線フラグ、また外郭線情報として、外郭線有効フラグ、グリッド交差座標点、交差軸、傾き、左右辺、x軸符号、投影中心からの距離(z値)のそれぞれを記憶する。ここでグリッド交差座標点は従来の方式とは異なり(従来は短軸側のDDAの小数点)、長短軸に関わり無くグリッド辺と交差する座標値とする。交差軸とはポリゴン外郭線がグリッドに侵入交差する軸(xあるいはy)である。よって交差軸、左右辺、x軸符号および外郭線有効フラグはそれぞれ1ビットで表す。交差座標値および傾きは任意の範囲をもつ実数あるいは浮動小数点形式値(グリッドの単位は1辺を1.0とし、またy軸の傾きは常に正、x軸は符号ビットが別途設けられおり、いずれの数値も正の小数点以下である)とする。  In the present invention, a buffer (silhouette line buffer) for storing outline line information is provided, and an outline line flag indicating the passage of the outline line, and outline line valid flag, grid intersection coordinate point, intersection axis, inclination, left and right as outline line information Each of the side, the x-axis code, and the distance (z value) from the projection center is stored. Here, the grid intersection coordinate point is different from the conventional method (conventionally, the DDA decimal point on the short axis side), and is a coordinate value that intersects the grid side regardless of the long or short axis. The intersecting axis is an axis (x or y) at which the polygon outline enters and intersects the grid. Therefore, the intersection axis, the left and right sides, the x-axis code, and the outline valid flag are each represented by 1 bit. Crossed coordinate values and slopes are real numbers or floating-point values with arbitrary ranges (the grid unit is 1.0 on one side, the slope of the y-axis is always positive, and the sign bit is separately provided for the x-axis. (Each number is less than the positive decimal point).

本発明ではシルエットラインバッファとして、従来の全描画空間の大きさをもち画素当たり数十ビットの外郭線情報を記憶する構造ではなく、1画素1ビットからなるバッファ(以下平面バッファという)を設ける。この平面バッファには外郭線が通過する画素に“1”を立て、外郭線以外では“0”とする。また外郭線情報を記憶するバッファとして、外郭線が通過する画素数分のアドレス数からなる1次元バッファを設ける(以下このバッファを情報バッファという)。よって従来の方式とは異なり、外郭線情報を記憶するバッファは全描画空間分の容量を持たない。情報バッファはアドレス毎(ワード単位)には、例えば3本分の外郭線情報が記憶できるものとする。もし同一グリッド内でポリゴン外郭線が3本以上交差し、この記憶域をオーバーフローする場合には、ワード長を拡張してバッファする。このように同一グリッドに多数の外郭線が交差すれば、3本毎に、情報バッファを拡張し、順次外郭線情報を記憶してゆく。拡張バッファ部分も、例えば外郭線情報3本分単位で拡張する。一方、物体名の具なるポリゴンの外郭線がグリッド内に侵入した場合には、その外郭線情報は、それまでの情報バッファのワード内に記憶域が残っていても、前記拡張バッファ部分に切り替えて記憶する。
本発明では情報バッファのアドレス毎(シルエットライン・グリッド毎)に1つの背景バッファ(以下BKバッファという)を設ける。BKバッファにはグリッドの背景となるポリゴンの投影中心からの距離(z値)を記憶する。デフォルトでは無限遠方とする。
描画空間全体の画素数に比べて、シルエットラインの占める画素数は通常数百分の1以下であり、また複数の外郭線やポリゴン頂点が、同一グリッド内で重なる頻度はさらに少ない。また1つのポリゴン(3角形)が1つのグリッド内で交差する数は最大で3本である。隣接するポリゴンが1辺を共有し、その共有した辺はシルエットラインではない(外郭線を共有するポリゴン辺と一致した場合は外郭線有効フラグをリセットする)ため、この場合は2本となる。この結果から本発明では、前記情報バッファのアドレス毎には少なくとも外郭線情報を3本分書き込み可能とし、この本数を超える場合は、拡張されたワードに記憶する。バッファの物理的構造としては、情報バッファのワードを外郭線情報1セット分の記憶容量とし、2セット以降は外郭線情報毎にバッファを動的にリンクしてゆく方法であっても良い。
In the present invention, a buffer having 1 bit per pixel (hereinafter referred to as a plane buffer) is provided as a silhouette line buffer rather than a conventional structure for storing outline information of several tens of bits per pixel having the size of the entire drawing space. In this plane buffer, “1” is set for the pixels through which the outline passes, and “0” is set for the pixels other than the outline. Further, as a buffer for storing outline information, a one-dimensional buffer having addresses corresponding to the number of pixels through which the outline passes is provided (hereinafter, this buffer is referred to as an information buffer). Therefore, unlike the conventional method, the buffer for storing the outline information does not have a capacity for the entire drawing space. The information buffer can store, for example, three outline information for each address (in word units). If three or more polygon outlines intersect in the same grid and overflow this storage area, the word length is expanded and buffered. In this way, when a large number of outline lines intersect the same grid, the information buffer is expanded every three lines, and outline information is sequentially stored. The extension buffer part is also extended in units of three outline information, for example. On the other hand, when the outline of the polygon that is the object name enters the grid, the outline information is switched to the extended buffer even if the storage area remains in the word of the previous information buffer. And remember.
In the present invention, one background buffer (hereinafter referred to as BK buffer) is provided for each address of the information buffer (for each silhouette line / grid). The BK buffer stores the distance (z value) from the projection center of the polygon serving as the grid background. Default is infinity.
Compared to the total number of pixels in the drawing space, the number of pixels occupied by the silhouette line is usually less than one hundredth, and a plurality of contour lines and polygon vertices are less frequently overlapped in the same grid. Further, the maximum number of intersections of one polygon (triangle) in one grid is three. Adjacent polygons share one side, and the shared side is not a silhouette line (the outline line valid flag is reset if it coincides with a polygon side that shares the outline line). In this case, there are two lines. From this result, in the present invention, at least three outline information can be written for each address of the information buffer, and when this number is exceeded, it is stored in the expanded word. As a physical structure of the buffer, a method may be used in which the word of the information buffer has a storage capacity for one set of outline information, and the buffers are dynamically linked for each outline information after two sets.

本発明では平面バッファから情報バッファへのリンクは、平面バッファの外郭線座標値(x、y)を入力変数とした、例えばハッシュ法で生成した値を間接アドレスとすることで対応つける。よって排他的にアドレッシングできる情報バッファの大きさは、m次関数で除算した場合、2ワードとなる。平面バッファのx、yアドレスが異なるにも関わらず、設定したm値が小さくアドレスが競合した場合には、リンクアドレスを生成してバッファワードを拡張する。情報バッファ間のリンクは、前記間接アドレスをデータとして、再度m値の異なる多項式剰余値を用いたアドレスを生成して記憶する動的な方法が考えられるが、情報バッファの拡張ワード数(ビットフィールド長)を制限し(例えば4ワード分までとすると、ワード当たり3本分の外郭線情報として最大12本の外郭線情報が記憶可能)、情報バッファはアドレス毎にすべて同じビット長としても、2次元配列の構造から比較すれば大きな容量とはならない。In the present invention, the link from the plane buffer to the information buffer is associated by using, as an indirect address, a value generated by the hash method, for example, using the outline coordinate values (x, y) of the plane buffer as input variables. Therefore, the size of the information buffer that can be exclusively addressed is 2 m words when divided by an m-order function. When the set m value is small and the addresses conflict even though the x and y addresses of the planar buffer are different, a link address is generated and the buffer word is expanded. As a link between information buffers, a dynamic method in which an indirect address is used as data to generate and store an address using a polynomial remainder value having a different m value can be considered. (Up to 4 words, for example, a maximum of 12 outline information can be stored as 3 outline information per word), and even if the information buffer has the same bit length for each address, 2 Compared with the structure of the dimensional array, the capacity is not large.

外郭線を情報バッファに記憶する際、すでに記憶された外郭線のそれぞれのz値を読み出して比較する。シャドウ・アンチエイリアスにおいては光源に最も近い、またポリゴン・アンチエイリアスにおいては、視点に最も近い外郭線情報を情報バッファ・ワード内の第1フィールドに、また次に近い外郭線を第2フィールドに、さらに次に近いものを第3フィールドという順序で記憶する。よって後書きのポリゴンのz値が、最も光源あるいは視点に近い場合には、それぞれのフィールドの情報は下位のフィールドに移動させる。一方、共有辺により、バッファの情報が削除された場合には、これとは逆に上位方向に詰める。  When storing the contour lines in the information buffer, the z values of the contour lines already stored are read and compared. In shadow antialiasing, the closest contour to the light source, and in polygon antialiasing, the contour information closest to the viewpoint is in the first field in the information buffer word, the next contour in the information buffer word is in the second field, and the next Is stored in the order of the third field. Therefore, when the z value of the later-written polygon is closest to the light source or the viewpoint, the information of each field is moved to the lower field. On the other hand, when the buffer information is deleted due to the shared side, the information is packed in the upper direction.

外郭線のz値の比較は、外郭線のz値をzバッファ(それぞれの情報バッファのそれぞれのワード毎にz値を記憶するビットフィールド)を設けて記憶し、このz値と、後書き外郭線のz値との差分計算となるが、隠面消去のためのz値は、通常の画像メモリシステムでは、最も視点あるいは光源に近いz値を記憶するために1組のバッファを設けており、2番目以降の視点あるいは光源近いz値を記憶するバッファは設けていない。本発明では所定の近接数まで(実用的には3−4レベルまでで良い)それぞれのzバッファを情報バッファ内に用意する。  The z-value of the outline is compared by storing the z-value of the outline by providing a z-buffer (a bit field for storing the z-value for each word of each information buffer), and this z-value and the postscript outline In the normal image memory system, a set of buffers is provided to store the z value closest to the viewpoint or the light source in the normal image memory system. There is no buffer for storing the second and subsequent viewpoints or z values close to the light source. In the present invention, each z buffer up to a predetermined proximity number (practically up to 3-4 level) is prepared in the information buffer.

外郭線が、シルエットラインかポリゴン共有辺のいずれかの判定は、新たにグリッドに交差する外郭線(後書き)と、すでに情報バッファに記憶された外郭線(前書き)のそれぞれの辺の内外部方向が相反し(離れる方向)、且つこの方向以外の外郭線情報が一致した場合は、その外郭線はポリゴン接続境界(辺)でありシルエットラインでないと見なされる。これに対し左右辺が相対する(向かい合う)方向の場合は、全ての外郭線情報が一致していたとしても、描画投影上、2辺が一致したに過ぎないため、この判定で外郭線がポリゴン接続境界とは断定できない。さらに前記判定は同一曲面上にあるポリゴンに関して満足するものであり曲面が異なる場合には、後書き外郭線と前書き外郭線が完全に重畳し、且つ辺方向が相反するといえども接続境界とは断定できない。よって本発明では、曲面が異なるポリゴンの外郭線と判断された場合は、その情報を、異なるバッファ(情報バッファの拡張部)に記憶する。一方、完全に曲面の背後にあるポリゴンの外郭線情報は記憶する必要はない。外郭線交差グリッドが、完全にポリゴンの背面に位置するか否かは、ポリゴンの内部の塗りつぶし処理の段階で始めて判断可能である。よって本発明ではスパン補間処理においても、その補間座標値を用いて平面バッファの外郭線フラグを読出し、フラグが立っているグリッドが検出された場合、スパン補間z値と、情報バッファに記憶されたz値を読み出して比較し、スパン補間側が、すべての情報バッファのz値よりも視点あるいは光源により近い場合には、塗りつぶし中のポリゴンは全ての映像の前面に位置するものとして、平面バッファのフラグをリセットする。この場合、スパン補間中の外郭線上(左右の始点と終点およびy軸のボトムとトップ辺)でのグリッドに関しては、グリッド領域内でのポリゴンとしてはオーバーラップではなく、クロスしている可能性がある。よって本発明では前記  Whether the outline is a silhouette line or a polygon shared side is determined by the internal / external direction of each side of the outline that intersects the grid (postscript) and the outline of the outline already stored in the information buffer (preface) Are contradictory (in the direction away from each other) and the contour line information other than this direction matches, the contour line is regarded as a polygon connection boundary (side) and not a silhouette line. On the other hand, in the direction where the left and right sides are opposite (facing each other), even if all the outline line information matches, only two sides match in drawing projection. It cannot be determined as a connection boundary. Furthermore, the above determination is satisfactory for polygons on the same curved surface, and if the curved surfaces are different, the connection boundary cannot be determined even if the trailing outline and the leading outline are completely overlapped and the side directions are contradictory. . Therefore, in the present invention, when it is determined that the contour line of the polygon has a different curved surface, the information is stored in a different buffer (an extended portion of the information buffer). On the other hand, it is not necessary to memorize the outline information of the polygon completely behind the curved surface. Whether or not the outline crossing grid is completely positioned behind the polygon can be determined only at the stage of the interior painting process of the polygon. Therefore, in the present invention, also in the span interpolation processing, the contour line flag of the plane buffer is read using the interpolation coordinate value, and when the grid with the flag set is detected, the span interpolation z value and the information buffer are stored. The z value is read and compared, and if the span interpolation side is closer to the viewpoint or light source than the z value of all information buffers, the filled polygon is assumed to be located in front of all images, and the flag of the plane buffer To reset. In this case, regarding the grid on the contour line during the span interpolation (left and right start and end points and y-axis bottom and top sides), there is a possibility that the polygons in the grid area are not overlapping but crossing. is there. Therefore, in the present invention,

の前提から、スパン補間が外郭線補間の直後に実行されることから、外郭線補間時の識別子(この識別子は本発明では次項記載の順序値)をスパン補間回路に引継ぎ、スパン補間の段階でバッファから外郭線情報を読み出す際、順序値が一致するものがあれば、そのグリッドはスパン補間中のポリゴンの外郭線としてバッファのリセットは行わない。順序値が一致するものがなく、且つバッファの外郭線情報のz値がスパン補間のz値に対して遠方となる場合には、その外郭線はスパン補間中のポリゴンの背後に位置するものと見なし、遠方となる外郭線情報をリセットする。遠方となる外郭線がグリッド内で唯一の場合には、平面バッファのフラグもまたリセットする。一方、前記処理において、セット・リセット対象グリッドにおいて、スパン補間の順序値が不一致で、平面バッファのフラグがセットされた状態となる場合(スパン補間中のポリゴンは異なるポリゴンの外郭線の遠方に位置する)は、さらにスパン補間のz値と、BKバッファのz値とも比較する。もしBKバッファのz値がスパン補間のz値よりも視点に近いときは、BKバッファはそのままとし、遠方となる場合は、BKバッファをスパン補間のz値に置き換える。Therefore, since the span interpolation is executed immediately after the outline interpolation, the identifier at the time of the outline interpolation (this identifier is the order value described in the next section in the present invention) is taken over by the span interpolation circuit, and at the stage of span interpolation. When the contour line information is read from the buffer, if there is a match in the order value, the grid is not reset as the contour line of the polygon being span-interpolated. If there is no match in the order value and the z value of the buffer outline information is far from the z value of the span interpolation, the outline is located behind the polygon being spanned. Regardless, reset the distant outline information. If the far outline is the only one in the grid, the plane buffer flag is also reset. On the other hand, in the processing described above, when the set value of the set / reset grid does not match the span interpolation sequence value and the plane buffer flag is set (the polygon being span-interpolated is located far from the outline of a different polygon) Is also compared with the z value of span interpolation and the z value of the BK buffer. If the z value of the BK buffer is closer to the viewpoint than the z value of span interpolation, the BK buffer is left as it is, and if it is far away, the BK buffer is replaced with the z value of span interpolation.

ポリゴンがそれぞれ具なるオブジェクトのものであるか否かの判断は、特開2002−352253のように、オブジェクト名を外郭線の識別子として外郭線情報の1つとする手段があるが、本発明では、オブジェクト識別子は情報バッファ内の拡張バッファの切り替えに用い、外郭線それぞれの記憶対象としての識別子とはしない。ポリゴンの識別子として本発明は順序値を用い、それぞれの外郭線情報に付加する。順序値とはオブジェクト識別子毎に0から順次、値を更新し適当な値になると再び0から開始するものである。オブジェクトの配置様態は通常、幾何学的に局所性をもっており、1つのグリッドに落ち込むオブジェクトの確立はそれほど高くない(例えば1万オブジェクト程度であれば14ビットで良い)。順序値を記憶するバッファを、平面バッファではなく情報バッファ上に置く。この結果、順序値記憶のためのバッファ容量は僅かとなる。これらオブジェクト識別子と順序値は、オブジェクト毎のバッファの切り替えと、同一識別子内の順序値の場合には、共有辺条件の有無を検査するためのものとなる。すなわち識別子が同一で、前書き、後書き順序値も同一の場合は、同一グリッド内に同一ポリゴンの2辺が交差することを意味し、カレントな情報バッファに外郭線情報を記憶する。一方、順序値が異なる場合には、情報バッファがオーバーフローしなければカレントなバッファに、オーバーフローすれば情報バッファの次の拡張バッファに外郭線情報を書き込む。カレントなバッファを示すポインタは、情報バッファのワード内に付加するか、ポインタ用レジスタを1つ設ける。順序値が異なる最初のバッファアクセスで、情報バッファのID(識別子)をカレントバッファ(あるいはレジスタ)に書き込む。情報バッファIDとはバッファ番号(0は情報バッファ、1は最初の拡張バッファ、2は次の拡張バッファ等)とワードフィールド番号(0−2まで)である。以降アクセス毎にその順序値とバッファIDを同時に比較する。例えばオブジェクトが変わることにより、それまでの順序値が不一致となり、情報バッファの最初のバッファがすでに使用され、第2の(拡張)バッファが未使用であれば、カレントバッファポインタには第2のバッファIDと未使用ワードフィールド番号がセットされる。以降は順序値が変わらないか、空き領域が無くならない限り、第2バッファがアクセスされる。
前記順序値のバッファリングに関し、それぞれの情報バッファ毎に順序値をバッファする方法ではなく、情報バッファに1つ記憶する手段も可能である。すなわち、外郭線補間とスパン補間とは常にパイプライン順序で処理されることを前提にすれば順序値記憶バッファを情報バッファのそれぞれに記憶するのでなく、パイプラインレジスタを用いればスパン補間段階での自身のポリゴンの外郭線情報の識別ができ、前項のスパン補間段階での外郭線のリセット判定の処理が可能となる。
The determination of whether or not each polygon is a specific object has means for setting the object name as one of the outline line information as disclosed in JP-A-2002-352253. In the present invention, The object identifier is used for switching the extension buffer in the information buffer, and is not used as an identifier for storing each outline. The present invention uses an order value as a polygon identifier and adds it to each outline information. The order value is a value that is sequentially updated from 0 for each object identifier and starts from 0 again when an appropriate value is obtained. The arrangement of objects is usually geometrically local, and the probability of an object falling into one grid is not so high (for example, 14 bits are enough for about 10,000 objects). The buffer for storing the sequence value is placed on the information buffer instead of the plane buffer. As a result, the buffer capacity for storing the sequence value is small. These object identifiers and order values are used to switch buffers for each object, and in the case of order values within the same identifier, check for the presence of a shared edge condition. That is, when the identifiers are the same and the foreword and the afterword order values are the same, it means that two sides of the same polygon intersect in the same grid, and the outline information is stored in the current information buffer. On the other hand, if the order values are different, the outline information is written in the current buffer if the information buffer does not overflow, and in the next extended buffer after the information buffer if the information buffer overflows. A pointer indicating the current buffer is added in the word of the information buffer or one pointer register is provided. In the first buffer access with a different order value, the ID (identifier) of the information buffer is written to the current buffer (or register). The information buffer ID is a buffer number (0 is an information buffer, 1 is a first extension buffer, 2 is a next extension buffer, etc.) and a word field number (up to 0-2). Thereafter, the sequence value and the buffer ID are simultaneously compared for each access. For example, if the object changes, the previous sequence values become inconsistent, the first buffer of the information buffer is already used, and the second (extended) buffer is unused, the second buffer is used as the current buffer pointer. ID and unused word field number are set. Thereafter, the second buffer is accessed as long as the order value does not change or as long as there is no free space.
With respect to the buffering of the order value, it is possible to store one in the information buffer instead of the method of buffering the order value for each information buffer. That is, if it is assumed that the contour line interpolation and the span interpolation are always processed in the pipeline order, the sequence value storage buffer is not stored in each of the information buffers, but if the pipeline register is used, the span interpolation stage is not stored. The contour line information of its own polygon can be identified, and the contour line reset determination process at the span interpolation stage described above can be performed.

以上から、本発明では前記  From the above, in the present invention,

の1−4項までの様態に対して、下記の処理を行う。1項は外郭線情報を情報バッファに記憶する。2−1項は情報バッファの同一ワードに2つの外郭線情報を記憶する。2−2項はポリゴンが視線方向と平行か縮小化され、外郭線が一致する場合であり、2つのそれぞれの外郭線情報を同一バッファ・ワードに記憶する。2−3項ではオブジェクトは同一で順序値の変化はないが、ポリゴンが異なる場合で、2つのそれぞれの外郭線情報を同一バッファ・ワードに記憶する。2−4項はオブジェクトが同一で内外部方向が相反している場合、外郭線は2つのポリゴンの共有辺と見なし、バッファに記憶された前書き外郭線情報と後書き外郭線情報の両者を消去(バッファ内の外郭線フラグをリセット)する。もし消去により情報バッファに外郭線情報がなくなれば平面バッファの外郭線フラグもリセットする。一方、相対する外郭線情報のみで、且つ同一オブジェクトであれば、オブジェクトは凹面を含んでおり、後書き情報をバッファに記憶する。この場合、前記The following processing is performed for the aspects up to 1-4. Item 1 stores outline information in the information buffer. Item 2-1 stores two outline information in the same word of the information buffer. Item 2-2 is a case where the polygon is parallel or reduced to the line-of-sight direction and the outline lines match, and the two pieces of outline line information are stored in the same buffer word. In section 2-3, the objects are the same and the order value does not change, but when the polygons are different, the two pieces of outline information are stored in the same buffer word. In item 2-4, when the objects are the same and the internal and external directions are contradictory, the outline is regarded as a shared edge of the two polygons, and both the foreword outline information and the afterline outline information stored in the buffer are deleted ( Reset the outline flag in the buffer). If there is no outline information in the information buffer due to erasure, the outline flag of the plane buffer is also reset. On the other hand, if only the opposite outline information is the same object, the object includes a concave surface, and the postscript information is stored in the buffer. In this case,

のバッファ容量例とすれば最大3つまでの外郭線情報が記憶可能となる。この数は任意に増加することができる。2項のケースでオブジェクトが異なる場合は、拡張された情報バッファに新たに外郭線情報を記憶する。またポリゴン塗りつぶし処理(スパン補間)時の隠面消去処理により、バッファに記憶された外郭線がポリゴンの完全背後に位置する場合は、その背後となるすべての外郭線情報を消去する。この結果、バッファ・ワードあるいは拡張バッファが空白となる場合は、空いたワードを詰めるため上位の方向に移動する。3−1および3−2項は左右辺の2つをそれぞれ同一の情報バッファ・ワードに記憶する。3−3項は内外部方向が相対し、その他の外郭線情報が全て一致する場合であり左右辺のそれぞれを記憶する。4−1項では、後書きの外郭線は頂点を当該グリッド内(よって2辺を含む)に持ち、また当該グリッドには、すでに記憶された外郭線があり、その外郭線と後書き外郭線の一方が内外部方向で相反し、その他の外郭線情報は一致するものであれば、一致したその外郭線をバッファから消去し(外郭線フラグのリセット)、また後書き情報の内、一致した辺も記憶しない。後書きが一致しない外郭線情報のみをバッファに新たに記憶する。4−2項は、例えば球体の頂点のように、すべての外郭線の1辺が後書きの外郭線の1辺と同一であり、すべての辺が接続辺である場合であり、描画後にはグリッド内のすべての外郭線がリセットされる。4−3項は、例えば縮小されてポリゴンの各辺が重なり合う場合で、後書き外郭線と、すでに記憶された外郭線の内外方向が相反するものがあればリセットする。結果としてポリゴンが閉じていなければ2つの相対する外郭線がバッファに残ることになる。4−4項は外郭線の内外方向が相反し他の外郭線情報が一致したもののみをリセットする。4−5項はすべての外郭線が記憶対象となる。但し隠面消去結果ではリセットされるものが含まれる可能性がある。最大の記憶数はバッファの拡張数で決まる。4−6項は4−5項と同様の処理となる。In this example of buffer capacity, up to three pieces of outline information can be stored. This number can be increased arbitrarily. If the object is different in the case of item 2, the outline information is newly stored in the extended information buffer. Further, when the outline line stored in the buffer is completely behind the polygon by the hidden surface elimination process during the polygon filling process (span interpolation), all outline line information behind the polygon is erased. As a result, when the buffer word or the extension buffer becomes blank, the upper word is moved to pack the empty word. Items 3-1 and 3-2 store the two left and right sides respectively in the same information buffer word. Item 3-3 is a case where the inner and outer directions are opposite and the other contour line information all match, and stores each of the left and right sides. In Section 4-1, the outline of the afterword has a vertex in the grid (and thus includes two sides), and the grid has an already stored outline, and one of the outline and the outline of the latter If there is a conflict in the internal and external directions and the other contour line information matches, the matched contour line is erased from the buffer (reset the contour line flag), and the matched edge is also stored in the postscript information do not do. Only the outline information that does not match the afterword is newly stored in the buffer. Item 4-2 is a case where one side of all outlines is the same as one side of the outline line written later, for example, as a vertex of a sphere, and all sides are connected sides. All outlines in are reset. Item 4-3 is, for example, when the sides of the polygon are reduced and overlapped, and if there is a conflict between the outline of the later writing and the inside / outside direction of the outline already stored, it is reset. As a result, if the polygon is not closed, two opposing outlines will remain in the buffer. The item 4-4 resets only the case where the inside and outside directions of the outline line conflict and the other outline line information matches. In the item 4-5, all outlines are stored. However, the hidden surface removal result may include a reset result. The maximum memory number is determined by the number of buffer expansions. Item 4-6 is the same processing as item 4-5.

ポリゴンの描画では、ポリゴン頂点に必要な情報(頂点座標値、法線、光源入射角、視線ベクトルなど)を定義し、ポリゴン頂点間を結ぶ外郭線に沿って前記定義情報を補間した後、水平軸と交わる外郭線左右の点間でさらに補間を行うスパン処理をポリゴンのy軸上の下から上に行うことでポリゴンの内部のすべての点の頂点定義情報の補間値を得る。外郭線に沿った補間処理においては一般に、外郭線補間回路を構成する直線式あるいはDDA回路から得られる座標値の整数部を画素座標値と定める。この際、外郭線が45度の傾きに対してx軸側に傾いている場合の直線をx軸メジャー(長細)、y軸マイナー(短軸)と言い、y軸に傾いている場合はその逆に呼ぶ。補間はメジャー軸座標値を代入にて求める。この代入座標値は整数値を用いる。(1)式はx軸メジャーの場合で(2)式はy軸メジャーの場合の直線式を示す。直線の始点と終点をそれぞれ(x0,y0)と(x1,y1)とする。(1)式でXiは直線の始点(x0)から終点までのグリッド間距離を代入してy座標値を求める。(1)および(2)式のYiおよびXiは整数値、またYfおよびXfはそれぞれ小数点値である。この結果得られた(Xi,Yi)は画素座標点であり、すなわち直線は、(Xi,Yi)の整数値をグリッド原点としてグリッド内を通過する。
Yi+Yf={(y1−y0)/(x1−x0)}(Xi−x0)+y0 (1)
Xi+Xf={(x1−x0)/(y1−y0)}(Yi−y0)+x0 (2)
最近傍法を用いれば、例えば(1)式において、直線の小数点値Yfが1>Yf≧0.5となる場合では四捨五入により(Xi,Yi+1)が画素座標点となる。すなわち従来のDDAは(1)式に0.5を丸め加算し、左辺の整数値のみを用いた。この決定方式では直線が(Xi,Yi)グリッドを交差するにもかかわらず、一部の交差グリッドは通過点と見なされない場合が生じる。この結果、直線式やDDAから得られる座標点は交差する全てのグリッドを含まない。一方、グリッドを交差する直線を境界としてポリゴン内外の面積比を求めるアンチエイリアスやソフトシャドウでは、外郭線が通過するすべてのグリッド座標とその面積比を求める必要がある。
In polygon drawing, necessary information (vertex coordinate value, normal line, light source incident angle, line-of-sight vector, etc.) is defined for polygon vertices, the definition information is interpolated along the outline line connecting the polygon vertices, and then horizontal By performing span processing for further interpolation between points on the left and right sides of the contour line intersecting the axis from the bottom to the top on the y-axis of the polygon, the interpolation values of the vertex definition information of all the points inside the polygon are obtained. In interpolation processing along an outline, generally, an integer part of a coordinate value obtained from a linear expression or a DDA circuit constituting an outline interpolation circuit is determined as a pixel coordinate value. At this time, the straight line when the outline is inclined to the x-axis side with respect to the inclination of 45 degrees is called the x-axis major (long and narrow) and the y-axis minor (short axis). Call the opposite. Interpolation is obtained by substituting major axis coordinate values. An integer value is used as the assigned coordinate value. Equation (1) is an x-axis major and equation (2) is a linear equation for y-axis major. Let the start point and end point of the straight line be (x0, y0) and (x1, y1), respectively. In equation (1), Xi substitutes the distance between grids from the start point (x0) to the end point of the straight line to obtain the y coordinate value. In equations (1) and (2), Yi and Xi are integer values, and Yf and Xf are decimal values. (Xi, Yi) obtained as a result is a pixel coordinate point, that is, a straight line passes through the grid with the integer value of (Xi, Yi) as the grid origin.
Yi + Yf = {(y1-y0) / (x1-x0)} (Xi-x0) + y0 (1)
Xi + Xf = {(x1-x0) / (y1-y0)} (Yi-y0) + x0 (2)
If the nearest neighbor method is used, for example, in equation (1), when the decimal point value Yf of the straight line satisfies 1> Yf ≧ 0.5, (Xi, Yi + 1) becomes the pixel coordinate point by rounding off. That is, the conventional DDA rounds and adds 0.5 to the equation (1) and uses only the integer value on the left side. In this determination method, although a straight line intersects the (Xi, Yi) grid, some intersecting grids may not be regarded as passing points. As a result, the coordinate points obtained from the linear formula or DDA do not include all intersecting grids. On the other hand, in anti-aliasing or soft shadow for obtaining the area ratio inside and outside the polygon with a straight line intersecting the grid as a boundary, it is necessary to obtain all grid coordinates through which the outline passes and the area ratio.

本発明では、ポリゴン塗りつぶしのための外郭線補間回路において、前記の従来方式とは異なり0.5を加算しないで、整数部と小数点部をそれぞれ求め、グリッド座標点は整数部(よって本発明では、座標点のまるめは四捨五入ではなく、切捨て)とし、長短軸、傾きおよび小数点部の値から交差条件を求め、全てのグリッドを検出する。この判定例として本発明では表1のアルゴリズムを用いてグリッド点を決定できる。

Figure 2007141196
表1において、Yfはy軸の小数点部、Xfはx軸小数点部、ΔSはx軸メジャーの場合は(y1−y0)/(x1−x0)、y軸メジャーの場合は(x1−x0)/(y1−y0)となる。グリッド点は本発明の、外郭線が交差するグリッド座標を示し、一方、DDA画素点は最近傍法における小数点部が丸められた座標値であり、これが従来のポリゴンの塗りつぶしに用いる座標値である。In the present invention, in the outline interpolation circuit for filling the polygon, unlike the above-described conventional method, the integer part and the decimal point part are obtained without adding 0.5, and the grid coordinate point is the integer part (therefore, in the present invention). The rounding of the coordinate points is not rounded off, but rounded off), and the intersection condition is obtained from the long and short axes, the slope, and the decimal point values, and all grids are detected. As an example of this determination, the present invention can determine grid points using the algorithm shown in Table 1.
Figure 2007141196
In Table 1, Yf is the decimal point part of the y-axis, Xf is the decimal part of the x-axis, ΔS is (y1-y0) / (x1-x0) for the x-axis major, and (x1-x0) for the y-axis major. / (Y1-y0). The grid points indicate the grid coordinates at which the contour lines of the present invention intersect, while the DDA pixel points are the coordinate values with the decimal point rounded in the nearest neighbor method, which are the coordinate values used for conventional polygon filling. .

ポリゴン塗りつぶし処理において、本発明と、従来の直線式やDDAと具なる点は本発明では表1のグリッド点を画素座標値として出力することである。この結果、例えばx軸メジャーにおいて、直線式にx軸座標値を代入すると、出力座標点は1点だけでなく、条件により2点すなわちx軸メジャーにおいては、(Xi,Yi)と(Xi,Yi+1)を通過グリッド点となる。  In the polygon filling process, the present invention and the conventional linear expression and DDA are the points that the grid points in Table 1 are output as pixel coordinate values in the present invention. As a result, for example, when the x-axis coordinate value is substituted into the linear equation in the x-axis measure, not only one output coordinate point but also two (Xi, Yi) and (Xi, Yi + 1) becomes a passing grid point.

グリッド内の描画点(補間値の小数点部。以下サンプリング点と言う)が、シルエットラインバッファに記憶された情報から、ポリゴンの内部か外部かの判定を行うことは、影の描画に必要である。この場合、第1パスでは光源系座標でシルエットラインバッファに外郭線情報を記憶し、第2パスで、視点系座標値で前記(1)あるいは(2)式で補間された描画点を光源系座標値に変換し、この変換座標値を第1パスで求めたシルエットラインバッファを構成する情報バッファの外郭線情報を用いて検証を行う。前記サンプリング点は影の処理では、光源系座標に変換された描画座標値を示す。サンプリング点を外郭線情報から得られた直線式にそれぞれ代入し、その値とサンプリング点とを差分し、左右辺のフラグを基に符号でサンプリング点の内外判定を行う。その手順は下記となる。
1.サンプリング点が、すべての情報バッファに記憶された外郭線(ポリゴン)の外側にあり、またBKバッファのz値とサンプリング点のz値を比較して、サンプリング点がより光源あるいは視点に近い場合は領域外(影判定の場合は照射点)、一方、サンプリング点がBKバッファよりも遠方であれば背後(影判定の場合は影)として判定終了。
2.サンプリング点がいずれかの情報バッファ外郭線の領域内で、またz値の比較結果、遠方にある場合は背後(影)となる。
3.サンプリング点が、あるポリゴンの内部となるものの、光源に近く、それ以上の上位のバッファの全ての記憶情報に対しては領域外である場合は領域外(照射点)となる。
It is necessary to draw a shadow to determine whether the drawing point in the grid (the decimal part of the interpolation value; hereinafter referred to as the sampling point) is inside or outside the polygon from the information stored in the silhouette line buffer. . In this case, the contour line information is stored in the silhouette line buffer in the light source system coordinates in the first pass, and the drawing points interpolated by the above-described expression (1) or (2) in the viewpoint system coordinate values in the second pass. Conversion to coordinate values is performed, and verification is performed using the contour line information of the information buffer that constitutes the silhouette line buffer obtained in the first pass. The sampling point indicates a drawing coordinate value converted into a light source system coordinate in shadow processing. Sampling points are substituted into the linear equations obtained from the contour line information, and the values and the sampling points are subtracted, and the inside / outside determination of the sampling points is performed with a code based on the flags on the left and right sides. The procedure is as follows.
1. If the sampling point is outside the outline (polygon) stored in all the information buffers, and the z value of the BK buffer is compared with the z value of the sampling point, the sampling point is closer to the light source or viewpoint Outside the region (irradiation point in the case of shadow determination), on the other hand, if the sampling point is far from the BK buffer, the determination ends as the back (shadow in the case of shadow determination).
2. If the sampling point is in the area of any information buffer outline and the comparison result of the z value is far away, it is behind (shadow).
3. If the sampling point is inside a certain polygon, but close to the light source and out of the area for all the stored information in the higher-order buffer, it is out of the area (irradiation point).

表2はサンプリング点と外郭線内外の関係表である。ポリゴンの内外判定は、1例として外郭線情報から得た直線式にサンプリング点を代入し、その結果値とサンプリング点とを差分し、符号で判断する。表2においてXjおよびYjはそれぞれサンプリング点(Xi,Yi)を前記(1)および(2)式に代入して得た座標値である。Inside RightおよびLeftはポリゴンの内部側がそれぞれ右および左を表す。

Figure 2007141196
Table 2 is a relationship table between sampling points and contour lines. As an example, polygon inside / outside determination is performed by substituting a sampling point into a linear expression obtained from outline information, and the difference between the result value and the sampling point is determined by a sign. In Table 2, Xj and Yj are coordinate values obtained by substituting sampling points (Xi, Yi) into the equations (1) and (2), respectively. Inside Right and Left represent the right and left sides of the polygon, respectively.
Figure 2007141196

影のシルエットラインのアンチエイリアスと、ポリゴン・バウンダリーエッジ・アンチエイリアスは前記  Shadow silhouette line antialiasing, polygon boundary edge antialiasing

からFrom

と同じ処理で実現できる。それぞれが異なる点は、前者が内挿点のポリゴンの内外領域判定であるのに対して、後者はグリッド内に占めるそれぞれのポリゴン面積に比例した輝度合成を行う点である。It can be realized by the same process. The difference is that the former is the determination of the inside / outside region of the polygon at the interpolation point, while the latter is the luminance synthesis proportional to the area of each polygon in the grid.

また影は2パス方式であるのに対しバンダリーエッジアンチエイリアスでは、1パス方式であり、視点系座標描画時に外郭線情報を記憶し、これをポリゴン描画毎か、あるいは描画後に輝度合成を行う点でそれぞれ異なる。これらアンチエイリアス回路はコンピュータグラフィックスプロセッサや画像処理装置の基本機能として、ポリゴン内挿補間や輝度計算回路と組み合わせることによって高品質の画像を得ることができる。  The shadow is a two-pass method, whereas the Boundary Edge Anti-aliasing is a one-pass method, and outline line information is stored at the time of viewpoint system coordinate drawing, and brightness synthesis is performed for each polygon drawing or after drawing. Each is different. These anti-aliasing circuits can obtain a high-quality image by combining with a polygon interpolation or luminance calculation circuit as a basic function of a computer graphics processor or an image processing apparatus.

本発明により、より自然に近い現実感のある光反射効果のある映像の描画が実時間で可能となる。  According to the present invention, it is possible to draw an image having a light reflection effect with a realistic feeling close to nature in real time.

本発明の技術はLSI、プログラマブル論理回路等への実装あるいはIP(Intelligent Property)の形態で実施され、コンピュータグラフィックスプロセッサや画像処理装置に応用される。  The technique of the present invention is implemented in an LSI, a programmable logic circuit or the like or in the form of IP (Intelligent Property), and is applied to a computer graphics processor or an image processing apparatus.

図1に本発明に関わるグリッドと外郭線の交差例を示す。図1の(1)は  FIG. 1 shows an example of intersection between a grid and an outline line according to the present invention. (1) in FIG.

の1項の関係に相当する。(2)および(3)はそれぞれThis corresponds to the relationship of one term. (2) and (3) are respectively

の2−1および2−2に対応する。図中での破線は他のポリゴン辺との重なりを示す。2 and 2-2. A broken line in the figure indicates an overlap with another polygon side.

の2−3および2−4も図としては(2)と(3)の関係となる。(4)は3つの外郭線が交差する関係を示す。(5)および(6)はそれぞれ2-3 and 2-4 also have the relationship of (2) and (3). (4) shows the relationship where three outlines intersect. (5) and (6) are

の3−1と3−2に相当する。また(7)はThese correspond to 3-1 and 3-2. (7)

の3−3に相当する。(8)および(9)はそれぞれNo. 3-3. (8) and (9) are

の4−1および4−2に相当する。また(10)と(11)はそれぞれ4-1 and 4-2. (10) and (11) are

の4−4と4−5に対応する。また図1のBuf1に示す複数の、オブジェクトが異なる(図例では3種類を示し、それぞれ実線、破線、鎖線で表示)外郭線が交差する場合には、本発明ではBuf2には実線となるポリゴンを、Buf2には破線のポリゴン外郭線を、またBuf4には鎖線のポリゴン外郭線のそれぞれの情報を分離して記憶する。図でBufは情報バッファとその拡張バッファを意味する。1つの情報バッファおよびその拡張バッファには同一識別子のポリゴン外郭線情報であれば、1例として3組まで記憶する。4-4 and 4-5. In addition, in the present invention, when a plurality of objects shown in Buf1 in FIG. 1 are different (three types are shown in the figure, each indicated by a solid line, a broken line, and a chain line) and outline lines intersect, Buf2 is a polygon that is a solid line In Buf2, the broken line polygon outline is stored in Buf2, and the information of the broken line polygon outline is stored in Buf4. In the figure, Buf means an information buffer and its extension buffer. In one information buffer and its extended buffer, up to three sets of polygon outline information with the same identifier are stored as an example.

図2は本発明に関する外郭線が通過するグリッド位置の例を示す。実線で示す外郭線がグリッドを通過する場合、丸め補正を行う従来のDDAでは黒丸のグリッドが外郭線画素となっていた。しかし図2の(1)に示すように外郭締は破線丸のグリッド内も通過している。よって本発明では図中(1)の場合には黒丸および破線丸のそれぞれが対象画素(外郭線交差グリッド)となる。一方図中の(2)では右2画素(黒丸)に関して外郭線は交差していないが、丸め補正によると一段上の黒丸の画素が有効となる。本発明ではシルエットラインバッファ(平面バッファ)には外郭線が通過しない右2画素の黒丸グリッドにはフラグを立てず、下段(破線丸)にフラグを立てる。さらに図中の(3)ではDDAが示す画素点(黒丸)と外郭線が通過するグリッド(破線丸)が全て具なる例を示す。シルエットラインバッファには外郭線交差画素点(破線丸)のみにフラグを立て、前記同様外郭線の通過しない黒丸グリッドはシルエットラインとしての認識を行わない。  FIG. 2 shows an example of a grid position through which an outline line according to the present invention passes. When a contour line indicated by a solid line passes through the grid, in the conventional DDA that performs rounding correction, the black circle grid is the contour line pixel. However, as shown in FIG. 2 (1), the outer tightening passes through the broken-line grid. Therefore, in the present invention, in the case of (1) in the figure, each of the black circle and the dashed circle is a target pixel (outline crossing grid). On the other hand, in (2) in the figure, the outline lines do not intersect with respect to the right two pixels (black circles), but according to rounding correction, the black circle pixels one level above are effective. In the present invention, the silhouette line buffer (planar buffer) does not set the flag for the black circle grid of the right two pixels through which the outline does not pass, but sets the flag for the lower stage (dotted line circle). Further, (3) in the figure shows an example in which all pixel points (black circles) indicated by the DDA and a grid (broken line circles) through which the outline passes are provided. In the silhouette line buffer, a flag is set only for the outline line intersecting pixel point (dotted line circle), and the black circle grid through which the outline line does not pass is not recognized as a silhouette line.

図3は本発明に関わるシルエットライン情報を記憶する回路を示す。ポリゴンの頂点情報はポリゴン外郭線補間回路30に逐次与えられ、前記補間回路30では頂点間を結ぶ外郭線に沿って頂点情報を線形に補間する。補間回路30では、頂点座標値の内、x、y座標値に関しては前記(1)あるいは(2)式に基づきx、yをスパン補間回路31、マルチプレクサ32および33、に出力する。(1)および(2)式に表記していないz座標値は、x、yのうち長軸座標を直線式の代入値として補間回路30で求めるものとする。すなわちz座標の直線式は、x座標が長軸の場合は(1)式のy座標がz座標値として表記される。影のシルエットラインを生成するシステムではx、y、z座標値は光源系(光源を投影中心と見なした座標系)で定義する。補間回路30では、ポリゴンの左右辺の外郭線補間値を同時平行あるいは交互に求めるため、2回路あるいは1回路を交互に切り替える回路構成となっている。左右の外郭線補間値は次段のスパン補間回路31に与えられ、スパン補間回路31では外郭線左右の座標値を端点として、さらにスパン方向に補間して、ポリゴン水平軸上の座標値を得る。
外郭線補間回路30からは整数座標値だけでなく、左右辺の外郭線それぞれの傾き、小数点座標値、左右辺情報、長短軸情報のそれぞれが補間演算の歩進に合わせて出力される。補間回路30および31で求めたz値はそれぞれマルチプレクサ33を通してz値比較回路36に加えられる。マルチプレクサ33は、z値を補間回路30および31の出力時点毎に切り替えてz値比較回路36に入力するためである。このz値をソースz値と呼ぶ。z値比較回路36では、前記ソースz値と情報バッファ37に記憶されたz値(これをデスティネーションz値と呼ぶ)とを比較する。もしデスティネーションz値が光源に近ければ情報バッファ37にはそれを残し、遠ければソースz値に置き換える。
FIG. 3 shows a circuit for storing silhouette line information according to the present invention. The polygon vertex information is sequentially given to the polygon outline interpolation circuit 30. The interpolation circuit 30 linearly interpolates the vertex information along the outline connecting the vertices. The interpolation circuit 30 outputs x and y to the span interpolation circuit 31 and the multiplexers 32 and 33 based on the expression (1) or (2) regarding the x and y coordinate values among the vertex coordinate values. The z-coordinate values not described in the equations (1) and (2) are obtained by the interpolation circuit 30 using the long-axis coordinate of x and y as a linear equation substitution value. That is, in the linear formula of the z coordinate, when the x coordinate is the long axis, the y coordinate of the formula (1) is expressed as the z coordinate value. In a system that generates a shadow silhouette line, x, y, and z coordinate values are defined by a light source system (a coordinate system in which the light source is regarded as the projection center). The interpolation circuit 30 has a circuit configuration in which two circuits or one circuit are switched alternately in order to obtain parallel interpolation values on the left and right sides of the polygon simultaneously in parallel or alternately. The left and right outline interpolation values are given to the next-stage span interpolation circuit 31, and the span interpolation circuit 31 further interpolates in the span direction using the coordinate values on the left and right outlines as end points to obtain coordinate values on the polygon horizontal axis. .
The contour line interpolation circuit 30 outputs not only the integer coordinate values but also the slopes of the right and left side contour lines, decimal point coordinate values, left and right side information, and long and short axis information in accordance with the progress of the interpolation calculation. The z values obtained by the interpolation circuits 30 and 31 are added to the z value comparison circuit 36 through the multiplexer 33, respectively. The multiplexer 33 switches the z value at each output time of the interpolation circuits 30 and 31 and inputs the z value to the z value comparison circuit 36. This z value is called the source z value. The z value comparison circuit 36 compares the source z value and the z value stored in the information buffer 37 (referred to as a destination z value). If the destination z value is close to the light source, it is left in the information buffer 37, and if it is far away, it is replaced with the source z value.

情報バッファからz値の読出しアドレスの生成を行うのがアドレス制御回路38である。補間回路30および31から出力されたx、y座標値はマルチプレクサ32で選択した後、アドレス発生器34および平面バッファ35に入力する。x、y座標値は全ての画素分を含む2次元配列の平面バッファ35には直接加わるが、情報バッファ37には、アドレス発生器34にて、x、y座標値を多項式除算した剰余値をアドレス制御回路38にて物理アドレスに変換した後、アドレスとして与える。
平面バッファ35から外郭線フラグを読み出し、フラグが立っていれば、そのx、yアドレスを用いたアドレス制御回路38からのアドレスが示す情報バッファおよびその拡張バッファに記憶されたz値をそれぞれ読出し、これらz値をデスティネーションz値として、前記ソースz値と比較回路36で比較する。比較結果はアドレス制御回路38にて、情報バッファ37からの情報(使用中のバッファを示すフラグなど)および外郭線補間回路30からの情報と合わせて、空きバッファの検出やz値比較により隠面消去処理による削除によって生じた外郭線情報の入れ替え等を行うために用いる。
以上から外郭線フラグのための平面バッファ35と、情報バッファ37にはすべての補間が終了した時点で、シルエットラインとなる外郭線情報のみが記憶される。
The address control circuit 38 generates a z-value read address from the information buffer. The x and y coordinate values output from the interpolation circuits 30 and 31 are selected by the multiplexer 32 and then input to the address generator 34 and the plane buffer 35. The x and y coordinate values are directly added to the two-dimensional array plane buffer 35 including all the pixels, but the information buffer 37 receives a remainder value obtained by polynomially dividing the x and y coordinate values by the address generator 34. After being converted into a physical address by the address control circuit 38, it is given as an address.
The outline line flag is read from the plane buffer 35. If the flag is set, the information buffer indicated by the address from the address control circuit 38 using the x and y addresses and the z value stored in the extension buffer are respectively read. These z values are used as a destination z value and compared with the source z value by the comparison circuit 36. The comparison result is hidden in the address control circuit 38 by detecting an empty buffer and comparing z values together with information from the information buffer 37 (such as a flag indicating a buffer in use) and information from the outline interpolation circuit 30. This is used to replace the outline information generated by deletion by the erasing process.
From the above, only the outline line information that becomes a silhouette line is stored in the plane buffer 35 for the outline line flag and the information buffer 37 when all the interpolations are completed.

図4には本発明のシルエットライン処理全体図(影の場合は第2パス)を示す。外郭線40およびスパン41補間回路において、ポリゴン頂点に定義された情報のポリゴン内部のすべての点での補間値を求める。影の処理の場合、座標値は視点座標で補間されており、座標変換回路42において、光源系座標値に変換する(視点座標系シルエットランのアンチエイリアスでは回路42は使用されない)。頂点情報として光源系座標値が定義されている場合は、座標変換回路42はなくても良い。一方、座標値以外の補間された頂点定義情報は補間毎にシェーダ43に加わり、シェーダではそれら補間値から補間点の輝度を決定する。座標変換回路42から出力する光源系座標値はシルエットラインバッファ44に与えられる。シルエットラインバッファは外郭線フラグを記憶した平面バッファ(図1の35)および情報バッファ(図1の37)とその拡張バッファで構成する。座標変換回路42において変換された座標値、さらにその座標値から得た間接アドレスのそれぞれを用いてシルエットラインバッファ44内の平面バッファを読出し、外郭線フラグがなければシルエット処理を行わず、一方、外郭線フラグがある場合には、前記変換座標値は図1に示したアドレス発生器34を経て、さらに情報バッファのすべての対象バッファを読出し、補間座標値と、記憶された外郭線情報から得られるグリッド内領域情報を用いて、境界領域判定回路45にて、補間座標値が、グリッドに交差するポリゴン外郭線の内外部のいずれに位置するのかを判定する。ポリゴン内部の場合には、z値を比較し、そのポリゴンよりも遠方に位置するか否かも判定する。判定の結果、ポリゴンの後方に位置すると決定された場合には、補間点は影と見なしてシェーダ43によって得られた輝度を減衰するためにスケーラ回路46に所定の値を与え、乗算して輝度を下げ、この結果を画素の輝度として画像メモリ47に記憶する。  FIG. 4 is an overall view of silhouette line processing of the present invention (second pass in the case of a shadow). In the outline 40 and span 41 interpolation circuit, the interpolation values at all points inside the polygon of the information defined in the polygon vertex are obtained. In the case of shadow processing, the coordinate values are interpolated by viewpoint coordinates, and are converted into light source system coordinate values by the coordinate conversion circuit 42 (the circuit 42 is not used in antialiasing of the viewpoint coordinate system silhouette run). When the light source system coordinate value is defined as the vertex information, the coordinate conversion circuit 42 may be omitted. On the other hand, the interpolated vertex definition information other than the coordinate value is added to the shader 43 for each interpolation, and the shader determines the luminance of the interpolation point from these interpolation values. The light source system coordinate values output from the coordinate conversion circuit 42 are given to the silhouette line buffer 44. The silhouette line buffer is composed of a plane buffer (35 in FIG. 1) and an information buffer (37 in FIG. 1) storing an outline line flag and its extended buffer. The coordinate value converted by the coordinate conversion circuit 42 and the indirect address obtained from the coordinate value are used to read the plane buffer in the silhouette line buffer 44. If there is no outline line flag, no silhouette processing is performed. When there is an outline flag, the converted coordinate value is obtained from the interpolation coordinate value and the stored outline information through the address generator 34 shown in FIG. The boundary area determination circuit 45 determines whether the interpolated coordinate value is located inside or outside the polygon outline that intersects the grid using the grid area information. In the case of the inside of the polygon, the z value is compared, and it is also determined whether or not it is located farther than the polygon. As a result of the determination, if it is determined that the pixel is located behind the polygon, the interpolation point is regarded as a shadow, and a predetermined value is given to the scaler circuit 46 in order to attenuate the luminance obtained by the shader 43, and the luminance is obtained by multiplication. The result is stored in the image memory 47 as the luminance of the pixel.

図5は図4に示した本発明の境界領域判定回路45の詳細図を示す。ポリゴンの内挿補間座標値は図4の座標変換回路42において光源系座標値に変換し、図5のxl、yl、zlとして、その内のxl、ylはシルエットラインバッファ50の平面バッファに加わり、内挿点が外郭線グリッドか否かの判定のためフラグFが読み出されAND回路54に出力する。一方、zl値はz比較回路53にて、情報バッファにあるz値と比較する。座標値xlylから情報バッファのアドレス生成は図3のアドレス発生器34で行われ、内挿点が外郭線グリッドとなる場合には、外郭線情報を読み出す。外郭線情報の内、z値(図中のzd)は外郭線分の数があり、逐次読み出しzlと比較を行う。比較結果はSのバスでAND回路54に与える。また外郭線情報の内、外郭線の傾き、小数点値等の情報はEのバスで直線発生器51に加わり、直線式にxl、ylを代入して得た値xiyiと、xl、ylとを符号判定回路52にて差分し、その符号と左右辺情報とから内挿点xl,ylがポリゴンの内外かを判定する。判定値DはAND回路54に与え、前記z値の比較結果、および外郭線フラグとの条件から、内挿点がグリッド内においてポリゴンの光源寄りかポリゴンの背後かを決定する。
複数の外郭線が交差するグリッドでは情報バッファ50に記憶された外郭線情報を逐次あるいは同時に読出し、z比較器53で逐次あるいは比較器を複数実装して同時に比較する。読み出されたzdとzlの比較結果と、そのポリゴンに対応する外郭線の内外値との関係では、内挿点が光源寄りにある場合はポリゴンの内外の条件に関わらず、内挿点は照射点の可能性がある。一方、後方にある場合は、ポリゴン外部に位置する場合にのみ照射点の可能性がある。内挿点がポリゴン後方に位置し、且つポリゴン内部に位置する場合には影となり、それ以上の外郭線が記憶されていても判定処理は不要である。可能性有りと判断されるかぎり、記憶された外郭線情報を逐次あるいは同時に前記条件で判定し、内挿点の位置がすべてのポリゴンの外部あるいはポリゴン内部の場合で、そのポリゴンに対して光源寄りと判断された場合にAND回路54では照射条件を満たすものとする。照射点となる場合は、IN/OUT信号により境界領域判定回路から図4のスケーラ46へ与えるスケール値は1となり、輝度の減衰はされない。
FIG. 5 shows a detailed view of the boundary region determination circuit 45 of the present invention shown in FIG. The interpolation interpolation coordinate value of the polygon is converted into the light source system coordinate value by the coordinate conversion circuit 42 in FIG. 4 and xl, yl, and xl are added to the plane buffer of the silhouette line buffer 50 as xl, yl, and zl in FIG. The flag F is read and output to the AND circuit 54 to determine whether the interpolation point is an outline grid. On the other hand, the zl value is compared with the z value in the information buffer by the z comparison circuit 53. The address generation of the information buffer from the coordinate value xlyl is performed by the address generator 34 in FIG. 3, and the outline information is read when the interpolation point is an outline grid. Among the outline information, the z value (zd in the figure) has the number of outline lines, and is sequentially compared with zl. The comparison result is given to the AND circuit 54 via the S bus. Of the contour line information, information such as the slope of the contour line and the decimal point value is added to the straight line generator 51 by the E bus, and the values xiii obtained by substituting xl and yl into the linear equation, and xl and yl are obtained. The sign determination circuit 52 makes a difference, and determines whether the interpolation points xl and yl are inside or outside the polygon from the sign and the left and right side information. The determination value D is given to the AND circuit 54, and it is determined whether the interpolation point is close to the polygon light source or behind the polygon in the grid from the comparison result of the z value and the condition of the outline line flag.
In a grid where a plurality of contour lines intersect, the contour line information stored in the information buffer 50 is read sequentially or simultaneously, and the z comparator 53 implements sequential or multiple comparators and compares them simultaneously. In the relationship between the read comparison result of zd and zl and the inside / outside value of the contour line corresponding to the polygon, when the interpolation point is near the light source, the interpolation point is Possible irradiation point. On the other hand, if it is behind, there is a possibility of an irradiation point only when it is located outside the polygon. When the interpolated point is located behind the polygon and inside the polygon, it becomes a shadow, and determination processing is unnecessary even if more contour lines are stored. As long as it is determined that there is a possibility, the stored outline information is determined sequentially or simultaneously under the above conditions, and when the position of the interpolation point is outside or inside all polygons, the polygon is closer to the light source. When it is determined that the AND circuit 54 satisfies the irradiation condition. In the case of an irradiation point, the scale value given to the scaler 46 in FIG. 4 from the boundary region determination circuit by the IN / OUT signal is 1, and the luminance is not attenuated.

図6は本発明の外郭線情報を記憶するバッファ構造を示す。平面バッファ60はx、yの2次元配列からなり、外郭線通過画素(グリッド)に1ビットのフラグを記憶する。また影の処理では第2パスでそれぞれのポリゴンを描画するプロセスでポリゴンの内挿点を第1パスの座標系に座標変換してxl,ylを得た場合、このアドレスで平面バッファ60を読出し、読出し点(図中の黒丸点)に外郭線フラグが立っている場合、その点のアドレスxl、ylはアドレス発生器61でxl、ylを入力データとする多項式除算を行い、剰余値を変換後のアドレスとする。剰余値aiは情報バッファ62のアドレスとして、そのアドレス位置に記憶される有効ビットの立っているバッファ(情報バッファとその拡張バッファのワード)から、外郭線情報を読み出す。情報バッファ62は1次元構造のメモリでよい。外郭線情報を記憶するこの情報バッファのそれぞれのアドレスに対応するワード構成63は3つのブロックからなり、一つのブロックには図中に示す外郭線情報が記憶されている。外郭線情報のカッコ内はビット長の1例を示す。これら情報は影の処理では第1パスで求めたものである。視点座標系のシルエットライン描画では視点座標系での外郭線情報が記憶される。有効ビットは該当するブロック内情報が有効であることを示す。情報バッファと拡張バッファのそれぞれの位置関係は、アドレスaiを基点として、リンクアドレスをさらに生成して行ってもよいが、メモリアクセス時間を最優先とする場合には、情報バッファのそれぞれは同一のアドレスを共有するものとしてもよい。この場合は情報バッファのアドレス当たりのワードビットが増えた構造となる。後者の場合はメモリコストの増加となるため拡張数を適当な数(4あるいは5)までで打ち切ることとが必要となる。また情報バッファには図に示していないが背景バッファがそれぞれの情報バッファのアドレスに対応して1組(aiアドレスに一つ)含まれる。ポリゴンの内挿点が外郭線交差グリッドであり、情報バッファのアドレスaiが決定すると、情報バッファから、有効となる外郭線情報を読出し、これを図5の境界領域判定回路に与える。  FIG. 6 shows a buffer structure for storing outline information of the present invention. The plane buffer 60 has a two-dimensional array of x and y, and stores a 1-bit flag in an outline line passing pixel (grid). In the shadow processing, when the polygon interpolation point is transformed into the coordinate system of the first pass in the process of drawing each polygon in the second pass and xl and yl are obtained, the plane buffer 60 is read at this address. When the outline flag is set at the readout point (black dot in the figure), the address xl and yl at that point is converted by the address generator 61 using xl and yl as input data to convert the remainder value. It will be a later address. As the address of the information buffer 62, the remainder value ai reads out the outline information from the buffer (the word of the information buffer and its extension buffer) in which the effective bit is stored at the address position. The information buffer 62 may be a one-dimensional memory. The word structure 63 corresponding to each address of this information buffer for storing outline information comprises three blocks, and outline information shown in the figure is stored in one block. An example of the bit length is shown in parentheses in the outline information. These pieces of information are obtained in the first pass in the shadow processing. In contour line drawing in the viewpoint coordinate system, outline line information in the viewpoint coordinate system is stored. The valid bit indicates that the corresponding intra-block information is valid. The positional relationship between the information buffer and the expansion buffer may be performed by further generating a link address starting from the address ai. However, when the memory access time is given the highest priority, each information buffer is the same. The address may be shared. In this case, the number of word bits per address of the information buffer is increased. In the latter case, since the memory cost increases, it is necessary to terminate the expansion number to an appropriate number (4 or 5). Although not shown in the figure, the information buffer includes one set of background buffers (one for the ai address) corresponding to the address of each information buffer. When the interpolation point of the polygon is an outline crossing grid and the address ai of the information buffer is determined, valid outline line information is read from the information buffer, and this is given to the boundary area determination circuit of FIG.

前記  Said

からFrom

ではポリゴン外郭線情報を影の判定に用いる場合に関するものであるが、シルエットラインのアンチエイリアス処理ではシャドウポリゴン内外の位置判定ではなく、視点系座標におけるグリッド内に含まれるそれぞれのポリゴン面積に対応する輝度の配分となる点で異なっている。また2パスの影の生成とは異なり、視点座標系で描画する際に、その外郭線情報をシルエットラインバッファに記憶する。また外郭線情報としてそれぞれのポリゴンがもつ輝度あるいは色情報を図6の情報バッファのワードに追加記憶する。すなわちアンチエイリアスでは、光源系座標での描画がない点、図4の境界判定回路45が面積計算回路に代わる点、および面積計算から輝度合成を行う処理を除いて図3−5の回路と同一の回路で構成できる。面積比率に対する輝度合成は、本発明の外郭線情報をポリゴン毎に情報バッファに記憶する方式では、視点座標系描画中の画素毎に、あるいは描画後いずれも可能である。Is related to the case where the polygon outline information is used for shadow determination, but the silhouette line anti-aliasing process does not determine the position inside or outside the shadow polygon, but the brightness corresponding to each polygon area included in the grid in the viewpoint system coordinates. It differs in that it becomes the distribution of. Also, unlike the generation of a two-pass shadow, the contour line information is stored in the silhouette line buffer when drawing in the viewpoint coordinate system. Further, luminance or color information of each polygon is additionally stored as outline data in the word of the information buffer in FIG. That is, in anti-aliasing, the same circuit as that in FIG. 3-5 except that there is no drawing in the light source system coordinates, the boundary determination circuit 45 in FIG. 4 replaces the area calculation circuit, and the process of performing luminance synthesis from area calculation. It can be configured with a circuit. Luminance composition for the area ratio can be performed for each pixel in the viewpoint coordinate system drawing or after drawing in the method of storing outline information in the information buffer for each polygon in the present invention.

本発明の回路をIP(Intelligent Property)として、あるいはグラフィックスプロセッサLSIチップに実装することによって映像製作、CGゲーム等のシステムにおいて実時間描画を可能とする。  By mounting the circuit of the present invention as an IP (Intelligent Property) or a graphics processor LSI chip, real-time drawing can be performed in a system such as video production or CG game.

「本発明に関するグリッド内外郭線交差図」  “Grid-inner-outline crossing diagram related to the present invention” 「本発明に関する外郭線交差グリッド」  “Outer Line Intersection Grid for the Present Invention” 「本発明のシルエットライン情報記憶回路」  "Silhouette line information storage circuit of the present invention" 「本発明のシルエットライン処理回路  "Silhouette line processing circuit of the present invention 「本発明の境界判定回路」  "Boundary judgment circuit of the present invention" 「本発明の外郭線記憶バッファ構造」  “Outer Line Storage Buffer Structure of the Present Invention”

符号の説明Explanation of symbols

図1
(1)−(11)グリッド内外郭線交差例
Buf1−4 外郭線と情報バッファ記憶例
図2
(1)−(3)外郭線通過グリッド例
図3
30 外郭線補間回路
31 スパン補間回路
32 マルチプレクサ
33 マルチプレクサ
34 アドレス発生器
35 平面バッファ
36 z値比較器
37 情報バッファ
38 アドレス制御回路
図4
40 外郭線補間回路
41 スパン補間回路
42 座標変換回路
43 シェーダ
44 シルエットラインバッファ
45 スケーラ
46 境界領域判定回路
47 画像メモリ
図5
50 シルエットラインバッファ
51 直線生成回路
52 符号判定回路
53 z値比較器
54 AND回路
図6
60 シルエットライン平面バッファ
61 アドレス発生器
62 情報バッファ
63 情報バッファ・ワード構成図
FIG.
(1)-(11) Outer grid line crossing example Buf1-4 Outer line and information buffer storage example FIG.
(1)-(3) Outline line grid example Fig. 3
30 outline interpolation circuit 31 span interpolation circuit 32 multiplexer 33 multiplexer 34 address generator 35 plane buffer 36 z-value comparator 37 information buffer 38 address control circuit FIG.
40 outline interpolation circuit 41 span interpolation circuit 42 coordinate conversion circuit 43 shader 44 silhouette line buffer 45 scaler 46 boundary region determination circuit 47 image memory FIG.
50 silhouette line buffer 51 straight line generation circuit 52 sign determination circuit 53 z value comparator 54 AND circuit diagram 6
60 silhouette line plane buffer 61 address generator 62 information buffer 63 information buffer word configuration diagram

Claims (8)

シルエットラインとなるポリゴンのアンチエイリアス技術において、ポリゴンの頂点座標間を結ぶ外郭線上の画素点を、外郭線フラグとして2次元配列からなるバッファ(以下平面バッファという)に記憶する手段と、画素を正方形領域(以下グリッドという)と見なすと共に、複数の1次元配列からなるバッファ(以下情報バッファという)を設けて、前記外郭線が、前記グリッドを通過する際の交差情報(以下外郭線情報という)を、前記情報バッファに記憶する手段と、前記平面バッファは外郭線の座標値をアドレスに、また前記情報バッファは前記外郭線座標値から得る間接アドレスによってそれぞれアドレッシングする手段と、前記情報バッファのそれぞれのワード毎に、少なくとも3つの外郭線情報を記憶できる容量をもつ手段と、ポリゴン辺が他のポリゴン辺と共有し、後書き外郭線が、バッファに記憶された前書き外郭線と一致する場合には、前書き外郭線情報を該当する情報バッファから削除すると共に、後書き外郭線情報を記憶しない手段と、外郭線補間の後に行うポリゴン内部の塗りつぶしの段階において、ポリゴン内挿補間座標値をアドレスとして、前記平面バッファを読出し、外郭線フラグがある場合には、対応する前記情報バッファのそれぞれから外郭線情報を読み出し、外郭線情報の一つとして記憶された投影中心からの距離情報と、前記内挿補間点のもつ距離とを比較し、内挿補間点よりも遠方に位置する場合には、情報バッファに記憶された該当する外郭線情報を削除する手段のそれぞれを用いて、すべてのポリゴンの描画後には、前記平面バッファにはシルエットラインとなる外郭線上にフラグを、また情報バッファには前記フラグ点に対応する外郭線情報を記憶したポリゴン・シルエットラインアンチエイリアス回路。  In the anti-aliasing technology for polygons to be silhouette lines, means for storing pixel points on the outline line connecting the vertex coordinates of the polygons as a outline line flag in a two-dimensional array buffer (hereinafter referred to as a plane buffer), and pixels in a square area (Hereinafter referred to as a grid), and a buffer (hereinafter referred to as an information buffer) comprising a plurality of one-dimensional arrays is provided, and intersection information (hereinafter referred to as outline information) when the outline passes through the grid, Means for storing in the information buffer; the plane buffer for addressing the coordinate value of the contour line; and the information buffer for addressing by an indirect address obtained from the contour line coordinate value; and each word of the information buffer A means with a capacity to store at least three outline information every time If the polygon side is shared with other polygon sides and the postscript outline matches the foreword outline stored in the buffer, the prelude outline information is deleted from the corresponding information buffer and the postscript outline information In the step of painting inside the polygon performed after the outline line interpolation, the plane buffer is read out using the polygon interpolation coordinate value as an address, and if there is an outline flag, the corresponding information buffer The contour line information is read out from each of them, and the distance information from the projection center stored as one of the contour line information is compared with the distance of the interpolation point, and is located farther than the interpolation point. In this case, after each polygon is drawn using each of the means for deleting the corresponding outline information stored in the information buffer, the plane bar is displayed. Polygon silhouette line antialiasing circuit flags on outline of the silhouette line and the information buffer that stores outline information corresponding to the flag points to file. 請求項1の回路において、外郭線情報が有効であることを示す有効フラグ、グリッドに交差する外郭線の傾き、交差軸および交点座標値、y軸最小頂点座標点を基点として分岐する外郭線の左右辺を示す値、長軸、x軸歩進方向、投影中心からのグリッド交差点までの距離、ポリゴン毎に更新する順序値の、それぞれを外郭線情報として記憶する手段と、情報バッファのワード毎に1つの背景バッファを付加し、前記背景バッファには初期値として投影中心からの最大遠方値を記憶する一方、ポリゴン内部の内挿補間において最も投影中心に近い距離に記憶更新する手段と、前記情報バッファに記憶された外郭線と、後書き外郭線とがポリゴン辺を共有る場合には、その外郭線はシルエットラインではないと見なして、情報バッファの該当バッファに記憶された前記有効フラグをリセットする手段と、すべての情報バッファの有効フラグがリセットされた場合には、前記平面バッファの前記外郭線フラグをリセットする手段とをもつポリゴン・シルエットラインアンチエイリアス回路。2. The circuit according to claim 1, wherein an effective flag indicating that the outline information is valid, an inclination of the outline intersecting with the grid, an intersection axis and an intersection coordinate value, and an outline line branched from the y-axis minimum vertex coordinate point as a base point. Means for storing the values indicating the left and right sides, the long axis, the x-axis step direction, the distance from the projection center to the grid intersection, and the order value to be updated for each polygon as outline information, and for each word in the information buffer Means for storing and updating a maximum distance value from the projection center as an initial value in the background buffer, while storing and updating at a distance closest to the projection center in interpolation interpolation inside the polygon, When the contour line stored in the information buffer and the postscript contour line share a polygon edge, the contour line is regarded as not a silhouette line, and the corresponding buffer in the information buffer is used. A polygon silhouette line anti-aliasing circuit having means for resetting the valid flag stored in the file and means for resetting the outline flag of the planar buffer when the valid flags of all information buffers are reset . 請求項1および2の回路において、影のアンチエイリアスを行う手段として、第1パスではポリゴンを光源座標系で描画すると共に、第2パスとして視点座標系で再びポリゴンを描画する際、ポリゴン内挿補間毎に、補間点を視点座標から光源座標系に変換した座標値を用いて前記平面バッファを読出し、外郭線フラグがあれば前記情報バッファから外郭線情報を読出し、外郭線情報と前記光源系座標値を用いて、前記補間点がグリッド内のポリゴン内外のいずれに位置するかを判定する手段と、ポリゴン内部であれば、さらに投影中心からの距離を比較して、前記変換座標点が情報バッファ情報のもつ距離よりも遠方にあると判定された場合は影とする手段と、前記補間点がポリゴンの外部である場合には、さらに外郭線情報の記憶の有無を調べ、外郭線情報が記憶されていれば前記同様の判定を行い、影と判断された場合はその段階で第2パスの内挿点は影として処理を終了し、記憶されているすべての外郭線情報に対して内挿点が領域外あるいは、領域内においてはすべてが投影中心に、より近い位置にあると判断された場合には、前記内挿点を照射点とするそれぞれの手段からなるポリゴン内外検出回路を含むポリゴン・シルエットラインアンチエイリアス回路。3. The circuit according to claim 1, wherein, as means for performing anti-aliasing of shadows, polygon interpolation is performed when a polygon is drawn in the light source coordinate system in the first pass and is drawn again in the viewpoint coordinate system as the second pass. Each time, the plane buffer is read using the coordinate value obtained by converting the interpolation point from the viewpoint coordinate to the light source coordinate system, and if there is an outline line flag, the outline line information is read from the information buffer, and the outline line information and the light source system coordinates are read out. A value is used to determine whether the interpolation point is located inside or outside the polygon in the grid, and if inside the polygon, the distance from the projection center is further compared, and the converted coordinate point is stored in the information buffer. If it is determined that the information is far away from the distance of the information, a means for making a shadow, and if the interpolation point is outside the polygon, whether or not contour line information is stored If the contour line information is stored, the same determination as described above is performed. If it is determined to be a shadow, the interpolation process of the second pass is terminated as a shadow at that stage, and all stored contours are determined. When it is determined that the interpolation points are outside the region or are all closer to the projection center within the region with respect to the line information, each means includes the respective insertion points as the irradiation points. Polygon / silhouette line antialiasing circuit including polygon inside / outside detection circuit. 請求項1および2の回路において、バッファに記憶された情報から、視点座標系で描画したポリゴン・シルエットラインのアンチエイリアスを行う手段として、ポリゴンを視点座標系で補間した外郭線フラグを前記平面バッファに、また外郭線情報を情報バッファに記憶する手段と、外郭線情報として、その外郭線を有するポリゴンの色情報を付加する手段と、前記背景バッファには初期値として背景色を付加すると共に、ポリゴン内部の内挿補間の際、背景バッファに記憶された視点からの距離と比較し、内挿補間点が背景バッファより近い距離となる場合には、背景バッファにはその距離と内挿補間ポリゴンの色情報とする手段と、ポリゴン内部の内挿補間点毎に前記平面バッファを読出し、内挿補間点がシルエットラインと判断された場合には、前記情報バッファから読み出した外郭線情報を用いて、グリッドを投影面とした場合のそれぞれのポリゴンが占める面積を求める手段と、前記ぞれぞれの面積に応じて、前記それぞれのポリゴンが持つ色を比例配分する手段のそれぞれからシルエットラインとなるグリッドの輝度を決定するポリゴン・シルエットラインアンチエイリアス回路。3. The circuit according to claim 1, wherein an outline line flag obtained by interpolating a polygon in a viewpoint coordinate system is stored in the plane buffer as means for performing anti-aliasing of a polygon / silhouette line drawn in the viewpoint coordinate system from information stored in the buffer. Means for storing outline line information in the information buffer; means for adding color information of a polygon having the outline as outline line information; and adding a background color as an initial value to the background buffer, In the case of internal interpolation, when the interpolation point is closer to the background buffer than the distance from the viewpoint stored in the background buffer, the background buffer contains the distance and the interpolation polygon. The means for making color information and the plane buffer are read for each interpolation point inside the polygon, and the interpolation point is determined to be a silhouette line. In this case, the contour line information read from the information buffer is used to determine the area occupied by each polygon when the grid is used as the projection plane, and the respective areas are determined according to the respective areas. Polygon / silhouette line antialiasing circuit that determines the brightness of the grid that is the silhouette line from each of the means for proportionally distributing the colors of the polygon. 請求項1の回路において、外郭線が交差するグリッドを決定する手段として、直線発生器のxおよびy座標の内、短軸側の丸め補正を行わず、直線式から求めた実数値を座標値として出力すると共に、前記実数値の整数値が示すグリッド座標と、小数点値が示すグリッド交差座標と、前記直線式がもつ傾きおよび方向から、前記直線が交差するすべてのグリッドを検出し、これを外郭線交差グリッドとして前記平面バッファにフラグを、また情報バッファに外郭線情報を記憶する外郭線交差グリッド決定回路を含むポリゴン・シルエットラインアンチエイリアス回路。2. The circuit according to claim 1, wherein as a means for determining a grid at which the outer lines intersect, a real value obtained from a linear equation is used as a coordinate value without rounding correction on the short axis side of the x and y coordinates of the straight line generator. And the grid coordinates indicated by the integer value of the real value, the grid intersection coordinates indicated by the decimal point value, and the slope and direction of the straight line expression, detect all grids where the straight lines intersect, A polygon / silhouette line anti-aliasing circuit including an outline cross grid determination circuit for storing a flag in the plane buffer as an outline cross grid and storing outline information in an information buffer. 請求項1および2の回路において、外郭線情報を記憶する際の手段に関し、描画物体に識別子を設け、外郭線の補間の際、前記物体識別子が変化した場合には、それまで記憶対象であった情報バッファワードに記憶域が残っていても、拡張された情報バッファに切り替えて外郭線情報を記憶する手段と、物体識別子が同一で、ポリゴン毎の順序値が異なる場合には、同一の物体識別子をもつ情報バッファのそれぞれから外郭線情報を読み出して、補間中の外郭線とを比較し、共有外郭線が検出された場合には、該当するバッファ内の外郭線情報の有効フラグをリセットすると共に、リセットによってバッファに空領域が生じた場合、物体識別子毎に情報バッファ内あるいはバッファ間で外郭線情報をシフトして、空領域を埋める処理を行う手段と、補間中の外郭線が記憶された辺といずれも共有しないと判断された場合には、情報バッファに順次外郭線情報を記憶し、記憶域を超える交差数となる場合は情報バッファを拡張して記憶するそれぞれの記憶手段をもつポリゴン・シルエットラインアンチエイリアス回路。3. The circuit according to claim 1 or 2, wherein an identifier is provided for a drawn object with respect to means for storing contour line information, and when the object identifier changes during interpolation of the contour line, the object is a storage object until then. Even if the storage area remains in the information buffer word, if the object identifier is the same as the means for storing the outline information by switching to the extended information buffer and the order value for each polygon is different, the same object The outline information is read from each of the information buffers having the identifiers, compared with the outline being interpolated, and when a common outline is detected, the valid flag of the outline information in the corresponding buffer is reset. At the same time, when an empty area is generated in the buffer due to the reset, a process for filling the empty area by shifting the outline information in the information buffer or between the buffers for each object identifier is performed. If it is determined that the contour line being interpolated does not share any of the stored edges, the contour line information is sequentially stored in the information buffer. If the number of intersections exceeds the storage area, the information buffer is expanded. Polygon / silhouette line anti-aliasing circuit with each storage means to store. 請求項1および4の回路において、ポリゴンの色情報を記憶する手段として、ポリゴン頂点には法線や光源入射角等が定義され、輝度計算回路を経てはじめて輝度が決定される回路においては、ポリゴンの順序値をポリゴン内挿補間回路から前記輝度計算回路に伝送し、前記輝度計算回路からは、ポリゴン内挿補間座標値、色情報および前記順序値とを同期して出力し、前記内挿補間点のx、y座標値をアドレスとして、前記平面バッファを読み出し、外郭線フラグがある場合には、前記輝度計算回路から出力した順序値に一致するポリゴン外郭線情報を、前記情報バッファから検出して、前記輝度計算回路からの前記色情報を該当する情報バッファの外郭線情報に付加記憶する手段をもつポリゴン・シルエットラインアンチエイリアス回路。  5. The circuit according to claim 1, wherein a normal line, a light source incident angle, etc. are defined in the polygon vertex as means for storing the color information of the polygon, and the luminance is determined only after the luminance calculation circuit. Are transmitted from the polygon interpolation circuit to the luminance calculation circuit, and the polygon interpolation coordinate value, color information, and the sequence value are output in synchronization from the luminance calculation circuit, and the interpolation interpolation is performed. Using the x and y coordinate values of the points as addresses, the plane buffer is read, and when there is an outline flag, polygon outline information matching the sequence value output from the luminance calculation circuit is detected from the information buffer. A polygon silhouette line antialiasing circuit having means for additionally storing the color information from the luminance calculation circuit in the outline information of the corresponding information buffer 請求項1から7までに記載のポリゴン・シルエットラインアンチエイリアス回路を用いたコンピュータグラフィックス画像装置。  A computer graphics image apparatus using the polygon silhouette line anti-aliasing circuit according to claim 1.
JP2005359568A 2005-11-15 2005-11-15 Polygon/silhouette line/anti-aliasing circuit Pending JP2007141196A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005359568A JP2007141196A (en) 2005-11-15 2005-11-15 Polygon/silhouette line/anti-aliasing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005359568A JP2007141196A (en) 2005-11-15 2005-11-15 Polygon/silhouette line/anti-aliasing circuit

Publications (1)

Publication Number Publication Date
JP2007141196A true JP2007141196A (en) 2007-06-07

Family

ID=38203938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005359568A Pending JP2007141196A (en) 2005-11-15 2005-11-15 Polygon/silhouette line/anti-aliasing circuit

Country Status (1)

Country Link
JP (1) JP2007141196A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103390264A (en) * 2012-05-11 2013-11-13 三星电子株式会社 Method for processing image and image processing apparatus thereof
CN108537718A (en) * 2018-04-12 2018-09-14 长沙景美集成电路设计有限公司 A kind of device and method for realizing some pel anti-aliasings in GPU
CN112233008A (en) * 2020-09-23 2021-01-15 中国船舶重工集团公司第七一六研究所 Device and method for realizing triangle rasterization in GPU

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103390264A (en) * 2012-05-11 2013-11-13 三星电子株式会社 Method for processing image and image processing apparatus thereof
CN108537718A (en) * 2018-04-12 2018-09-14 长沙景美集成电路设计有限公司 A kind of device and method for realizing some pel anti-aliasings in GPU
CN108537718B (en) * 2018-04-12 2022-12-02 长沙景美集成电路设计有限公司 Device and method for realizing point diagram element anti-aliasing in GPU
CN112233008A (en) * 2020-09-23 2021-01-15 中国船舶重工集团公司第七一六研究所 Device and method for realizing triangle rasterization in GPU

Similar Documents

Publication Publication Date Title
US6204856B1 (en) Attribute interpolation in 3D graphics
JP5185418B2 (en) Method and apparatus for rendering translucent 3D graphics
JP3759971B2 (en) How to shade a 3D image
US6982723B1 (en) Method and apparatus for eliminating unwanted steps at edges in graphic representations in the line raster
KR20040093432A (en) Image rendering device and image rendering method
US9530241B2 (en) Clipping of graphics primitives
US7616202B1 (en) Compaction of z-only samples
US5973701A (en) Dynamic switching of texture mip-maps based on pixel depth value
US20050225557A1 (en) Method and apparatus for reading texture data from a cache
JP2011138445A (en) Transparent object display circuit
US6501481B1 (en) Attribute interpolation in 3D graphics
JP2007141196A (en) Polygon/silhouette line/anti-aliasing circuit
US6239809B1 (en) Image processing device, image processing method, and storage medium for storing image processing programs
US6518969B2 (en) Three dimensional graphics drawing apparatus for drawing polygons by adding an offset value to vertex data and method thereof
US7737971B2 (en) Image drawing device, vertex selecting method, vertex selecting program, and integrated circuit
JPH06266852A (en) Picture synthesizing device
KR100243184B1 (en) Anti-aliasing graphics apparatus using virtual sub-pixel memory
US8576219B2 (en) Linear interpolation of triangles using digital differential analysis
JP2009163469A (en) Global illumination circuit
JP4408152B2 (en) Texture mapping method and texture mapping apparatus
EP0725365A1 (en) Shading three-dimensional images
JP2012141833A (en) Polygon contour line/grid crossing area calculation circuit
JP3721951B2 (en) Image generation method and apparatus
JP2010157170A (en) Omnidirectional shadow projection renderer
JP2774874B2 (en) Image synthesizing apparatus and image synthesizing method