JP2008152743A - Circuit for calculating texture pattern size - Google Patents

Circuit for calculating texture pattern size Download PDF

Info

Publication number
JP2008152743A
JP2008152743A JP2006357294A JP2006357294A JP2008152743A JP 2008152743 A JP2008152743 A JP 2008152743A JP 2006357294 A JP2006357294 A JP 2006357294A JP 2006357294 A JP2006357294 A JP 2006357294A JP 2008152743 A JP2008152743 A JP 2008152743A
Authority
JP
Japan
Prior art keywords
polygon
outline
texture
grid
interpolation
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
JP2006357294A
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 JP2006357294A priority Critical patent/JP2008152743A/en
Publication of JP2008152743A publication Critical patent/JP2008152743A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To allow accurate texture mapping even on a polygon outline. <P>SOLUTION: This circuit interpolates linearly a geometric coordinate value defined on a polygon apex, a texture mapping address and the like. The circuit outputs crossing information of the outline and a pixel to an FIFO memory. The circuit reads out outline information, when receiving the outline information to be compared with an x-axis coordinate value and when a point under interpolation is one on the outline, to find an x-axial coordinate value or a y-axial coordinate value, a texture mapping coordinate value and a perspective transformation relation value, in a point where the outline is crossed with a grid. Distances between the x- and y-coordinate values and between the texture coordinate values are calculated using not grid crossing information but adjacent pixel information, even on the outline, and further a polygon magnification and a texture ratio are found by dividing those distances, respectively. A texture RAM address generator receives calculation results therein to select the optimum pattern. Brightness in an interpolation point is determined based on the texture information and the like. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、コンピュータグラフィックス描画技術において、テキスチャーパターンをポリゴン面にマッピングする際に、ポリゴンサイズに対する最適なテキスチャーパターンサイズを選択するための手段に関する論理回路およびその回路を搭載した装置分野に属する。  The present invention relates to a logic circuit relating to a means for selecting an optimum texture pattern size for a polygon size when mapping a texture pattern onto a polygon surface in computer graphics drawing technology, and belongs to the field of devices equipped with the circuit.

コンピュータグラフィックス技術において、テキスチャーマッピングは最も重要な描画技法の一つである。テキスチャーマッピングとは、描画物体を多角形面(以下ポリゴンという)の集合として構成し、それぞれの多角形の頂点には3次元座標値やテキスチャーパターン(以下パターンという)座標値を定義し、これらをポリゴン面上を内挿補間することで得たそれぞれの座標値を用いて、予めメモリに記憶したカラー情報等を読出し、これを内挿補間点にマッピングしてテキスチャー表示を行うものである。この際、描画空間内のポリゴンの幾何学的大きさは、視野変換等により変化する一方、パターン座標値は影響を受けない。この結果、ポリゴン対パターンサイズ比率は例えば、視点の移動によって動的に変化する。この変化は、透視投影下においては単一ポリゴン領域内でも生じる。よって前記比率をポリゴンの補間点(画素)毎に計算し、ポリゴンの幾何学的大きさに対して最適なサイズとなるパターンを選択することが高画質を得る条件となる。また、テキスチャーマッピング技術には、最適な比率を計算してパターンサイズを決定すると、そのサイズの最近傍となる2つのパターンを選択し、これら複数のパターン情報を参照し、さらにフィルタリングした情報間を前記比率で重み付けし補間点のパターン値を得るトライリニアー・テキスチャーマッピング技法が商用機に広く実装されている。透視投影下においては、ポリゴン対パターンサイズが変化するだけでなく、パターン座標軸(以下uおよびv座標という)比率も変化する場合がある。これに対応するにはuv比率のそれぞれ異なるパターンを予め用意して、ポリゴンとパターン、さらにパターン座標軸成分間の比率の違いを計算して、マッピングに最適なパターンを選択するRIPマップ方式も実用化されている。一方、ポリゴン内部でのx、y軸の変化率に対してu、v軸の変化率(倍率)を画素毎に求めるには大きな計算コストを要する。例えばポリゴン内挿補間におけるスパン(水平)ライン内挿補間処理においては、画素毎の比率を正確に計算することは出来ない。これはスパン補間がy座標値を一定としているため、ポリゴン形状の変化をx軸の変化のみを用いてuv比率を求めることは高精度な倍率が得られない。これを避けるため水平軸2ライン分を同時に補間し、xおよびy軸の画素間距離に対して、uおよびvの距離を求め、それぞれの距離の除算値(以下ポリゴン倍率という)と、uとvの変移量の除算値(以下uv比という)を計算する手段がある。しかし、ポリゴンの外郭線上では、常に2つの水平軸が同時並行して補間できない傾き形状があり、正確な比率を求めることが出来ない。よって形状によっては、ポリゴン辺が接するポリゴン境界(外郭線上)においてパターンのマッピングエイリアスが発生する。  In computer graphics technology, texture mapping is one of the most important drawing techniques. In texture mapping, a drawing object is configured as a set of polygonal surfaces (hereinafter referred to as polygons), and three-dimensional coordinate values and texture pattern (hereinafter referred to as pattern) coordinate values are defined at the vertices of each polygon. Using each coordinate value obtained by interpolating on the polygon surface, color information or the like previously stored in the memory is read, and this is mapped to the interpolation point to display the texture. At this time, the geometrical size of the polygon in the drawing space changes due to field conversion or the like, while the pattern coordinate value is not affected. As a result, the polygon to pattern size ratio dynamically changes with the movement of the viewpoint, for example. This change also occurs within a single polygon region under perspective projection. Therefore, the condition for obtaining high image quality is to calculate the ratio for each interpolation point (pixel) of the polygon and select a pattern having an optimum size with respect to the geometric size of the polygon. In texture mapping technology, when the optimal ratio is calculated and the pattern size is determined, two patterns that are closest to the size are selected, the plurality of pattern information is referred to, and further, the filtered information is divided. A trilinear texture mapping technique that obtains a pattern value of an interpolation point by weighting with the ratio is widely implemented in commercial machines. Under perspective projection, not only the polygon-to-pattern size changes, but also the ratio of pattern coordinate axes (hereinafter referred to as u and v coordinates) may change. To cope with this, the RIP map method that selects the most suitable pattern for mapping by calculating the difference in the ratio between polygon and pattern and pattern coordinate axis components in advance by preparing patterns with different uv ratios is also put into practical use. Has been. On the other hand, a large calculation cost is required to obtain the change rate (magnification) of the u and v axes for each pixel with respect to the change rate of the x and y axes inside the polygon. For example, in span (horizontal) line interpolation processing in polygon interpolation, the ratio for each pixel cannot be calculated accurately. This is because span interpolation makes the y-coordinate value constant. Therefore, obtaining a uv ratio using only the change of the x-axis for the change of the polygon shape cannot obtain a highly accurate magnification. In order to avoid this, two horizontal lines are interpolated at the same time, the distances u and v are obtained with respect to the inter-pixel distances on the x and y axes, and the divided values of these distances (hereinafter referred to as polygon magnification), u and There is a means for calculating a division value (hereinafter referred to as uv ratio) of the shift amount of v. However, on the outline of the polygon, there is always an inclined shape in which the two horizontal axes cannot be interpolated simultaneously in parallel, and an accurate ratio cannot be obtained. Thus, depending on the shape, a pattern mapping alias occurs at the polygon boundary (on the outline) where the polygon side contacts.

