JP4617187B2 - Z sort processing circuit and three-dimensional image drawing apparatus using the same - Google Patents

Z sort processing circuit and three-dimensional image drawing apparatus using the same Download PDF

Info

Publication number
JP4617187B2
JP4617187B2 JP2005101128A JP2005101128A JP4617187B2 JP 4617187 B2 JP4617187 B2 JP 4617187B2 JP 2005101128 A JP2005101128 A JP 2005101128A JP 2005101128 A JP2005101128 A JP 2005101128A JP 4617187 B2 JP4617187 B2 JP 4617187B2
Authority
JP
Japan
Prior art keywords
data
polygon
depth value
polygon data
comparison
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005101128A
Other languages
Japanese (ja)
Other versions
JP2006285371A (en
Inventor
誠一 梶原
Original Assignee
株式会社エスアイエレクトロニクス
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 株式会社エスアイエレクトロニクス filed Critical 株式会社エスアイエレクトロニクス
Priority to JP2005101128A priority Critical patent/JP4617187B2/en
Publication of JP2006285371A publication Critical patent/JP2006285371A/en
Application granted granted Critical
Publication of JP4617187B2 publication Critical patent/JP4617187B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Description

本発明は、3次元画像を描画する3次元画像描画装置に関し、特に、半透明描画データ(半透明ポリゴン)をZ方向にソートするZソート処理技術に関する。   The present invention relates to a three-dimensional image drawing apparatus for drawing a three-dimensional image, and more particularly to a Z sort processing technique for sorting semi-transparent drawing data (semi-transparent polygon) in the Z direction.

3Dグラフィックスで使用される「モデル」と呼ばれる立体物は、ポリゴンと呼ばれる複数の三角形で構成され、各頂点の3次元座標値(x,y,z)により立体物と表される。一般に、図7に示すように、このモデルデータを構成する頂点の座標空間を「モデル座標」、モデルを配置する座標空間を「ワールド座標」、モニタに表示される絵を写すためのカメラを基準にした座標空間を「カメラ座標」、最終的なモニタ画面での座標空間を「スクリーン座標」と呼ぶ。   A three-dimensional object called “model” used in 3D graphics is composed of a plurality of triangles called polygons, and is represented as a three-dimensional object by three-dimensional coordinate values (x, y, z) of each vertex. In general, as shown in FIG. 7, the coordinate space of the vertices constituting this model data is “model coordinates”, the coordinate space where the model is arranged is “world coordinates”, and the camera for copying the picture displayed on the monitor is used as a reference. This coordinate space is called “camera coordinates”, and the final coordinate space on the monitor screen is called “screen coordinates”.

3次元空間上に配置されたモデルデータを、モニタ等の2次元画面に表示する際の基本的な3Dグラフィックス処理は、次のような順番で行われる。
1)モデルとカメラをワールド座標空間に配置する。
2)モデルデータの各頂点データ(モデル座標)をワールド座標に変換し、更にそれをカメラ座標に変換して、各頂点座標値がカメラから見た際の座標値になるようにする。
3)ワールド座標空間に設定された「ライト(光源)」の方向や色などにしたがって、モデル各頂点のライティング計算(明るさや色味の計算)を行う。
4)カメラ座標での各頂点座標をスクリーン座標に透視変換して、その座標値を描画回路に入力して描画処理を行う。
Basic 3D graphics processing when displaying model data arranged in a three-dimensional space on a two-dimensional screen such as a monitor is performed in the following order.
1) Place the model and camera in the world coordinate space.
2) Each vertex data (model coordinate) of the model data is converted into world coordinates, and further converted into camera coordinates so that each vertex coordinate value becomes a coordinate value when viewed from the camera.
3) Perform lighting calculation (brightness and color calculation) for each vertex of the model according to the direction and color of the “light (light source)” set in the world coordinate space.
4) Each vertex coordinate in camera coordinates is perspective-transformed into screen coordinates, and the coordinate value is input to a drawing circuit to perform drawing processing.

また、3次元グラフィックスでは、色付きガラスなどの向こう側が透けて見えるような物体を描画することがある。これを一般に、半透明描画と呼んでいる。半透明描画処理は、ガラスを描画する位置に、既にフレームバッファに格納されている背景の各ピクセルカラーデータを読み出し、その背景カラーとガラスカラーとを演算し、演算したカラーデータをフレームバッファに格納すれば良い。半透明の描画処理では、例えば、加算結果を1/2倍にする。ちなみに、半透明と呼ぶのは言葉的に判りやすいからで、実際のカラー演算割合は自由に指定することが可能であり、グラフィックス用語としては、「αブレンディング」(カラー演算割合パラメータをα値と呼ぶことから)と呼ばれる。   In three-dimensional graphics, an object such as colored glass that can be seen through the other side may be drawn. This is generally called translucent drawing. The translucent rendering process reads each pixel color data of the background that is already stored in the frame buffer at the drawing position of the glass, calculates the background color and glass color, and stores the calculated color data in the frame buffer. Just do it. In the translucent drawing process, for example, the addition result is halved. By the way, translucent is easy to understand in terms of words, so the actual color calculation ratio can be freely specified, and the graphics terminology is “α blending” (the color calculation ratio parameter is an α value). Is called).

1つの画面の中で、背景のような「不透明描画」とガラスのような「半透明描画」を混合して行う場合は、最初に不透明なものだけを全て描画し、その描画終了後に半透明なものを画面奥側にあるものから順番に半透明処理しながら描画することになる。例えば、図8(a)に示すように、最初に山や太陽などの全ての不透明な背景を描画し、次に、図8(b)、(c)に示すように、画面の奥側から半透明ガラスをA、C、Bの順番で描画する。   If you mix "opaque drawing" like background and "semi-transparent drawing" like glass in one screen, draw only the opaque thing first, and after that drawing is semi-transparent The drawing is performed while translucent processing is performed in order from the object on the back side of the screen. For example, as shown in FIG. 8A, all opaque backgrounds such as mountains and the sun are first drawn, and then, as shown in FIGS. 8B and 8C, from the back side of the screen. The translucent glass is drawn in the order of A, C, and B.

上記のように、半透明描画処理では画面奥側にある描画オブジェクトから画面手前側に向かって順番に描画する必要があるため、描画処理する前に半透明描画オブジェクトを画面奥側から順番に並べ替えておく必要がある。上記の例では、半透明ガラスをA→C→Bの順に並べる。この処理は、画面に垂直な座標軸に当たるZ座標値でソートすることから、通常「Zソート処理」と呼ばれている。   As described above, in the semi-transparent drawing process, it is necessary to draw in order from the drawing object on the back side of the screen toward the front side of the screen, so the semi-transparent drawing objects are arranged in order from the back side of the screen before the drawing process. It is necessary to change. In the above example, the translucent glasses are arranged in the order of A → C → B. This process is generally called “Z sort process” because it sorts by the Z coordinate value corresponding to the coordinate axis perpendicular to the screen.

3Dグラフィックスにおける半透明オブジェクトは、上記のガラスのような平面物に限らず、図9のような立体物となる。この立方体を半透明描画する場合は、ポリゴン単位でZソート処理を行い、画面奥側のポリゴンから順番に半透明描画処理を行うことになる。   The translucent object in 3D graphics is not limited to the above-described planar object such as glass, but is a three-dimensional object as shown in FIG. When rendering this cube translucently, Z sort processing is performed in units of polygons, and translucent rendering processing is performed in order from the polygons at the back of the screen.

Zソート処理について、いくつかの技術が報告されている。特許文献1は、ポリゴン識別部で不透明ポリゴンデータと半透明ポリゴンデータとの識別を行い、Zソートされた半透明ポリゴンデータの描画に要する描画予想時間を演算し、描画予想時間から不透明ポリゴンと半透明ポリゴンとの描画の切り換え時間を演算し、不透明ポリゴンデータから透明ポリゴンデータへの切り替えを可能にしている。これにより、プログラム開発時間の短縮化を期し、1フレーム期間中で描画すべき半透明ポリゴンデータを欠落なく描画できる半透明描画生成装置を提供している。   Several techniques have been reported for the Z sort process. In Patent Document 1, opaque polygon data and semi-transparent polygon data are identified by a polygon identification unit, an estimated drawing time required for drawing Z-sorted semi-transparent polygon data is calculated, and opaque polygons and semi-transparent data are calculated from the estimated drawing time. The switching time of drawing with transparent polygons is calculated, and switching from opaque polygon data to transparent polygon data is enabled. Accordingly, a translucent drawing generation apparatus is provided which can shorten the program development time and can draw the translucent polygon data to be drawn in one frame period without omission.

