JP2004102841A - Clipping processing device, graphics system, clipping processing method, and the graphics method - Google Patents

Clipping processing device, graphics system, clipping processing method, and the graphics method Download PDF

Info

Publication number
JP2004102841A
JP2004102841A JP2002266134A JP2002266134A JP2004102841A JP 2004102841 A JP2004102841 A JP 2004102841A JP 2002266134 A JP2002266134 A JP 2002266134A JP 2002266134 A JP2002266134 A JP 2002266134A JP 2004102841 A JP2004102841 A JP 2004102841A
Authority
JP
Japan
Prior art keywords
vertex
clip
information
division
unit
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
JP2002266134A
Other languages
Japanese (ja)
Inventor
Yasuyuki Ushijima
牛島 康之
Taku Takemoto
竹本 卓
Yasuharu Takenaka
竹中 康晴
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002266134A priority Critical patent/JP2004102841A/en
Publication of JP2004102841A publication Critical patent/JP2004102841A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a clipping processing device capable of performing clipping processing at high speed and low cost, a graphics system, a clipping processing method, and a graphics method in the clipping processing of a three-dimensional model data. <P>SOLUTION: A clipping processing device 100 comprises a coordinate conversion device 11 converting object information indicated by homogeneous coordinate into apex information in a visual point coordinate system, an apex buffer part 14 storing the apex information, a clip test processing part 15 performing a clip test on a clip surface based on the apex information, a split part 61 performing a split processing for primitives determined by a clip test that the primitives must be split, a clip test processing device 12 performing a perspective conversion processing for the apex information and having a deducting part 18 preparing screen coordinate system apex information, and a rasterizer device 13 newly assembling the primitives based on the screen coordinate system apex information. A split processing for each clip plane when new primitives are re-structured is performed to suit for the shapes of the new primitives and the purpose of the split processing. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、3次元コンピュータグラフィックスに係り、特に3次元空間でスクリーンに表示したい範囲以外の部分をクリッピング処理するクリッピング処理装置、グラフィックスシステム、コンピュータによる画像のクリッピング処理方法及びグラフィックス方法に関するものである。
【0002】
【従来の技術】
3次元コンピュータグラフィックスにおけるクリッピング処理は、図2に示すように視点1を基準とした四角錘台の空間にて行われ、これをビューボリューム3と呼ぶ。ビューボリューム3は視点1から見てZ手前面2a、Z奥面2b、Y上面6、Y下面7、X右面5、X左面4の6面によって定義され、物体の基本構成要素を定義するプリミティブの内、ビューボリューム3内に存在するもののみが実際にスクリーン上に描画される。尚、視点1からZ手前面2a迄の距離をニアdnearと呼び、Z手前面2aは視点1よりdnear離れた位置に存在する、Z軸に垂直な面である。視点1からZ奥面2b迄の距離をファーdfarと呼び、Z奥面2bはZ手前面2aは視点1よりdfar離れた位置に存在する、Z軸に垂直な面である。クリッピング処理とは一般的に以下の手順で行われる。先ず、各プリミティブに対するビューボリュームの関係をビューボリューム3内、ビーボリューム3外及びビューボリューム3内外の領域をまたぐ領域の3つに分類するクリップテストを行う。次に、ビューボリューム3内に存在する必要なプリミティブを拾い、ビューボリューム外に存在する不要なプリミティブを捨て、ビューボリューム3内とビューボリューム3外の領域をまたぐ領域に存在するプリミティブにおいては分割処理を行う。こうして全てのプリミティブをビューボリューム3内に適切に存在させるようにする。この際、分割処理が必要と判定されたプリミティブに対しては、クリップ面との交点を求めプリミティブを再構築する必要がある。各クリップ平面に対する分割処理は、プリミティブを構成する頂点間の線分と各クリップ面との交点(以下、「分割点」と記載)における線分と分割点の距離の比率を正規化したもの(以下、「補間係数」と記載)を求め、この補間係数を元に両端の頂点情報から分割点の座標値、法線値、色、α値、フォグ係数及びテクスチャ座標等の頂点に付随する各パラメータ値について求めていく。
【0003】
従来の分割点の算出によるクリッピング手法について図3を用いて説明する。頂点ABCから成る三角形のプリミティブが、あるクリップ面をまたいでいる場合には、まず線分ABとクリップ面との交点Dを求め、分割された線分ADと線分DBの比をt:1−tと表す。ここで求めた線分の比である補間係数を基に、線分ADと線分DBの頂点A、D及びBの座標値を求める。図4に示すように、分割が必要と判定された頂点AをP、頂点DをP、頂点BをPとする。各頂点はX軸、Y軸及びZ軸に加え、3次元空間内の単一の原点に対する相対的な頂点を表し、この空間内での頂点のひねり、回転等の動きを表現するワールド座標(W軸)を加えた4座標で表現される。このとき、P(x,y,z,w)、P(x,y,z,w)で構成される線分に対する、クリップ面との分割点P(x,y,z,w)を求めるのに、線分Pと線分Pの距離の比率を正規化したもの、すなわち線分比t:1−tの、クリップ面に対する補間係数(t、t)は、一般的には以下の式で求めることができる。
【0004】
【数1】