本発明は、前記ポリゴン外郭線上においても正確なxおよびy軸の変移量に対するuおよびv軸の変化量すなわち前記ポリゴンとuv比率を求める手段と、その手段を実装する回路構造手段を課題とする。  It is an object of the present invention to provide a means for obtaining u and v-axis change amounts relative to x- and y-axis shift amounts on the polygon outline, that is, a ratio of the polygon and uv, and circuit structure means for mounting the means. .

ポリゴンの完全内部(描画点が隣接する水平および垂直の画素で取り囲まれている領域)においては、スパン方向の2ライン同時の補間によって、描画点(x、y)に隣接する対角線上のxおよびy座標値(x+1、y+1)に対するuおよびvの変化率は(1)式で求めることができる。ここで画素間距離を1とし、ポリゴン倍率をP、uv比をTとする。またΔuおよびΔvは対角線上の2点(x、y)(x+1、y+1)のuおよびv座標値を、それぞれの点での透視変換関係値(同次座標系)wで除算した後、差分した値である。

Figure 2008152743
一方、外郭線の傾きによっては、2ライン分のスパン並行補間が不可能な領域があり、描画点を基点とする隣接する対角線上の画素点が同時処理として得られない。この場合、1スパンライン分のx軸の変移量だけでΔuとΔvを求めなければならない。よってポリゴンの投影形状あるいは画素位置によっては、ポリゴン倍率やuv比に大きな誤差を生じる。これに対して3角形の3頂点の幾何学情報からポリゴン全体のスケール比を求める3点法や、スパン補間段階でスパン両端点でのuおよびvの差分値を用いる手段も考えられるが、スパン区間でuおよびvの変化率は透視変換補正のため画素毎に透視変換関係値で除算されているため線形でない。In the complete interior of the polygon (the region where the drawing point is surrounded by adjacent horizontal and vertical pixels), x and y on the diagonal line adjacent to the drawing point (x, y) are obtained by simultaneous interpolation of two lines in the span direction. The rate of change of u and v with respect to the y-coordinate value (x + 1, y + 1) can be obtained by equation (1). Here, the inter-pixel distance is 1, the polygon magnification is P, and the uv ratio is T. Δu and Δv are obtained by dividing the u and v coordinate values of two diagonal points (x, y) (x + 1, y + 1) by the perspective transformation relation value (homogeneous coordinate system) w at each point, It is the value.
Figure 2008152743
On the other hand, depending on the inclination of the outline, there is an area in which span parallel interpolation for two lines is impossible, and pixel points on adjacent diagonal lines with the drawing point as a base point cannot be obtained as simultaneous processing. In this case, Δu and Δv must be obtained only by the amount of x-axis shift for one span line. Therefore, depending on the projected shape of the polygon or the pixel position, a large error occurs in the polygon magnification and uv ratio. On the other hand, a three-point method for obtaining the scale ratio of the entire polygon from the geometric information of the three vertices of the triangle and a means of using the difference values of u and v at both ends of the span in the span interpolation stage can be considered. The rate of change of u and v in the interval is not linear because it is divided by the perspective transformation relation value for each pixel for perspective transformation correction.

本発明では、参照する情報が不足する問題が生じる外郭線上でのxおよびy座標とuおよびv座標値の変化率と、ポリゴン内部での変化率とは、それぞれ個別の手段で求める。外郭線情報を外郭線補間時に、アンチエイリアスのためにバッファに記憶する手段は特願2005−359568で示されたが、前記特願では外郭線情報を2次元配列1ビットからなる平面バッファと、平面バッファの外郭線フラグがあるアドレスから得られた間接アドレスが示す外郭線情報バッファに、外郭線の傾き、交差軸、長短軸、x軸方向、z値また色情報などを記憶した。前記特願では、バッファに記憶された情報は後続の描画により、ポリゴン辺が共有する場合は削除し、またスパン補間段階で隠面消去を行って、結果として描画後にはシルエットラインのみがバッファに記憶された。  In the present invention, the change rate of the x and y coordinates, the u and v coordinate values on the outline that causes the problem of insufficient information to be referred to, and the change rate inside the polygon are obtained by individual means. Japanese Patent Application No. 2005-359568 shows a means for storing outline line information in a buffer for anti-aliasing during outline interpolation. In this patent application, the outline line information includes a plane buffer consisting of two bits of a two-dimensional array, and a plane. The outline of the outline, the cross axis, the long / short axis, the x-axis direction, the z value, the color information, and the like are stored in the outline information buffer indicated by the indirect address obtained from the address having the outline line flag. In the patent application, the information stored in the buffer is deleted when the polygon side is shared by subsequent drawing, and the hidden surface is deleted at the span interpolation stage. As a result, only the silhouette line is stored in the buffer after drawing. It was remembered.