特許文献2は、画像を構成するポリゴンを半透明なものと不透明なものとに区別し、不透明なポリゴンすべての描画が終了すると、半透明なポリゴンが奥方向から手前方向に向かう順番でZバッファを使用して描画される。これにより、不透明なポリゴンと半透明なポリゴンとを含む画像の描画を高速化している。   Patent Document 2 distinguishes polygons constituting an image from translucent ones and opaque ones, and when drawing of all opaque polygons is completed, the semi-transparent polygons are moved in the order from the back to the front in the Z buffer. Rendered using. This speeds up drawing of an image including an opaque polygon and a translucent polygon.

特許文献3は、物陰に隠れて見えなくなるポリゴンを描画する無駄を省くために、各視点別に複数のポリゴンそれぞれについて見えるか否かを示した情報を用意し、描画処理時に、この情報を利用して、見えるポリゴンについてのみ描画するようにしている。   Patent Document 3 prepares information indicating whether or not each of a plurality of polygons can be seen for each viewpoint in order to eliminate the waste of drawing a polygon that is hidden behind the object and cannot be seen, and uses this information at the time of drawing processing. Only the visible polygons are drawn.

特許文献4は、オブジェクトデータから、視点位置を基準として定められる視界内に位置するオブジェクトデータを選定し、選定したオブジェクトデータをスクリーン上の投影画像となる画像データに透視変換し、変換された画像データをZソートし、Zソートされた画像データ中、視点位置から所定距離以上離れた画像データを抽出し、数ドットずらした半透明な画像をテクスチャとする半透明ダミーポリゴンを生成し、半透明ダミーポリゴンを含む画像データにしたがって不鮮明なぼやけた状態の画像を描画する。これにより、3次元画像データを現実感のある画像として表示している。   Patent Document 4 selects object data located within a field of view defined with reference to a viewpoint position from object data, and perspective-converts the selected object data into image data to be a projected image on a screen, and the converted image Data is Z-sorted, image data that is more than a predetermined distance away from the viewpoint position is extracted from the Z-sorted image data, and a semi-transparent dummy polygon with a translucent image shifted by several dots as a texture is generated. A blurry and blurred image is drawn according to the image data including the dummy polygon. Thereby, the three-dimensional image data is displayed as a realistic image.

特許文献5は、画像を構成しているオブジェクト毎に割り当てたメモインメモリ上の複数の順序テーブルに画像を複数に分割した各ブロックのZ方向の情報をアドレスとして各ブロックの処理順序を示す順序データを書き込み、DMAコントローラにより複数の順序テーブル同士を段階的にZソートすることによって描画データを作成する。これにより、物理的に分かれたオブジェクトが近い深さにあった場合にも、ポリゴン単位の干渉を排除して、画質の良好な描画データを生成することを可能にしている。   Japanese Patent Application Laid-Open No. 2004-151867 shows an order indicating the processing order of each block by using, as an address, information in the Z direction of each block obtained by dividing the image into a plurality of order tables on the memo-in memory allocated for each object constituting the image Data is written and drawing data is created by Z-sorting a plurality of order tables step by step by the DMA controller. As a result, even when physically separated objects are close in depth, it is possible to eliminate the polygon unit interference and generate drawing data with good image quality.

特開2000−268190号JP 2000-268190 A 特開平10−11610号JP-A-10-11610 特開平9−44697号JP 9-44697 A 特開2000−93654号JP 2000-93654 A 特開平7−114654号JP-A-7-114654

従来の3次元画像描画装置では、ソフトウエアまたはハードウエアを用いてZソート処理を行っている。ソフトウエアによりZソートを行う場合、描画内容に最も適したZソート処理方法を提供できる自由度があるが、その反面、処理の最適化を図るアルゴリズムの設計には大きなコストを要する。また、演算結果を格納する比較的大きなメモリ容量を必要とし、かつメモリへのアクセス頻度も増加するため、Zソート処理時間の高速化には限界がある。   In a conventional three-dimensional image drawing apparatus, Z sort processing is performed using software or hardware. When performing Z sort by software, there is a degree of freedom that can provide a Z sort processing method most suitable for the content to be drawn, but on the other hand, designing an algorithm for optimizing the processing requires a large cost. Further, since a relatively large memory capacity for storing the calculation result is required and the frequency of access to the memory is increased, there is a limit to speeding up the Z sort processing time.

一方、ハードウエアによるZソート専用回路を搭載した場合、頂点座標演算から描画処理までの処理を全てハードウエア処理で実行できるため、シンプルな構成を実現することが可能であり、かつCPU負荷を軽減することができ、システムの処理性能が向上する。しかし、ポリゴン毎のZ座標値を1つずつ比較してソートする方法のZソート回路とした場合、どのような描画内容にも対応可能であり、かつソート回路規模を小さくできる利点がある一方で、ソートするポリゴン数が増加すると、その二乗の回数でZ座標値比較を行うこととなり、ソート処理に多くの時間を要してしまい、Zソート処理を高速化することが難しいという課題がある。   On the other hand, when a hardware dedicated Z sort circuit is installed, all processing from vertex coordinate calculation to drawing processing can be executed by hardware processing, so a simple configuration can be realized and the CPU load is reduced. Can improve the processing performance of the system. However, when the Z sort circuit of the method of comparing and sorting the Z coordinate values for each polygon one by one, it is possible to deal with any drawing content and has the advantage of reducing the sort circuit scale. If the number of polygons to be sorted increases, Z coordinate value comparison is performed by the squared number of times, so that a lot of time is required for the sorting process, and it is difficult to speed up the Z sorting process.

本発明は、上記従来の課題を解決するために成されたもので、ポリゴンのソートを高速に行うことができる3次元画像描画装置およびソート処理方法を提供することを目的とする。
さらに本発明は、ハードウエアによるZソート処理回路を設けることで、頂点座標演算から描画処理までをハードウエアにより処理することができる3次元画像描画装置を提供することを目的とする。
さらに本発明は、Zソート処理回路を設けることで、他のハードウエア資源への負担を軽減し、3次元グラフィックスの高速描画を可能とする3次元画像描画装置を提供することを目的とする。
The present invention has been made to solve the above-described conventional problems, and an object of the present invention is to provide a three-dimensional image drawing apparatus and a sort processing method that can perform polygon sorting at high speed.
A further object of the present invention is to provide a three-dimensional image drawing apparatus capable of processing from vertex coordinate calculation to drawing processing by hardware by providing a hardware Z sort processing circuit.
A further object of the present invention is to provide a three-dimensional image drawing apparatus that reduces the burden on other hardware resources by providing a Z sort processing circuit and enables high-speed drawing of three-dimensional graphics. .

本発明に係る、半透明ポリゴンを画面奥側から画面手前または画面手前から画面奥側に向けてZソートする機能を備えた3次元画像描画装置は、ポリゴンについて画面奥行きの関数であるデプス値を算出するデプス値算出手段と、算出されたポリゴンのデプス値と基準デプス値とを比較する比較手段と、比較手段による比較結果に基づきポリゴンの描画順序を決定する描画順序決定手段と、ポリゴンのデプス値と基準デプス値の一部を比較対象から除外する比較精度制御手段とを有する。   According to the present invention, a 3D image rendering apparatus having a function of Z-sorting a translucent polygon from the back of the screen toward the front of the screen or from the front of the screen toward the back of the screen has a depth value that is a function of the screen depth for the polygon. Depth value calculating means for calculating, comparing means for comparing the calculated polygon depth value and the reference depth value, a drawing order determining means for determining the drawing order of the polygon based on the comparison result by the comparing means, and a polygon depth And a comparison accuracy control means for excluding a part of the value and the reference depth value from the comparison target.