Figure 2004102841
次に、式(1)、(2)より求められた分割係数を用いて、クリップ面との交点における座標値を求める。
【0005】
【数2】
Figure 2004102841
上記の式(3)、(4)、(5)及び(6)により、頂点A、D及びBの頂点座標値を求めると、次に、各頂点に付随する法線値(Nx、Ny、Nz)、色(R、G、B)、α値(A)、フォグ係数(F)及びテクスチャ座標(S、T、Q)などの頂点に付随する各パラメータ値を算出する。
【0006】
この後、頂点A、D及びBの頂点座標値の、透視変換処理を行う。
【0007】
【数3】
Figure 2004102841
上記の式(7)、(8)及び(9)により得られた座標値(x、y、z)に対して、ビューポート変換処理を行い、スクリーン座標における頂点情報が求められる。
【0008】
上記のように、線分ACにおいても、まず線分ACとクリップ面との交点Dを求め、分割された線分ADと線分DBの比をs:1−sと表す。ここで式1で求めた補間係数を基に、線分ADと線分DBの頂点A、D及びBの座標値を求め、各頂点に付随するパラメータ値を求めて行く。又、頂点A、D及びBの座標値に対し、透視変換処理、ビューポート変換処理を行い、スクリーン座標における、新しいプリミティブADEの頂点情報が求められる。
【0009】
【発明が解決しようとする課題】
しかしながら、分割処理での補間係数の算出には大きな計算コストがかかり、また頂点に付随する各パラメータの算出に関しては、複数のテクスチャ座標、複数の色を持つ場合もあり数多くの処理が必要となる。さらにこの処理を(X、Y、Z)の各クリップ平面に対して行っていくため、クリッピング処理は複雑で非常に多くの計算コストが発生する。このように分割処理は、3次元グラフィックス処理において処理速度を低下させるボトルネックとなり、またハードウェア化した際にパイプライン処理を止める要因ともなっている。また、この結果、ボトルネックの処理の為、多くの余分なコストがかかっているのが現状である。
【0010】
本発明は上記の問題点に鑑みて為されたもので、3次元モデルデータのクリッピング処理において、高速で、且つ低コストなクリッピング処理が可能となるクリッピング処理装置、グラフィックスシステム、クリッピング処理方法及びグラフィックス方法を提供することを目的とする。
【0011】
【課題を解決するための手段】
本発明の第1の特徴は、(イ)同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換装置と、(ロ)頂点情報を記憶する頂点バッファ部、クリップ面において頂点情報を基にクリップテストを行うクリップテスト処理部、クリップテストにて分割が必要と判断されたプリミティブを分割処理行う分割部、頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成する除算部を有するクリップテスト処理装置と、(ハ)スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置とを備えるクリッピング処理装置であることを要旨とする。
【0012】
本発明の第2の特徴は、(イ)同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換光源計算部、Z面に対してクリップテストを行うZ面クリップテスト部、クリップテストにより分割処理が必要と判断されたZクリップ面の補間係数を算出するZクリップ面補間係数算出部、クリップテストにより分割処理が不要と判断されたZ面に対し透視変換係数を算出する透視変換係数算出部を有する座標変換光源計算装置と、(ロ)頂点情報を記憶する頂点バッファ部、Z面以外のクリップ面において頂点情報を基にクリップテストを行うクリップテスト処理部、クリップテストにて分割が必要と判断されたプリミティブに分割処理行う分割部、頂点情報に対し透視変換処理を行いスクリーン座標系頂点情報を作成する除算部を有するクリップテスト処理装置と、(ハ)スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置とを備えるグラフィックスシステムであることを要旨とする。
【0013】
本発明の第3の特徴は、(イ)同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換装置と、(ロ)クリップ面と頂点情報との比較及びクリップ面とガードバンド領域との比較を行い、その結果に応じて判定ビットを出力する比較部、予め設定されたビットマスク情報を保持するレジスタ部、判定ビット及びビットマスク情報よりマスクの論理和を算出し、描画対象、非描画対象及び分割対象のいずれか1つの判定を行う論理和算出部を有する比較装置と、(ハ)頂点情報を記憶する頂点バッファ部と、(ニ)頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成する除算部と、(ホ)スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置とを備えることを要旨とする。
【0014】
本発明の第4の特徴は、(イ)同次座標で表されるオブジェクト情報を、視点座標系での頂点情報に変換するステップと、(ロ)頂点情報を記憶するステップと、(ハ)クリップ面において頂点情報を基にクリップテストを行うステップと、(ニ)クリップテストにて分割が必要と判断されたプリミティブに対し、分割処理を行うステップと、(ホ)頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成するステップとを備えるコンピュータによる画像のクリッピング処理方法であることを要旨とする。
【0015】
本発明の第5の特徴は、(イ)同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換するステップと、(ロ)Z面に対してクリップテストを行うステップと、(ハ)クリップテストにより分割処理が必要と判断されたZクリップ面の補間係数を算出するステップと、(ニ)クリップテストにより分割処理が不要と判断されたZ面に対し透視変換係数を算出するステップと、(ホ)頂点情報を記憶するステップと、(ヘ)Z面以外のクリップ面において頂点情報を基にクリップテストを行うステップと、(ト)クリップテストにて分割が必要と判断されたプリミティブに分割処理行うステップと、(チ)頂点情報に対し透視変換処理を行いスクリーン座標系頂点情報を作成するステップとを備えるグラフィックス方法であることを要旨とする。
【0016】
本発明の第6の特徴は、(イ)同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換するステップと、(ロ)クリップ面と頂点情報との比較及びクリップ面とガードバンド領域との比較を行い、その結果に応じて判定ビットを出力するステップと、(ハ)予めレジスタ部に設定されたビットマスク情報及び判定ビットより、論理和算出部マスクの論理和を算出し、描画対象、非描画対象及び分割対象のいずれか1つであるとの判定を行うステップと、(ニ)論理和を含む頂点情報を記憶するステップと、(ホ)頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成するステップとを備えるグラフィックス方法であることを要旨とする。
【0017】
【発明の実施の形態】
3次元コンピュータグラフィックスによる3次元画像を2次元平面形状のビューポート内に表現するにはクリッピング処理が必要となるが、その際にプリミティブの分割処理において最も複雑な処理が必要となることは周知の事実である。分割処理が必要と判定されたプリミティブに対しては、クリップ面との分割点を求めプリミティブを再構築するが、この際、ビューポート内のプリミティブには種々の形態がある。例えば図3に示すように、クリップ面に対しプリミティブの2辺がまたいでおり、且つビューポート内に新しいプリミティブの1頂点を含んでいる三角形状の新しいプリミティブや、図7に示すようにクリップ面に対しプリミティブの2辺がまたいでおり、且つビューポート内に新しいプリミティブの2頂点を含んでいる四角形状の新しいプリミティブ、又、図14に示すようなクリップ面に対しプリミティブの4辺がまたいでおり、且つビューポート内に新しいプリミティブの7頂点を含んでいる七角形状の新しいプリミティブ等が考えられる。
【0018】
発明者らは、このような種々の新しいプリミティブを再構成する際の分割処理において、新しいプリミティブの形状及び分割処理の目的に応じて適した処理を行うよう鑑みた。
【0019】
クリッピング処理において、新しいプリミティブの形状及び分割処理の目的に応じて適する分割処理を行う為の装置及び方法の実施の形態について、図面に基づいて以下に説明する。第1の実施の形態では各クリップ面に対する分割係数を省く為の装置及び方法について、第2の実施の形態ではプリミティブのパラメータ算出処理の回数を最小限に抑える為の装置及び方法について、第3の実施の形態ではプリミティブの補間係数算出処理と、複数の座標が与えられたとき、その座標間を接続する分割点を求める線形補間処理を並列的に行い各処理速度の高速化を図る為の装置及び方法について、第4の実施の形態では分割処理の際に使用する頂点バッファ数を削減する為の装置及び方法について、第5の実施の形態ではガードバンドを使用するクリップ判定処理の高速化を図るための装置及び方法について説明する。尚、本発明は以下の実施の形態にとらわれず、その趣旨を脱しない範囲で種々変更して実施できることは勿論である。
【0020】
(第1の実施の形態)
(クリッピング処理装置)
本発明の第1の実施の形態に係るクリッピング処理装置100は、各クリップ面に対する分割係数を省くことを目的とした装置であり、図1に示すように座標変換処理装置11と、クリップテスト処理装置12と、ラスタライザ装置13とを備えている。座標変換処理装置11はオブジェクト情報入力装置30より、同次座標系プリミティブのオブジェクト情報を取得し、このオブジェクト情報に対し、モデルビュー変換、プロジェクション変換等の座標変換処理を行う。オブジェクト情報入力装置30は、ジオメトリ演算を行うCPU若しくは外部メモリ等より構成される。
【0021】
クリップテスト処理装置12は、頂点バッファ部14、クリップテスト処理部15、分割部61及び除算部18とを備えている。頂点バッファ部14は、座標変換処理装置11が生成した頂点及び頂点座標、分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数及びテクスチャ座標等の頂点情報を記憶する記憶装置である。クリップテスト処理部15は、各クリップ面においてプリミティブの分割処理が必要か否かのクリップテストを行う。分割部61は、線分比生成部16及び分割頂点座標生成部17から成る。線分比生成部16は、オブジェクト情報を座標変換した結果生成される頂点情報を用いて線分比を生成する。分割頂点座標生成部17は、線分比生成部16が生成した線分比を用いてクリップ面における頂点座標を生成する。除算部18は、クリップテスト処理部15より渡された頂点座標に対して透視変換処理を行う。
【0022】
ラスタライザ装置13は、スクリーン座標として与えられた頂点情報を基にプリミティブを組み上げ、ピクセル等を各パラメータ値に応じて色付けする処理を行いピクセル情報を作成し、このピクセル情報を描画装置39に渡す。描画装置39は、ピクセル情報を基に、ビデオメモリへ描画を行う。
【0023】
(クリッピング処理方法)
次に、クリッピング処理装置100を用いたクリッピング処理方法において、3次元コンピュータグラフィックスにおける3次元空間でのオブジェクト情報をスクリーンに描画するまでの処理の手順を、図5を用いて説明する。
【0024】
(a)先ず、ステップS101として、座標変換処理装置11が、オブジェクト情報入力装置30より、同次座標で表される3次元空間の頂点座標(x,y,z,w)をオブジェクト情報として取得する。
【0025】
(b)次に、座標変換処理装置11は、行列変換処理を行う。ステップS102として、モデルビュー変換、ステップS103としてプロジェクション変換を、式(10)のような4×4の行列式を用いて行う。この行列変換処理により、視点座標系に変換されたオブジェクト情報は、頂点情報として、頂点バッファ部14に送信され、一時記憶される。
【0026】
【数4】
Figure 2004102841
(c)ステップS104では、クリップテスト処理部15が、頂点情報を頂点バッファ部14より取得し、ビューボリュームを構成するZ手前面2a、Z奥面2b、Y上面6、Y下面7、X右面5、X左面4の全6面に対して、プリミティブが領域内に存在するかどうかの判定を行う。
【0027】
(d)ステップS105では、クリップテスト処理部15が、プリミティブが領域内に存在した場合、そのプリミティブを構成する線分毎に分割処理が必要かどうかの判定を行う。分割が必要と判定された頂点情報は、線分比生成部16に送信される。
【0028】
(e)ステップS106では、線分比生成部16が、分割が必要と判定された2頂点P(x,y,z,w)、P(x,y,z,w)で構成される線分に対して、クリップ面との分割交点Pc(x,y,z,w)を求める。この際、従来のように式(1)、(2)を用いて線分Pと線分Pの距離の比率を正規化した分割係数を用いるのではなく、分子の項のみを用いた以下の式により線分比を用いる。
【0029】
【数5】
Figure 2004102841
(f)次に、ステップS107にて、分割頂点座標生成部17が、式(11)、(12)より求められた分割係数を用いて、X−Wクリップ面との交点における座標値を求める。
【0030】
【数6】
Figure 2004102841
上記の式(13)、(14)、(15)及び(16)を用いて、ビューボリュームを構成するZ手前面2a、Z奥面2b、Y上面6、Y下面7、X右面5、X左面4の全6面に対してに対して座標値を順次求めて行き、全てのクリップ面に対するビューボリューム内の交点座標を算出する。
【0031】
(G)全ての交点座標が算出されたら、ステップS108にて、除算部18が透視変換処理を行う。具体的には、以下の式を用いて、W座標値による割り算を行う。
【0032】
【数7】
Figure 2004102841
(H)ステップS109では、除算部18が、上記式(17)、(18)及び(19)により得られた座標値(x、y、z)に対して、ビューポート変換処理を行い、スクリーン座標系でのモデルデータを算出する。次に、ステップS110にて、このモデルデータより、スクリーン座標における頂点情報を算出する。この後、ラスタライザ装置13が、スクリーン座標における頂点情報を基に、分割処理後の新しいプリミティブをドット、ピクセル等のカラムに分割し、そのカラムにテクスチャを張り込み、画像描画を完成させる。
【0033】
以下、式(1)、(2)と式(11)、(12)の計算結果の一致を証明する。まず従来の手法で使用される式(7)を展開する。X座標に対する式(7)は、式(3)より、以下のように展開される。
【0034】
【数8】
Figure 2004102841
次に、本発明の第1の実施の形態に係るクリッピング処理方法の透視変換処理にて用いられる式(17)について展開すると以下のようになる。
【0035】
【数9】
Figure 2004102841
以上により、式(22)と式(24)が等しいことより、式(7)と式(17)は等価であり、従来の手法と本発明の第1の実施の形態に係るクリッピング方法による計算結果の一致が証明された。
【0036】
従来の手法だと、分割係数を求める際に、割算が全6面のクリップ面に対して合計12回必要であるのに対し、本発明のクリッピング方法の様に、線分比を用いて演算することによりこの割算が不要となる。この結果、クリッピング処理速度を向上させることが可能となり、ひいては計算コストを下げることが可能となる。
【0037】
(第2の実施の形態)
(クリッピング処理装置)
本発明の第2の実施の形態に係るクリッピング処理装置200は、プリミティブのパラメータ算出処理の回数を最小限に抑えることを目的とした装置であり、図6に示すように座標変換処理装置21と、クリップテスト処理装置22と、ラスタライザ装置23とを備えている。クリップテスト処理装置22は、頂点バッファ部24、クリップテスト処理部25、分割部62及び除算部28とを備えている。分割部62は分割係数算出部26及び線形補間部27から構成される。分割係数算出部26は、各クリップ面とビューポート線分との交点に対し、後述する式に従って、分割係数を算出する。線形補間部27は、分割係数を基に頂点座標を算出し、この頂点座標毎に対応する頂点情報を基に線形補間処理を行う。その他の装置については、第1の実施の形態のクリッピング処理装置100と同様のものを使用する為、説明を省略する。
【0038】
(クリッピング処理方法)
次に、クリッピング処理装置200を用いたクリッピング処理方法について、図8のフロー図を用いて説明する。3次元コンピュータグラフィックスのクリッピング処理において、パラメータ算出処理の回数を最小限に抑えることを可能とする処理は以下の手順で行われる。
【0039】
(a)先ず、ステップS201として、座標変換処理装置21が、オブジェクト情報入力装置30より、オブジェクト情報としてプリミティブ20aの3次元空間における同次座標系での頂点座標(x,y,z,w)を取得する。
【0040】
(b)次に、座標変換処理装置21は、行列変換処理を行う。ステップS202として、モデルビュー変換、ステップS203としてプロジェクション変換を、式1のような4×4の行列式を用いて行う。この行列変換処理により、視点座標系に変換されたオブジェクト情報は、頂点情報として、頂点バッファ部24に送信され、一時記憶される。
【0041】
(c)ステップS204では、クリップテスト処理部25が、頂点情報を頂点バッファ部24より取得し、ビューボリュームを構成するZ手前面2a、Z奥面2b、Y上面6、Y下面7、X右面5、X左面4の全6面に対して、プリミティブが領域内に存在するかどうかの判定を行う。
【0042】
(d)ステップS205では、クリップテスト処理部25が、プリミティブが領域内に存在した場合、そのプリミティブを構成する分割係数毎に分割処理が必要かどうかの判定を行う。必要と判定された場合、分割処理は以下のように行われる。
【0043】
(e)ステップS206では、分割係数算出部26が、分割係数による頂点分割を行う。例として図7に示すような、頂点A、B、Cの3頂点から構成されるプリミティブ20aとクリップ平面の分割処理について説明する。この場合、Y=Wのクリップ平面、X=Wのクリップ平面及びビューボリュームの領域内である、太字で囲まれたビューポート領域20c周辺においてプリミティブを構成する頂点の分割処理が行われる。
【0044】
まずY=W平面との分割交点を求め、線分ABとY−Wクリップ面との交点Dに対する分割係数tと交点Dの座標値を求める。
【0045】
【数10】
Figure 2004102841
線分BCとY−Wクリップ面との交点Eに対する分割係数tと交点Eの座標値を求める。
【0046】
【数11】
Figure 2004102841
次にX=W平面との分割交点を求める。又、線分DBとX=Wクリップ平面との交点Fに対する分割係数tと座標値を求める。
【0047】
【数12】
Figure 2004102841
ここで交点Dは、線分ABの分割点となっているので
【数13】
Figure 2004102841
となる。整理すると以下のように、頂点Aと頂点Bとそれぞれの分割係数で表される。
【0048】
【数14】
Figure 2004102841
線分DEとX=Wクリップ平面との交点Gに対する分割係数tと座標値を求める。
【0049】
【数15】
Figure 2004102841
ここで交点DはABの分割点、交点EはBCの分割点となっているので、
【数16】
Figure 2004102841
整理すると、以下のように頂点A、頂点B、頂点Cとそれぞれの分割係数によって表される。
【0050】
【数17】
Figure 2004102841
以上のようにして、最終的に描画対象となるビューボリューム内の新しいプリミティブ20bの頂点B、E、G、Fの座標値が求められる。
【0051】
(f)次にステップS207において、線形補間部27が、新しいプリミティブ20bの頂点B、E、G、Fの座標値より、パラメータ値の算出を行う。ここでパラメータ値とは、各頂点に付随する情報を表し、法線情報(Nx、Ny、Nz)、色情報(R、G、B)、透明度(A)、テクスチャ座標(S、T、Q)、フォグ値(F)等がある。またパラメータ値には、複数の色情報、複数のテクスチャ座標を持つ場合もあり、全てのパラメータ値の計算量は多くなる。例えば、頂点に付随するパラメータとして、色(R、G、B)、透明度(A)、テクスチャ座標(S、T、Q)の7つのパラメータが存在する場合には、図7の例において従来手法だと35回のパラメータ演算が発生するのに対し、本発明の第2の実施の形態による方法では、頂点A、B、Cからの分割係数をそれぞれ保持しておいて、最終的にクリップ領域内に存在する頂点に対してのみパラメータ値の算出を行うことにより、21回のパラメータ演算で済むこととなる。この結果、分割処理に係る時間を短縮することができ、ひいては計算コストを低減することができる。
【0052】
(第3の実施の形態)
(グラフィックスシステム)
本発明の第3の実施の形態に係るグラフィックスシステム300は、プリミティブの補間係数算出処理と線形補間処理を並列的に行うことを目的とした装置であり、図9に示すようにオブジェクト情報入力装置30と、座標変換光源計算装置31と、クリップテスト処理装置32と、ラスタライザ装置33と、描画装置39とを備えている。
【0053】
オブジェクト情報入力装置30は、CPU若しくは外部メモリより構成され、光学的読取手段やオブジェクトの図形データ等より3次元のオブジェクト情報を取り込む。
【0054】
座標変換光源計算装置31は、座標変換光源計算部31a、Z面クリップテスト部31b、透視変換係数算出部31d及びZクリップ面補間係数算出部31cとを備えている。座標変換光源計算部31aは、入力されたオブジェクト情報に対し座標変換処理を行い、頂点情報を作成する。又、プリミティブに光源が当たっているとみなし、日向及び日陰部分の光源計算を行う。Z面クリップテスト部31bは、Z軸に垂直であるZ手前面2a、Z奥面2bに対するクリップテストを行う。Zクリップ面補間係数算出部31cは、Z軸に垂直であるZ手前面2a、Z奥面2bに対する補間係数の算出を行う。透視変換係数算出部31dは、Zクリップ面に対する1/dnear、若しくは1/dfarの透視除算係数を算出し、これを基に透視変換処理を行う。ここで、透視変換係数とは、遠くの対象物が近くの対象物より小さく見えるよう画像を調整する際に使用する係数のことである。
【0055】
クリップテスト処理装置32は、頂点バッファ部34、クリップテスト処理部35、分割部63及び除算部38を備えている。分割部63は、線形補間部36と補間係数算出部37から構成される。補間係数算出部37は、X軸及びY軸に垂直であるZ手前面2a、Z奥面2bに対する補間係数の算出を行う。クリップテスト処理装置32中の他の装置については第1の実施の形態及び第2の実施の形態と同様のものを使用する為、説明を省略する。
【0056】
ラスタライザ装置33は、頂点情報を、各パラメータ値等を含むピクセル情報へと変換する。描画装置39は、ピクセル情報を基に、ビデオメモリへ描画を行う。尚、座標変換光源計算装置31、クリップテスト処理装置32及びラスタライザ装置33をグラフィックエンジンとして、一つの装置として存在させることも可能である。
【0057】
(グラフィックス方法)
以下、グラフィックスシステム300を用いたグラフィック方法について図10のデータフローグラフを用いて説明する。このグラフィック方法は、プリミティブの補間係数算出処理と線形補間処理を並列的に行うことを目的とする。データフローグラフの(1)及び(2)のステージは、座標変換光源計算装置31においての処理を指し、(3)、(4)及び(5)のステージはクリップテスト処理装置32においての処理を指す。また、前処理としてZ軸に垂直なクリップ面に対する1/dnear及び1/dfarの透視除算係数をあらかじめ計算しておく。
【0058】
(a)先ず、ステップS301において、オブジェクト情報入力装置30よりオブジェクトを取得し、座標変換光源計算部31aにて、視点座標系でのオブジェクト情報のデータを算出する。
【0059】
(b)ステップS302では、Zクリップ面でのクリップテスト及びZ面に対する補間係数の算出を行う。詳細を図11のフロー図を用いて説明する。先ず、ステップS302aでは、視点座標系でのオブジェクト情報のデータ生成後、Z面クリップテスト部31bは、このデータを用いて、Zクリップ面に対するクリップテストを行う。ステップS302bでは、プリミティブの分割処理が必要か否かを判断する。分割処理が必要な場合、S302cにおいて、Zクリップ面補間係数算出部31cが、Zクリップ面に対する補間係数を算出する。この補間係数は頂点バッファ部34に一時記憶される。分割処理が不要な場合は、ステップS302dにおいて、透視変換係数算出部31dが、透視変換係数を算出する。この透視変換係数は、ラスタライザ装置33に送られる。このようにステップS302では、Zクリップ面に対するテストの結果によって算出するステップが変化する。これは後述するステップS304のYクリップ面及びステップS306のXクリップ面についても同じことが言える。
【0060】
(c)ステップS303では、線形補間部36が、頂点バッファ部34よりZクリップ面に対する補間係数を取り出し、線形補間処理を行う。この線形補間処理より、プリミティブの分割点の座標値、パラメータ値が算出され、ステップS304に渡され、先頭の頂点情報が、ステップS305に渡される。さらに前計算しておいたZ軸に垂直なクリップ面に対する1/dnear及び1/dfarの透視除算係数を用いて、除算部38が透視変換処理を行う。
【0061】
ステップS304では、頂点の座標値とパラメータ値より、Yクリップ面に対するクリップテストが行われる。クリップテストの結果、分割処理が必要と判断された場合、Yクリップ面に対する補間係数を算出する。この補間係数はステップS305に渡される。
【0062】
このとき、ステップS303の線形補間処理と、ステップS304の補間係数の算出処理は、同じ(3)ステージで、並列的に処理され、且つ、各処理の動作にかかる時間もほぼ同じである。
【0063】
(d)ステップS305においては、線形補間部36が、頂点バッファ部34よりYクリップ面に対する補間係数を取り出し、線形補間処理を行う。この線形補間処理より、プリミティブの分割点の座標値、パラメータ値が算出され、ステップS306に渡され、先頭の頂点情報が、ステップS307に渡される。さらに前計算しておいたZ軸に垂直なクリップ面に対する1/dnear及び1/dfarの透視除算係数を用いて、除算部38が透視変換処理を行う。
【0064】
ステップS306では、頂点の座標値とパラメータ値より、Xクリップ面に対するクリップテストが行われる。クリップテストの結果、分割処理が必要と判断された場合、Xクリップ面に対する補間係数を算出する。この補間係数はステップS307に渡される。
【0065】
このとき、ステップS305の線形補間処理と、ステップS306の補間係数の算出処理は、同じ(4)ステージで、並列的に処理され、且つ、各処理の動作にかかる時間もほぼ同じである。
【0066】
(e)ステップS307では、線形補間部36が、頂点バッファ部34よりXクリップ面に対する補間係数を取り出し、線形補間処理を行う。この線形補間処理より、プリミティブの分割点の座標値、パラメータ値が算出される。さらに前計算しておいたX軸に垂直なクリップ面に対する1/dnear及び1/dfarの透視除算係数を用いて、除算部38が透視変換処理を行う。
【0067】
(f)最後にステップS308では、ラスタライザ装置33が、透視変換処理された頂点情報を、各パラメータ値等を含むピクセル情報へと変換する。描画装置39は、このピクセル情報を基に、ビデオメモリへ描画を行う。
【0068】
図10の(3)及び(4)のステージで示されるように、Zクリップ面に対しては、補間係数を予め計算しておくこと。また線形補間と次のクリップ面に対する補間係数算出を同じステージで並列処理することにより計算効率をあげ、従来の手法に比べ1ステージ分(約15サイクル)クリップ処理を高速に行うことが可能となる。
【0069】
(第4の実施の形態)
(クリッピング処理装置)
本発明の第4の実施の形態に係るクリッピング処理装置400は、分割処理の際に使用する頂点バッファ数を削減することを目的とした装置であり、図12に示すように座標変換処理装置41と、クリップテスト処理装置42と、ラスタライザ装置43とを備えている。
【0070】
クリップテスト処理装置42は、頂点バッファ部44、インデックス部45、クリップテスト処理部46、分割部47及び除算部48とを備えている。クリップテスト処理部46は、線分単位で各クリップ面に対するクリップテストを行う。頂点バッファ部44は、座標変換処理装置41より入力された頂点と、分割部47によって分割処理された分割頂点、その他のパラメータ値等の頂点情報を記憶する。インデックス部45は、頂点バッファ部44内で、頂点の整列、線分を構成する頂点の選択及び頂点の入出力の操作を行う。分割部47は、クリップ面を線分単位で分割する為の装置である。具体的には第1の実施の形態の線分比生成より分割頂点座標を生成する装置であったり、第2の実施の形態の分割係数より線形補間処理を行う装置であったりする。その他の装置については、第1の実施の形態、第2の実施の形態及び第3の実施の形態のクリッピング処理装置と同様のものを使用する為、説明を省略する。
【0071】
(クリッピング処理方法)
次に、クリッピング処理装置400を用いたクリッピング処理方法について説明する。この方法では、クリップ面に対する分割処理の際に発生する頂点バッファの数を節約することを目的とする。
【0072】
クリッピング分割処理で発生する頂点の例を図13に示す。図は簡略化するためにX軸及びZ軸の2次元で示している。プリミティブ49aがv0、v1、v2の3頂点で構成されており、破線で描かれている線がクリップ面49b、実線で囲まれた部分がビューポート49cの空間である。最終的に必要となる頂点は実線で囲まれたビューポート49の枠上の7つの頂点である。
【0073】
通常の手法において、図13の例に対しクリッピング処理を行う場合、以下のような処理を行う。
【0074】
(a)Zクリップ面での分割処理として、先ず、線分v0、v1に対して分割部47が分割処理を行い、頂点v3、v4を生成する。次に、線分v1、v2に対して分割部47が分割処理を行い、頂点v5を生成する。最後に、線分v2、v0に対して分割部47が分割処理を行い、頂点v2、v6を生成する。この結果、頂点v3、v4、v5、v2、v6が形成される。
【0075】
(b)Xクリップ面での分割処理として、先ず、線分v3、v4に対して分割部47が分割処理を行い、頂点v10、v4を生成する。先ず、線分v4、v5に対して分割部47が分割処理を行い、頂点v5を生成する。次に、線分v5、v2に対して分割部47が分割処理を行い、頂点v7を生成する。更に、線分v2、v6に対して分割部47が分割処理を行い、頂点v8、v6を生成する。最後に、線分v6、v3に対して分割部47が分割処理を行い、頂点v9を生成する。この結果、頂点v10、v4、v5、v7、v8、v6、v9が形成される。以上の例より、この場合は10頂点分の頂点バッファ部が44つ必要となる。
【0076】
次に、第4の実施の形態にかかるクリッピング処理方法について、図14の頂点バッファ部44の状態遷移図を参照して説明する。このクリッピング処理方法では、線分毎にクリップテスト処理部46によるクリップテストと分割部47による分割処理を繰り返し行うことにより、頂点バッファ部を図14に示すように6つに減少することが出来る。
【0077】
(0)の状態では、頂点バッファ部44の初期状態を示す。上から3つ目までをZ面バッファ、下から3つ目までをX面バッファとする。このとき、先ず、インデックス部45は、頂点バッファ部44に、プリミティブ49aの頂点v0、v1、v2を記憶させる。
【0078】
(1)の状態では、クリップテスト処理部46が、線分v0、v1に対してZクリップ面に対するクリップテストを行う。次に、線分v0、v1に対して、分割部47がZクリップ面の分割処理を行い、v3、v4を生成する。
【0079】
(2)の状態では、線分v3、v4に対して、クリップテスト処理部46が、Xクリップ面に対するクリップテストを行う。次に、線分v3、v4に対して、分割部47がXクリップ面による分割処理を行い、インデックス部45はv4、v10を出力する。
【0080】
(3)の状態では、線分v1、v2に対して、クリップテスト処理部46が、Zクリップ面に対するクリップテストを行う。次に、線分v1、v2に対して、分割部47がZクリップ面による分割処理を行い、v5を生成する。
【0081】
(4)の状態では、線分v5、v2に対して、クリップテスト処理部46が、Xクリップ面に対するクリップテストを行う。
【0082】
(5)の状態では、クリップテスト処理部46が、v5を出力する。次に、線分v5、v2に対して分割部47がXクリップ面による分割処理を行い、インデックス部45はv7を出力する。
【0083】
(6)の状態では、線分v2、v0に対して、クリップテスト処理部46が、Zクリップ面に対するクリップテストを行う。次に、線分v2、v0に対して、分割部47がZクリップ面による分割処理を行い、v6を生成する。
【0084】
(7)の状態では、線分v2、v0に対して、クリップテスト処理部46が、Xクリップ面に対するクリップテストを行い、v6を出力する。又、線分v2、v6に対してXクリップ面の分割処理を行い、インデックス部45はv8を出力する。
【0085】
(8)の状態では、線分v6、v3に対して、クリップテスト処理部46が、Xクリップ面の分割処理を行い、インデックス部45はv9を出力する。
【0086】
上記のように、線分毎の処理において、出力とソーティングを繰り返すことにより従来よりバッファの少ない頂点バッファ部44でクリッピング分割処理を行うことが可能である。
【0087】
(第5の実施の形態)
(グラフィックスシステム)
本発明の第5の実施の形態に係るグラフィックスシステム500は、ガードバンドを使用するクリップ判定処理の高速化を図ることを目的とした装置であり、図15に示すように、ジオメトリエンジン50とラスタライザ装置60とを備えている。ジオメトリエンジン50は、オブジェクトの座標をスクリーン座標に変換する装置であり、座標変換処理装置51、比較装置64及び頂点バッファ部55を備えている。比較装置64は、比較部52、レジスタ部53及び論理和算出部54から構成される。
【0088】
座標変換処理装置51は、オブジェクト情報入力装置30より取得した、同次座標系でのプリミティブのオブジェクト情報を視点座標系での頂点情報に変換する。比較部52は、クリップ面と頂点情報との比較及びクリップ面とガードバンド領域との比較を行い、その結果に応じて判定ビットを出力する。レジスタ部53は、プログラマ等が予め設定したビットマスク情報を記憶する。論理和算出部54は、判定ビット及びビットマスク情報よりマスクの論理和を算出し、描画対象、非描画対象及び分割対象のいずれか1つの判定を行う。頂点バッファ部55は、頂点情報と各クリップ面に対する判定ビットを記憶する。頂点バッファ部55が記憶する頂点情報は固定小数点、もしくは整数型でラスタライザ装置60に渡される。オブジェクト情報入力装置30は、GPU(グラフィックスプロセッシングユニット)、CPU及び外部メモリ等より構成される。
【0089】
ラスタライザ装置60は、頂点情報を、各パラメータ値等を含むピクセル情報へと変換し、このピクセル情報を描画装置39に渡す。又、2次元のスクリーン空間でのシザリング機能と呼ばれるクリッピング機能を有する。尚、ラスタライザ装置60が受け取ることができる固定ビット長の最大値をガードバンドと呼ぶ。
【0090】
(グラフィックス処理方法)
次に、ガードバンドを使用するグラフィックスシステム500を用いたクリッピング処理方法について図17のフローチャートを用いて説明する。この方法では、3次元コンピュータグラフィックスにおけるクリッピング処理にて、ラスタライザ装置60のシザリング機能を用いて分割処理を低減し、クリップ判定処理を高速に行うことを目的とする。
【0091】
(a)先ず、ステップS501において、座標変換処理装置51は、オブジェクト情報入力装置30より、オブジェクトの情報を取り込む。
【0092】
(b)次に、座標変換処理装置51は、行列変換処理を行う。ステップS502として、モデルビュー変換、ステップS503としてプロジェクション変換を、式1のような4×4の行列式を用いて行う。この行列変換処理により、視点座標系に変換されたオブジェクト情報は、頂点情報として、比較部52に渡される。
【0093】
(c)ステップS504では、比較部52において、頂点情報を基にした、空間領域における判定ビットの比較を、レジスタ部53が保持するプログラマ等が予め設定したビットマスク情報と比較することにより行う。ガードバンドを使用するグラフィックスシステム500における空間領域の分類例を図16に示す。この空間領域は、簡易的にX軸Y軸から成る二次元空間で示してある。色付きで塗りつぶしてある内側の矩形領域はビューポート領域59を示す。斜線で囲まれた領域はガードバンド領域57、57a、57b、57c、57dである。このうち57aはY下面、57bはY上面、57cはX左面及び57dはX右面のクリップ面である。ビューポートの各面に対する判定は、ジェイムスD,F、アンドリV,D、スティーブンK,F及びジョンF,H著作の「コンピュータグラフィックス理論と実践」によると、コーエンシュザーランド(Cohen−Sutherland)アルゴリズムによる領域分類コードを使用すると、6ビットの情報により6つの領域に対し分類することが可能であると定義されている。第5の実施の形態に係るガードバンドグラフィック方法では、さらにガードバンドの領域を判定するために1ビットの情報を付加することにより計7ビットの情報によりの空間の領域分類を行う。(表1)に3次元空間での領域分類例を示す。
【0094】
【表1】
Figure 2004102841
(表1)の3次元空間の場合と異なり、図16の場合の2次元空間における領域分類は5ビットのコードで示される。ビューポート56内の領域は、コード00000で表される。Y下面57aの領域は、ビューポートの底側面よりもY座標が小さい領域であり、コード00100で表される。Y上面57bの領域は、ビューポートの上側面よりもY座標が大きい領域であり、コード01000で表される。X左面57cの領域は、ビューポートの左側面よりもX座標が小さい場合であり、コード00001で表される。X右面57dの領域は、ビューポートの右側面よりもX座標が大きい場合であり、コード00010で表される。ガードバンド外領域58の領域は、座標がガードバンドを超えた場合であり、コード10000で表される。
【0095】
ここで、上記ガードバンド外領域58の領域判定は、X座標とY座標の絶対値を取り、そのどちらか大きい方とガードバンドが有するビット長の最大値とを比較する。この比較結果が、ガードバンドの領域を越えたと判断された場合に判定ビットを立てる。これは以下のプログラムによって実行される。
【0096】
判定ビット=( max(|X座標|、|Y座標|) > Guard Band )? 1 : 0; (33)
以上の領域判定を各頂点に対して行い、領域判定ビットとして頂点ごとに頂点バッファ部55に保持しておく。
【0097】
(d)ステップS505では、論理和算出部54が、プリミティブに対する描画対象、非描画対象、分割対象の判定を、論理和を用いて行う。非描画対象は、領域判定ビットの論理積が成立することによって判定する。描画対象は、領域判定ビットの論理積が非成立で、且つ、領域判定ビットの論理和が非成立であることによって判定する。分割対象は、領域判定ビットの論理積が非成立で、且つ、領域判定ビットの論理和が成立することによって判定する。
【0098】
(e)ステップS506では、描画対象、非描画対象、分割対象の判定が終了すると、除算部56が、式4のW座標値による割り算により透視変換処理を行う。又、ステップS507にて、除算部56は、式4により得られた座標値(x、y、z)に対して、ビューポート変換処理を行い、スクリーン座標系でのモデルデータを算出する。次に、ステップS508にて、このモデルデータより、スクリーン座標における頂点情報を算出する。この後、ラスタライザ装置60が、シザリング機能により、2次元空間のスクリーン座標における頂点情報を基に、分割処理後の新しいプリミティブをドット、ピクセル等のカラムに分割し、そのカラムにテクスチャを張り込み、画像描画を完成させる。
【0099】
ガードバンドを有するシステムの場合、以上のようにガードバンド領域の分類を行うことにより、高速で且つ低コストなクリッピング処理が可能となる。又、アプリケーションの種類によっては、Z手前面2a、Z奥面2bにおいてはクリッップ分割しなくて良い場合や、オブジェクトのバウンディングボックスやバウンディングスフェア等の情報によりオブジェクトの位置が予め判断できる場合がある。この場合、どのクリップ面に対するクリップ分割処理が必要かどうかの情報を受け取り、上記判定ビットをマスクすることにより、不要なクリップ面に対する処理をスキップすることが可能となる。又、ラスタライザ装置60にて、2次元空間でのシザリング機能を使用することにより、ジオメトリエンジン50での3次元空間におけるクリッピング分割処理を低減することが可能である。
【0100】
【発明の効果】
本発明によれば、3次元モデルデータのクリッピング処理において、高速で、且つ低コストなクリッピング処理が可能なクリッピング処理装置、グラフィックスシステム、クリッピング処理方法及びグラフィックス方法を実現することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態に係るクリッピング処理装置の構造を示す構造図である。
【図2】オブジェクト空間とスクリーン空間を示す概略図である。
【図3】クリップ面におけるプリミティブ分割の例を示す図である。
【図4】クリップ面に対する頂点分割の例を示す図である。
【図5】本発明の第1の実施の形態に係るクリッピング処理装置の動作を示すフローチャートである。
【図6】本発明の第2の実施の形態に係るクリッピング処理装置の構造を示す構造図である。
【図7】本発明の第2の実施の形態に係る分割処理の対象となるプリミティブとクリップ面の例を示す図である。
【図8】本発明の第2の実施の形態に係るクリッピング処理装置の動作を示すフローチャートである。
【図9】本発明の第3の実施の形態に係るグラフィックスシステムの構造を示す構造図である。
【図10】本発明の第3の実施の形態に係るグラフィックスシステムの動作を示すフローチャートである。
【図11】本発明の第3の実施の形態に係るグラフィックスシステムの動作を示すフローチャートである。
【図12】本発明の第4の実施の形態に係るクリッピング処理装置の構造を示す構造図である。
【図13】本発明の第4の実施の形態に係るクリッピング処理装置のクリッピング処理にて発生する頂点の例を示す図である。
【図14】本発明の第4の実施の形態に係るクリッピング処理装置の頂点バッファ部の状態を示す状態遷移図である。
【図15】本発明の第5の実施の形態に係るグラフィックスシステムの構造を示す構造図である。
【図16】本発明の第5の実施の形態に係るグラフィックスシステムのガードバンド領域及びビューポート領域を示す領域図である。
【図17】本発明の第5の実施の形態に係るグラフィックスシステムの動作を示すフローチャートである。
【符号の説明】
1…視点
2a…Z手前面
2b…Z奥面
3…ビューボリューム
4…X左面
5…X右面
6…Y上面
7…Y下面
near…near距離
far…far距離
100…クリッピング処理装置
11…座標変換処理装置
12…クリップテスト処理装置
13…ラスタライザ装置
14…頂点バッファ部
15…クリップテスト処理部
16…線分比生成部
17…分割頂点座標生成部
18…除算部
200…クリッピング処理装置
20a…プリミティブ
20b…新しいプリミティブ
20c…ビューポート領域
21…座標変換処理装置
22…クリップテスト処理装置
23…ラスタライザ装置
24…頂点バッファ部
25…クリップテスト処理部
26…分割係数算出部
27…線形補間部
28…除算部
300…グラフィックスシステム
30…オブジェクト情報入力装置
31…座標変換光源計算装置
31a…座標変換光源計算部
31b…Z面クリップテスト部
31c…Zクリップ面補間係数算出部
31d…透視変換係数算出部
32…クリップテスト処理装置
33…ラスタライザ装置
34…頂点バッファ部
35…クリップテスト処理部
36…線形補間部
37…補間係数算出部
38…除算部
39…描画装置
400…クリッピング処理装置
41…座標変換処理装置
42…クリップテスト処理装置
43…ラスタライザ装置
44…頂点バッファ部
45…インデックス部
46…クリップテスト処理部
47…分割部
48…除算部
49…ビューポート
49a…プリミティブ
49b…クリップ面
49c…ビューポート
500…グラフィックスシステム
50…ジオメトリエンジン
51…座標変換処理装置
52…比較部
53…レジスタ部
54…論理和算出部
55…頂点バッファ部
56…除算部
57…ガードバンド領域
57a…Y下面
57b…Y上面
57c…X左面
57d…X右面
58…ガードバンド外領域
59…ビューポート領域
60…ラスタライザ装置
61、62、63…分割部[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to three-dimensional computer graphics, and more particularly, to a clipping processing device, a graphics system, a computer-based image clipping processing method, and a graphics method for performing clipping processing on a portion other than a range to be displayed on a screen in a three-dimensional space. It is.
[0002]
[Prior art]
The clipping process in three-dimensional computer graphics is performed in a space of a quadrangular frustum based on the viewpoint 1 as shown in FIG. The view volume 3 is defined by six surfaces of the Z hand front surface 2a, the Z back surface 2b, the Y upper surface 6, the Y lower surface 7, the X right surface 5, and the X left surface 4 as viewed from the viewpoint 1, and a primitive that defines a basic component of the object. Of those, only those existing in the view volume 3 are actually drawn on the screen. Note that the distance from the viewpoint 1 to the front surface 2a of the Z hand is near d. near And the Z hand front 2a is d from the viewpoint 1 near This is a plane perpendicular to the Z axis that exists at a remote position. The distance from the viewpoint 1 to the Z inner surface 2b is far d far And Z back surface 2b is Z hand front surface 2a is d from viewpoint 1. far This is a plane perpendicular to the Z axis that exists at a remote position. The clipping process is generally performed according to the following procedure. First, a clip test is performed in which the relationship of the view volume to each primitive is classified into three areas: inside the view volume 3, outside the bee volume 3, and over the area inside and outside the view volume 3. Next, necessary primitives existing in the view volume 3 are picked up, unnecessary primitives existing outside the view volume are discarded, and division processing is performed on primitives existing in an area that straddles the area inside the view volume 3 and outside the view volume 3. I do. In this way, all the primitives are appropriately present in the view volume 3. At this time, it is necessary to reconstruct the primitive for the primitive for which the division processing is determined to be necessary, by finding the intersection with the clip plane. The division processing for each clip plane is obtained by normalizing the ratio of the distance between the line segment and the division point at the intersection (hereinafter, referred to as “division point”) between the line segment between the vertices constituting the primitive and each clip plane (hereinafter referred to as “division point”). Hereinafter, “interpolation coefficient” is calculated, and based on the interpolation coefficient, each of the vertices such as the coordinate value, the normal value, the color, the α value, the fog coefficient, and the texture coordinate of the division point are obtained from the vertex information at both ends. We will calculate the parameter values.
[0003]
A conventional clipping method by calculating a division point will be described with reference to FIG. When a triangular primitive composed of vertices ABC crosses a certain clip plane, first, an intersection D between the line segment AB and the clip plane is obtained, and the ratio of the divided line segment AD to the line segment DB is set to t: 1. Expressed as -t. The coordinate values of the vertices A, D, and B of the line segment AD and the line segment DB are obtained based on the interpolation coefficient that is the ratio of the line segments obtained here. As shown in FIG. 4, the vertex A determined to need to be divided is denoted by P 0 , Vertex D to P C , Vertex B to P 1 And Each vertex represents a vertex relative to a single origin in a three-dimensional space in addition to the X axis, the Y axis, and the Z axis, and world coordinates (such as twist, rotation, and the like) of the vertex in this space. (W axis). At this time, P 0 (X 0 , Y 0 , Z 0 , W 0 ), P 1 (X 1 , Y 1 , Z 1 , W 1 ), The division point P with the clip plane for the line segment C (X c , Y c , Z c , W c ), The line segment P 0 P C And line segment P C P 1 , The interpolation ratio (t) of the line segment ratio t: 1-t to the clip plane. 0 , T 1 ) Can be generally obtained by the following equation.
[0004]
(Equation 1)
Figure 2004102841
Next, the coordinate value at the intersection with the clip plane is obtained by using the division coefficients obtained from Expressions (1) and (2).
[0005]
(Equation 2)
Figure 2004102841
When the vertex coordinate values of the vertices A, D, and B are obtained by the above equations (3), (4), (5), and (6), the normal values (Nx, Ny, Nz), color (R, G, B), α value (A), fog coefficient (F), texture coordinates (S, T, Q), and other parameter values associated with the vertices are calculated.
[0006]
Thereafter, the perspective transformation processing of the vertex coordinate values of the vertices A, D, and B is performed.
[0007]
[Equation 3]
Figure 2004102841
Viewport conversion processing is performed on the coordinate values (x, y, z) obtained by the above equations (7), (8), and (9) to obtain vertex information in screen coordinates.
[0008]
As described above, also in the line segment AC, first, the intersection D between the line segment AC and the clip plane is obtained, and the ratio between the divided line segment AD and the line segment DB is expressed as s: 1-s. Here, the coordinate values of the vertices A, D, and B of the line segment AD and the line segment DB are obtained based on the interpolation coefficients obtained by Expression 1, and the parameter values associated with each vertex are obtained. Further, perspective transformation processing and viewport transformation processing are performed on the coordinate values of the vertices A, D, and B, and vertex information of a new primitive ADE in screen coordinates is obtained.
[0009]
[Problems to be solved by the invention]
However, the calculation of the interpolation coefficient in the division processing requires a large calculation cost, and the calculation of each parameter associated with the vertex may have a plurality of texture coordinates and a plurality of colors, and thus requires a lot of processing. . Further, since this processing is performed on each of the (X, Y, Z) clip planes, the clipping processing is complicated and requires a great deal of calculation cost. As described above, the division processing is a bottleneck that lowers the processing speed in the three-dimensional graphics processing, and is a factor that stops the pipeline processing when hardware is implemented. Further, as a result, a large amount of extra cost is incurred for bottleneck processing.
[0010]
SUMMARY OF THE INVENTION The present invention has been made in view of the above-described problems, and in a clipping process of three-dimensional model data, a clipping processing device, a graphics system, a clipping processing method, and a high-speed, low-cost clipping process that can be performed. It aims to provide a graphics method.
[0011]
[Means for Solving the Problems]
A first feature of the present invention is that (a) a coordinate conversion device for converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system, (b) a vertex buffer unit for storing vertex information, and a clip. A clip test processing unit that performs a clip test based on vertex information on a surface, a division unit that performs a division process on a primitive that is determined to be required to be divided by the clip test, performs a perspective transformation process on the vertex information, and obtains screen coordinate system vertex information. It is a gist of the present invention that the clipping processing device includes a clip test processing device having a division unit for generating the and a rasterizer device for assembling new primitives based on screen coordinate system vertex information.
[0012]
A second feature of the present invention is (a) a coordinate conversion light source calculation unit that converts object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system, and a Z plane clip that performs a clip test on the Z plane. A test unit for calculating an interpolation coefficient of the Z-clip plane determined to require the splitting process by the clip test; and a perspective conversion coefficient for the Z-plane determined to be unnecessary for the splitting process by the clip test. (B) a vertex buffer for storing vertex information, a clip test processing unit for performing a clip test based on vertex information on a clip plane other than the Z plane, and a clip. A division unit that performs a division process on a primitive determined to be necessary in the test, and performs a perspective transformation process on the vertex information to create screen coordinate system vertex information And Clip Test processing apparatus having a divider, and summarized in that a graphics system comprising a rasterizer device assembling the new primitives based on (c) the screen coordinate system vertex information.
[0013]
A third feature of the present invention resides in (a) a coordinate conversion device for converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system, and (b) comparison between a clip plane and vertex information and clipping. A comparison unit that compares the surface with the guard band area and outputs a determination bit according to the result, a register unit that holds preset bit mask information, and calculates a logical OR of a mask from the determination bit and the bit mask information A comparing device having a logical sum calculating unit for determining any one of a drawing target, a non-drawing target, and a division target; (c) a vertex buffer unit for storing vertex information; It is necessary to provide a division unit that performs conversion processing and creates screen coordinate system vertex information, and (e) a rasterizer device that assembles new primitives based on the screen coordinate system vertex information. To.
[0014]
A fourth feature of the present invention is that (a) a step of converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system; (b) a step of storing vertex information; A step of performing a clip test on the clip plane based on the vertex information; (d) a step of performing a division process on the primitive determined to be necessary in the clip test; and (e) a perspective transformation process of the vertex information And generating the screen coordinate system vertex information.
[0015]
A fifth feature of the present invention is that (a) a step of converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system; (b) a clip test on a Z plane; (C) calculating an interpolation coefficient for the Z-clip plane determined to require the division processing by the clip test; and (d) calculating a perspective transformation coefficient for the Z-plane determined to not require the division processing by the clip test. (E) storing vertex information; (f) performing a clip test based on the vertex information on a clip plane other than the Z plane; and (g) determining that division is necessary in the clip test. The graphics method includes a step of performing primitive division processing and a step of (C) performing perspective transformation processing on vertex information to generate screen coordinate system vertex information. The the gist.
[0016]
A sixth feature of the present invention is that (a) a step of converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system; (b) a comparison between a clip plane and vertex information; Comparing with the guard band area and outputting a determination bit according to the result; and (c) calculating the logical sum of the logical sum calculation unit mask from the bit mask information and the determination bit previously set in the register unit Determining whether the object is one of a drawing target, a non-drawing target, and a division target; (d) storing vertex information including a logical sum; and (e) performing perspective transformation on the vertex information Performing a process and creating screen coordinate system vertex information.
[0017]
BEST MODE FOR CARRYING OUT THE INVENTION
In order to represent a three-dimensional image by three-dimensional computer graphics in a two-dimensional planar shape viewport, a clipping process is required, and it is well known that the most complicated process is required in the primitive division process. It is a fact of. For a primitive for which division processing is determined to be necessary, a division point with the clip plane is obtained and the primitive is reconstructed. At this time, there are various forms of the primitive in the viewport. For example, as shown in FIG. 3, a new primitive having a triangular shape straddling two sides of the primitive with respect to the clip plane and including one vertex of the new primitive in the viewport, or a clip plane as shown in FIG. 7. , And two new primitives in the viewport, including the two vertices of the new primitive in the viewport, and the four sides of the primitive straddling the clip plane as shown in FIG. A new primitive in the form of a heptagon, which includes the new vertices in the viewport and includes the seven vertices of the new primitive, can be considered.
[0018]
The inventors have considered that in the division processing when reconstructing such various new primitives, processing suitable for the shape of the new primitive and the purpose of the division processing is performed.
[0019]
In the clipping process, an embodiment of an apparatus and a method for performing a division process suitable for the shape of a new primitive and the purpose of the division process will be described below with reference to the drawings. The first embodiment relates to an apparatus and a method for omitting a division coefficient for each clip plane, and the second embodiment relates to an apparatus and a method for minimizing the number of times of primitive parameter calculation processing. In the embodiment of the present invention, the processing for calculating the interpolation coefficient of the primitive and the linear interpolation processing for obtaining the division points connecting the coordinates when a plurality of coordinates are given are performed in parallel to increase the processing speed. In the fourth embodiment, an apparatus and a method for reducing the number of vertex buffers used in the division processing are described. In the fifth embodiment, the clip determination processing using a guard band is accelerated in the fifth embodiment. An apparatus and a method for achieving this will be described. It is to be noted that the present invention is not limited to the following embodiments, and it is needless to say that various changes can be made without departing from the spirit of the present invention.
[0020]
(First Embodiment)
(Clipping processing device)
The clipping processing apparatus 100 according to the first embodiment of the present invention is an apparatus for omitting a division coefficient for each clip plane, and as shown in FIG. The apparatus includes a device 12 and a rasterizer device 13. The coordinate transformation processing device 11 acquires the object information of the homogeneous coordinate system primitive from the object information input device 30, and performs a coordinate transformation process such as a model view transformation and a projection transformation on the object information. The object information input device 30 is configured by a CPU for performing a geometry operation, an external memory, or the like.
[0021]
The clip test processing device 12 includes a vertex buffer unit 14, a clip test processing unit 15, a division unit 61, and a division unit 18. The vertex buffer unit 14 stores the vertices and the vertex coordinates generated by the coordinate transformation processing device 11, the divided vertices and the vertex coordinates after the division processing, and the vertices such as the normal, color, α value, fog coefficient, and texture coordinates associated with each vertex It is a storage device for storing information. The clip test processing unit 15 performs a clip test on each of the clip planes to determine whether primitive division processing is necessary. The dividing unit 61 includes a line segment ratio generating unit 16 and a divided vertex coordinate generating unit 17. The line segment ratio generation unit 16 generates a line segment ratio using vertex information generated as a result of performing coordinate conversion on the object information. The division vertex coordinate generation unit 17 generates vertex coordinates on the clipping plane using the line segment ratio generated by the line segment ratio generation unit 16. The division unit 18 performs a perspective transformation process on the vertex coordinates passed from the clip test processing unit 15.
[0022]
The rasterizer device 13 assembles primitives based on vertex information given as screen coordinates, performs a process of coloring pixels and the like according to each parameter value, creates pixel information, and passes the pixel information to the rendering device 39. The drawing device 39 performs drawing on a video memory based on the pixel information.
[0023]
(Clipping method)
Next, in the clipping processing method using the clipping processing apparatus 100, a procedure of processing until object information in a three-dimensional space in three-dimensional computer graphics is drawn on a screen will be described with reference to FIG.
[0024]
(A) First, in step S101, the coordinate transformation processing device 11 uses the object information input device 30 to input vertex coordinates (x m , Y m , Z m , W m ) Is obtained as object information.
[0025]
(B) Next, the coordinate conversion processing device 11 performs a matrix conversion process. As a step S102, a model view conversion is performed, and as a step S103, a projection conversion is performed using a 4 × 4 determinant such as the equation (10). The object information converted into the viewpoint coordinate system by the matrix conversion process is transmitted to the vertex buffer unit 14 as vertex information, and is temporarily stored.
[0026]
(Equation 4)
Figure 2004102841
(C) In step S104, the clip test processing unit 15 acquires the vertex information from the vertex buffer unit 14, and the Z hand front surface 2a, the Z back surface 2b, the Y upper surface 6, the Y lower surface 7, and the X right surface that constitute the view volume 5. It is determined whether or not the primitive exists in the area for all six surfaces of the X left surface 4.
[0027]
(D) In step S105, when the primitive exists in the area, the clip test processing unit 15 determines whether or not the division processing is necessary for each line segment constituting the primitive. The vertex information determined to require division is transmitted to the line segment ratio generation unit 16.
[0028]
(E) In step S106, the line segment ratio generating unit 16 determines whether the two vertices P 0 (X 0 , Y 0 , Z 0 , W 0 ), P 1 (X 1 , Y 1 , Z 1 , W 1 ), A division intersection Pc (x c , Y c , Z c , W c ). At this time, the line segment P is calculated using the equations (1) and (2) as in the related art. 0 P C And line segment P C P 1 Instead of using the division coefficient in which the ratio of the distances is normalized, the line segment ratio is used by the following expression using only the numerator term.
[0029]
(Equation 5)
Figure 2004102841
(F) Next, in step S107, the divided vertex coordinate generation unit 17 obtains a coordinate value at the intersection with the XW clip plane using the division coefficients obtained from Expressions (11) and (12). .
[0030]
(Equation 6)
Figure 2004102841
Using the above expressions (13), (14), (15) and (16), the Z hand front surface 2a, the Z back surface 2b, the Y upper surface 6, the Y lower surface 7, the X right surface 5, X Coordinate values are sequentially determined for all six surfaces of the left surface 4, and the intersection coordinates in the view volume for all the clip surfaces are calculated.
[0031]
(G) After all the intersection coordinates have been calculated, in step S108, the division unit 18 performs a perspective transformation process. Specifically, division by the W coordinate value is performed using the following equation.
[0032]
(Equation 7)
Figure 2004102841
(H) In step S109, the divider 18 performs a viewport conversion process on the coordinate values (x, y, z) obtained by the above equations (17), (18), and (19), and Calculate model data in the coordinate system. Next, in step S110, vertex information at screen coordinates is calculated from the model data. Thereafter, based on the vertex information in the screen coordinates, the rasterizer device 13 divides the new primitive after the division into columns such as dots and pixels, and pastes the texture into the columns to complete the image drawing.
[0033]
Hereinafter, the coincidence between the calculation results of Expressions (1) and (2) and the calculation results of Expressions (11) and (12) will be proved. First, equation (7) used in the conventional method is expanded. Equation (7) for the X coordinate is expanded as follows from equation (3).
[0034]
(Equation 8)
Figure 2004102841
Next, the expression (17) used in the perspective transformation processing of the clipping processing method according to the first embodiment of the present invention is expanded as follows.
[0035]
(Equation 9)
Figure 2004102841
As described above, since the equations (22) and (24) are equal, the equations (7) and (17) are equivalent, and the calculation by the conventional method and the clipping method according to the first embodiment of the present invention is performed. The agreement of the results has been proven.
[0036]
According to the conventional method, when the division coefficient is obtained, division is required 12 times in total for all six clipping planes. On the other hand, as in the clipping method of the present invention, the line segment ratio is used. The calculation makes this division unnecessary. As a result, the clipping processing speed can be improved, and the calculation cost can be reduced.
[0037]
(Second embodiment)
(Clipping processing device)
The clipping processing apparatus 200 according to the second embodiment of the present invention is an apparatus aimed at minimizing the number of times of primitive parameter calculation processing, and as shown in FIG. , A clip test processing device 22 and a rasterizer device 23. The clip test processing device 22 includes a vertex buffer unit 24, a clip test processing unit 25, a division unit 62, and a division unit 28. The division unit 62 includes the division coefficient calculation unit 26 and the linear interpolation unit 27. The division coefficient calculation unit 26 calculates a division coefficient for the intersection between each clip plane and the viewport line segment according to an expression described later. The linear interpolation unit 27 calculates vertex coordinates based on the division coefficient, and performs linear interpolation processing based on the vertex information corresponding to each vertex coordinate. The other devices are the same as those of the clipping processing device 100 according to the first embodiment, and the description is omitted.
[0038]
(Clipping method)
Next, a clipping processing method using the clipping processing apparatus 200 will be described with reference to a flowchart of FIG. In the clipping process of three-dimensional computer graphics, a process that can minimize the number of parameter calculation processes is performed in the following procedure.
[0039]
(A) First, as step S201, the coordinate transformation processing device 21 uses the object information input device 30 to input vertex coordinates (x) in the homogeneous coordinate system in the three-dimensional space of the primitive 20a as object information. m , Y m , Z m , W m ) To get.
[0040]
(B) Next, the coordinate conversion processing device 21 performs a matrix conversion process. The model view conversion is performed as step S202, and the projection conversion is performed as step S203 using a 4 × 4 determinant such as Expression 1. The object information converted into the viewpoint coordinate system by this matrix conversion process is transmitted to the vertex buffer unit 24 as vertex information, and is temporarily stored.
[0041]
(C) In step S204, the clip test processing unit 25 acquires the vertex information from the vertex buffer unit 24, and forms the Z-hand front surface 2a, the Z back surface 2b, the Y upper surface 6, the Y lower surface 7, and the X right surface constituting the view volume. 5. It is determined whether or not the primitive exists in the area for all six surfaces of the X left surface 4.
[0042]
(D) In step S205, when the primitive exists in the area, the clip test processing unit 25 determines whether or not the division processing is required for each of the division coefficients constituting the primitive. If it is determined that it is necessary, the division processing is performed as follows.
[0043]
(E) In step S206, the division coefficient calculation unit 26 performs vertex division using the division coefficient. As an example, a description will be given of a process of dividing a primitive 20a including three vertices A, B, and C and a clip plane as shown in FIG. In this case, the vertices constituting the primitive are divided around the viewport region 20c surrounded by bold characters, which is in the region of the clip plane of Y = W, the clip plane of X = W, and the view volume.
[0044]
First, a division intersection with the Y = W plane is obtained, and a division coefficient t for the intersection D between the line segment AB and the YW clip plane is obtained. 0 And the coordinate value of the intersection D.
[0045]
(Equation 10)
Figure 2004102841
Division coefficient t for intersection E between line segment BC and YW clip plane 1 And the coordinate value of the intersection E.
[0046]
[Equation 11]
Figure 2004102841
Next, a division intersection with the X = W plane is obtained. Also, the division coefficient t for the intersection F between the line segment DB and the X = W clip plane 2 And the coordinate value.
[0047]
(Equation 12)
Figure 2004102841
Since the intersection D is a division point of the line segment AB,
(Equation 13)
Figure 2004102841
It becomes. When arranged, the vertices A and B are represented by the respective division coefficients as follows.
[0048]
[Equation 14]
Figure 2004102841
Division factor t for intersection G of line segment DE and X = W clip plane 3 And the coordinate value.
[0049]
[Equation 15]
Figure 2004102841
Since the intersection D is a division point of AB and the intersection E is a division point of BC,
(Equation 16)
Figure 2004102841
In summary, it is represented by the vertices A, B, and C and the respective division coefficients as follows.
[0050]
[Equation 17]
Figure 2004102841
As described above, the coordinate values of the vertices B, E, G, and F of the new primitive 20b in the view volume to be finally rendered are obtained.
[0051]
(F) Next, in step S207, the linear interpolation unit 27 calculates a parameter value from the coordinate values of the vertices B, E, G, and F of the new primitive 20b. Here, the parameter value represents information associated with each vertex, and normal line information (Nx, Ny, Nz), color information (R, G, B), transparency (A), texture coordinates (S, T, Q) ), Fog value (F) and the like. Further, the parameter value may have a plurality of pieces of color information and a plurality of texture coordinates, and the calculation amount of all the parameter values increases. For example, when there are seven parameters associated with a vertex, ie, color (R, G, B), transparency (A), and texture coordinates (S, T, Q), the conventional method in the example of FIG. In this case, the parameter calculation is performed 35 times. On the other hand, in the method according to the second embodiment of the present invention, the division coefficients from the vertices A, B, and C are held, and the clip region is finally determined. By calculating the parameter value only for the vertices existing in the parameter, only 21 parameter calculations are required. As a result, the time required for the division processing can be reduced, and the calculation cost can be reduced.
[0052]
(Third embodiment)
(Graphics system)
A graphics system 300 according to the third embodiment of the present invention is a device for performing a primitive interpolation coefficient calculation process and a linear interpolation process in parallel. As shown in FIG. The apparatus includes a device 30, a coordinate transformation light source calculation device 31, a clip test processing device 32, a rasterizer device 33, and a drawing device 39.
[0053]
The object information input device 30 is constituted by a CPU or an external memory, and takes in three-dimensional object information from optical reading means, graphic data of an object, and the like.
[0054]
The coordinate transformation light source calculation device 31 includes a coordinate transformation light source calculation unit 31a, a Z plane clip test unit 31b, a perspective transformation coefficient calculation unit 31d, and a Z clip plane interpolation coefficient calculation unit 31c. The coordinate conversion light source calculation unit 31a performs a coordinate conversion process on the input object information to create vertex information. Also, it is assumed that the light source is hitting the primitive, and the light source calculation for the sunshine and shaded parts is performed. The Z-plane clip test unit 31b performs a clip test on the Z-hand front surface 2a and the Z-rear surface 2b that are perpendicular to the Z-axis. The Z clip plane interpolation coefficient calculation unit 31c calculates an interpolation coefficient for the Z hand front surface 2a and the Z back surface 2b that are perpendicular to the Z axis. The perspective transformation coefficient calculation unit 31d calculates 1 / d with respect to the Z clip plane. near Or 1 / d far Is calculated, and based on this, the perspective transformation processing is performed. Here, the perspective transformation coefficient is a coefficient used when adjusting an image so that a distant object looks smaller than a nearby object.
[0055]
The clip test processing device 32 includes a vertex buffer unit 34, a clip test processing unit 35, a division unit 63, and a division unit 38. The division unit 63 includes a linear interpolation unit 36 and an interpolation coefficient calculation unit 37. The interpolation coefficient calculation unit 37 calculates an interpolation coefficient for the Z hand front surface 2a and the Z back surface 2b that are perpendicular to the X axis and the Y axis. Since other devices in the clip test processing device 32 are the same as those in the first and second embodiments, the description will be omitted.
[0056]
The rasterizer 33 converts the vertex information into pixel information including each parameter value and the like. The drawing device 39 performs drawing on a video memory based on the pixel information. It should be noted that the coordinate conversion light source calculation device 31, the clip test processing device 32, and the rasterizer device 33 can be provided as one device as a graphic engine.
[0057]
(Graphics method)
Hereinafter, a graphic method using the graphics system 300 will be described with reference to a data flow graph of FIG. The purpose of this graphic method is to perform a primitive interpolation coefficient calculation process and a linear interpolation process in parallel. The stages (1) and (2) of the data flow graph indicate the processing in the coordinate transformation light source calculation device 31, and the stages (3), (4) and (5) indicate the processing in the clip test processing device 32. Point. Also, as preprocessing, 1 / d with respect to the clip plane perpendicular to the Z axis near And 1 / d far Is calculated in advance.
[0058]
(A) First, in step S301, an object is obtained from the object information input device 30, and the coordinate conversion light source calculation unit 31a calculates data of the object information in the viewpoint coordinate system.
[0059]
(B) In step S302, a clip test on the Z clip plane and an interpolation coefficient for the Z plane are calculated. Details will be described with reference to the flowchart of FIG. First, in step S302a, after generating data of object information in the viewpoint coordinate system, the Z-plane clip test unit 31b performs a clip test on the Z clip plane using this data. In step S302b, it is determined whether or not primitive division processing is necessary. When division processing is necessary, in S302c, the Z clip plane interpolation coefficient calculation unit 31c calculates an interpolation coefficient for the Z clip plane. This interpolation coefficient is temporarily stored in the vertex buffer unit 34. If the division processing is unnecessary, in step S302d, the perspective transformation coefficient calculation unit 31d calculates the perspective transformation coefficient. The perspective transformation coefficients are sent to the rasterizer 33. As described above, in step S302, the calculation step changes according to the result of the test on the Z clip plane. The same can be said for the Y clip plane of step S304 and the X clip plane of step S306 described later.
[0060]
(C) In step S303, the linear interpolation unit 36 extracts an interpolation coefficient for the Z clip plane from the vertex buffer unit 34, and performs a linear interpolation process. By this linear interpolation processing, the coordinate values and parameter values of the division points of the primitive are calculated, passed to step S304, and the top vertex information is passed to step S305. 1 / d with respect to the clip plane perpendicular to the Z axis near And 1 / d far The division unit 38 performs a perspective transformation process using the perspective division coefficient of
[0061]
In step S304, a clip test is performed on the Y clip plane based on the coordinate values of the vertices and the parameter values. As a result of the clip test, when it is determined that the division processing is necessary, an interpolation coefficient for the Y clip plane is calculated. This interpolation coefficient is passed to step S305.
[0062]
At this time, the linear interpolation processing of step S303 and the calculation processing of the interpolation coefficient of step S304 are performed in parallel in the same (3) stage, and the time required for the operation of each processing is almost the same.
[0063]
(D) In step S305, the linear interpolation unit 36 extracts an interpolation coefficient for the Y clip plane from the vertex buffer unit 34, and performs a linear interpolation process. By this linear interpolation processing, the coordinate values and parameter values of the division points of the primitive are calculated, passed to step S306, and the top vertex information is passed to step S307. 1 / d with respect to the clip plane perpendicular to the Z axis near And 1 / d far The division unit 38 performs a perspective transformation process using the perspective division coefficient of
[0064]
In step S306, a clip test is performed on the X clip plane based on the coordinate values of the vertices and the parameter values. As a result of the clip test, when it is determined that the dividing process is necessary, an interpolation coefficient for the X clip plane is calculated. This interpolation coefficient is passed to step S307.
[0065]
At this time, the linear interpolation processing in step S305 and the interpolation coefficient calculation processing in step S306 are performed in parallel in the same (4) stage, and the time required for the operation of each processing is almost the same.
[0066]
(E) In step S307, the linear interpolation unit 36 extracts an interpolation coefficient for the X clip plane from the vertex buffer unit 34, and performs a linear interpolation process. By this linear interpolation processing, the coordinate values and parameter values of the division points of the primitive are calculated. 1 / d with respect to the clip plane perpendicular to the X axis near And 1 / d far The division unit 38 performs a perspective transformation process using the perspective division coefficient of
[0067]
(F) Finally, in step S308, the rasterizer device 33 converts the vertex information subjected to the perspective transformation processing into pixel information including parameter values and the like. The drawing device 39 performs drawing on the video memory based on the pixel information.
[0068]
As shown in the stages (3) and (4) in FIG. 10, the interpolation coefficient must be calculated in advance for the Z clip plane. In addition, by performing parallel processing of linear interpolation and calculation of an interpolation coefficient for the next clip plane in the same stage, calculation efficiency is increased, and clip processing for one stage (about 15 cycles) can be performed at a higher speed than in the conventional method. .
[0069]
(Fourth embodiment)
(Clipping processing device)
A clipping processing apparatus 400 according to the fourth embodiment of the present invention is an apparatus aimed at reducing the number of vertex buffers used in the division processing, and as shown in FIG. And a clip test processing device 42 and a rasterizer device 43.
[0070]
The clip test processing device 42 includes a vertex buffer unit 44, an index unit 45, a clip test processing unit 46, a division unit 47, and a division unit 48. The clip test processing unit 46 performs a clip test on each clip plane in units of line segments. The vertex buffer unit 44 stores the vertices input from the coordinate transformation processing device 41, the divided vertices divided by the dividing unit 47, and other vertex information such as parameter values. The index unit 45 performs an operation of aligning vertices, selecting vertices forming a line segment, and inputting and outputting vertices in the vertex buffer unit 44. The dividing unit 47 is a device for dividing the clip plane in units of line segments. Specifically, the apparatus may generate the divided vertex coordinates from the line segment ratio generation according to the first embodiment, or may perform the linear interpolation processing based on the division coefficients according to the second embodiment. For other devices, the same devices as those of the clipping processing devices of the first, second, and third embodiments are used, and the description is omitted.
[0071]
(Clipping method)
Next, a clipping method using the clipping device 400 will be described. This method aims at saving the number of vertex buffers generated at the time of division processing on a clip plane.
[0072]
FIG. 13 shows an example of vertices generated in the clipping division processing. The figure is shown in two dimensions of the X axis and the Z axis for simplification. The primitive 49a is composed of three vertices v0, v1, and v2, a line drawn by a broken line is a clip plane 49b, and a portion surrounded by a solid line is a space of the viewport 49c. The finally required vertices are seven vertices on the frame of the viewport 49 surrounded by solid lines.
[0073]
When clipping processing is performed on the example of FIG. 13 in a normal method, the following processing is performed.
[0074]
(A) As the division processing on the Z clip plane, first, the division unit 47 performs the division processing on the line segments v0 and v1, and generates vertices v3 and v4. Next, the dividing unit 47 performs a dividing process on the line segments v1 and v2, and generates a vertex v5. Finally, the dividing unit 47 performs a dividing process on the line segments v2 and v0, and generates vertices v2 and v6. As a result, vertices v3, v4, v5, v2, and v6 are formed.
[0075]
(B) As the division processing on the X clip plane, first, the division unit 47 performs the division processing on the line segments v3 and v4 to generate vertices v10 and v4. First, the dividing unit 47 performs a dividing process on the line segments v4 and v5 to generate a vertex v5. Next, the dividing unit 47 performs a dividing process on the line segments v5 and v2, and generates a vertex v7. Further, the dividing unit 47 performs a dividing process on the line segments v2 and v6, and generates vertices v8 and v6. Finally, the dividing unit 47 performs a dividing process on the line segments v6 and v3, and generates a vertex v9. As a result, vertices v10, v4, v5, v7, v8, v6, v9 are formed. From the above example, in this case, 44 vertex buffer units for 10 vertices are required.
[0076]
Next, a clipping processing method according to the fourth embodiment will be described with reference to a state transition diagram of the vertex buffer unit 44 in FIG. In this clipping processing method, the clip test by the clip test processing unit 46 and the division processing by the division unit 47 are repeated for each line segment, so that the number of vertex buffers can be reduced to six as shown in FIG.
[0077]
The state (0) indicates the initial state of the vertex buffer unit 44. The third from the top is a Z-plane buffer, and the third from the bottom is an X-plane buffer. At this time, first, the index unit 45 causes the vertex buffer unit 44 to store the vertices v0, v1, and v2 of the primitive 49a.
[0078]
In the state (1), the clip test processing unit 46 performs a clip test on the Z clip plane for the line segments v0 and v1. Next, the dividing unit 47 performs a dividing process of the Z clip plane on the line segments v0 and v1, and generates v3 and v4.
[0079]
In the state (2), the clip test processing unit 46 performs a clip test on the X clip plane for the line segments v3 and v4. Next, the dividing unit 47 performs a dividing process on the line segments v3 and v4 using the X clip plane, and the index unit 45 outputs v4 and v10.
[0080]
In the state (3), the clip test processing unit 46 performs a clip test on the Z clip plane for the line segments v1 and v2. Next, the dividing unit 47 performs a dividing process on the line segments v1 and v2 using the Z clip plane to generate v5.
[0081]
In the state (4), the clip test processing unit 46 performs a clip test on the X clip plane for the line segments v5 and v2.
[0082]
In the state (5), the clip test processing unit 46 outputs v5. Next, the division unit 47 performs division processing on the line segments v5 and v2 using the X clip plane, and the index unit 45 outputs v7.
[0083]
In the state (6), the clip test processing unit 46 performs a clip test on the Z clip plane for the line segments v2 and v0. Next, the division unit 47 performs division processing on the line segments v2 and v0 using the Z clip plane, and generates v6.
[0084]
In the state (7), the clip test processing unit 46 performs a clip test on the X clip plane for the line segments v2 and v0, and outputs v6. Further, the X segmentation process is performed on the line segments v2 and v6, and the index unit 45 outputs v8.
[0085]
In the state (8), the clip test processing unit 46 performs the X clip plane division process on the line segments v6 and v3, and the index unit 45 outputs v9.
[0086]
As described above, in the processing for each line segment, the clipping division processing can be performed in the vertex buffer unit 44 having a smaller number of buffers than before by repeating output and sorting.
[0087]
(Fifth embodiment)
(Graphics system)
A graphics system 500 according to the fifth embodiment of the present invention is a device for the purpose of speeding up clip determination processing using a guard band. As shown in FIG. And a rasterizer device 60. The geometry engine 50 is a device that converts the coordinates of an object into screen coordinates, and includes a coordinate conversion processing device 51, a comparison device 64, and a vertex buffer unit 55. The comparison device 64 includes a comparison unit 52, a register unit 53, and a logical sum calculation unit 54.
[0088]
The coordinate conversion processing device 51 converts the primitive object information in the homogeneous coordinate system acquired from the object information input device 30 into vertex information in the viewpoint coordinate system. The comparing unit 52 performs a comparison between the clip plane and the vertex information and a comparison between the clip plane and the guard band area, and outputs a determination bit according to the result. The register unit 53 stores bit mask information set in advance by a programmer or the like. The logical sum calculation unit 54 calculates the logical sum of the mask from the determination bit and the bit mask information, and determines any one of a drawing target, a non-drawing target, and a division target. The vertex buffer unit 55 stores vertex information and determination bits for each clip plane. The vertex information stored in the vertex buffer unit 55 is passed to the rasterizer device 60 in a fixed-point or integer type. The object information input device 30 includes a GPU (graphics processing unit), a CPU, an external memory, and the like.
[0089]
The rasterizer device 60 converts the vertex information into pixel information including each parameter value and the like, and passes the pixel information to the drawing device 39. It also has a clipping function called a scissoring function in a two-dimensional screen space. Note that the maximum value of the fixed bit length that can be received by the rasterizer device 60 is called a guard band.
[0090]
(Graphics processing method)
Next, a clipping processing method using the graphics system 500 using guard bands will be described with reference to the flowchart of FIG. This method has an object to reduce clipping processing by using the scissoring function of the rasterizer device 60 in clipping processing in three-dimensional computer graphics, and to perform clip determination processing at high speed.
[0091]
(A) First, in step S501, the coordinate transformation processing device 51 fetches object information from the object information input device 30.
[0092]
(B) Next, the coordinate conversion processing device 51 performs a matrix conversion process. The model view conversion is performed as step S502, and the projection conversion is performed as step S503 using a 4 × 4 determinant such as Expression 1. The object information converted into the viewpoint coordinate system by this matrix conversion process is passed to the comparison unit 52 as vertex information.
[0093]
(C) In step S504, the comparison unit 52 compares the determination bits in the space area based on the vertex information by comparing with the bit mask information stored in the register unit 53 and set in advance by a programmer or the like. FIG. 16 shows a classification example of a spatial region in the graphics system 500 using guard bands. This space area is simply shown as a two-dimensional space including the X axis and the Y axis. The inner rectangular area filled with color indicates the viewport area 59. The regions surrounded by oblique lines are the guard band regions 57, 57a, 57b, 57c, and 57d. Of these, 57a is the Y lower surface, 57b is the Y upper surface, 57c is the X left surface, and 57d is the X right surface clip surface. Judgments for each side of the viewport were made by Cohen-Sutherland, according to "Computer Graphics Theory and Practice" by James D, F, Andri V, D, Stephen K, F and John F, H. It is defined that if an area classification code based on an algorithm is used, it is possible to classify six areas based on 6-bit information. In the guard band graphic method according to the fifth embodiment, a 1-bit information is added in order to further determine a guard band area, and a space area is classified based on a total of 7 bits of information. (Table 1) shows an example of area classification in a three-dimensional space.
[0094]
[Table 1]
Figure 2004102841
Unlike the case of the three-dimensional space in (Table 1), the region classification in the two-dimensional space in the case of FIG. 16 is indicated by a 5-bit code. The area in the viewport 56 is represented by code 00000. The area of the Y lower surface 57a is an area where the Y coordinate is smaller than the bottom side surface of the viewport, and is represented by a code 00100. The area of the Y upper surface 57b is an area where the Y coordinate is larger than the upper surface of the viewport, and is represented by a code 01000. The area of the X left surface 57c is a case where the X coordinate is smaller than the left surface of the viewport, and is represented by a code 00001. The area on the X right side 57d is a case where the X coordinate is larger than the right side of the viewport, and is represented by a code 00010. The region outside the guard band 58 is a case where the coordinates exceed the guard band, and is represented by a code 10000.
[0095]
Here, in the area determination of the area 58 outside the guard band, the absolute value of the X coordinate and the Y coordinate is obtained, and the larger one of them is compared with the maximum bit length of the guard band. When it is determined that the comparison result exceeds the guard band area, a determination bit is set. This is performed by the following program.
[0096]
Judgment bit = (max (| X coordinate |, | Y coordinate |)> Guard Band)? 1: 0; (33)
The above-described region determination is performed for each vertex, and is held in the vertex buffer unit 55 for each vertex as a region determination bit.
[0097]
(D) In step S505, the logical sum calculation unit 54 determines a drawing target, a non-drawing target, and a division target for the primitive using the logical sum. The non-drawing target is determined by the logical product of the area determination bits. The drawing target is determined based on the fact that the logical product of the area determination bits is not established and the logical sum of the area determination bits is not established. The division target is determined when the logical product of the area determination bits is not satisfied and the logical sum of the area determination bits is satisfied.
[0098]
(E) In step S506, when the determination of the drawing target, the non-drawing target, and the division target is completed, the division unit 56 performs the perspective transformation process by the division by the W coordinate value of Expression 4. Also, in step S507, the division unit 56 performs a viewport conversion process on the coordinate values (x, y, z) obtained by Expression 4, and calculates model data in a screen coordinate system. Next, in step S508, vertex information at screen coordinates is calculated from the model data. Thereafter, the rasterizer device 60 divides the new primitive after division processing into columns of dots, pixels, etc. based on the vertex information in the screen coordinates of the two-dimensional space by the scissoring function, and pastes the texture into the columns, Complete the drawing.
[0099]
In the case of a system having a guard band, high-speed and low-cost clipping can be performed by classifying the guard band areas as described above. In addition, depending on the type of application, clip division may not be performed on the front surface 2a and the rear surface 2b of the Z hand, or the position of the object may be determined in advance based on information such as a bounding box and a bounding sphere of the object. In this case, by receiving information on which clip plane requires clip division processing and masking the determination bit, it becomes possible to skip processing on unnecessary clip planes. Further, by using the scissoring function in the two-dimensional space in the rasterizer device 60, it is possible to reduce the clipping division processing in the three-dimensional space by the geometry engine 50.
[0100]
【The invention's effect】
According to the present invention, it is possible to realize a clipping processing apparatus, a graphics system, a clipping processing method, and a graphics method capable of performing high-speed and low-cost clipping processing in clipping processing of three-dimensional model data.
[Brief description of the drawings]
FIG. 1 is a structural diagram showing a structure of a clipping processing device according to a first embodiment of the present invention.
FIG. 2 is a schematic diagram showing an object space and a screen space.
FIG. 3 is a diagram illustrating an example of primitive division on a clip plane.
FIG. 4 is a diagram showing an example of vertex division on a clip plane.
FIG. 5 is a flowchart showing an operation of the clipping processing device according to the first embodiment of the present invention.
FIG. 6 is a structural diagram showing a structure of a clipping processing device according to a second embodiment of the present invention.
FIG. 7 is a diagram illustrating an example of a primitive and a clip plane to be subjected to division processing according to a second embodiment of the present invention.
FIG. 8 is a flowchart showing an operation of the clipping processing device according to the second embodiment of the present invention.
FIG. 9 is a structural diagram showing a structure of a graphics system according to a third embodiment of the present invention.
FIG. 10 is a flowchart showing an operation of the graphics system according to the third embodiment of the present invention.
FIG. 11 is a flowchart showing an operation of the graphics system according to the third embodiment of the present invention.
FIG. 12 is a structural diagram showing a structure of a clipping processing device according to a fourth embodiment of the present invention.
FIG. 13 is a diagram illustrating an example of vertices generated in clipping processing of a clipping processing device according to a fourth embodiment of the present invention.
FIG. 14 is a state transition diagram illustrating a state of a vertex buffer unit of a clipping processing device according to a fourth embodiment of the present invention.
FIG. 15 is a structural diagram showing a structure of a graphics system according to a fifth embodiment of the present invention.
FIG. 16 is an area diagram showing a guard band area and a viewport area of a graphics system according to a fifth embodiment of the present invention.
FIG. 17 is a flowchart showing an operation of the graphics system according to the fifth embodiment of the present invention.
[Explanation of symbols]
1 ... viewpoint
2a ... front of Z hand
2b ... Z back
3. View volume
4 ... X left side
5 ... X right side
6 ... Y upper surface
7 ... Y bottom surface
d near … Near distance
d far … Far distance
100: clipping processing device
11 ... Coordinate transformation processing device
12 ... Clip test processing device
13. Rasterizer device
14 ... Vertex buffer section
15. Clip test processing unit
16 line segment ratio generator
17—Division vertex coordinate generation unit
18 Division unit
200: clipping processing device
20a ... Primitive
20b… New primitive
20c ... viewport area
21 ... Coordinate transformation processing device
22 ... Clip test processing device
23 ... Rasterizer device
24 ... Vertex buffer section
25: Clip test processing unit
26: division coefficient calculation unit
27 Linear interpolation unit
28 Division unit
300 ... Graphics system
30 ... Object information input device
31 coordinate conversion light source calculation device
31a Coordinate conversion light source calculation unit
31b ... Z-plane clip test section
31c... Z clip plane interpolation coefficient calculation unit
31d: perspective transformation coefficient calculation unit
32: Clip test processing device
33 ... Rasterizer device
34 ... Vertex buffer section
35 ... Clip test processing unit
36 Linear interpolation unit
37 ... Interpolation coefficient calculator
38 Division unit
39 Drawing device
400: clipping processing device
41 ... Coordinate conversion processing device
42 ... Clip test processing device
43 ... Rasterizer device
44 ... Vertex buffer section
45 ... Index section
46: clip test processing unit
47 ... division part
48 Division unit
49… Viewport
49a ... Primitive
49b: clip surface
49c… Viewport
500 ... Graphics system
50 ... Geometry engine
51 Coordinate transformation processing device
52 ... Comparison unit
53 Register part
54: Logical OR calculator
55 ... vertex buffer section
56 division unit
57… Guard band area
57a ... Y bottom surface
57b ... Y upper surface
57c ... X left side
57d ... X right side
58: Area outside guard band
59… Viewport area
60 ... Rasterizer device
61, 62, 63 ... division part