本発明では、前記特願と同様に、ポリゴンの内挿補間は外郭線補間回路とスパン補間回路とのパイプライン処理で進行するが、以下の点で前記特願の手段とは異なる。
(1)外郭線情報は、外郭線補間からスパン補間を経てテキスチャーマッピングアドレス、が決定されるまでの間のみ保存される。よって外郭線全画素分の外郭線情報を記憶するバッファを必要としない。
(2)ポリゴン共有辺削除や隠面消去によるバッファ処理は行わず、外郭線情報を外郭線補間回路からテキスチャーアドレス発生回路まで、それぞれの処理に同期してパイプラインレジスタあるいはFIFO(First IN First Out)で転送する。
(3)外郭線情報として、xy座標軸に対する傾きΔSxyと、x、yグリッド外郭線交差座標値、xy長短軸フラグ、x軸方向、uおよびv軸のグリッド交差座標値(u0,v0)、透視変換関係値のグリッド交差値w0、xあるいはy長軸に対するuおよびv軸の傾き(ΔSxu,ΔSxv)、また長軸に対する透視変換関係値wの傾きΔSxwが含まれる。
In the present invention, similarly to the above-mentioned patent application, interpolation of polygons proceeds by pipeline processing of an outline interpolation circuit and a span interpolation circuit, but differs from the means of the above-mentioned patent application in the following points.
(1) The outline information is stored only until the texture mapping address is determined from the outline interpolation to the span interpolation. Therefore, a buffer for storing outline line information for all outline lines is not required.
(2) No buffer processing due to polygon shared edge deletion or hidden surface deletion is performed, and outline information is processed in a pipeline register or FIFO (First IN First Out) from the outline interpolation circuit to the texture address generation circuit in synchronization with each process. ).
(3) As contour line information, the inclination ΔSxy with respect to the xy coordinate axis, x, y grid contour line intersection coordinate value, xy long / short axis flag, x axis direction, u and v axis grid intersection coordinate values (u0, v0), perspective The grid intersection value w0, x or y of the transformation relation value includes the slopes of u and v axes (ΔSxu, ΔSxv) with respect to the major axis, and the slope ΔSxw of the perspective transformation relation value w with respect to the major axis.

本発明では、外郭線上では外郭線情報から(2)式によりポリゴン倍率やuv比を求める。(2)式ではx軸を長軸とし交差座標値はy軸の場合を示す。

Figure 2008152743
ここで、長軸(上式ではx軸)に対するu、vおよびwの傾きは、外郭線補間回路において補間計算の際に求めた値をそのまま、スパンおよびテキスチャーマッピング回路へ転送する。(2)式においてy軸が長軸となる場合は、ΔSxyの分母分子が逆になり、またグリッド交差軸がx長軸においてx軸(例えばxc点)となる場合は、それぞれの傾きは、前記それぞれの傾きに対して(1−xc)を乗算した値となる。グリッド内の交差軸間の距離ΔLxyに対しても(1−xc)を乗算した値となる。y軸が長軸で、y軸に交差する場合も同様の考えで処理を行う。前記透視変換関係値wは、視点と投影面との距離および視点からレンダリング点までの距離の逆数1/zを含み、それぞれのポリゴン頂点のuおよびv値はw値で除算された値として定義する。これは透視投影での消点に向かっての図形の非線形な変化を表現するための一般的に知られた処理である。In the present invention, the polygon magnification and the uv ratio are obtained from the outline information on the outline by Equation (2). In equation (2), the x axis is the long axis and the cross coordinate value is the y axis.
Figure 2008152743
Here, the slopes of u, v, and w with respect to the long axis (the x axis in the above equation) are transferred to the span and texture mapping circuit as they are, with the values obtained during the interpolation calculation in the outline interpolation circuit. In equation (2), when the y-axis is the major axis, the denominator of ΔSxy is reversed, and when the grid crossing axis is the x-axis (for example, the xc point) in the x-major axis, the respective slopes are It becomes a value obtained by multiplying each inclination by (1−xc). The distance ΔLxy between the intersecting axes in the grid is also a value obtained by multiplying (1−xc). When the y-axis is the long axis and intersects the y-axis, the same process is performed. The perspective transformation relation value w includes the distance between the viewpoint and the projection plane and the reciprocal 1 / z of the distance from the viewpoint to the rendering point, and the u and v values of each polygon vertex are defined as values divided by the w value. To do. This is a generally known process for expressing a non-linear change of a figure toward a vanishing point in perspective projection.

本発明では(2)式により得られたそれぞれの値から(3)式により、ポリゴン倍率Pおよびuv比Tを得る。

Figure 2008152743
(3)式は補間画素点が外郭線上であり、スパン補間において隣接するスパンラインが存在しない場合に適用し、それ以外では少なくとも2スパンラインの隣接する画素の最大距離(対角線上)とその距離間でのパターン座標値の差分値である(1)式を用いる。In the present invention, the polygon magnification P and the uv ratio T are obtained from the respective values obtained from the expression (2) according to the expression (3).
Figure 2008152743
Equation (3) is applied when the interpolation pixel point is on the outline and there is no adjacent span line in span interpolation. Otherwise, the maximum distance (on the diagonal line) of adjacent pixels of at least two span lines and its distance Equation (1), which is the difference value of the pattern coordinate values between them, is used.