好ましくは、比較精度制御手段は、比較手段に入力されるポリゴンのデプス値および基準デプス値のデータの一部をマスクする。さらに好ましくは、ポリゴンのデプス値および基準デプス値は、それぞれ浮動小数点数による所定ビット数のデータビットによって表され、比較精度制御手段は、ポリゴンのデプス値および基準デプス値のそれぞれの小数部を表すデータビットの一部をマスクする。   Preferably, the comparison accuracy control means masks part of the polygon depth value and reference depth value data input to the comparison means. More preferably, the polygon depth value and the reference depth value are each represented by a predetermined number of data bits in a floating-point number, and the comparison accuracy control means represents a decimal part of each of the polygon depth value and the reference depth value. Mask some of the data bits.

また、比較精度制御手段は、複数のマスク設定値を含み、当該複数のマスク設定値から選択されたマスク設定値に応じて、ポリゴンのデプス値および基準デプス値の選択されたデータビットをマスクするようにしてもよい。   Further, the comparison accuracy control means includes a plurality of mask setting values, and masks the selected data bits of the polygon depth value and the reference depth value according to the mask setting value selected from the plurality of mask setting values. You may do it.

好ましくは比較精度制御手段は、複数のANDゲートを含み、ポリゴンのデプス値の所定のデータビットおよび基準デプス値の所定のデータビットは、各ANDゲートの一方の入力に接続され、各ANDゲートの他方の入力には、マスク制御信号が接続される。基準デプス値は、比較される複数のポリゴンの中から選択されたデプス値であり、実施例の最小保持デプス値に相当する。また、ポリゴンのデプス値は、ポリゴンの頂点座標のZ座標軸方向の平均値を用いることができる。好ましくは、ポリゴンは、半透明ポリゴンである。   Preferably, the comparison accuracy control means includes a plurality of AND gates, and the predetermined data bits of the polygon depth value and the predetermined data bits of the reference depth value are connected to one input of each AND gate, A mask control signal is connected to the other input. The reference depth value is a depth value selected from a plurality of polygons to be compared, and corresponds to the minimum holding depth value of the embodiment. As the polygon depth value, an average value in the Z coordinate axis direction of the vertex coordinates of the polygon can be used. Preferably, the polygon is a translucent polygon.

本発明に係るポリゴンを画面奥側から画面手前または画面手前から画面奥側に向けてソートするソート処理方法は、ポリゴンについて画面奥行きの関数であるデプス値を算出するステップと、ポリゴンのデプス値と基準デプス値の一部をマスクし、ポリゴンのデプス値と基準デプス値とを比較するステップと、比較結果に基づきポリゴンの描画順序を決定するステップとを有する。   The sorting processing method for sorting the polygons according to the present invention from the back side of the screen toward the front side of the screen or from the front side of the screen toward the back side of the screen includes a step of calculating a depth value that is a function of the screen depth for the polygon, The method includes masking a part of the reference depth value, comparing the polygon depth value with the reference depth value, and determining a polygon drawing order based on the comparison result.

好ましくはポリゴンのデプス値および基準デプス値は、浮動小数点数による所定ビット数のデータビットによって表され、ポリゴンのデプス値および基準デプス値の選択されたビットをマスクして比較する。   Preferably, the polygon depth value and the reference depth value are represented by data bits having a predetermined number of floating-point numbers, and the selected bits of the polygon depth value and the reference depth value are masked and compared.

本発明の3次元画像描画装置によれば、ポリゴンのデプス値と基準デプス値との比較において、ポリゴンのデプス値と基準デプス値の一部を比較対象から除外(マスク)し、比較精度を制御するようにしたので、比較精度を落とすことで、比較処理に要する時間を短縮し、ポリゴンのソートを高速化させることができる。さらに、本発明によれば、頂点演算、Zソート処理、および描画処理をハードウエアにより行うことが可能となるため、3次元画像の描画を高速化することができる。   According to the three-dimensional image drawing apparatus of the present invention, in comparing the polygon depth value and the reference depth value, a part of the polygon depth value and the reference depth value are excluded (masked) from the comparison target, and the comparison accuracy is controlled. Therefore, by reducing the comparison accuracy, the time required for the comparison process can be shortened, and the polygon sorting can be speeded up. Furthermore, according to the present invention, vertex calculation, Z sort processing, and drawing processing can be performed by hardware, so that drawing of a three-dimensional image can be speeded up.

本発明に係る3次元画像描画装置について図面を参照して詳細に説明する。   A three-dimensional image drawing apparatus according to the present invention will be described in detail with reference to the drawings.

図1は、本発明の実施例に係る3次元画像描画装置のシステム構成を示すブロック図である。3次元画像描画装置1は、システム全体を制御するCPU10、2次元または3次元のグラフィック描画を制御する描画用回路20、プログラムや画像データ等を格納するメモリ30、メモリ30へのアクセスを制御するメモリコントローラ40、メモリに格納された画像データをモニタに出力する画像表示用回路50、外部ポートに接続されプログラム等のデータを格納する外部メモリ60、内部バスや外部ポート(シリアルI/F)の制御を行う周辺制御回路70、画像表示用回路50から出力された画像データを表示するモニタ80を含んで構成される。   FIG. 1 is a block diagram showing a system configuration of a three-dimensional image drawing apparatus according to an embodiment of the present invention. The three-dimensional image drawing apparatus 1 controls a CPU 10 that controls the entire system, a drawing circuit 20 that controls two-dimensional or three-dimensional graphic drawing, a memory 30 that stores programs and image data, and access to the memory 30. A memory controller 40, an image display circuit 50 for outputting image data stored in the memory to a monitor, an external memory 60 connected to an external port for storing data such as a program, an internal bus and an external port (serial I / F) A peripheral control circuit 70 that performs control and a monitor 80 that displays image data output from the image display circuit 50 are configured.

描画用回路20はさらに、モデルの各頂点座標値の3次元演算(回転、拡張、移動など)や光源計算などを行って、スクリーン座標空間での頂点データを求めるジオメトリ回路22と、描画最小単位である三角形や四角形のポリゴンデータのZソート処理やクリッピング処理を行うZソート処理回路24と、描画リストにしたがってグラフィック描画を行うレンダリング回路26を含んでいる。本実施例では、描画用回路20をハードウエアにより構成することで、モデルの座標演算、Zソート処理、および描画処理をハードウエアにより実現することができる。   The drawing circuit 20 further performs a three-dimensional calculation (rotation, expansion, movement, etc.) of each vertex coordinate value of the model, light source calculation, and the like, a geometry circuit 22 for obtaining vertex data in the screen coordinate space, and a drawing minimum unit. A Z sort processing circuit 24 that performs Z sort processing and clipping processing of triangular or quadrilateral polygon data, and a rendering circuit 26 that performs graphic drawing according to a drawing list. In this embodiment, by configuring the drawing circuit 20 with hardware, model coordinate operations, Z sort processing, and drawing processing can be realized with hardware.

図2は、3次元画像描画装置における描画処理の基本的なフローを示す図である。CPU10は、メモリ30内のプログラムデータ31および3次元モデルデータ32等にしたがって、モデルの回転や移動などの基となる各パラメータを計算する(ステップa)。CPU10は、計算したモデルデータの各パラメータにしたがって、ジオメトリ回路22が受け付ける形式のジオメトリ回路用描画リストデータ33を生成し、これをメモリ内に格納する(ステップb)。   FIG. 2 is a diagram illustrating a basic flow of a drawing process in the three-dimensional image drawing apparatus. The CPU 10 calculates each parameter serving as a basis for rotation and movement of the model in accordance with the program data 31 and the three-dimensional model data 32 in the memory 30 (step a). The CPU 10 generates geometry circuit drawing list data 33 in a format accepted by the geometry circuit 22 according to each parameter of the calculated model data, and stores it in the memory (step b).

ジオメトリ回路22は、メモリ内のジオメトリ回路用描画リストデータ33を読み込みながら決められた頂点演算処理を行い、その結果をソート処理回路24に送る(ステップc)。   The geometry circuit 22 performs the determined vertex calculation process while reading the geometry circuit drawing list data 33 in the memory, and sends the result to the sort processing circuit 24 (step c).