Claims (21)

同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換装置と、
前記頂点情報を記憶する頂点バッファ部、クリップ面において前記頂点情報を基にクリップテストを行うクリップテスト処理部、前記クリップテストにて分割が必要と判断されたプリミティブを分割処理行う分割部、前記頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成する除算部を有するクリップテスト処理装置と、
前記スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置
とを備えることを特徴とするクリッピング処理装置。
A coordinate conversion device that converts object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system;
A vertex buffer unit that stores the vertex information; a clip test processing unit that performs a clip test on the clip plane based on the vertex information; a division unit that performs a division process on a primitive determined to be required to be divided by the clip test; A clip test processing device having a division unit for performing perspective transformation processing on information and creating screen coordinate system vertex information;
A clipping processing device comprising: a rasterizer device for assembling a new primitive based on the screen coordinate system vertex information.
前記頂点情報が、頂点及び頂点座標、前記分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数及びテクスチャ座標の少なくとも1つを含む情報であることを特徴とする請求項1に記載のクリッピング処理装置。The vertex information is information including at least one of a vertex and a vertex coordinate, a divided vertex and a vertex coordinate after the division process, a normal line, a color, an α value, a fog coefficient, and a texture coordinate associated with each vertex. The clipping processing device according to claim 1, wherein 前記分割部が、
頂点情報を用いて線分比を生成する線分比生成部と、
前記線分比を用いてクリップ面における頂点座標を生成する分割頂点座標生成部
とを備えることを特徴とする請求項1又は2に記載のクリッピング処理装置。
The dividing unit is:
A line segment ratio generation unit that generates a line segment ratio using the vertex information,
The clipping processing device according to claim 1, further comprising: a division vertex coordinate generation unit configured to generate vertex coordinates on a clip plane using the line segment ratio.
前記分割部が、
前記クリップ面とプリミティブを構成する線分との交点に対する分割係数を算出する分割係数算出部と、
前記分割係数を基に頂点座標を算出し、前記頂点座標毎に対応する前記頂点情報を基に線形補間処理を行う線形補間部
とを備えることを特徴とする請求項1乃至3のいずれか1項に記載のクリッッピング処理装置。
The dividing unit is:
A division coefficient calculation unit that calculates a division coefficient for an intersection between the clip plane and a line segment that forms a primitive,
4. A linear interpolator that calculates vertex coordinates based on the division coefficient and performs a linear interpolation process based on the vertex information corresponding to each of the vertex coordinates. A clipping processing device according to the item.
頂点の整列、線分を構成する頂点の選択及び頂点の入出力を含む命令を前記頂点バッファ部に対して行うインデックス部を更に備え、
前記クリップテスト処理部が、線分単位でクリップ面に対するクリップテストを行うことを特徴とする請求項1乃至4のいずれか1項に記載のクリッピング処理装置。
Vertex alignment, further comprising an index unit for performing an instruction to the vertex buffer unit including a selection of vertices constituting a line segment and input and output of vertices,
The clipping processing device according to claim 1, wherein the clip test processing unit performs a clip test on a clip plane in units of line segments.
同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換光源計算部、Z面に対してクリップテストを行うZ面クリップテスト部、前記クリップテストにより分割処理が必要と判断されたZクリップ面の補間係数を算出するZクリップ面補間係数算出部、前記クリップテストにより分割処理が不要と判断されたZ面に対し透視変換係数を算出する透視変換係数算出部を有する座標変換光源計算装置と、
前記頂点情報を記憶する頂点バッファ部、Z面以外のクリップ面において前記頂点情報を基にクリップテストを行うクリップテスト処理部、前記クリップテストにて分割が必要と判断されたプリミティブに分割処理行う分割部、前記頂点情報に対し透視変換処理を行いスクリーン座標系頂点情報を作成する除算部を有するクリップテスト処理装置と、
前記スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置
とを備えることを特徴とするグラフィックスシステム。
A coordinate conversion light source calculation unit that converts object information represented by homogeneous coordinates into vertex information in the viewpoint coordinate system, a Z plane clip test unit that performs a clip test on the Z plane, and a division process is required by the clip test. A coordinate having a Z-clip plane interpolation coefficient calculation unit for calculating an interpolation coefficient of the determined Z-clip plane, and a perspective conversion coefficient calculation unit for calculating a perspective conversion coefficient for the Z-plane determined to be unnecessary to be divided by the clip test. Conversion light source calculation device,
A vertex buffer unit that stores the vertex information; a clip test processing unit that performs a clip test on the clip plane other than the Z plane based on the vertex information; and a division that performs a division process on the primitive that is determined to be necessary in the clip test. Unit, a clip test processing device having a division unit that performs perspective transformation processing on the vertex information to create screen coordinate system vertex information,
A graphics system, comprising: a rasterizer device that assembles new primitives based on the screen coordinate system vertex information.
前記頂点情報が、頂点及び頂点座標、前記分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数及びテクスチャ座標の少なくとも1つを含む情報であることを特徴とする請求項6に記載のグラフィックスシステム。The vertex information is information including at least one of a vertex and a vertex coordinate, a divided vertex and a vertex coordinate after the division process, a normal line, a color, an α value, a fog coefficient, and a texture coordinate associated with each vertex. The graphics system according to claim 6, characterized in that: 前記分割部が、
前記クリップ面とプリミティブを構成する線分との交点に対する補間係数を算出する補間係数算出部と、
前記補間係数を基に頂点座標を算出し、前記頂点座標毎に対応する前記頂点情報を基に線形の補間処理を行う線形補間部
とを備えることを特徴とする請求項6又は7に記載のグラフィックスシステム。
The dividing unit is:
An interpolation coefficient calculation unit that calculates an interpolation coefficient for an intersection between the clip plane and a line segment that forms a primitive,
8. The linear interpolation unit according to claim 6, further comprising: a linear interpolation unit that calculates vertex coordinates based on the interpolation coefficient and performs a linear interpolation process based on the vertex information corresponding to each of the vertex coordinates. Graphics system.
前記補間係数算出部の補間係数を算出する処理と、前記線形補間部の線形補間処理が並列的且つ同一サイクルにて動作することを特徴とする請求項6乃至8のいずれか1項に記載のグラフィックスシステム。9. The method according to claim 6, wherein a process of calculating an interpolation coefficient of the interpolation coefficient calculation unit and a linear interpolation process of the linear interpolation unit operate in parallel and in the same cycle. 10. Graphics system. 同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換する座標変換装置と、
クリップ面と前記頂点情報との比較及び前記クリップ面とガードバンド領域との比較を行い、その結果に応じて判定ビットを出力する比較部、予め設定されたビットマスク情報を保持するレジスタ部、前記判定ビット及び前記ビットマスク情報よりマスクの論理和を算出し、描画対象、非描画対象及び分割対象のいずれか1つの判定を行う論理和算出部を有する比較装置と、
前記頂点情報を記憶する頂点バッファ部と、
前記頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成する除算部と、
前記スクリーン座標系頂点情報を基に新しくプリミティブを組み上げるラスタライザ装置
とを備えることを特徴とするグラフィックスシステム。
A coordinate conversion device that converts object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system;
A comparing unit that compares a clip plane with the vertex information and a comparison between the clip plane and the guard band area, and outputs a determination bit according to the result; a register unit that holds preset bit mask information; A comparison device that calculates a logical sum of a mask from a determination bit and the bit mask information, and includes a logical sum calculation unit that determines one of a drawing target, a non-drawing target, and a division target;
A vertex buffer unit for storing the vertex information;
A division unit that performs a perspective transformation process on the vertex information and creates screen coordinate system vertex information,
A graphics system, comprising: a rasterizer device that assembles new primitives based on the screen coordinate system vertex information.
前記頂点情報が、頂点及び頂点座標、前記分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数、テクスチャ座標及び前記判定ビットの少なくとも1つを含む情報であることを特徴とする請求項10に記載のグラフィックスシステム。Information that the vertex information includes at least one of a vertex and vertex coordinates, a divided vertex and vertex coordinates after the division process, a normal line, a color, an α value, a fog coefficient, a texture coordinate, and the determination bit attached to each vertex. The graphics system according to claim 10, wherein: 3次元コンピュータグラフィックスの頂点分割処理を伴う画像処理方法において、
同次座標で表されるオブジェクト情報を、視点座標系での頂点情報に変換するステップと、
前記頂点情報を記憶するステップと、
クリップ面において前記頂点情報を基にクリップテストを行うステップと、
前記クリップテストにて分割が必要と判断されたプリミティブに対し、分割処理を行うステップと、
前記頂点情報に対し透視変換処理を行い、スクリーン座標系頂点情報を作成するステップ
とを備えることを特徴とするコンピュータによる画像のクリッピング処理方法。
In an image processing method involving vertex division processing of three-dimensional computer graphics,
Converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system;
Storing the vertex information;
Performing a clip test on the clip plane based on the vertex information;
Performing a dividing process on the primitive determined to be necessary in the clip test,
Performing a perspective transformation process on the vertex information to create screen coordinate system vertex information.
前記頂点情報が、頂点及び頂点座標、前記分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数及びテクスチャ座標の少なくとも1つを含む情報であることを特徴とする請求項12に記載のコンピュータによる画像のクリッピング処理方法。The vertex information is information including at least one of a vertex and a vertex coordinate, a divided vertex and a vertex coordinate after the division process, a normal line, a color, an α value, a fog coefficient, and a texture coordinate associated with each vertex. 13. The method according to claim 12, wherein the image is clipped. 前記分割処理を行うステップが、
頂点情報を用いて線分比を生成するステップと、
前記線分比を用いて、クリップ面における頂点座標を生成するステップ
とを備えることを特徴とする請求項12又は13に記載のコンピュータによる画像のクリッピング処理方法。
Performing the dividing process,
Generating a line segment ratio using the vertex information;
14. The method according to claim 12, further comprising: generating vertex coordinates on a clip plane using the line segment ratio.
前記分割処理を行うステップが、
前記クリップ面とビューポート線分との交点に対する分割係数を算出するステップと、
前記分割係数を基に線形補間部頂点座標を算出し、更に前記頂点座標毎に対応する前記頂点情報を基に線形補間処理を行うステップ
とを備えることを特徴とする請求項12乃至14のいずれか1項に記載のコンピュータによる画像のクリッピング処理方法。
Performing the dividing process,
Calculating a division coefficient for an intersection between the clip plane and the viewport line segment;
The method according to any one of claims 12 to 14, further comprising: calculating a vertex coordinate of the linear interpolation unit based on the division coefficient, and performing a linear interpolation process based on the vertex information corresponding to each vertex coordinate. 2. The image clipping processing method by the computer according to claim 1.
頂点の整列、線分を構成する頂点の選択及び頂点の入出力に対して命令するステップを有し、
前記クリップテストを行うステップが、前記命令するステップを用い、線分単位でクリップ面に対するクリップテストを行うことを特徴とする請求項12乃至15のいずれか1項に記載のコンピュータによる画像のクリッピング処理方法。
Commanding vertex alignment, selection of vertices constituting a line segment, and input / output of vertices,
The image clipping process according to any one of claims 12 to 15, wherein the step of performing the clip test performs a clip test on a clip plane in units of line segments using the commanding step. Method.
3次元コンピュータグラフィックスの頂点分割処理を伴う画像処理方法において、
同次座標で表されるオブジェクト情報を視点座標系での頂点情報に変換するステップと、
Z面に対してクリップテストを行うステップと、
前記クリップテストにより分割処理が必要と判断されたZクリップ面の補間係数を算出するステップと、
前記クリップテストにより分割処理が不要と判断されたZ面に対し透視変換係数を算出するステップと、
前記頂点情報を記憶するステップと、
Z面以外のクリップ面において前記頂点情報を基にクリップテストを行うステップと、
前記クリップテストにて分割が必要と判断されたプリミティブに分割処理を行うステップと、
前記頂点情報に対し透視変換処理を行いスクリーン座標系頂点情報を作成するステップ
とを備えることを特徴とするコンピュータによる画像のグラフィックス方法。
In an image processing method involving vertex division processing of three-dimensional computer graphics,
Converting object information represented by homogeneous coordinates into vertex information in a viewpoint coordinate system;
Performing a clip test on the Z plane;
Calculating an interpolation coefficient of the Z-clip plane determined to require the dividing process by the clip test;
Calculating a perspective transformation coefficient for the Z plane determined to be unnecessary to be divided by the clip test;
Storing the vertex information;
Performing a clip test on the clip plane other than the Z plane based on the vertex information;
Performing a dividing process on the primitive determined to be necessary in the clip test,
Generating a screen coordinate system vertex information by performing a perspective transformation process on the vertex information.
前記頂点情報が、頂点及び頂点座標、前記分割処理後の分割頂点及び頂点座標、各頂点に付随する法線、色、α値、フォグ係数、テクスチャ座標及び透視変換係数の少なくとも1つを含む情報であることを特徴とする請求項17に記載のグラフィックス方法。The vertex information includes at least one of a vertex and a vertex coordinate, a divided vertex and a vertex coordinate after the division process, a normal line, a color, an α value, a fog coefficient, a texture coordinate, and a perspective transformation coefficient attached to each vertex. 18. The graphics method according to claim 17, wherein 前記分割処理を行うステップが、
前記クリップ面とビューポート線分との交点に対する補間係数を算出するステップと、
前記補間係数を基に頂点座標を算出し、前記頂点座標毎に対応する前記頂点情報を基に線形の補間処理を行うステップ
とを備えることを特徴とする請求項17又は18に記載のグラフィックス方法。
Performing the dividing process,
Calculating an interpolation coefficient for an intersection between the clip plane and a viewport line segment;
19. The graphics according to claim 17, further comprising: calculating vertex coordinates based on the interpolation coefficients, and performing a linear interpolation process based on the vertex information corresponding to each of the vertex coordinates. Method.
前記補間係数を算出するステップと、前記線形の補間処理を行うステップが並列的且つ同一サイクルにて行われることを特徴とする請求項17乃至19のいずれか1項に記載のグラフィックス方法。20. The graphics method according to claim 17, wherein the step of calculating the interpolation coefficient and the step of performing the linear interpolation processing are performed in parallel and in the same cycle. 3次元コンピュータグラフィックスの頂点分割処理を伴う画像処理方法において、
同次座標系で表されるオブジェクト情報を視点座標系での頂点情報に変換するステップと、
クリップ面と前記頂点情報との比較及び前記クリップ面とガードバンド領域との比較を行い、その結果に応じて判定ビットを出力するステップと、
予めレジスタ部に設定されたビットマスク情報及び前記判定ビットより、マスクの論理和を算出し、描画対象、非描画対象及び分割対象のいずれか1つであるとの判定を行うステップと、
前記論理和を含む頂点情報を記憶するステップと、
前記頂点情報に対し透視変換処理を行いスクリーン座標系頂点情報を作成するステップ
とを備えることを特徴とするコンピュータによる画像のグラフィックス方法。
In an image processing method involving vertex division processing of three-dimensional computer graphics,
Converting object information represented by a homogeneous coordinate system into vertex information in a viewpoint coordinate system;
Performing a comparison between a clip plane and the vertex information and a comparison between the clip plane and the guard band area, and outputting a determination bit according to the result;
Calculating the logical sum of the mask from the bit mask information previously set in the register unit and the determination bit, and determining that the target is a drawing target, a non-drawing target, or a division target;
Storing vertex information including the logical sum;
Generating a screen coordinate system vertex information by performing a perspective transformation process on the vertex information.
JP2002266134A 2002-09-11 2002-09-11 Clipping processing device, graphics system, clipping processing method, and the graphics method Pending JP2004102841A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002266134A JP2004102841A (en) 2002-09-11 2002-09-11 Clipping processing device, graphics system, clipping processing method, and the graphics method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002266134A JP2004102841A (en) 2002-09-11 2002-09-11 Clipping processing device, graphics system, clipping processing method, and the graphics method