前記ポリゴンのxy幾何座標値とテキスチャーパターン座標値との比率計算は、ポリゴン頂点に直接パターン座標値を定義するものであった。一方、コンピュータグラフィックス描画技術の一つに、物体を取り巻く周辺映像を、6面のテキスチャーパターンとして作成し、これを視線ベクトルが、ポリゴン上の描画点で反射する視線反射ベクトルから、前記6面内のパターン座標と交差する面とを計算し、その交差点パターン情報を描画点にマッピングする環境マッピングがある。環境マッピングは前述のテキスチャーマッピングと比較して、ポリゴン面上においてパターン座標値(u、v)が、視線反射ベクトルに置き換わり、この視線反射ベクトルから該当する面とパターン座標値(u、v)を求める点を除けば、テキスチャーマッピングと同様の処理となる。すなわち[006]の(3)項の情報に対して、環境マッピングでは、外郭線情報として、x、y軸に対する傾きΔSxy、x、yグリッド交差座標値、長短軸フラグ、x軸方向、視線反射ベクトルRのグリッド交差座標値R0、透視変換関係値のグリッド交差値w0、x、y長軸に対する視線反射ベクトルRの傾きΔSxr、また長軸に対する透視変換関係値wの傾きΔSxwである。ここで視線反射ベクトルが太字で表記されているのは、それぞれx、y、z成分を含んでおり、例えばRはR(Rx,Ry,Rz)を意味する。  The calculation of the ratio between the xy geometric coordinate value of the polygon and the texture pattern coordinate value directly defines the pattern coordinate value at the polygon vertex. On the other hand, as one of computer graphics drawing technologies, a peripheral image surrounding an object is created as a six-sided texture pattern, and the line-of-sight vector is reflected from the line-of-sight reflection vector reflected by a drawing point on the polygon. There is an environment mapping that calculates the plane intersecting the pattern coordinates and maps the intersection pattern information to the drawing point. In the environment mapping, the pattern coordinate values (u, v) are replaced with the line-of-sight reflection vector on the polygonal surface as compared with the texture mapping described above, and the corresponding surface and pattern coordinate values (u, v) are converted from the line-of-sight reflection vector. Except for the required points, the processing is the same as the texture mapping. That is, in contrast to the information in [006] (3), in environment mapping, as the outline information, the gradient ΔSxy, x, y grid intersection coordinate values, long and short axis flags, x-axis direction, line-of-sight reflection with respect to the x and y axes The grid intersection coordinate value R0 of the vector R, the grid intersection value w0 of the perspective transformation relation value, x, y, the slope ΔSxr of the line-of-sight reflection vector R with respect to the major axis, and the slope ΔSxw of the perspective transformation relation value w with respect to the major axis. Here, the line-of-sight reflection vector is shown in bold, including x, y, and z components, for example, R means R (Rx, Ry, Rz).

また前記外郭線情報の中で、視線反射ベクトルRは通常内挿補間点でのポリゴンの面法線N、視線ベクトルVから(4)式により求めるが、スパン補間回路に至る処理で前記面法線および視線ベクトルが補間の対象となり、視線反射ベクトルRは、スパン補間後に計算される場合には、外郭線交差情報としてのR0は面法線および視線ベクトルのグリッド交差点値N0およびV0に代わる。この場合、面法線および視線ベクトルは通常、透視変換関係値wで除算されてから、視線反射ベクトルを求めるため、視線反射ベクトル計算後のwによるRの除算は不要となる。環境マッピングにおいては(4)式における視線反射ベクトルRから、ベクトルが交差する面fと、その面内における(u,v)を求める。本発明では参照点が1グリッドしかない外郭線上においては、グリッド内で交差する2つの交差点間でのf,u,vの差分をとり、ポリゴン倍率とuv比を求める。

Figure 2008152743
以上の、本発明のそれぞれの手段によって、ポリゴン倍率とuv比を、外郭線上においても外郭線1画素から得られることと、ポリゴン共有辺でのテキスチャーパターンの選択サイズの不一致を避けることにより、高品質の画像を得ることができる。In the outline information, the line-of-sight reflection vector R is usually obtained from the surface normal N of the polygon at the interpolation point and the line-of-sight vector V using the equation (4). When the line and line-of-sight vector are to be interpolated, and the line-of-sight reflection vector R is calculated after span interpolation, R0 as contour line intersection information replaces the grid normal values and line-of-sight vector grid intersection values N0 and V0. In this case, the surface normal and the line-of-sight vector are usually divided by the perspective transformation relation value w, and then the line-of-sight reflection vector is obtained. Therefore, the division of R by w after the line-of-sight reflection vector calculation is unnecessary. In the environment mapping, from the line-of-sight reflection vector R in the equation (4), a plane f where the vectors intersect and (u, v) in the plane are obtained. In the present invention, on the contour line having only one grid reference point, the polygon magnification and the uv ratio are obtained by taking the difference of f, u, v between two intersections intersecting in the grid.
Figure 2008152743
By each means of the present invention, the polygon magnification and the uv ratio can be obtained from one pixel of the contour line even on the contour line, and by avoiding the mismatch in the selected size of the texture pattern on the polygon shared side, A quality image can be obtained.

本発明により、エイリアスのない映像の描画が実時間で可能となる。  According to the present invention, it is possible to draw an alias-free video 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.