ソート処理回路24は、ジオメトリ回路22から受け取った頂点演算された描画リストデータ33にしたがって、Zソート処理やクリッピング処理を行い、そしてレンダリング回路26が受け付ける形式のレンダリング回路用描画リストデータ34を生成し、これをメモリ内に格納する(ステップd)。   The sort processing circuit 24 performs Z sort processing and clipping processing in accordance with the drawing list data 33 subjected to the vertex calculation received from the geometry circuit 22, and generates rendering circuit drawing list data 34 in a format accepted by the rendering circuit 26. This is stored in the memory (step d).

レンダリング回路26は、メモリ内のレンダリング回路用描画リストデータ34を読み込みながら描画処理用ピクセルパラメータを計算する(ステップe)。描画処理用ピクセルパラメータとは、描画ピクセルのテクスチャ座標値、描画ピクセルのデプス値(すなわち画面奥行き方向座標値:Z値)、および描画ピクセルのフレームバッファ座標値などのピクセル描画に必要なパラメータである。   The rendering circuit 26 calculates the rendering process pixel parameters while reading the rendering circuit rendering list data 34 in the memory (step e). The pixel parameter for drawing processing is a parameter necessary for pixel drawing, such as a texture coordinate value of the drawing pixel, a depth value of the drawing pixel (that is, a screen depth direction coordinate value: Z value), and a frame buffer coordinate value of the drawing pixel. .

レンダリング回路26は、描画ピクセルのテクスチャ座標値にしたがって各ピクセルに対応したテクスチャデータ35をメモリから読み込んで処理し、描画ピクセルのカラーデータを求め(ステップf)、さらに、描画ピクセルのデプス値とデプスバッファ36から読み込んだデプス値の比較結果にしたがってピクセル描画を行うかどうか判断する(ステップg)。   The rendering circuit 26 reads the texture data 35 corresponding to each pixel from the memory according to the texture coordinate value of the drawing pixel and processes it to obtain the color data of the drawing pixel (step f), and further, the depth value and the depth of the drawing pixel. It is determined whether to perform pixel drawing according to the comparison result of the depth values read from the buffer 36 (step g).

レンダリング回路26はさらに、αブレンディング処理指定にしたがって描画ピクセルのカラーデータを計算し、描画ピクセルのフレームバッファ37の座標位置にデータを格納する(ステップh)。   The rendering circuit 26 further calculates the color data of the drawing pixel in accordance with the α blending processing specification, and stores the data at the coordinate position of the drawing pixel frame buffer 37 (step h).

次に、本実施例のソート処理回路24の詳細について説明する。立体物を構成するポリゴンをZソートする際に比較するZ座標値は、ポリゴン各頂点(三角形の場合は3頂点)のZ座標値の「平均値」を用いることができる。但し、ポリゴンのZ座標値の最小値または最大値を用いてもよい。   Next, details of the sort processing circuit 24 of this embodiment will be described. As the Z coordinate value to be compared when the polygons constituting the three-dimensional object are Z-sorted, the “average value” of the Z coordinate values of the respective vertexes (three vertices in the case of a triangle) of the polygon can be used. However, the minimum value or the maximum value of the Z coordinate value of the polygon may be used.

比較に使用する値は、画面に垂直な座標軸に関連する奥行き方向の値であれば良く、「Z座標値」には限らない。そこで、本明細書では、以降の説明において、比較に使用する値を総称として「デプス値」と呼ぶことにする。   The value used for the comparison may be a value in the depth direction related to the coordinate axis perpendicular to the screen, and is not limited to the “Z coordinate value”. Therefore, in this specification, in the following description, values used for comparison are collectively referred to as “depth values”.

ソート処理回路24におけるZソート処理の概要は、次の通りである。
1)入力された半透明描画オブジェクトをポリゴン単位に分割し、各ポリゴンのデプス平均値を求める。
2)各ポリゴンのデプス平均値を大小比較して、画面奥側から順番に並べ替える。デプス平均値が等しい場合は、予め決められた法則に則って順番を決める。通常は、処理する順番が早い方を画面奥側となるようにする。
The outline of the Z sort processing in the sort processing circuit 24 is as follows.
1) The input translucent drawing object is divided into polygons, and a depth average value of each polygon is obtained.
2) The depth average values of the polygons are compared in size and rearranged sequentially from the back of the screen. When the depth average values are equal, the order is determined according to a predetermined rule. Normally, the earlier processing order is set to the back side of the screen.

一般に、頂点xyz座標値やデプス値は、「16bit/32bit固定小数点数」または「32bit浮動小数点数」を用いて表される。最近の3次元コンピュータグラフィックスでは、数値としての表現可能範囲が大きい32ビット浮動小数点数が使用されることが多い。以下の表は、IEEEによる国際標準規格により定められた32ビット浮動小数点数のデータ構成を示している。   In general, the vertex xyz coordinate value and the depth value are expressed using “16-bit / 32-bit fixed-point number” or “32-bit floating-point number”. In recent three-dimensional computer graphics, a 32-bit floating point number having a large expressible range as a numerical value is often used. The following table shows the data structure of a 32-bit floating point number defined by the international standard by IEEE.

Figure 0004617187
Figure 0004617187

図3は、Zソート処理のフローを示す図である。ここでは、デプス値を画面手前より画面奥側の方が小さい値とする。始めに、ソート処理回路24は、最小保持デプス値に予め定められた最大数の値をセットする(ステップS101)。最小保持デプス値とは、全ての半透明描画ポリゴンの中で最も画面奥側(言い換えれば、デプス値が最小値)となるポリゴンのデプス平均値である。最小保持デプス値は、メモリ30またはレジスタ等に記憶される。   FIG. 3 is a diagram illustrating a flow of the Z sort process. Here, it is assumed that the depth value is smaller on the back side of the screen than on the near side of the screen. First, the sort processing circuit 24 sets a predetermined maximum number of values as the minimum holding depth value (step S101). The minimum retained depth value is the average depth value of the polygons that are on the farthest screen side (in other words, the depth value is the minimum value) among all the translucent drawn polygons. The minimum hold depth value is stored in the memory 30 or a register.

ソート処理回路24は、入力された順に、3次元演算後の頂点座標を持つ、スクリーン座標投影処理後の半透明描画オブジェクトを三角形ポリゴン単位に分割し、これをポリゴンデータとしてメモリ30に格納する(ステップS102)。   The sort processing circuit 24 divides the semi-transparent drawing object after the screen coordinate projection processing having the vertex coordinates after the three-dimensional calculation in the order of input, into triangle polygon units, and stores this in the memory 30 as polygon data ( Step S102).

ソート処理回路24は、入力された順に三角形ポリゴンの3頂点分のデプス平均値を計算し、この平均値は、メモリ30に格納されたポリゴンデータの先頭アドレスと一緒にソート用データとしてメモリ30に格納される(ステップS103)。   The sort processing circuit 24 calculates the depth average value of the three vertices of the triangular polygon in the order of input, and this average value is stored in the memory 30 as sort data together with the head address of the polygon data stored in the memory 30. Stored (step S103).

図4は、ポリゴンデータとソート用データのメモリ30への格納状態を示している。同図に示すように、ソート処理回路24は、入力された順に、ポリゴンデータ0、1、2・・・をメモリ30に格納する。各ポリゴンデータは、3頂点分のxyz座標値、テクスチャ座標値およびシェーディングカラー等を含んでいる。またソート処理回路24は、ポリゴンデータ0、1、2・・・に対応するソート用データ0、1、2・・・をメモリ30に格納する。各ソート用データは、対応するポリゴンデータの先頭アドレスとデプス平均値とを含んでいる。例えば、ソート用データ0は、ポリゴンデータ0の先頭アドレスとそのデプス平均値を含んでいる。   FIG. 4 shows a state in which polygon data and sorting data are stored in the memory 30. As shown in the figure, the sort processing circuit 24 stores the polygon data 0, 1, 2,... In the memory 30 in the input order. Each polygon data includes xyz coordinate values, texture coordinate values, shading colors, and the like for three vertices. The sort processing circuit 24 stores sort data 0, 1, 2,... Corresponding to polygon data 0, 1, 2,. Each sort data includes the head address of the corresponding polygon data and the depth average value. For example, the sort data 0 includes the top address of the polygon data 0 and its depth average value.