Publications (1)

Publication Number Publication Date
JP2004102841A true JP2004102841A (en) 2004-04-02

Family

ID=32265035

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002266134A Pending JP2004102841A (en) 2002-09-11 2002-09-11 Clipping processing device, graphics system, clipping processing method, and the graphics method

Country Status (1)

Country Link
JP (1) JP2004102841A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008181514A (en) * 2007-01-24 2008-08-07 Vivante Corp Method for distributed clipping outside of view volume
WO2008126392A1 (en) * 2007-04-11 2008-10-23 Panasonic Corporation Image generating apparatus and image generating method
JP2010507875A (en) * 2006-10-23 2010-03-11 クゥアルコム・インコーポレイテッド 3D clipping in graphics processing unit
JP2010198144A (en) * 2009-02-23 2010-09-09 Fujitsu Semiconductor Ltd Image drawing device
JP2012528410A (en) * 2009-05-29 2012-11-12 クゥアルコム・インコーポレイテッド Graphics processing unit using delayed vertex shading
CN109727184A (en) * 2018-12-12 2019-05-07 中国航空工业集团公司西安航空计算技术研究所 A kind of graphics processor three-dimensional cuts out circuit

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010507875A (en) * 2006-10-23 2010-03-11 クゥアルコム・インコーポレイテッド 3D clipping in graphics processing unit
US8212840B2 (en) 2006-10-23 2012-07-03 Qualcomm Incorporated 3-D clipping in a graphics processing unit
US8773459B2 (en) 2006-10-23 2014-07-08 Qualcomm Incorporated 3-D clipping in a graphics processing unit
JP2008181514A (en) * 2007-01-24 2008-08-07 Vivante Corp Method for distributed clipping outside of view volume
WO2008126392A1 (en) * 2007-04-11 2008-10-23 Panasonic Corporation Image generating apparatus and image generating method
JPWO2008126392A1 (en) * 2007-04-11 2010-07-22 パナソニック株式会社 Image generating apparatus and image generating method
JP4987070B2 (en) * 2007-04-11 2012-07-25 パナソニック株式会社 Image generating apparatus and image generating method
US8823705B2 (en) 2007-04-11 2014-09-02 Panasonic Corporation Image generating apparatus and image generating method for generating images by rendering a polygon
JP2010198144A (en) * 2009-02-23 2010-09-09 Fujitsu Semiconductor Ltd Image drawing device
JP2012528410A (en) * 2009-05-29 2012-11-12 クゥアルコム・インコーポレイテッド Graphics processing unit using delayed vertex shading
CN109727184A (en) * 2018-12-12 2019-05-07 中国航空工业集团公司西安航空计算技术研究所 A kind of graphics processor three-dimensional cuts out circuit