以下、本発明に関する実施例を説明する。図1は本発明に関するテキスチャーマッピング倍率計算回路を示す。図1において、ポリゴン頂点には3次元幾何座標値(x,y,z)、テキスチャーマッピングアドレス(u,v)、法線、光源入射ベクトル等を定義し、まずポリゴンの外郭線に沿って、頂点定義情報を外郭線補間回路10において線形に補間する。この補間はy軸最小値となる頂点(ポリゴンの底辺)から左右に分岐した2つの外郭線を同時にy軸上位に向かって進行し、同一水平軸上の左右の補間点が揃ったところで、スパン回路11に、外郭線両端点の頂点定義情報を出力する。スパン補間をポリゴンの下から上に順次実行することで、ポリゴン内におけるすべての補間情報を得る。補間情報の内、ポリゴン座標値やポリゴン内部の輝度を決定する面法線、光源入射ベクトル等はスパン補間回路11を経てシェーダー15に送る。一方、外郭線補間回路10では、外郭線と画素との交差(画素をグリッドと呼ぶ正方形の領域と見なし、外郭線がこの領域と交わる)情報をFIFOメモリ12に出力する。図2の2aはFIFOに記憶するデータフォーマットの1例を示す。図2aでは外郭線を示す有効フラグFビット20、外郭線のx軸座標値21および外郭線情報22のビットフィールドで構成する。外郭線情報にはxy座標軸に対する傾きΔSxy、x、yグリッド交差座標値、xy長短軸フラグ、x軸方向、uおよびv軸のグリッド交差座標値(u0,v0)、透視変換関係値のグリッド交差値w0、xあるいはy長軸に対するuおよびv軸の傾き(ΔSxu,ΔSxv)、また長軸に対する透視変換関係値wの傾きΔSxwが含まれる。  Examples relating to the present invention will be described below. FIG. 1 shows a texture mapping magnification calculation circuit according to the present invention. In FIG. 1, three-dimensional geometric coordinate values (x, y, z), texture mapping addresses (u, v), normals, light source incident vectors, etc. are defined for the polygon vertices. First, along the outline of the polygon, The vertex definition information is linearly interpolated by the outline interpolation circuit 10. This interpolation proceeds two contour lines branching left and right from the vertex (the bottom of the polygon) that is the minimum value of the y axis, and simultaneously proceeds upward in the y axis. When the left and right interpolation points on the same horizontal axis are aligned, the span is reached. The vertex definition information of both ends of the contour line is output to the circuit 11. By executing span interpolation sequentially from the bottom to the top of the polygon, all interpolation information in the polygon is obtained. Of the interpolation information, a polygon coordinate value, a surface normal for determining the luminance inside the polygon, a light source incident vector, and the like are sent to the shader 15 via the span interpolation circuit 11. On the other hand, the outline interpolation circuit 10 outputs information on the intersection of the outline and the pixel (the pixel is regarded as a square area called a grid and the outline intersects this area) to the FIFO memory 12. 2a in FIG. 2 shows an example of a data format stored in the FIFO. In FIG. 2a, it consists of a valid flag F bit 20 indicating an outline, a bit field of an outline x-axis coordinate value 21, and outline information 22. The contour line information includes the slope ΔSxy, x, y grid crossing coordinate values, xy long and short axis flags, x-axis direction, u- and v-axis grid crossing coordinate values (u0, v0), and perspective transformation-related grid crossings. The values w0, x or y include the inclinations of the u and v axes (ΔSxu, ΔSxv) with respect to the long axis, and the inclination ΔSxw of the perspective transformation relation value w with respect to the long axis.

図1において、スパン回路11では、左端から右端に向かって左右両端点における外郭線補間情報を、さらに線形に補間するが、その中には、外郭線上の画素点も含まれる。スパン補間課程でどの画素が外郭線上のものかポリゴン完全内部点であるかは、スパン回路自身では判断できない。この関係を図2の2bに示す。図2bでは2つの外郭線23と24があり、区間Aでは、外郭線23と24は重なり合っている。区間Aにおいては、外郭線上に隣接するy+1の画素(あるいはライン)がなく、参照する画素点(x+1、y+1)が存在しない。一方区間Bの外郭線24の画素では同時2ラインのスパン処理でy+1ライン上の隣接する画素を得ることができる。このように2つの対角線上あるいはy軸方向の隣接画素点が得られる配置と得られない配置がある。隣接する画素が得られる区間では、図2cに示すように対角線上の補間点が得られ、点AおよびBでの補間情報を求めることができる。すなわち対角線上にあるグリッドの中心点でのx、yおよびuvのそれぞれの距離を求め、前記(1)式の処理を行う。x、y間距離はグリッドサイズを1としているため、対角線上では2の平方根となる。
スパン回路11からは、補間されたx軸座標値を、外郭線検出および比率計算回路13に出力し、また回路13ではFIFO12からのx軸座標値を含む外郭線情報を受け、これら2つの回路からのx軸座標値とを比較する。もし、外郭線有効フラグが立ち、x軸座標値が一致すれば、補間中のスパン補間点は外郭線上の点であることが判定できる。回路13では現在補間中の点が外郭線上のものであることが分かれば、FIFO12からの外郭線情報(図2aの22)をFIFOから読み出して、外郭線がグリッドと交差する点での、xあるいはy軸座標値、テキスチャーマッピング座標値および透視変換関係値を求める。もし、外郭線上であっても、スパン補間回路11が2つのスパンラインを同時並列処理可能な状態であれば、外郭線検出および比率計算回路13ではグリッド交差情報ではなく、隣接画素情報(図2cの関係)を用いる。
In FIG. 1, the span circuit 11 further linearly interpolates the contour line interpolation information at the left and right end points from the left end toward the right end, and includes pixel points on the contour line. In the span interpolation process, it cannot be determined by the span circuit itself which pixel is on the contour line or the polygon complete internal point. This relationship is shown in 2b of FIG. In FIG. 2b, there are two outlines 23 and 24. In section A, the outlines 23 and 24 overlap. In section A, there is no y + 1 pixel (or line) adjacent on the outline, and there is no pixel point (x + 1, y + 1) to be referenced. On the other hand, in the pixel of the outline line 24 in the section B, adjacent pixels on the y + 1 line can be obtained by the span processing of two lines simultaneously. As described above, there are an arrangement in which adjacent pixel points on two diagonal lines or in the y-axis direction are obtained and an arrangement in which the adjacent pixel points cannot be obtained. In the section where adjacent pixels are obtained, interpolation points on the diagonal are obtained as shown in FIG. 2c, and interpolation information at points A and B can be obtained. That is, the respective distances x, y, and uv at the center point of the grid on the diagonal line are obtained, and the processing of the above equation (1) is performed. Since the grid size is 1, the distance between x and y is the square root of 2 on the diagonal line.
The span circuit 11 outputs the interpolated x-axis coordinate value to the contour line detection and ratio calculation circuit 13, and the circuit 13 receives the contour line information including the x-axis coordinate value from the FIFO 12, and receives these two circuits. To the x-axis coordinate value from. If the outline line valid flag is set and the x-axis coordinate values match, it can be determined that the span interpolation point being interpolated is a point on the outline line. If the circuit 13 knows that the point currently being interpolated is on the outline, the outline information (22 in FIG. 2a) from the FIFO 12 is read out from the FIFO, and the x at the point where the outline intersects the grid. Alternatively, a y-axis coordinate value, a texture mapping coordinate value, and a perspective transformation relation value are obtained. If the span interpolation circuit 11 can process two span lines simultaneously in parallel even on the outline line, the outline line detection and ratio calculation circuit 13 does not use grid intersection information but adjacent pixel information (FIG. 2c). ).