ソート処理回路24は、ポリゴンのデプス平均値と最小保持デプス値を比較し、値の小さい方を最小保持デプス値としてレジスタに保持する(ステップS104)。全ての半透明描画オブジェクトのポリゴンデータとソート用データをメモリ30に格納し終えるまで、上記ステップS102からS104までの処理が繰り返される。   The sort processing circuit 24 compares the polygon depth average value and the minimum hold depth value, and holds the smaller one in the register as the minimum hold depth value (step S104). Until the polygon data and sort data of all the translucent drawing objects are stored in the memory 30, the processes from step S102 to step S104 are repeated.

次に、ソート処理が開始される。ソート処理回路24は、最初のソート用データ(図4のソート用データ“0”)のデプス平均値を一時保持デプス値としてレジスタにセットする(ステップS106)。ソート処理回路24は、メモリ30からソート用データを順番に読出し、デプス平均値と最小保持デプス値を大小比較する(ステップS107)。   Next, the sort process is started. The sort processing circuit 24 sets the depth average value of the first sort data (sort data “0” in FIG. 4) as a temporary holding depth value in the register (step S106). The sort processing circuit 24 sequentially reads the sort data from the memory 30, and compares the depth average value with the minimum hold depth value (step S107).

デプス値の比較を行った結果(ステップS108)、ソート用データのデプス平均値が最小保持デプス値よりも大きい場合には、さらにソート用データのデプス平均値と一時保持デプス値とを比較する。ソート用データのデプス平均値が一時保持デプス値よりも小さいとき(デプス平均値<一次保持デプス値)、一時保持デプス値をソート用データのデプス平均値に更新する(ステップS109)。   As a result of the depth value comparison (step S108), when the depth average value of the sorting data is larger than the minimum holding depth value, the depth average value of the sorting data is further compared with the temporary holding depth value. When the depth average value of the sorting data is smaller than the temporary holding depth value (depth average value <primary holding depth value), the temporary holding depth value is updated to the depth average value of the sorting data (step S109).

ソート用データのデプス平均値と最小保持デプス値とが等しい場合には、ソート用データ内のポリゴンデータ先頭アドレス値を「ポリゴン描画順番用データ」としてメモリ30に格納する(ステップS110)。   If the depth average value of the sort data is equal to the minimum hold depth value, the polygon data head address value in the sort data is stored in the memory 30 as “polygon drawing order data” (step S110).

デプス平均値が最小保持デプス値よりも小さい場合には、その比較結果に対する処理は行われない。こうして、全てのソート用データについての比較処理が行われると、画面奥側の最初に描画すべき半透明描画オブジェクトの半透明ポリゴンが検出されたことになる(ステップS111)。また、一時保持デプス値には、最小保持デプス値の次に大きいデプス値(2番目のデプス値)が格納されることになるので、最小保持デプス値を一時保持デプス値に更新する(ステップS112)。次のソート処理では、2番目に小さなデプス平均値をもつ半透明ポリゴンが検出される。   When the depth average value is smaller than the minimum holding depth value, the comparison result is not processed. In this way, when comparison processing has been performed for all sort data, a translucent polygon of a translucent drawing object to be drawn first on the back side of the screen is detected (step S111). In addition, since the depth value (second depth value) next to the minimum holding depth value is stored in the temporary holding depth value, the minimum holding depth value is updated to the temporary holding depth value (step S112). ). In the next sorting process, a semi-transparent polygon having the second smallest depth average value is detected.

以上の処理を、全てのポリゴン分の「ポリゴン描画順番用データ」が完成するまで繰り返すことで(ステップS113)、Zソート処理が終了する(ステップS114)。ポリゴン描画順番用データは、描画リストデータ34としてメモリ30に格納される。   The above process is repeated until “polygon drawing order data” for all polygons is completed (step S113), and the Z sort process is completed (step S114). The polygon drawing order data is stored in the memory 30 as the drawing list data 34.

図5は、ポリゴン描画順番用データの格納状態を示す図である。同図に示すように、ソート処理を行った結果、ポリゴン描画順番用データの先頭アドレス(ポリゴン先頭アドレス“0”)には、1番目に描画するポリゴンデータの先頭アドレス値が格納され、次のアドレスには、2番目に描画するポリゴンデータの先頭アドレス値が格納される。ポリゴン描画順番用データの先頭アドレスから順にその内容を参照することで、半透明ポリゴンデータを読み出すことができる。   FIG. 5 is a diagram illustrating a storage state of polygon drawing order data. As shown in the figure, as a result of the sorting process, the head address value of the polygon data to be drawn first is stored in the head address of the polygon drawing order data (polygon head address “0”). The address stores the start address value of the polygon data to be drawn second. By referring to the contents in order from the top address of the polygon drawing order data, the translucent polygon data can be read.

ポリゴンデータのデプス平均値を比較することによって、ポリゴンの描画順番を決定する場合、全て異なるデプス平均値を持ったN個の三角形ポリゴンがあれば、N個×N回の比較処理を実行することになる。つまり、最大で半透明描画ポリゴン数の2乗もの回数のデプス値比較処理を行わなければならない。   When the drawing order of polygons is determined by comparing the depth average values of polygon data, if there are N triangular polygons having different depth average values, N × N comparison processes are executed. become. That is, the depth value comparison processing must be performed as many times as the square of the number of semitransparent drawing polygons.

本実施例では、ソート処理回路に簡単な回路を付加することによってデプス値の比較処理回数を低減し、Zソート処理を高速化している。同時に、比較精度の制御も可能にしている。   In this embodiment, by adding a simple circuit to the sort processing circuit, the number of depth value comparison processes is reduced, and the Z sort process is speeded up. At the same time, comparison accuracy can be controlled.

半透明描画処理において、ポリゴン単位で画面奥側から順番に描画されるようにZソート処理を行う必要があるのは、ポリゴン同士が画面奥行き方向に対して重なる場合のみである。つまり、半透明描画ポリゴン全てを正しくソート処理しなくても正しい半透明描画は可能である。また、ある程度の大きさを持つ立体物を構成する各ポリゴンにおいて、半透明描画時に正しいソート処理をする必要のあるポリゴン同士のデプス平均値の差は、あまり小さな値にならないことの方が多い。   In the translucent rendering process, it is necessary to perform the Z sort process so that the polygons are sequentially rendered from the back side of the screen only when the polygons overlap with each other in the screen depth direction. That is, the correct translucent drawing is possible without correctly sorting all the translucent drawing polygons. In addition, in each polygon constituting a solid object having a certain size, the difference in depth average value between polygons that need to be correctly sorted at the time of semi-transparent rendering is often not so small.

このことから、デプス値の比較処理時の比較精度を落として、言い換えればデプス値の比較結果が「等しい」となる確率を上げることで、比較処理回数を少なくし、Zソート処理を高速化する。   Therefore, by reducing the comparison accuracy during the depth value comparison process, in other words, by increasing the probability that the comparison result of the depth value is “equal”, the number of comparison processes is reduced, and the Z sort process is speeded up. .

デプス値は、上記表に示したように、「単精度浮動小数点数(32bit値)」で表現されており、それらのデータは、「符号」、「指数部」、「小数部」の3つの値から構成されている。大小比較処理として、小数部の内容の比較結果が意味を持つのは、符号および指数部が共に等しい場合のみである。つまり、全ての半透明描画ポリゴンのデプス平均値の差が2倍以上ずつある場合、言い換えれば、全ての指数部が等しくない場合、小数部は、デプス平均値の比較結果に影響しない。デプス値は0.0〜1.0の値(単精度浮動小数点数の精度が最も高くなる範囲)となるように調整することが多く、符号は、正(”0”固定)となるので、比較処理に使用されない(もちろん比較処理しても良い)。   As shown in the above table, the depth value is expressed by “single precision floating point number (32-bit value)”, and the data is divided into “sign”, “exponential part”, and “decimal part”. Consists of values. As a magnitude comparison process, the comparison result of the contents of the decimal part is meaningful only when both the sign and the exponent part are equal. That is, when the difference in the average depth value of all the translucent drawing polygons is twice or more, in other words, when all the exponent parts are not equal, the decimal part does not affect the comparison result of the average depth value. The depth value is often adjusted to be a value between 0.0 and 1.0 (the range in which the precision of the single-precision floating-point number is the highest), and the sign is positive (fixed to “0”). Not used for comparison processing (of course, comparison processing may be performed).