Similar Documents

Publication Publication Date Title
US8144158B2 (en) Display system having floating point rasterization and floating point framebuffering
KR101351236B1 (en) A tessellator whose tessellation time grows linearly with the amount of tessellation
US8223149B2 (en) Cone-culled soft shadows
US7126600B1 (en) Method and apparatus for high speed block mode triangle rendering
US8059119B2 (en) Method for detecting border tiles or border pixels of a primitive for tile-based rendering
JP6863693B2 (en) Graphics processing system and method
US7098924B2 (en) Method and programmable device for triangle interpolation in homogeneous space
US6806886B1 (en) System, method and article of manufacture for converting color data into floating point numbers in a computer graphics pipeline
EP2402910A2 (en) Seamless fracture generation in a graphic pipeline
US7400325B1 (en) Culling before setup in viewport and culling unit
US20100097388A1 (en) Graphics processing systems
US7292239B1 (en) Cull before attribute read
US8179399B2 (en) Rasterizing method
JP2004102841A (en) Clipping processing device, graphics system, clipping processing method, and the graphics method
US20230082839A1 (en) Rendering scalable raster content
US7196706B2 (en) Method and apparatus for rendering a quadrangle primitive
JP3587105B2 (en) Graphic data processing device
US7414635B1 (en) Optimized primitive filler
US11776179B2 (en) Rendering scalable multicolored vector content
US7532751B2 (en) Apparatus and computer readable medium for setting up multi-dimensional DDA variables
CN116342778A (en) Hybrid rasterization apparatus and method
JPH02132572A (en) Picture display device
KR0164160B1 (en) A graphic processor
CN103593875A (en) Three-dimensional clipping in a graphic processing unit
Santina Resolution independent nurbs curves rendering using programmable graphics pipeline