図3にはグリッドと、グリッドに交差する外郭線の交差点を示す。図3aおよび図3bはそれぞれx軸を長軸とした例であり、侵入する外郭線の交差する軸がy軸(図3a)とx軸(図3b)の場合を示す。図中のグリッド交差点P0およびP1でのx、y、u、v、およびwを求め、次にそれぞれの点のu/wおよびv/wを計算した後、2点間でのそれぞれの差分値(距離)を求め、さらに前記(2)および(3)式によってポリゴン倍率とuv比をそれぞれ計算する。すなわちグリッド内でのP0とP1間のxy座標の距離と、uv座標系の距離をそれぞれ用いて、ポリゴン倍率とuv比を求める。この結果、外郭線上では1グリッド内の情報のみで、ポリゴン倍率とuv比が得られる。一方、スパン補間点(x、y)に隣接する点(x+1、y+1)あるいは(x+1、y−1)のuおよびv値が補間毎に得られれば、1つのグリッド内での前記計算は行わず、前記(1)式でポリゴン倍率とuv比を求める。これは対角線上のグリッド中心点間を距離計算点とする方が、グリッド内部での距離に比較して距離幅が増し、倍率と比率精度が高くなるためである。前記(1)式のように隣接対角線画素間でのxyとuvの距離を求めるのではなく、グリッドの辺の大きさが1であることから、グリッドの4頂点間のuとvを差分し、その内の最大値となるΔuとΔvを直接RIPパターンのアドレスとして定義する手段もあるが、より大きなxy距離に対するuv値を使用する方が精度は高くなる。  FIG. 3 shows an intersection of a grid and an outline line intersecting the grid. FIGS. 3a and 3b are examples in which the x-axis is the long axis, and the y-axis (FIG. 3a) and the x-axis (FIG. 3b) are the axes where the intruding contour lines intersect. After obtaining x, y, u, v, and w at grid intersections P0 and P1 in the figure, and then calculating u / w and v / w for each point, the respective difference values between the two points The (distance) is obtained, and the polygon magnification and the uv ratio are calculated by the equations (2) and (3). That is, the polygon magnification and the uv ratio are obtained by using the xy coordinate distance between P0 and P1 in the grid and the uv coordinate system distance, respectively. As a result, the polygon magnification and the uv ratio can be obtained with only information in one grid on the outline. On the other hand, if the u and v values of the point (x + 1, y + 1) or (x + 1, y-1) adjacent to the span interpolation point (x, y) are obtained for each interpolation, the calculation in one grid is performed. First, the polygon magnification and the uv ratio are obtained by the above equation (1). This is because, when the distance calculation point is between the grid center points on the diagonal line, the distance width increases as compared with the distance inside the grid, and the magnification and the ratio accuracy increase. Rather than calculating the distance between xy and uv between adjacent diagonal pixels as in equation (1) above, the grid side size is 1, so u and v between the four vertices of the grid are differentiated. Although there is means for directly defining Δu and Δv which are the maximum values among them as addresses of the RIP pattern, the accuracy becomes higher by using the uv value for a larger xy distance.

図1に戻り、図1の回路13では、図2aに示した、図1のFIFO12からのx座標値21と、図1のスパン補間回路11からのx座標値が一致し、また外郭線フラブ20が有効で、スパン補間点が外郭線グリッドであると判断されると、図2aの外郭線情報22を用いてグリッド内交差点を求め、ポリゴン倍率とuv比を計算する。この詳細を図4に示す。図4では、図1のFIFO12からの図2aに示したx座標値21と、スパン補間回路からのx座標値を一致検出回路41にて比較し、一致情報はグリッド交差点および透視補正除算回路40に与える。回路40ではスパン補間回路から2スパンライン分のxおよびy座標値(x、y)と(x+1、y+1)と、それらの点でのテキスチャーパターンアドレスu、vと透視変換関係値wが、さらにFIFOからの外郭線情報を歩進毎に受ける。すなわち図1のスパン補間回路11はyとy+1軸上の2つの水平軸を同時に補間するものとする。回路40では、それぞれの外郭線において、(x、y)および(x+1、y+1)の同時補間が可能か否かの判定を行い、同時補間ができない外郭線上においては、外郭線情報から、グリッドのxy軸と外郭線とが交わる点と、それらの点でのxおよびy座標値とu、vおよびw値を、またポリゴン内部では(x、y)および(x+1、y+1)でのu、vおよびwを得て、u、v値をw値で除算し、これらを差分して距離計算回路42に差分値を出力する。回路42では前記(2)式に示した計算を行い、さらにこれらを除算器からなる比率計算回路43で(3)式に示す除算によりポリゴン倍率とuv比を得る。一方、ポリゴン内部あるいは外郭線であっても2スパンライン対角線上のu、vおよびw値が得られる場合には、グリッド内の交差点計算は不要となる。またxy座標の距離は一定となり、u、v値はそれぞれをw値で除算した後、これらを差分する。これは前記(1)式の関係となる。
図3において、外郭線がグリッド内部に始点あるいは終点の端点をもつ図3cの場合には、P0−P1あるいはP0−P2間の距離の長い方を選択するか、P0−P1あるいはP1−P2間の長い方を選択する。図3cのP1点はP0とP2の2つの外郭線の交点としてそれぞれの外郭線情報から求めることができる。
Returning to FIG. 1, in the circuit 13 of FIG. 1, the x coordinate value 21 from the FIFO 12 of FIG. 1 shown in FIG. 2 matches the x coordinate value from the span interpolation circuit 11 of FIG. If 20 is valid and it is determined that the span interpolation point is an outline grid, the in-grid intersection is obtained using the outline information 22 in FIG. 2a, and the polygon magnification and the uv ratio are calculated. The details are shown in FIG. In FIG. 4, the x coordinate value 21 shown in FIG. 2a from the FIFO 12 of FIG. 1 is compared with the x coordinate value from the span interpolation circuit by the coincidence detection circuit 41, and the coincidence information is the grid intersection and perspective correction division circuit 40. To give. In the circuit 40, the x and y coordinate values (x, y) and (x + 1, y + 1) for two span lines from the span interpolation circuit, the texture pattern addresses u and v at those points, and the perspective transformation relation value w are further obtained. The outline information from the FIFO is received for each step. That is, it is assumed that the span interpolation circuit 11 in FIG. 1 simultaneously interpolates two horizontal axes on the y and y + 1 axes. In the circuit 40, it is determined whether or not simultaneous interpolation of (x, y) and (x + 1, y + 1) is possible in each outline line. On the outline line where simultaneous interpolation is not possible, the outline of the grid is determined from the outline information. The points where the xy axis and the outline line intersect, the x and y coordinate values and u, v and w values at those points, and u and v at (x, y) and (x + 1, y + 1) inside the polygon And w are obtained, the u and v values are divided by the w value, and the difference between these values is output to the distance calculation circuit 42. The circuit 42 performs the calculation shown in the above equation (2), and further obtains the polygon magnification and the uv ratio by the division shown in the equation (3) by the ratio calculation circuit 43 including a divider. On the other hand, if the u, v, and w values on the two-span line diagonal are obtained even inside the polygon or on the outline, it is not necessary to calculate the intersection in the grid. Further, the distance of the xy coordinates is constant, and the u and v values are subtracted from each other after being divided by the w value. This is the relationship of the formula (1).
In FIG. 3, in the case of FIG. 3c in which the outline has the start point or the end point inside the grid, the longer distance between P0-P1 or P0-P2 is selected, or between P0-P1 or P1-P2 Choose the longer one. The point P1 in FIG. 3c can be obtained from the respective outline information as the intersection of the two outlines P0 and P2.

図1に戻り、テキスチャーRAMアドレス発生器14では、図4の比率計算回路43の出力情報として、テキスチャー座標値(u,v)、uv比Δv/Δuおよびポリゴン倍率ΔLuv/ΔLxyを受け、これら情報から最適なサイズと、与えられたuv比をもつテキスチャーパターンの記憶されたRAM16の所定のアドレスを生成する。RAM16から読み出したテキスチャー情報等はシェーダー15に与えられ、補間点の輝度を決定する。
以上の説明で明らかなように本発明では、ポリゴンへのテキスチャーマッピングにおいて、ポリゴンサイズに対するテキスチャーパターンの最適なサイズを選択するための手段として、画素グリッド内の外郭線情報と、複数のスパンライン間の距離の2つの方法を利用するものである。
Returning to FIG. 1, the texture RAM address generator 14 receives the texture coordinate values (u, v), the uv ratio Δv / Δu, and the polygon magnification ΔLuv / ΔLxy as output information of the ratio calculation circuit 43 of FIG. A predetermined address of the RAM 16 in which a texture pattern having an optimum size and a given uv ratio is stored is generated. The texture information read from the RAM 16 is given to the shader 15 to determine the luminance of the interpolation point.
As is apparent from the above description, in the present invention, in the texture mapping to the polygon, as a means for selecting the optimum size of the texture pattern with respect to the polygon size, the outline line information in the pixel grid and the interval between a plurality of span lines are used. Two methods of distance are used.

本発明の回路を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.

「本発明のテキスチャーマッピング倍率計算回路を示す。」“Shows the texture mapping magnification calculation circuit of the present invention.” 「本発明の外郭線データ、外郭線関係および画素間隔を示す。」“Shows outline data, outline relation, and pixel spacing of the present invention.” 「本発明の外郭線グリッド交差様態を示す。」“Shows the outline grid crossing aspect of the present invention.” 「本発明の外郭線検出および比率計算回路を示す。」“The outline detection and ratio calculation circuit of the present invention is shown.”

符号の説明Explanation of symbols

図1
10 外郭線補間回路
11 スパン補間回路
12 FIFOメモリ
13 外郭線検出および比率計算回路
14 テキスチャーRAMアドレス発生器
16 シェーダー
16 テキスチャーRAM
図2
図2a
20 外郭線有効フラグ
21 x軸座標値
22 外郭線情報
図2b
23 外郭線
24 外郭線
図2c
25 対角線画素関係
図3
3a y軸交差外郭線
3b x軸交差外郭線
3c グリッド内端点外郭線
図4
40 グリッド交差点および透視補正除算回路
41 一致検出回路
42 距離計算回路
43 比率計算回路
FIG.
10 outline interpolation circuit 11 span interpolation circuit 12 FIFO memory 13 outline detection and ratio calculation circuit 14 texture RAM address generator 16 shader 16 texture RAM
FIG.
FIG.
20 outline line valid flag 21 x-axis coordinate value 22 outline line information Figure 2b
23 outline 24 outline 2 figure 2c
25 Diagonal pixel relationship diagram 3
3a y axis crossing outline 3b x axis crossing outline 3c grid end point outline 4
40 Grid intersection and perspective correction division circuit 41 Match detection circuit 42 Distance calculation circuit 43 Ratio calculation circuit

Claims (3)

コンピュータグラフィックス・テキスチャーマッピング技術に関し、ポリゴンサイズに適応したテキスチャーパターンサイズを画素毎に決定する手段として、ポリゴンの内挿補間において、ポリゴン外郭線の補間からスパンラインに沿った補間を逐次行う手段と、それぞれの補間点を画素毎に正方形領域(以下グリッドという)と見なしてポリゴン外郭線が前記グリッド辺と交差する座標値を求める手段として補間毎に外郭線情報を記憶して、後段のテキスチャーマッピング回路へ、前記外郭線情報を送出する手段と、テキスチャーマッピング回路においては、前記外郭線情報を読み出して、ポリゴン外郭線がグリッド辺と交差する交差点間の距離および前記交差点間のテキスチャー座標がなす距離をそれぞれ求める手段と、前記それぞれの距離を除算して、グリッド内におけるポリゴンサイズに対するテキスチャーパターンサイズ比を決定する手段と、さらにテキスチャーマッピング座標軸成分のそれぞれの長さを除算して、透視変換下においてマッピングされるテキスチャーパターンの縦横比を求める手段と、2つ以上のスパンラインの補間において並列歩進が可能なポリゴン内挿補間領域では、2つ以上のスパンライン間の対角線上で隣接する2つの画素がなす距離と、前記それぞれの画素間のテキスチャー座標距離を用いて、前記ポリゴンサイズ対テキスチャーパターンサイズ比と、テキスチャーパターン縦横比を求める、それぞれの手段を併せ持つテキスチャーパターンサイズ計算回路。  Regarding computer graphics / texture mapping technology, as means for determining the texture pattern size adapted to the polygon size for each pixel, in polygon interpolation, means for successively performing interpolation along the span line from polygon outline interpolation Each interpolation point is regarded as a square area (hereinafter referred to as a grid) for each pixel, and contour line information is stored for each interpolation as a means for obtaining a coordinate value at which a polygon outline intersects the grid side. Means for sending the contour line information to the circuit, and in the texture mapping circuit, the contour line information is read, and the distance between the intersections where the polygon contour line intersects the grid side and the texture coordinates between the intersections Means for determining each of the above and each of the above Divide the distance to determine the ratio of the texture pattern size to the polygon size in the grid, and further divide the length of each texture mapping coordinate axis component to obtain the aspect ratio of the texture pattern mapped under perspective transformation. In a polygon interpolating region capable of parallel stepping in the interpolation of two or more span lines, the distance between two pixels adjacent on the diagonal line between the two or more span lines, A texture pattern size calculation circuit having both means for obtaining the polygon size to texture pattern size ratio and the texture pattern aspect ratio using the texture coordinate distance between pixels. 請求項1の回路において、外郭線情報として、xy座標軸に対する傾き、グリッド外郭線交差座標値、長短軸フラグ、x軸方向、テキスチャー座標軸のグリッド交差座標値、透視変換関係値のグリッド交差値、ポリゴン座標長軸に対するテキスチャー座標軸の傾き、また前記長軸に対する透視変換関係値の傾きのそれぞれとする手段と、前記それぞれの外郭線情報をFIFO(First IN First Out)メモリに記憶する手段からなるテキスチャーパターンサイズ計算回路。  2. The circuit according to claim 1, wherein the contour line information includes an inclination with respect to an xy coordinate axis, a grid contour line cross coordinate value, a long / short axis flag, an x axis direction, a grid cross coordinate value of a texture coordinate axis, a grid cross value of a perspective transformation relation value, a polygon A texture pattern comprising means for setting the inclination of the texture coordinate axis with respect to the coordinate long axis and the inclination of the perspective transformation relation value with respect to the long axis, and means for storing the respective outline information in a FIFO (First IN First Out) memory. Size calculation circuit. 請求項1および2に記載のテキスチャーパターンサイズ計算回路を用いたコンピュータグラフィックス画像装置。  A computer graphics image device using the texture pattern size calculation circuit according to claim 1.
JP2006357294A 2006-12-18 2006-12-18 Circuit for calculating texture pattern size Pending JP2008152743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006357294A JP2008152743A (en) 2006-12-18 2006-12-18 Circuit for calculating texture pattern size

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006357294A JP2008152743A (en) 2006-12-18 2006-12-18 Circuit for calculating texture pattern size

Publications (1)

Publication Number Publication Date
JP2008152743A true JP2008152743A (en) 2008-07-03

Family

ID=39654811

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006357294A Pending JP2008152743A (en) 2006-12-18 2006-12-18 Circuit for calculating texture pattern size

Country Status (1)

Country Link
JP (1) JP2008152743A (en)

Similar Documents

Publication Publication Date Title
US7280121B2 (en) Image processing apparatus and method of same
US8059119B2 (en) Method for detecting border tiles or border pixels of a primitive for tile-based rendering
US7420559B2 (en) Video rendering apparatus and method and program
TWI552109B (en) A method, a non-transitory computer-readable storage medium and a system for conservative rasterization of primitives using an error term
US7884825B2 (en) Drawing method, image generating device, and electronic information apparatus
CN101061518B (en) Flexible antialiasing in embedded devices
US6636232B2 (en) Polygon anti-aliasing with any number of samples on an irregular sample grid using a hierarchical tiler
CN100399358C (en) Image processing apparatus and method of same
JPH0771936A (en) Device and method for processing image
CN101271588B (en) Recreatable geometric shade pattern method
US9269181B2 (en) Texture mapping device
KR20170025099A (en) Method and apparatus for rendering
KR100305461B1 (en) Graphic processing device
JP2008282171A (en) Graphics processor, and method for rendering processing
US7372461B2 (en) Image processing apparatus and method of same
JP4060375B2 (en) Spotlight characteristic forming method and image processing apparatus using the same
JP2008152743A (en) Circuit for calculating texture pattern size
US7372466B2 (en) Image processing apparatus and method of same
JP2007141196A (en) Polygon/silhouette line/anti-aliasing circuit
US20070229494A1 (en) Image Drawing Device, Vertex Selecting Method, Vertex Selecting Program, and Integrated Circuit
JP3747859B2 (en) Image processing apparatus and method
JP2010157170A (en) Omnidirectional shadow projection renderer
JP2008152742A (en) Determination circuit for polygon brightness reference point
KR100917887B1 (en) Graphic processing method and apparatus for supporting line acceleration function
Hoppe et al. Adaptive meshing and detail-reduction of 3D-point clouds from laser scans