これらのことを利用して、デプス平均値と最小保持デプス値を浮動小数点数比較回路に入力する前段で、デプス平均値と最小保持デプス値の小数部の所望のビットをマスクするANDゲートを付加している。   Using these things, an AND gate that masks the desired bits of the decimal part of the depth average value and the minimum retained depth value is added before the depth average value and the minimum retained depth value are input to the floating-point comparison circuit. is doing.

図6は、本実施例のソート処理回路の構成を示す図である。同図において、半透明ポリゴンのデプス平均値の指数部100の8ビットデータが浮動小数点比較部130に入力される。半透明ポリゴンのデプス平均値の小数部102の23ビットデータは、ANDゲート110−1〜110−23の一方の入力に供給される。また、最小保持デプス値の指数部104の8ビットデータが浮動小数点比較部130に入力され、その小数部106の23ビットデータがANDゲート120−1〜120−23の一方の入力に供給される。図では、ANDゲート110−1および110−23とANDゲート120−1および120−23しか示していないが、実際には、ANDゲート110およびAND120は、小数部の小数点第1位から小数点第23位までに相当する23個のANDゲートを有している。   FIG. 6 is a diagram showing the configuration of the sort processing circuit of this embodiment. In the figure, 8-bit data of the exponent part 100 of the depth average value of the semi-transparent polygon is input to the floating point comparison unit 130. The 23-bit data of the fractional part 102 of the semi-transparent polygon depth average value is supplied to one input of the AND gates 110-1 to 110-23. The 8-bit data of the exponent part 104 of the minimum holding depth value is input to the floating-point comparator 130, and the 23-bit data of the decimal part 106 is supplied to one input of the AND gates 120-1 to 120-23. . Although only the AND gates 110-1 and 110-23 and the AND gates 120-1 and 120-23 are shown in the figure, in practice, the AND gate 110 and the AND 120 are arranged from the first decimal place to the 23rd decimal place. There are 23 AND gates corresponding to the order.

さらに精度制御用小数部140は、23ビットについてのマスク値を有し、23ビットのマスク制御信号142が、ANDゲート110−1〜110−23およびANDゲート120−1〜120−23の他方の入力に供給される。精度制御用小数部140のマスク値は、比較精度制御部150からの制御信号によって可変することができる。   Further, the precision control decimal part 140 has a mask value for 23 bits, and the 23-bit mask control signal 142 is the other of the AND gates 110-1 to 110-23 and the AND gates 120-1 to 120-23. Supplied to the input. The mask value of the precision control decimal part 140 can be varied by a control signal from the comparison precision control part 150.

例えば、マスク制御信号142を”0x400000”(16進数)とすれば、ANDゲート110−2〜110−23およびANDゲート120−2〜120−23の他方の入力において、小数点第2位以降がすべて論理“0”となるため、半透明ポリゴンのデプス値および最小保持デプス値の小数部の小数点第2位以下がマスクされ、比較対象から外される。したがって、最小保持デプス値とデプス平均値との大小比較において、小数部の小数点第1位のみが比較対象となり、両者が「等しい」となる確率が上昇するため、比較処理回数が減少し、Zソート処理が高速化される。   For example, if the mask control signal 142 is “0x400000” (hexadecimal number), the second and subsequent decimal places are all in the other inputs of the AND gates 110-2 to 110-23 and the AND gates 120-2 to 120-23. Since the logic is “0”, the second decimal place of the decimal part of the depth value of the translucent polygon and the minimum retained depth value are masked and excluded from the comparison target. Therefore, in the magnitude comparison between the minimum holding depth value and the depth average value, only the first decimal place of the decimal part is a comparison target, and the probability that both are equal is increased, so the number of comparison processes decreases, and Z Sort processing is speeded up.

また、マスク制御信号142を”0x7FFFFF”とすれば、ANDゲート110−1〜110−23およびANDゲート120−1〜120−23の他方の入力のすべてが論理“1”となる。この場合にはすべての小数部がマスクされないので、半透明ポリゴンのデプス平均値および最小保持デプス値の全ての小数部についての比較処理が行われる。その結果、Zソート処理は高速化されないが、その反面、比較精度を最高とすることもできる。   If the mask control signal 142 is set to “0x7FFFFF”, all of the other inputs of the AND gates 110-1 to 110-23 and the AND gates 120-1 to 120-23 become logic “1”. In this case, since all the decimal parts are not masked, the comparison processing is performed for all the decimal parts of the depth average value and the minimum holding depth value of the semitransparent polygon. As a result, the Z sort process is not accelerated, but on the other hand, the comparison accuracy can be maximized.

比較精度制御部150は、例えば、半透明ポリゴンの数量や描画時間などの条件からマスク制御信号142のマスク値を設定することも可能である。例えば動画をモニタに表示する場合、1フレームの描画は一定時間(例えば、1/30秒)以内にしなければならない。1フレームの描画時間内に、不透明ポリゴンと半透明ポリゴンを描画するとき、半透明ポリゴンの描画時間は、1フレームの描画時間から不透明ポリゴンの描画時間を引いた値となる。したがって、描画すべき半透明ポリゴン数が多くなると、ソート処理を高速化しなければならない。このため、半透明ポリゴン数が一定数よりも多きときには、幾分だけ比較精度を落すようにマスクするビット数を多くして高速化し、その反対に、半透明ポリゴン数が一定数よりも少ないときは、比較精度を落すことなく、マスクするビット数を少なくし、あるいはマスクしないようにしてもよい。   The comparison accuracy control unit 150 can also set the mask value of the mask control signal 142 based on conditions such as the number of translucent polygons and the drawing time, for example. For example, when a moving image is displayed on a monitor, one frame must be drawn within a certain time (for example, 1/30 second). When an opaque polygon and a semitransparent polygon are drawn within the drawing time of one frame, the drawing time of the semitransparent polygon is a value obtained by subtracting the drawing time of the opaque polygon from the drawing time of one frame. Therefore, if the number of translucent polygons to be drawn increases, the sorting process must be accelerated. For this reason, when the number of semi-transparent polygons is larger than a certain number, the number of bits to be masked is increased so that the comparison accuracy is somewhat reduced, and on the contrary, when the number of semi-transparent polygons is smaller than a certain number. The number of bits to be masked may be reduced or not masked without reducing the comparison accuracy.

さらに比較精度制御部150は、予め複数のマスク値を用意しておき、複数のマスク値から所望のマスク値を選択し、これを精度制御用小数部140へ供給するようにしてもよい。例えば、指数部の値などにしたがって、複数のマスク値から1つを選択するようにしても良いし、描画する画像の種類によって比較精度を可変するようにしてもよい。さらに、モニタの解像度があまり高くない場合には、比較精度を落とすようにしてもよい。   Further, the comparison accuracy control unit 150 may prepare a plurality of mask values in advance, select a desired mask value from the plurality of mask values, and supply this to the accuracy control decimal unit 140. For example, one of a plurality of mask values may be selected according to the value of the exponent part, or the comparison accuracy may be varied depending on the type of image to be drawn. Furthermore, when the resolution of the monitor is not so high, the comparison accuracy may be lowered.

このように、精度制御用小数部140のマスク制御信号142とデプス平均値および最小保持デプス値の小数部のデータビットを入力としたANDゲート110、120を付加するだけで、デプス値比較精度を簡単に制御することができ、Zソート処理を高速化することができる。   As described above, the depth value comparison accuracy can be increased by simply adding the AND gates 110 and 120 to which the mask control signal 142 of the precision control decimal part 140 and the data bits of the decimal part of the depth average value and the minimum retained depth value are input. It can be easily controlled, and the Z sort process can be speeded up.

またジオメトリエンジン等のハードウエアによってポリゴンデータの頂点座標の演算を行う場合、その演算結果データをZソート処理することになるが、ソフトウエアによるZソート処理を行うと、演算結果データを一旦メモリに出力して処理しなければならず、全体の描画処理として、頂点演算(ハードウエア)→Zソート(ソフトウエア)→描画処理(ハードウエア)が混在し、各処理の開始と終了のタイミング管理が複雑化してしまう。しかし、本実施例の場合、Zソート処理回路を搭載することで、描画用回路20のハードウエア処理が可能となり、簡単なシステム構成で、高速のZソートを実現することができる。   In addition, when the vertex coordinates of polygon data are calculated by hardware such as a geometry engine, the calculation result data is subjected to Z sort processing. However, if software Z sort processing is performed, the calculation result data is temporarily stored in memory. As a whole drawing process, vertex calculation (hardware) → Z sort (software) → drawing process (hardware) is mixed, and the timing management of the start and end of each process It becomes complicated. However, in the case of the present embodiment, by mounting the Z sort processing circuit, hardware processing of the drawing circuit 20 becomes possible, and high-speed Z sort can be realized with a simple system configuration.

なお比較処理時の小数部有効ビット数を少なくして比較精度を落とすと、Zソート処理は高速化されるが、各半透明描画ポリゴンの描画順番が正確でない部分がでてくる可能性が増加する。これについては、半透明描画オブジェクト(複数ポリゴンで構成される物体)単位などで画面奥行き方向のソート処理をソフトウエアで行うなどして、ソート処理回路へのオブジェクト入力を画面奥側オブジェクトから順番に行うようにすることで緩和できる。オブジェクトは、通常、数百〜数千ポリゴンで構成され、画面内の個数は多くはないので、ソフトウエア処理しても重い処理にはならないことが多い。   Note that if the precision of the decimal part is reduced by reducing the number of effective bits in the fractional part, the Z sort process will be sped up, but there is an increased possibility that the drawing order of each semitransparent drawing polygon will be incorrect. To do. For this, sort processing in the screen depth direction is performed by software in units of semi-transparent drawing objects (objects composed of multiple polygons), etc., and object input to the sort processing circuit is performed in order from the back object on the screen. It can be mitigated by doing so. Usually, an object is composed of hundreds to thousands of polygons, and the number of objects in the screen is not large. Therefore, even if software processing is performed, the processing is often not heavy.

上記実施例では、単精度浮動小数点数のデプス値に対する制御としているが、倍精度浮動小数点数(64bit値)や、指数部と小数部から構成されるその他のデータ形式およびbit数の浮動小数点数にも適用できる。もちろん、指数部にもマスク値を用意しても良い。   In the above embodiment, control is performed for the depth value of a single-precision floating-point number, but a double-precision floating-point number (64-bit value), other data formats composed of an exponent part and a decimal part, and a floating-point number of a bit number It can also be applied to. Of course, a mask value may be prepared for the exponent part.

上記実施例に係るZソート処理回路は、半透明ポリゴンについてのZソートの例を示したが、これに限らず、不透明描画オブジェクトのポリゴンのZソートを行うことができる。特に、Zバッファを用いずに、不透明ポリゴンを画面奥側から画面手前または画面手前から画面奥側にZソートして描画する場合に、本発明を適用することができる。   The Z sort processing circuit according to the above embodiment has shown an example of Z sort for a semi-transparent polygon. However, the Z sort processing circuit is not limited to this, and can perform Z sort of polygons of an opaque drawing object. In particular, the present invention can be applied to a case where opaque polygons are Z-sorted and drawn from the back side of the screen to the near side of the screen or from the near side of the screen to the far side of the screen without using the Z buffer.

本発明の好ましい実施の形態について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形、変更が可能である。   Although the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the specific embodiment, and various modifications, within the scope of the gist of the present invention described in the claims, It can be changed.

本発明に係る3次元画像描画装置およびZソート処理方法は、3次元グラフィックスコンピュータ、ビデオゲーム機、遊技機、およびその他の映像装置などにおいて利用される。   The three-dimensional image drawing apparatus and the Z sort processing method according to the present invention are used in a three-dimensional graphics computer, a video game machine, a game machine, and other video apparatuses.

本発明の実施例に係る三次元画像描画装置のシステム構成を示すブロック図である。It is a block diagram which shows the system configuration | structure of the three-dimensional image drawing apparatus which concerns on the Example of this invention. 描画用回路の基本的な処理を示す図である。It is a figure which shows the basic process of the circuit for drawing. Zソート処理のフローを示す図である。It is a figure which shows the flow of Z sort process. ポリゴンデータとソート用データの格納状態を示す図である。It is a figure which shows the storage state of the polygon data and the data for sorting. ポリゴン描画順番用データの格納状態を示す図である。It is a figure which shows the storage state of the data for polygon drawing order. 本実施例のソート処理回路を示す図である。It is a figure which shows the sort processing circuit of a present Example. モデルデータの座標空間を示す図である。It is a figure which shows the coordinate space of model data. 半透明描画を説明する図である。It is a figure explaining translucent drawing. 立体物の半透明オブジェクトの例を示す図である。It is a figure which shows the example of the semi-transparent object of a solid object.

符号の説明Explanation of symbols

1:3次元画像描画装置
10:CPU
20:描画用回路
30:メモリ
40:メモリコントローラ
50:画像表示用回路
100:デプス平均値指数部
102:デプス平均値小数部
104:最小保持デプス値指数部
106:最小保持デプス値小数部
110−1〜110−23、120−1〜120−23:ANDゲート
130:浮動小数点比較器
140:精度制御用小数部
142:マスク制御信号
150:比較精度制御部
1: 3D image drawing apparatus 10: CPU
20: Drawing circuit 30: Memory 40: Memory controller 50: Image display circuit 100: Depth average value exponent part 102: Depth average value decimal part 104: Minimum holding depth value exponent part 106: Minimum holding depth value decimal part 110- 1-110-23, 120-1 to 120-23: AND gate 130: floating-point comparator 140: precision control decimal part 142: mask control signal 150: comparison precision control part

Claims (10)

ポリゴンデータを画面奥側から画面手前または画面手前から画面奥側に向けてソートする機能を備えた3次元画像描画装置であって、
半透明描画オブジェクトから得られたN個のポリゴンデータを格納する格納手段と、
前記格納手段に格納されたN個のポリゴンデータについて画面奥行きの関数である所定のデータビット数で表されたデプス値を算出するデプス値算出手段と、
N個のポリゴンデータのデプス値とN個のポリゴンデータのデプス値の中から選択された基準デプス値とを比較する比較手段と、
前記比較手段による比較結果に基づきポリゴンデータの描画順序を決定する描画順序決定手段と、
前記比較手段によるN個のポリゴンデータのデプス値と基準デプス値の一部を比較対象から除外する比較精度制御手段とを有し、
前記比較精度制御手段は、デプス値を表す所定のデータビット数のうちの選択されたデータビット数に対応する複数のANDゲートを含み、各ANDゲートの一方の入力には、ポリゴンデータの前記選択されたデータビットがそれぞれ入力され、他方の入力には、前記選択されたデータビットの少なくとも1つをマスク可能なマスク値を有するマスク制御信号が入力される、
3次元画像描画装置。
A 3D image drawing apparatus having a function of sorting polygon data from the back of the screen toward the front of the screen or from the front of the screen toward the back of the screen,
Storage means for storing N polygon data obtained from the translucent drawing object;
Depth value calculating means for calculating a depth value represented by a predetermined number of data bits as a function of screen depth for the N polygon data stored in the storage means ;
Comparison means for comparing the reference depth value selected from among the N depth values of the polygon data and depth value of the N polygon data,
A drawing order determining means for determining the drawing order of the polygon data based on the comparison result by the comparison means,
A comparison accuracy control means for excluding a part of the depth value of the N polygon data and the reference depth value from the comparison object by the comparison means ;
The comparison accuracy control means includes a plurality of AND gates corresponding to a selected number of data bits among a predetermined number of data bits representing a depth value, and one input of each AND gate has the selection of polygon data Each of the selected data bits is input, and a mask control signal having a mask value capable of masking at least one of the selected data bits is input to the other input.
3D image drawing device.
前記比較精度制御手段は、半透明ポリゴンデータの数量に基づき前記選択されたデータビットのマスクするビット数を制御する、請求項1に記載の3次元描画装置。The three-dimensional drawing apparatus according to claim 1, wherein the comparison accuracy control unit controls the number of bits masked by the selected data bits based on the quantity of translucent polygon data. 前記比較精度制御手段は、半透明ポリゴンデータの描画時間に基づき前記選択されたデータビットのマスクするビット数を制御する、請求項1または2に記載の3次元描画装置。The three-dimensional drawing apparatus according to claim 1, wherein the comparison accuracy control unit controls the number of bits to be masked by the selected data bits based on a drawing time of semi-transparent polygon data. 前記比較精度制御手段は、予め複数のマスク値を用意しておき、複数のマスク値の中から所定のマスク値を選択する、請求項1または2に記載の3次元描画装置。The three-dimensional drawing apparatus according to claim 1, wherein the comparison accuracy control unit prepares a plurality of mask values in advance and selects a predetermined mask value from the plurality of mask values. ポリゴンデータのデプス値および基準デプス値は、それぞれ浮動小数点数によるデータビットによって表され、前記比較精度制御手段は、ポリゴンデータのデプス値および基準デプス値のそれぞれの小数部を表すデータビットの一部をマスクする、請求項1ないし4いずれか1つに記載の3次元画像描画装置。 Depth value and the reference depth value of the polygon data are respectively represented by the data bits by a floating-point number, the comparison accuracy control means, a portion of each of the data bits representing the fractional part of the depth value and the reference depth value of the polygon data The three-dimensional image drawing apparatus according to claim 1, wherein the mask is masked. ポリゴンのデプス値は、ポリゴンの頂点座標のZ軸方向の平均値を含む、請求項1ないしいずれか1つに記載の3次元画像描画装置。 Depth value of the polygon comprises the average value of the Z-axis direction of the vertex coordinates of the polygon, three-dimensional image drawing apparatus according to 5 any one claims 1. ポリゴンデータを画面奥側から画面手前または画面手前側から画面奥側に向けてソートする機能を備えた3次元画像描画装置におけるソート処理方法であって、
半透明描画オブジェクトから得られたN個のポリゴンデータを格納するステップと、
格納されたN個のポリゴンデータについて画面奥行きの関数である所定のデータビット数で表されたデプス値を算出するステップと、
N個のポリゴンデータのデプス値とN個のポリゴンデータのデプス値の中から選択された基準デプス値とを比較するステップと、
比較結果に基づきポリゴンの描画順序を決定するステップとを有し、
前記比較するステップはさらに、デプス値を表す所定のデータビットのうちの選択されたデータビットの少なくとも1つをマスクすることで比較精度を制御するステップを含む、
ポリゴンデータのソート処理方法。
A sorting method in a 3D image drawing apparatus having a function of sorting polygon data from the back side of the screen toward the front of the screen or from the front side of the screen to the back side of the screen,
Storing N polygon data obtained from the translucent drawing object;
Calculating a depth value represented by a predetermined number of data bits as a function of screen depth for the stored N polygon data ;
Comparing the depth value of the N polygon data with a reference depth value selected from the depth values of the N polygon data ;
Determining a polygon rendering order based on the comparison result ,
The comparing step further includes controlling comparison accuracy by masking at least one selected data bit of the predetermined data bits representing the depth value.
How to sort polygon data .
ポリゴンデータのデプス値および基準デプス値は、浮動小数点数によるデータビットによって表され、ポリゴンデータのデプス値および基準デプス値の小数部の選択されたデータビットをマスクして比較する、請求項に記載のポリゴンのソート処理方法。 Depth value and the reference depth value of the polygon data is represented by data bits by a floating-point number, to mask selected data bits in the fractional part of the depth value and the reference depth value of the polygon data are compared, in claim 7 The polygon sorting method described. 前記比較精度を制御するステップは、半透明ポリゴンデータの数量に基づき前記選択されたデータビットのマスクするビット数を制御する、請求項7または8に記載のポリゴンデータのソート処理方法。9. The polygon data sorting method according to claim 7, wherein the step of controlling the comparison accuracy controls the number of bits masked by the selected data bits based on the quantity of translucent polygon data. 前記比較精度を制御するステップは、半透明ポリゴンデータの描画時間に基づき前記選択されたデータビットのマスクするビット数を制御する、請求項7または8に記載のポリゴンデータのソート処理方法。9. The polygon data sorting method according to claim 7, wherein the step of controlling the comparison accuracy controls the number of bits masked by the selected data bits based on a drawing time of semi-transparent polygon data.
JP2005101128A 2005-03-31 2005-03-31 Z sort processing circuit and three-dimensional image drawing apparatus using the same Expired - Fee Related JP4617187B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005101128A JP4617187B2 (en) 2005-03-31 2005-03-31 Z sort processing circuit and three-dimensional image drawing apparatus using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005101128A JP4617187B2 (en) 2005-03-31 2005-03-31 Z sort processing circuit and three-dimensional image drawing apparatus using the same

Publications (2)

Publication Number Publication Date
JP2006285371A JP2006285371A (en) 2006-10-19
JP4617187B2 true JP4617187B2 (en) 2011-01-19

Family

ID=37407272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005101128A Expired - Fee Related JP4617187B2 (en) 2005-03-31 2005-03-31 Z sort processing circuit and three-dimensional image drawing apparatus using the same

Country Status (1)

Country Link
JP (1) JP4617187B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5520698B2 (en) * 2010-06-07 2014-06-11 任天堂株式会社 GAME DEVICE, GAME PROGRAM, AND GAME SYSTEM

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0962863A (en) * 1995-08-22 1997-03-07 Fujitsu Ltd Z sorting method for three-dimensional picture display and graphic data sorting device using the same
JPH09114994A (en) * 1995-10-19 1997-05-02 Sony Corp Device and method for forming image
JPH09204543A (en) * 1995-12-19 1997-08-05 Cirrus Logic Inc Method and device to identify object and to detect collision in three-dimensional graphics space
JPH1011610A (en) * 1996-06-19 1998-01-16 Sony Computer Entertainment:Kk Device and method for plotting

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0962863A (en) * 1995-08-22 1997-03-07 Fujitsu Ltd Z sorting method for three-dimensional picture display and graphic data sorting device using the same
JPH09114994A (en) * 1995-10-19 1997-05-02 Sony Corp Device and method for forming image
JPH09204543A (en) * 1995-12-19 1997-08-05 Cirrus Logic Inc Method and device to identify object and to detect collision in three-dimensional graphics space
JPH1011610A (en) * 1996-06-19 1998-01-16 Sony Computer Entertainment:Kk Device and method for plotting

Also Published As

Publication number Publication date
JP2006285371A (en) 2006-10-19

Similar Documents

Publication Publication Date Title
US10957082B2 (en) Method of and apparatus for processing graphics
JP4579262B2 (en) Early Z-test method and system for rendering three-dimensional images
TWI592902B (en) Control of a sample mask from a fragment shader program
TWI584223B (en) Method and system of graphics processing enhancement by tracking object and/or primitive identifiers,graphics processing unit and non-transitory computer readable medium
US7570266B1 (en) Multiple data buffers for processing graphics data
US7307628B1 (en) Diamond culling of small primitives
US10032308B2 (en) Culling objects from a 3-D graphics pipeline using hierarchical Z buffers
US7538765B2 (en) Method and apparatus for generating hierarchical depth culling characteristics
JPH0727581B2 (en) Graphic processing device
US8917281B2 (en) Image rendering method and system
US8068120B2 (en) Guard band clipping systems and methods
US7310103B2 (en) Pipelined 2D viewport clip circuit
EP2728551B1 (en) Image rendering method and system
US8174526B2 (en) Methods and apparatus for rendering or preparing digital objects or portions thereof for subsequent processing
JP4617187B2 (en) Z sort processing circuit and three-dimensional image drawing apparatus using the same
CN111932689B (en) Three-dimensional object quick selection method adopting ID pixel graph
JP3279260B2 (en) 3D graphics drawing device
US6885375B2 (en) Stalling pipelines in large designs
JP4610394B2 (en) Z sort processing circuit and three-dimensional image drawing apparatus using the same
JP2014219739A (en) Image processing apparatus which processes graphics by dividing space, and image processing method
US6937236B2 (en) Methods and apparatus for culling sorted, back facing graphics data
JPH09223243A (en) Rendering method
JP2001283254A (en) Three-dimensional graphic plotting device and its method
JP4106719B2 (en) Image processing device
JPH03268186A (en) Graphic processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100716

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100727

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100908

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101019

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101025

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20131029

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees