JP4325038B2 - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP4325038B2 JP4325038B2 JP29891899A JP29891899A JP4325038B2 JP 4325038 B2 JP4325038 B2 JP 4325038B2 JP 29891899 A JP29891899 A JP 29891899A JP 29891899 A JP29891899 A JP 29891899A JP 4325038 B2 JP4325038 B2 JP 4325038B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- circuit
- texture
- processing
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明は、小規模な構成で高画質な画像を提供できる画像処理装置に関する。
【0002】
【従来の技術】
種々のCAD(Computer Aided Design) システムや、アミューズメント装置などにおいて、コンピュータグラフィックスがしばしば用いられている。特に、近年の画像処理技術の進展に伴い、3次元コンピュータグラフィックスを用いたシステムが急速に普及している。
このような3次元コンピュータグラフィックスでは、各画素(ピクセル)に対応する色を決定するときに、各画素の色の値を計算し、この計算した色の値を、当該画素に対応するディスプレイバッファ(フレームバッファ)のアドレスに書き込むレンダリング(Rendering) 処理を行う。
レンダリング処理の手法の一つに、ポリゴン(Polygon)レンダリングがある。この手法では、立体モデルを三角形の単位図形(ポリゴン)の組み合わせとして表現しておき、このポリゴンを単位として描画を行なうことで、表示画面の色を決定する。
【0003】
ポリゴンレンダリングでは、物理座標系における三角形の各頂点についての、座標(x,y,z)と、色データ(R,G,B)と、張り合わせのイメージパターンを示すテクスチャデータの同次座標(s,t)および同次項qの値とを三角形の内部で補間する処理が行われる。
ここで、同次項qは、簡単にいうと、拡大縮小率のようなもので、実際のテクスチャバッファのUV座標系における座標、すなわち、テクスチャ座標データ(U,V)は、同次座標(s,t)を同次項qで除算した(s/q,t/q)=(u,v)に、それぞれテクスチャサイズUSIZEおよびVSIZEを乗じた乗算結果に応じたものとなる。
【0004】
このようなポリゴンレンダリングを用いた3次元コンピュータグラフィックシステムでは、描画を行う際に、テクスチャデータをテクスチャバッファから読み出し、この読み出したテクスチャデータを、立体モデルの表面に張り付け、リアリティの高い画像データを得るテクスチャマッピング処理を行う。
なお、立体モデルについてテクスチャマッピングを行なうと、各画素毎に、張り付けを行なうテクスチャデータが示す画像の拡大縮小率が変化する。
【0005】
ところで、テクスチャマッピングを行なう際に、高画質を得る手法として、MIP(Multum In Parvo) MAP(複数解像度テクスチャ)フィルタリングがある。
このMIPMAPフィルタリングは、図22に示すように、複数の異なる縮小率のそれぞれに対応した、複数のフィルタ処理済みのテクスチャデータ200,201,202,203を予め用意し、各画素の縮小率204に対応したテクスチャデータを選択205することで、縮小率204に応じた最適なテクスチャデータ206を使用するものであり、イメージの縮小に伴う情報欠落に起因するエイリアシングの影響を抑制できる。
【0006】
以下、上述したMIPMAPフィルタリングを採用した従来の3次元コンピュータグラフィックシステムを説明する。
図23は、従来の3次元コンピュータグラフィックシステムの構成を説明するための図、図24は図23に示すテクスチャマッピング装置210における処理のフローチャートである。
図23に示すように、従来の3次元コンピュータグラフィックシステムでは、それぞれ異なる半導体チップ内に組み込まれたテクスチャマッピング装置210、テクスチャバッファ211およびディスプレイバッファ213が、配線を介して相互に接続されている。
【0007】
以下、テクスチャマッピング装置210における処理を説明する。
ステップS1:先ず、テクスチャマッピング装置210は、三角形の各頂点についての同次座標および同次項を示す(s1,t1,q1),(s2,t2,q2),(s3,t3,q3)データを入力する。
ステップS2:次に、テクスチャマッピング装置210は、入力した各頂点の(s1,t1,q1),(s2,t2,q2),(s3,t3,q3)データを線形補間して、三角形の内部の各画素の同次座標および同次項を示す(s,t,q)データを求める。
【0008】
ステップS3:テクスチャマッピング装置210は、内蔵した縮小率算出装置212において、三角形の内部の各画素の(s,t,q)データから、各画素の縮小率lodを求める。
ステップS4:テクスチャマッピング装置210は、各画素の(s,t,q)データについて、sデータをqデータで除算したuデータと、tデータをqデータで除算したvデータとを算出し、テクスチャ座標データ(u,v)を求める。
次に、テクスチャマッピング装置210は、縮小率算出装置212で算出した縮小率lodと、テクスチャ座標データ(u,v)とから、テクスチャバッファ211における物理アドレスであるテクスチャアドレス(U,V)を求める。
【0009】
ステップS5:テクスチャマッピング装置210は、テクスチャアドレス(U,V)をテクスチャバッファ211に出力し、テクスチャデータ(R,G,B)を読み出す。
ステップS6:テクスチャマッピング装置210は、ステップS5で読み出しテクスチャデータに所定の処理を施した画素データS210をディスプレイバッファ213に書き込む。
これにより、テクスチャバッファ211に記憶されている、複数の異なる縮小率のそれぞれに対応した複数のテクスチャデータのうち、縮小率lodに対応したテクスチャデータについてのアクセスが実現される。
【0010】
また、高速な描画を実現するために、複数の画素について並行してテクスチャマッピング処理を行い、それらの画素データをディスプレイバッファに同時に書き込む高速テクスチャマッピング装置がある。
このような高速テクスチャマッピング装置では、図25に示すように、三角形の頂点についての(s1,t1,q1),(s2,t2,q2),(s3,t3,q3)データを、n個のテクスチャマッピング装置2101 〜210n で並行して処理し、その処理結果である画素データS2101 〜S210n をディスプレイバッファに同時に書き込む。
すなわち、複数の画素についてのテクスチャマッピング処理が並行して(同時に)行なわれる。
【0011】
なお、テクスチャマッピング処理は、単位図形である三角形を単位として行なわれ、テクスチャデータの縮小率などの処理条件が三角形を単位として決定され、同時に処理が行なわれる複数の画素のうち、当該三角形の内側に位置する画素についての処理結果のみが有効とされ、当該三角形の外側に位置する画素についての処理結果は無効とされる。
【0012】
【発明が解決しようとする課題】
しかしながら、上述した従来の3次元コンピュータグラフィックシステムでは、テクスチャマッピング装置210と、テクスチャバッファ211およびディスプレイバッファ213との間のデータ転送速度が、システム全体の処理能力を高める上でのボトルネックになっていた。
【0013】
また、上述した従来の3次元コンピュータグラフィックシステムでは、テクスチャマッピング装置210、テクスチャバッファ211およびディスプレイバッファ213が異なる半導体チップ内に組み込まれているため、システムが大規模化するという問題がある。
【0014】
また、縮小率lodを求める演算には、多数の乗算および除算が含まれており、膨大な演算量を要する。
従って、図25に示すように、n個のテクスチャマッピング装置2101 〜210n の各々に、縮小率算出装置2121 〜212n を内蔵すると、高速処理は実現できるが、装置が大規模化していまうという問題がある。
このような問題を解決するために、並行して処理を行なう複数のテクスチャマッピング装置のうち、一のテクスチャマッピング装置にのみ縮小率算出装置を内蔵し、当該テクスチャマッピン装置の処理対象となる画素を縮小率を求める上での代表点とし、当該縮小率算出装置で求められた縮小率を、全てのテクスチャマッピング装置で用いる方法が考えられる。
この場合には、同時に処理を行なう複数の画素のうち、代表点となる画素の位置が固定となる。
従って、同時に処理が行なわれる複数の画素のうちに、前述した単位図形である三角形の外側に位置する画素が代表点となる可能性がある。
しかしながら、当該三角形の内側と外側とでは、縮小率が大きく異なることがあり、処理対象となっている三角形の外側に位置する画素が代表点となると、当該三角形の内側に位置する画素について、最適なテクスチャデータを選択できない。その結果、画質が大きく低下するという問題がある。
【0015】
本発明は上述した従来技術の問題点に鑑みてなされ、小規模な装置構成で、高画質を安定して提供できる画像処理装置を提供することを目的とする。
【0016】
【課題を解決するための手段】
本発明によれば、共通の処理条件が適用される複数の画素からなる単位図形を組み合わせて表示モデルを表現し、必要に応じてテクスチャデータを用いて前記画素に対応する画素データを生成する画像処理装置において、
前記表示モデルは立体モデルであり、
前記単位図形が三角形であり、
表示データと、同一のパターンについて相互に異なる縮小率に対応した複数のテクスチャデータとを記憶する記憶回路と、
同時に処理を行おうとする複数の画素データに対して共通して用いられる縮小率を算出する縮小率算出回路と、
前記算出された縮小率に対応する前記テクスチャデータを前記記憶回路から読み出す読み出し回路と、
前記読み出されたテクスチャデータを用いて前記複数の画素データの処理を同時に行って表示データを生成する画像処理回路と、
前記生成された表示データを前記記憶回路に書き込む書き込み回路と、
前記同時に処理を行おうとする複数の画素データに対応する画素のうち、処理対象となっている前記単位図形の内側に位置する画素のなかから代表点となる画素を決定する代表点決定回路と
を有し、
前記縮小率算出回路は、下記式に基づいて前記縮小率を示すLODを実質的に算出するため、
LOD=Clamp(((log 2 1/q)+maxe)
<<L+K)
ここで、
LODは、整数部と少数部とで構成され、符号なしの縮小率を示す記号であり、
Clampは、下記のクランプ回路においてクランプすることを示す記号であり、
qは、前記同次項を示す記号であり、
maxeは、前記処理対象となっている前記単位図形の頂点の同次座標(s,t)および同次項qの最大指数を示す整数部のみからなるデータであり、
<<Lは、下記のシフト回路においてデータをLビットシフトすることを示すものであり、
Kは、整数部と少数部とで構成され、符号有りで、下記の加算回路において加算に使用するデータであり、
前記同次項データqを正規化して指数qeおよび仮数qmを生成する正規化回路と、
前記指数qeと前記仮数qmとをビット結合したデータを、前記データLが示す値だけMSB(Most Significant Bit)に向けてシフトする第1のシフト回路と、
前記第1のシフト回路の出力を反転する第1の反転回路と、
前記仮数qmを入力して、「log 2 ({1,qm})−qm」を示すデータμを出力するデータ出力手段と、
前記データmaxeと前記データμとをビット結合したデータを、前記データLが示す値だけMSBに向けてシフトする第2のシフト回路と、
前記第2のシフト回路の出力を反転する第2の反転回路と、
前記データKと2進数の「10」とをビット結合したデータと、前記第1の反転回路の出力と、前記第2の反転回路の出力とを加算する加算回路と、
前記加算回路の出力を所定ビット内にクランプ処理して前記縮小率LODを生成するクランプ回路と
を有し、
前記読み出し回路は、前記同時に処理が行われる複数の画素データの各々について、前記決定された縮小率、前記同次座標(s,t)および同次項qによって特定されるテクスチャデータを前記記憶回路から読み出す、
画像処理装置が提供される。
【0038】
【発明の実施の形態】
以下、本実施形態においては、家庭用ゲーム機などに適用される、任意の3次元物体モデルに対する所望の3次元画像をCRT(Cathode Ray Tube)などのディスプレイ上に高速に表示する3次元コンピュータグラフィックシステムに、本発明の画像処理装置を適用した場合について説明する。
図1は、本実施形態の3次元コンピュータグラフィックシステム1のシステム構成図である。
3次元コンピュータグラフィックシステム1は、立体モデルを単位図形である三角形(ポリゴン)の組み合わせとして表現し、このポリゴンを描画することで表示画面の各画素の色を決定し、ディスプレイに表示するポリゴンレンダリング処理を行うシステムである。
また、3次元コンピュータグラフィックシステム1では、平面上の位置を表現する(x,y)座標の他に、奥行きを表すz座標を用いて3次元物体を表し、この(x,y,z)の3つの座標で3次元空間の任意の一点を特定する。
【0039】
図1に示すように、3次元コンピュータグラフィックシステム1は、メインメモリ2、I/Oインタフェース回路3、メインプロセッサ4およびレンダリング回路5が、メインバス6を介して接続されている。
ここで、レンダリング回路5が、本発明の画像処理装置に対応している。
以下、各構成要素の機能について説明する。
メインプロセッサ4は、例えば、ゲームの進行状況などに応じて、メインメモリ2から必要なグラフィックデータを読み出し、このグラフィックデータに対してクリッピング(Clipping)処理、ライティング(Lighting)処理およびジオメトリ(Geometry)処理などを行い、ポリゴンレンダリングデータを生成する。メインプロセッサ4は、ポリゴンレンダリングデータS4を、メインバス6を介してレンダリング回路5に出力する。
I/Oインタフェース回路3は、必要に応じて、外部からポリゴンレンダリングデータを入力し、これをメインバス6を介してレンダリング回路5に出力する。
【0040】
ここで、ポリゴンレンダリングデータは、ポリゴンの各3頂点の(x,y,z,R,G,B,COEblend ,s,t,q,COEfog )のデータを含んでいる。
ここで、(x,y,z)データは、ポリゴンの頂点の3次元座標を示し、(R,G,B)データは、それそれ当該3次元座標における赤、緑、青の輝度値を示している。
データCOEblend は、これから描画する画素と、ディスプレイバッファ21に既に記憶されている画素とのR,G,Bデータのブレンド(混合)係数を示している。
(s,t,q)データのうち、(s,t)は、対応するテクスチャの同次座標を示しており、qは同次項を示している。ここで、「s/q」および「t/q」に、それぞれテクスチャサイズUSIZEおよびVSIZEを乗じてテクスチャ座標データ(u,v)が得られる。テクスチャバッファ20に記憶されたテクスチャデータへのアクセスは、テクスチャ座標データ(u,v)を用いて行われる。
データCOEfog は、フォギング処理において用いられる混合係数を示している。
【0041】
以下、レンダリング回路5について詳細に説明する。
図1に示すように、レンダリング回路5は、DDA(Digital Differential Anarizer) セットアップ回路10、トライアングルDDA回路11、テクスチャエンジン回路12、メモリI/F回路13、CRTコントローラ回路14、RAMDAC回路15、DRAM16、SRAM17およびクロック信号生成回路18を有し、これらが一つの半導体チップ内に混載されている。
ここで、テクスチャエンジン回路12およびDRAM16によって、本発明の画像処理装置が構成される。DRAM16が本発明の記憶回路に対応している。レンダリング回路5では、上述したように、各構成要素を一つの半導体チップ内に混載することで、各構成要素間でのデータ伝送の高速化による高性能化、並びに回路規模の縮小化を図れる。
【0042】
DRAM16は、テクスチャバッファ20、ディスプレイバッファ21、zバッファ22およびテクスチャCLUTバッファ23として機能する。
また、クロック信号生成回路18からのクロック信号S18は、レンダリング回路5内の各構成要素を駆動する信号として用いられる。
【0043】
DRAM16
DRAM16は、テクスチャデータを記憶するテクスチャバッファ20、CRTに出力してディスプレイに表示する表示データを記憶するディスプレイバッファ21、zデータを記憶するzバッファ22およびカラールックアップデータを記憶するテクスチャCLUTバッファ23として機能する。
【0044】
DDAセットアップ回路10
DDAセットアップ回路10は、後段のトライアングルDDA回路11において物理座標系上の三角形の各頂点の値を線形補間して、三角形の内部の各画素の色と深さ情報を求めるに先立ち、ポリゴンレンダリングデータS4が示す(z,R,G,B,COEblend ,s,t,q,COEfog )データについて、三角形の辺と水平方向の差分などを求めるセットアップ演算を行う。
このセットアップ演算は、具体的には、開始点の値と終点の値と、開始点と終点との距離を用いて、単位長さ移動した場合における、求めようとしている値の変分を算出する。
【0045】
すなわち、DDAセットアップ回路10は、各画素について、(s,t,q)データのx方向の変分であるdsdx,dtdx,dqdxと、y方向の変分であるdsdy,dtdy,dqdyとを生成する。
DDAセットアップ回路10は、算出した変分データS10をトライアングルDDA回路11に出力する。
【0046】
トライアングルDDA回路11
トライアングルDDA回路11は、DDAセットアップ回路10から入力した変分データS10を用いて、三角形内部の各画素における線形補間された(z,R,G,B,COEblend ,s,t,q,COEfog )データを算出する。
また、トライアングルDDA回路11は、並行して処理を行う8画素について、処理対象となる三角形の内部に位置するか否かを示すそれぞれ1ビットの有効ビットデータI1 〜I8 を生成する。
有効ビットデータI1 〜I8 は、例えば、三角形の内部に位置する画素について「1」とし、三角形の外部に位置する画素について「0」とする。
具体的には、図2に示すように、x,y座標系に位置する三角形250について有効ビットデータI1 〜I8 が決定される。
なお、図2において、実線は、同時に処理が行なわれる8(=2×4)画素が属する矩形領域を示している。
トライアングルDDA回路11は、各画素の(x,y)データと、当該(x,y)座標における(z,R,G,B,COEblend ,s,t,q,COEfog )データと、有効ビットデータI1 〜I8 と、処理対象となる三角形の頂点のs,t,qデータの最大指数を示すmaxeデータS11cとを、DDAデータS11としてテクスチャエンジン回路12に出力する。
ここで、後述する図4に示す(R,G,B)データS11bおよび(s,t,q)データS11a1 〜S11a8 が、(z,R,G,B,COEblend ,s,t,q,COEfog )データから得られる。
本実施形態では、トライアングルDDA回路11は、並行して処理を行う矩形内に位置する8(=2×4)画素分を単位として、DDAデータS11をテクスチャエンジン回路12に出力する。
【0047】
テクスチャエンジン回路12
テクスチャエンジン回路12は、テクスチャデータの縮小率の選択処理、「s/q」および「t/q」の算出処理、テクスチャ座標データ(u,v)の算出処理、テクスチャアドレス(U,V)の算出処理、テクスチャバッファ20からの(R,G,B,tα)データの読み出し処理、MIPMAP処理、および、テクスチャファンクション処理を順に、例えばパイプライン方式で行う。
なお、テクスチャエンジン回路12は、所定の矩形領域内に位置する8画素についての処理を同時に並行して行う。
また、テクスチャエンジン回路12は、処理対象の三角形内に位置する画素については同じパターンのテクスチャデータを用いる。但し、選択するテクスチャデータの縮小率は、同時に処理を行う矩形領域内に位置する8画素を単位として決定する。
【0048】
テクスチャエンジン回路12は、SRAM17あるいはテクスチャバッファ20から読み出した(R,G,B)データS17を用いて、MIPMAP(複数解像度テクスチャ)処理やテクスチャファンクション処理を行う。
【0049】
MIPMAP処理では、(R,G,B)データS17から2次元上の所望の位置の画素の(R,G,B)データを算出する4点近傍補間処理と、縮小率LOD(Level Of Detail) のレベルを補間するレベル補間処理とが行われる。
SRAM17およびテクスチャバッファ20には、例えば、図3に示すように、MIPMAPに基づいた複数の縮小率に対応したテクスチャデータ、すなわち、縮小率1.0のレベルのテクスチャデータ100と、縮小率LODが2.0のレベルのテクスチャデータ101と、縮小率LODが3.0のレベルのテクスチャデータ102とが記憶されている。
そして、何れの縮小率LODのテクスチャデータを用いるかは、所定のアルゴリズムを用いて前記ポリゴン単位で算出された縮小率LODを用いて決定される。
なお、テクスチャデータ100,101,102は、既にフィルタリング処理が施され、イメージの縮小などに伴う情報欠落に起因するエイリアシングの影響が抑制された表示パターンを示すデータである。
【0050】
先ず、テクスチャエンジン回路12で行われるMIPMAP処理の4点近傍補間処理について説明する。
4点近傍補間処理では、テクスチャデータを割り当てる画素の座標から、当該座標の4近傍の点の(R,G,B)データを求める。
例えば、縮小率LODが1.0の場合には、SRAM17あるいはテクスチャバッファ20からテクスチャエンジン回路12に、図3に示すテクスチャデータ100の(R,G,B)データS17が読み出される。
そして、図3に示す位置pixel0の(R,G,B)データである4点近傍補間データCpixel0を、当該位置pixel0の4近傍点A0,B0,C0,D0の(R,G,B)データCA0,CB0,CC0,CD0を用いて、下記式(3)〜(5)に基づいて求める。
このとき、(R,G,B)データCA0,CB0,CC0,CD0は、テクスチャデータ100の(R,G,B)データS17から得られる。
なお、下記式(3)〜(5)において、a,bは、それぞれ位置pixel0のu座標,v座標の小数部を示している。
【0051】
【数3】
CAB0 =CB0×a+CA0×(1−a) …(3)
【0052】
【数4】
CCD0 =CD0×a+CC0×(1−a) …(4)
【0053】
【数5】
Cpixel0=CCD0 ×b+CAB0 ×(1−b) …(5)
【0054】
次に、縮小率のレベル補間処理について説明する。
ここでは、tri−linearと呼ばれるレベル補間処理を例示して説明する。
例えば、縮小率LODが1.5である場合には、テクスチャエンジン回路12は、上述したように、縮小率LODが1.0のテクスチャデータ100を用いて位置pixel0の4点近傍補間データCpixel0を算出すると共に、縮小率LODが2.0のテクスチャデータ101を用いて、テクスチャデータ100上の位置pixel0に対応したテクスチャデータ101上の位置pixel1の4点近傍補間データCpixel1を算出する。次に、4点近傍補間データCpixel0とCpixel1とを線形補間して、縮小率LODが1.5のレベル補間データCpixel を算出する。
【0055】
すなわち、前述した4点近傍補間データCpixel0の算出処理に続いて、SRAM17あるいはテクスチャバッファ20からテクスチャエンジン回路12に、図3に示すテクスチャデータ101の(R,G,B)データS17が読み出される。
そして、テクスチャエンジン回路12は、図3における位置pixel1の(R,G,B)データである4点近傍補間データCpixel1を、当該位置pixel1の4近傍点A1,B1,C1,D1の(R,G,B)データCA1,CB1,CC1,CD1を用いて、下記式(6)〜(8)に基づいて求める。
このとき、(R,G,B)データCA1,CB1,CC1,CD1は、テクスチャデータ101の(R,G,B)データS17から得られる。
なお、下記式(6)〜(8)において、c,dは、それぞれ位置pixel1のu,v座標の小数部を示している。
【0056】
【数6】
CAB1 =CB1×c+CA1×(1−c) …(6)
【0057】
【数7】
CCD1 =CD1×c+CC1×(1−c) …(7)
【0058】
【数8】
Cpixel1=CCD1 ×d+CAB1 ×(1−d) …(8)
【0059】
次に、テクスチャエンジン回路12は、下記式(9)を用いて、テクスチャデータ100と101との間のレベル補間を行い、レベル補間後の対応する位置(画素)の(R,G,B)データであるレベル補間データCpixel を求める。なお、下記式(9)において、ミップマップ係数COEmipmapは縮小率LODの小数部0.5を示している。
【0060】
【数9】
Cpixel =Cpixel1×COEmipmap+Cpixel0×(1−COEmipmap)
…(9)
【0061】
次に、テクスチャエンジン回路12で行われるテクスチャファンクション処理について説明する。
テクスチャエンジン回路12で行われるテクスチャファンクション処理には、例えば、モジュレート(Modulate)処理、デカル(Decal) 処理、ハイライト(Highlight) 、フォギング(Fogging) 処理、アルファブレンディング (α Blending)処理などがある。
ここで、モジュレート処理は、テクスチャデータが示す色でフラグメントデータが示す色の変調を行う処理である。
なお、本実施形態では、フラグメントデータは、トライアングルDDA回路11から入力したDDAデータS11に含まれる(R,G,B)データS11bである。
デカル処理は、テクスチャデータが示す色でフラグメントデータが示す色を置き換える処理である。
ハイライト処理は、ハイライト効果を出すために乗算結果に加算データHiを加算する処理である。
フォギング処理は、遠くの物体をぼかす効果を出す処理である。
アルファブレンディング処理は、ソースデータが示す色とディスティネーションデータが示す色とを所定の混合比で混合する処理である。
ここで、ソースデータが示す色は図1に示すディスプレイバッファ21に記憶されているデータが示す色であり、ディスティネーションデータが示す色はディスプレイバッファ21に描画しようとするデータが示す色である。
【0062】
これらのテクスチャファンクション処理は、テクスチャデータをCtex 、フラグメントデータをCflag、ハイライト処理の加算データをHiとし、モジュレート処理後のデータをCmod 、デカル処理後のデータをCdcl 、ハイライト処理後のデータをChgh とすると、下記式(10)〜(12)のように表せる。
なお、式(12)において、Hiは、ハイライト用の加算データを示している。
【0063】
【数10】
Cmod =Ctex ×Cflag …(10)
【0064】
【数11】
Cdcl =Ctex …(11)
【0065】
【数12】
Chgh =Ctex ×Cflag+Hi …(12)
【0066】
また、フォギング処理およびアルファブレンディング処理は、フラグメントデータをCflag、フォグデータをCfog 、フォグ係数データをCOEfog 、ソース(カラー)データをCsrc 、デスティネーション(カラー)データをCdst 、ブレンディング係数をCOEblend とし、フォギング処理後のデータをCfogged、ブレンディング処理後のデータをCblend とすると、以下式(13),(14)で示される。
【0067】
【数13】
Cfogged=Cflag×COEfog +Cfog ×(1−COEfog )
…(13)
【0068】
【数14】
Cblend =Csrc ×COEblend +Cdst ×(1−COEblend )
…(14)
【0069】
上述したように、式(9)〜(14)で示されるMIPMAP処理のレベル補間処理とテクスチャファンクション処理とは、データA,B,COE、CおよびDを用いた下記式(15)で表現できる。
本実施形態では、このことを利用して、後述するように、LIP回路61をレベル補間処理とテクスチャファンクション処理とで共用する。
【0070】
【数15】
D=A×COE+B(1−COE) …(15)
【0071】
図4は、テクスチャエンジン回路12の部分回路図である。
図4に示すように、テクスチャエンジン回路12は、例えば、縮小率演算回路50、読み出し回路51、LIP(Linear Inter Polator)回路52,53,54、LIP/テクスチャファンクション回路55を有する。
ここで、縮小率演算回路50が本発明の縮小率演算回路に対応し、読み出し回路51が本発明の読み出し回路に対応し、LIP回路52,53,54およびLIP/テクスチャファンクション回路55が本発明の画像処理回路に対応している。
テクスチャエンジン回路12内の各構成要素は、図1に示すクロック信号発生回路18からのクロック信号S18に基づいて動作する。
テクスチャエンジン回路12は、図4に示す構成を用いて、MIMAP処理、モジュレート処理、デカル処理、ハイライト処理、フォギング処理、テクスチャブレンディング処理およびアルファブレンディング処理などの一部あるいは全てを行う。
【0072】
以下、図4に示すテクスチャエンジン回路12の構成要素について詳細に説明する。
〔代表点決定回路301〕
代表点決定回路301は、トライアングルDDA回路11から入力した、DDAデータS11に含まれる有効ビットデータI1 〜I8 から、代表点となる画素を決定し、当該決定した代表点を示す代表点指示データS301をstq選択回路302に出力する。
具体的には、代表点決定回路301は、同時に処理される2行×4列の8画素のうち、処理対象となっている三角形の内部に位置するもののなかで、当該8画素が配置される矩形領域の中心に最も近い画素が代表点として決定する。
【0073】
図5は、代表点決定回路301における代表点決定処理のフローチャートである。
ステップS11:先ず、代表点決定回路301は、有効ビットデータI1 〜I8 に、「1」を示すものが少なくとも一つ存在するかを判断し、存在すれば、ステップS12の処理を実行する。
ステップS12:代表点決定回路301は、有効ビットデータI1 〜I8 のうち、「1」を示すものが一つであるか否かを判断し、一つである場合には、ステップS15に示す処理を実行する。ステップS15では、「1」を示す有効ビットデータに対応する画素を代表点として決定する。
【0074】
ステップS13:代表点決定回路301は、有効ビットデータI1 〜I8 に「1」を示すものが2つ以上ある場合に、「1」を示す有効ビットデータに対応する画素のうち、当該同時に処理が行なわれる画素が配置される矩形領域の中心に最も近い画素を、代表点として決定する。
このとき、当該矩形領域の中心に最も近い画素が複数ある場合には、これらのx座標が同じであるか否かが判断され、これらのx座標が異なる場合には、ステップS16に示す処理が実行される。ステップS16では、当該矩形領域の中心に最も近い複数の画素のうち、x座標が最も小さいものが、代表点として決定される。
【0075】
ステップS14:代表点決定回路301は、前記矩形領域の中心に最も近い画素が複数あり、しかも、これらのx座標が同じ場合には、これら複数の画素のうち、y座標が最も小さいものを代表点として決定する。
【0076】
以下、代表点決定回路301における代表点の決定を具体例を挙げて説明する。
図6は、代表点決定回路301における代表点の決定を説明するための図である。
有効ビットデータI1 〜I8 に対応する画素の配置を図6(A)に示すように設定する。ここで、同時に処理が実行される画素の矩形領域の中心はAである。
例えば、図6(B)に示すように、有効ビットデータI4 のみが「1」の場合には、代表点決定回路301は、有効ビットデータI4 に対応する画素を代表点として決定する。
【0077】
また、図6(C)に示すように、有効ビットデータI6 およびI7 が「1」であり、これに対応する画素のx座標が異なる場合には、x座標が小さい有効ビットデータI6 に対応する画素を代表点として決定する。
また、図6(D)に示すように、有効ビットデータI3 およびI7 が「1」であり、これに対応する画素のx座標が同じ場合には、y座標が小さい有効ビットデータI7 に対応する画素を代表点として決定する。
さらに、図6(E)に示すように、有効ビットデータI2 ,I3 ,I6 およびI7 が「1」である場合には、x座標およびy座標が最も小さい、有効ビットデータI6 に対応する画素を代表点として決定する。
【0078】
また、前述した図2に示す三角形250については8画素単位に、図5に示すアルゴリズムに基づいて、図7に示すように代表点が決定される。図7では、「1」が丸印で囲まれている画素が代表点になる。
このように、代表点決定回路301において、有効ビットデータI1 〜I8 に基づいて、同時に処理を行なう複数画素のうち処理対象となっている三角形の内側に位置する画素のなかから代表点を動的に決定するため、代表点を当該三角形の内側に確実に決定することができる。
その結果、当該三角形の内側に位置する画素について、適切なテクスチャデータを確実に選択でき、高い画質を安定して提供できる。
また、本実施形態で、8画素について同時処理を行なうが、縮小率演算回路301を1つ設ければよく、装置が大規模化することはない。
【0079】
〔qデータ選択回路302〕
qデータ選択回路302は、DDAデータS11に含まれる8画素分の(s,t,q)データS11a1 〜S11a8 を入力し、これらのうち、代表点指示データS301によって示される画素に対応するqデータを選択し、これをqデータS302として縮小率演算回路304に出力する。
【0080】
〔縮小率演算回路304〕
縮小率演算回路304は、トライアングルDDA回路11からのmaxeデータS11cと、q選択回路302からのqデータS302とに基づいて、テクスチャデータの縮小率LODを算出する。
ここで、maxeデータS11cは、例えば図2に示すような処理対象の三角形の頂点のs,t,qデータの指数のうち、最大の指数を示している。
このように、縮小率演算回路304では、代表点決定回路301において代表点として決定された画素のqデータと、maxeデータS11cとを用いて縮小率を算出し、これを縮小率LODとして読み出し回路51に出力する。
【0081】
ここで、縮小率LODは、元画像のテクスチャデータを、どの程度縮小したものであるかを示すものであり、元画像の縮小率を1/1とした場合には、1/2,1/4,1/8,・・・となる。
縮小率演算回路304における縮小率LODの演算処理は、下記式(16)で示される。
【0082】
【数16】
LOD=Clamp(((log2 1/q)−maxe)<<L+K)
…(16)
【0083】
上記式(16)において、
LOD:縮小率を示し、整数部3ビット、小数点部4ビット、符号無し(unsigned)のデータ、
maxe:図2に示す三角形の頂点のs,t,qの最大指数を示し、整数部8ビット、符号無し(unsigned)のデータ、
q:整数部10ビット、小数部5ビット、符号有り(signed)のデータ、
L:2ビット、符号無しのデータ、Lの最大値は10進数の「3」
K:整数部8ビット、小数部4ビット、符号有りのデータ
【0084】
以下、縮小率演算回路50について詳細に説明する。
図8は、縮小率演算回路50の構成図である。
図8に示すように、縮小率演算回路50は、例えば、プライオリティエンコーダ101、シフト回路102、シフト回路201,202、テーブル203、インバータ204,205、加算回路206およびクランプ回路109を有する。
ここで、プライオリティエンコーダ101およびシフト回路102が本発明の正規化回路に対応し、シフト回路201が本発明の第1のシフト回路に対応し、インバータ204が本発明の第1の反転回路に対応し、テーブル203が本発明のデータ出力手段に対応し、シフト回路202が本発明の第2のシフト回路に対応し、インバータ205が本発明の第2の反転回路に対応し、加算回路206が本発明の加算回路に対応し、クランプ回路109が本発明のクランプ回路に対応している。
縮小率演算回路50は、前記式(16)の演算を行い、その演算結果である縮小率LODを図4に示す読み出し回路51に出力する。
【0085】
プライオリティエンコーダ101は、図4に示すqデータ選択回路302から入力したqデータの対数値「log2 q」を求め、当該2の対数値「log2 q」の整数値「int(log2 q)」、すなわち指数qeをデータaとしてシフト回路102,201に出力する。
【0086】
シフト回路102は、図4に示すqデータ選択回路302から入力したデータqを、プライオリティエンコーダ101から入力した指数qeだけ、LSBに向けてシフト演算した結果の小数部であるデータqmを、データb2としてシフト回路201およびテーブル203に出力する。
【0087】
プライオリティエンコーダ101が出力したデータaと、シフト回路102が出力したデータb2とはビット結合され、その結果であるデータ{a,b2}がシフト回路201に出力される。
【0088】
シフト回路201は、入力したデータ{a,b2}を、入力したデータLだけ、MSBに向けてシフト演算した結果であるデータδ2をインバータ204に出力する。
【0089】
インバータ204は、データδ2を反転し、その結果であるデータ ̄δ2を加算回路206に出力する。
【0090】
テーブル203は、データqmと、「log2 ({1,qm})−qm」との対応表を備え、シフト回路102から入力したデータqm(=b2)をキーとして、当該データqmに対応する「log2 ({1,qm})−qm」を対応表から得て、これをデータμとしてシフト回路202に出力する。
なお、テーブル203の代わりに、入力したデータqmを用いて、「log2 ({1,qm})−qm」を自動的に生成するプログラムを用いてもよい。
【0091】
トライアングルDDA回路11から入力したmaxeデータS11cと、テーブル203から出力されたデータμとは、maxeデータS11cを整数部とし、小数部が7ビットとなるようにデータμの前に(000)を結合して小数部として結合され、当該ビット結合後のデータ{maxe,3’b0,μ}がシフト回路202に出力される。ここで、「3’b0」は、Verilog−HDLの表記で、3ビットの2進数の0を意味する。
【0092】
シフト回路202は、入力したデータ{maxe,3’b0,μ}を、入力したデータLだけ、MSBに向けてシフト演算した結果であるγ2をインバータ205に出力する。
【0093】
インバータ205は、データγ2を反転し、その結果であるデータ ̄γ2を加算回路206に出力する。
【0094】
また、データKと「10」とが、小数部が7ビットとなるように「10」の前に1ビットの「0」を加えて結合され、当該ビット結合後のデータ{K,3’b0,10}が加算回路206に出力される。
【0095】
加算回路206は、データ{K,3’b0,10}と、データ ̄δ2と、データ ̄γ2とを加算して、その加算結果であるε2をクランプ回路109に出力する。
【0096】
クランプ回路109は、加算回路206から入力したデータε2を、整数部3ビット、小数部4ビットのデータにクランプし(丸め込み)、その結果を縮小率LODとして図4に示す読み出し回路51に出力する。
【0097】
図8に示す縮小率演算回路50では、入力したデータqmに対応するμ(=「log2 ({1,qm})−qm」)を出力する図8に示すテーブル203を用いて、整数部のみからなるmaxeデータS11cと、小数部のみからなるデータμとをビット結合することで、maxeデータS11cに関しての加算処理を削減している。これにより、縮小率演算回路50によれば、ゲート数の削減および演算処理の高速化を図れる。
また、縮小率演算回路50では、前記式(16)における「log2 (1/q)」の小数部bと仮数qmの上位4ビット(=2-4)とが近似することと、縮小率LODの7ビットの小数部のうち下位4ビットの精度を決定付ける「log2 (1/q)」の7ビットの小数部のうち下位4ビットをテーブル203を用いて得ることで、縮小率LODの誤差の要因となる前記式(16)に示す「log2 (1/q)」の誤差を2-7にでき、データLが最大値「3」である場合でも、縮小率LODの誤差を2-4程度にできる。
【0098】
図9は、図8に示す縮小率演算回路50における処理を説明するための図である。
以下、図9を参照しながら、図8に示す縮小率演算回路50の動作を具体例を用いて説明する。
ここでは、以下に示す値を用いて、前記式(16)の演算処理を縮小率演算回路50において行う場合を例示する。
【0099】
q=(0001001110.10100):
maxe=(00000001.0000000):
L=(01):
K=(00010011.0000):
【0100】
q選択回路302が出力したqデータS302であるq(0001001110.10100)が、図8に示すプライオリティエンコーダ101およびシフト回路102に入力される。
次に、プライオリティエンコーダ101において、q(0001001110.10100)の指数qe(000110)が求められ、当該指数qe(000110)のMSB側に(00)を付加した8ビットのデータであるa(00000110)が出力される。
【0101】
次に、シフト回路102において、a(0001001110.10100)が、a(00000110)だけ、MSB側に向けてシフトされ、シフト後の小数部である仮数qm(0011101)が、データb2としてテーブル203に出力される。
次に、テーブル203において、仮数qm(0011101)に対応する4ビットのデータμ(「log2 ({1,qm})−qm」)であるμ(1000)が得られ、μ(1000)が出力される。
【0102】
次に、トライアングルDDA回路11から入力したデータmaxe(00000001)とデータμ(1000)とが、小数部が7ビットとなるようにデータμの前に(000)を結合して小数部として結合され、当該ビット結合後のデータ{maxe,3’b0,μ}=(00000001.0001000)がシフト回路202に出力される。
【0103】
次に、シフト回路202において、入力したデータ{maxe,3’b0,μ}=(00000001.0001000)を、入力したデータL=(01)だけ、MSBに向けてシフト演算した結果であるγ2(00000010.0010000)がインバータ205に出力される。
次に、インバータ205において、データγ2(00000010.0010000)が反転され、その結果であるデータ ̄γ2(11111101.1101111)が加算回路206に出力される。
【0104】
また、プライオリティエンコーダ101が出力したデータa(00000110)と、シフト回路102が出力したデータb2(0011101)とがビット結合され、その結果であるデータ{a,b2}=(00000110.0011101)がシフト回路201に出力される。
【0105】
次に、シフト回路201において、データ{a,b2}=(00000110.0011101)が、入力したデータL(01)だけ、MSBに向けてシフト演算され、その結果であるデータδ2(00001100.0111010)がインバータ204に出力される。
【0106】
次に、インバータ204において、データδ2(00001100.0111010)が反転され、その結果であるデータ ̄δ2(11110011.1000101)が加算回路206に出力される。
【0107】
また、データK(00010011.0000)と「10」とが、小数部が7ビットとなるように「10」の前に1ビットの「0」を加えて結合され、当該ビット結合後のデータ{K,3’b0,10}=(00010011.0000010)が加算回路206に出力される。
【0108】
次に、加算回路206において、データ{K,3’b0,10}と、データ ̄δ2と、データ ̄γ2とが加算され、その加算結果であるε2(00000100.0110110)がクランプ回路109に出力される。
【0109】
次に、クランプ回路109において、加算回路206から入力したデータε2が、整数部3ビット、小数部4ビットのデータにクランプされ(丸め込まれ)、その結果である(100.0110)が縮小率LODとして図4に示す読み出し回路51に出力される。
【0110】
〔読み出し回路51〕
読み出し回路51は、DDAデータS11に含まれる(s,t,q)データと、縮小率LODと、所定のテクスチャサイズUSIZEおよびVSIZEとに基づいて算出したアドレス(u,v)を用いて、SRAM17あるいはテクスチャバッファ20内のアドレスから(R,G,B)データを読み出し、これをテクスチャデータとしてLIP回路52,53に出力する。
このとき、読み出し回路51は、縮小率演算回路50から入力した縮小率LODの小数部が0でない場合には、縮小率LODの前後の整数部に対応する縮小率を持つ2個のテクスチャデータをそれぞれクロック信号S18の1クロックサイクルで順に読み出してLIP回路52,53に出力する。
【0111】
〔LIP回路52,53〕
LIP回路52は、演算対象となっている画素について、前述した式(3)に相当する4点近傍補間処理の演算を1クロックサイクル内に行って補間データS52を生成し、補間データS52をLIP回路54に出力する。
続いて、LIP回路52は、演算対象となっている画素について、前述した式(6)に相当する4点近傍補間処理の演算を1クロックサイクル内に行って補間データS52を生成し、補間データS52をLIP回路54に出力する。
【0112】
LIP回路53は、演算対象となっている画素について、前述した式(4)に相当する4点近傍補間処理の演算を1クロックサイクル内に行って補間データS53を生成し、補間データS53をLIP回路54に出力する。
続いて、LIP回路53は、演算対象となっている画素について、前述した式(7)に相当する4点近傍補間処理の演算を1クロックサイクル内に行って補間データS53を生成し、補間データS53をLIP回路54に出力する。
LIP回路53の演算は、LIP回路52の演算と並行して行われる。
【0113】
〔LIP回路54〕
LIP回路54は、LIP回路52および53からの補間データS52,S53を用いて、前述した式(5)に相当する4点近傍補間処理の演算を1クロックサイクル内に行って4点近傍補間データCpixel0を生成し、4点近傍補間データCpixel0をLIP/テクスチャファンクション回路55に出力する。
このとき、LIP回路54は、縮小率LODの小数部が0でない場合には、補間データS52,S53を用いて、レベル補間処理に用いる4点近傍補間データCpixel0と4点近傍補間データCpixel1とを順に生成する。
例えば、縮小率LODが前述したように1.5である場合には、LIP回路54は、上記式(5)に基づいて4点近傍補間データCpixel0を1クロックサイクルで生成した後に、上記式(8)に基づいて4点近傍補間データCpixel1を1クロックサイクルで生成する。
なお、LIP回路52,53,54の構成および処理は、後述するLIP回路61の構成および処理と基本的に同じである。
【0114】
〔LIP/テクスチャファンクション回路55〕
図10は、LIP/テクスチャファンクション回路55の構成図である。
LIP/テクスチャファンクション回路55は、LIP回路54からの4点近傍補間データCpixel0(必要に応じて4点近傍補間データCpixel1)を用いて、MIMAP処理のレベル補間処理と、モジュレート処理、デカル処理、ハイライト処理、フォギング処理、テクスチャブレンディング処理およびアルファブレンディング処理などのテクスチャファンクション処理の一部あるいは全てを行う。
具体的には、LIP/テクスチャファンクション回路55は、縮小率LODの小数部が0である場合には、LIP回路54から入力した4点近傍補間データCpixel0を用いて、テクスチャファンクション処理のうち必要な処理を行う。
また、LIP/テクスチャファンクション回路55は、縮小率の小数部が0でない場合には、LIP回路54から入力した4点近傍補間データCpixel0,Cpixel1を用いてレベル補間処理を行った後に、テクスチャファンクション処理のうち必要な処理を行う。
【0115】
LIP/テクスチャファンクション回路55は、図10に示すように、前処理回路60、LIP回路61およびレジスタ62を有する。
前処理回路60は、図10に示すように、モードコントローラ70、レジスタ74、マルチプレクサ75〜78およびレジスタ85〜88を有する。
モードコントローラ70は、図10に示すように、デコーダ71、カウンタ72およびデコーダ73を有する。
【0116】
デコーダ71は、カウンタ72のカウント値を監視し、カウンタ72のカウント値が「0」になったタイミングで、LIP回路61を共用する処理の数に応じた初期値「0」,「1」または「2」をセットする。
例えば、デコーダ71は、LIP回路61で一つの処理のみを行う場合には初期値「0」をカウンタ72にセットし、2個の処理でLIP回路61を共用する場合には初期値「1」をセットし、3個の処理でLIP回路61を共用する場合にはカウント値「2」をセットする。
なお、本実施形態では、カウント値72にセットする初期値として「0」,「1」および「2」を用いる場合を例示するが、当該初期値の値は、LIP回路61を共用する処理の数に応じて任意に設定可能である。
デコーダ71は、例えば図1に示すメインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラからファンクションモードデータFMDを入力する。
ファンクションモードデータFMDは、各クロックサイクル毎に、例えば図11に示すモード「1」〜「8」を指定し、後述するように、各モードに応じたデータをLIP回路61に入力するための制御に用いられる。すなわち、ファンクションモードデータFMDに基づいて、LIP回路61が行う処理の内容が決定される。図11の内容について、後に詳細に説明する。
デコーダ71は、例えば、ファンクションモードデータFMDに基づいて、LIP回路61において1個のモードの処理が終了する度に、カウンタ72のカウント値を1だけ減少させる。
【0117】
デコーダ73は、図1に示すメインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラからファンクションモードデータFMDおよびフォグイネーブルデータFEDを入力する。
また、デコーダ73は、LIP回路54あるいは読み出し回路51からミップマップ番号データMNDを入力する。
【0118】
ファンクションモードデータFMDは、前述したように、各クロックサイクル毎に、例えば図11に示すモード「1」〜「8」を指定し、後述するように、各モードに応じたデータをLIP回路61に入力するための制御に用いられる。図11に示す例では、LIP回路61において、MIPMAP処理のレベル補間処理、モジュレート処理、ハイライト処理、デカル処理およびフォギング処理を行う行う場合を例示している。
この場合に、図11に示すように、例えば、モジュール処理およびハイライト処理は、当該処理のみが行われるか、あるいは、MIPMAP処理のレベル補間処理に続いて行われるかによって異なるモードが付されている。また、フォギング処理も、当該処理のみが行われるか、あるいは、モジュレート処理に続いて行われるかによって異なるモードが付されている。これは、図10に示すLIP回路61の処理結果をフィードバックしてレジスタ88に書き込むか否かをデコーダ73において決定する必要があるためである。
なお、図11に示すモードは一例であり、その他にも種々のモードを指定することが可能である。
【0119】
また、フォグイネーブルデータFEDは、例えば、フォギング処理を行う場合には論理値「1」を示し、フォギング処理を行わない場合には論理値「0」を示している。
【0120】
また、ミップマップ番号データMNDは、LIP回路61においてレベル補間処理を行わない場合(縮小率LODの小数部が0である場合)の4点近傍補間データCpixel0を入力するタイミングと、レベル補間処理を行う場合の4点近傍補間データCpixel1を入力するタイミングとで論理値「1」を示す。
また、ミップマップ番号データMNDは、レベル補間処理を行う場合の4点近傍補間データCpixel0を入力するタイミングで論理値「0」を示す。
ミップマップ番号データMNDは、後述するように、デコーダ73によるマルチプレクサ77,78の制御に用いられる。
【0121】
デコーダ73は、ファンクションモードデータFMD、ミップマップ番号データMNDおよびフォグイネーブルデータFEDに基づいて、ファンクションモードデータFMDが指定した処理をLIP回路61が行うのに必要なデータをLIP回路61に供給するように、マルチプレクサ75〜78を制御する。
【0122】
具体的には、デコーダ73は、ミップマップ番号データMNDが論理値「0」を示す間は、LIP回路54から入力した4点近傍補間データCpixel0をレジスタ87に出力しないように、マルチプレクサ77を制御する。このとき、4点近傍補間データCpixel0は、レジスタ74に書き込まれる。
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「1」を示しており、LIP回路61がMIPMAP処理のレベル補間処理を行う場合には、ミップマップ番号データMNDが論理値「1」を示す間に、レジスタ74から読み出した4点近傍補間データCpixel0をレジスタ88に出力し、LIP回路54から入力した4点近傍補間データCpixel1をレジスタ87に出力するように、マルチプレクサ78,77を制御する。
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「1」を示し、ミップマップ番号データMNDが論理値「1」を示す間に、図4に示す縮小率演算回路50から入力したミップマップ係数COEmipmapを、レジスタ86に出力するように、マルチプレクサ76を制御する。それと同時に、デコーダ73は、論理値「0」をレジスタ85に出力するように、マルチプレクサ75を制御する。
これにより、4点近傍補間データCpixel0,Cpixel1およびミップマップ係数COEmipmapが、それぞれレジスタ88,87,86に同時に書き込まれ、LIP回路61において、4点近傍補間データCpixel0,Cpixel1を用いたレベル補間処理が行われる。
【0123】
図12は、LIP回路54から図10に示すモードコントローラ70への4点近傍補間データCpixel0,Cpixel1の入力タイミングと、LIP/テクスチャファンクション回路55におけるレベル補間処理の実行タイミングとを説明するためのタイミングチャートである。
図12において、同一の(a),(b),(c)が付されたデータは、同じレベル補間処理に係わるデータを示している。
【0124】
例えば、図12(A)に示すクロック信号S18に基づいて、図12(B)に示すタイミングで、LIP回路54からLIP/テクスチャファンクション回路55に入力されたレベル補間の対象となる4点近傍補間データCpixel0がレジスタ74に記憶される。
そして、次のクロックサイクルで、レジスタ74から読み出された4点近傍補間データCpixel0が、マルチプレクサ78およびレジスタ88を介して、LIP回路61のINA 端子に出力されると共に、LIP回路54から入力した4点近傍補間データCpixel1が、マルチプレクサ77およびレジスタ87を介して、LIP回路61のINB 端子に出力される。
そして、次のクロックサイクルで、図12(C)に示すように、LIP回路61において、ミップマップデータCpixel0,Cpixel1を用いたレベル補間処理が行われる。
図12(C)から分かるように、LIP回路52,53,54を用いて行われるMIPMAP処理の4点近傍補間処理のスループットは2クロックサイクルであるのに対して、LIP回路61ではMIMAP処理のレベル補間処理が1クロックサイクルで行われる。従って、LIP回路61において、レベル補間処理のみを行う場合には、LIP回路61に処理を行わない空き時間が生じる。当該実施形態では、後述するように、当該空き時間を利用して、LIP回路61にテクスチャファンクション処理を行わせる。すなわち、MIPMAP処理の4点近傍補間処理と、テクスチャファンクション処理とをインターリーブする。
【0125】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「2」を示しており、LIP回路61がモジュレート処理のみを行う場合には、対応する1クロックサイクルの間、LIP回路54から入力した4点近傍補間データCpixel0をレジスタ74を介してレジスタ88に出力し、トライアングルDDA回路11から入力したDDAデータS11に含まれる(R,G,B)データS11b(フラグメントデータCflag)をレジスタ86に出力するように、マルチプレクサ78,76を制御する。
また、同時に、デコーダ73は、レジスタ87に論理値「0」を出力し、レジスタ85に論理値「0」を出力するように、マルチプレクサ77,75を制御する。
【0126】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「3」を示しており、LIP回路61がMIPMAP処理のレベル補間処理に続いてモジュレート処理を行う場合には、対応する1クロックサイクルの間、LIP回路61のOUT端子からフィードバックされたレベル補間データをレジスタ88に出力し、フラグメントデータCflagをレジスタ86に出力するように、マルチプレクサ78,76を制御する。
また、同時に、デコーダ73は、レジスタ87に論理値「0」を出力し、レジスタ85に論理値「0」を出力するように、マルチプレクサ77,75を制御する。
【0127】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「4」を示しており、LIP回路61がハイライト処理のみを行う場合には、対応する1クロックサイクルの間、LIP回路54から入力した4点近傍補間データCpixel0をレジスタ78を介してレジスタ88に出力し、トライアングルDDA回路11から入力したDDAデータS11に含まれる(R,G,B)データS11b(フラグメントデータCflag)をレジスタ86に出力するように、マルチプレクサ78,76を制御する。
また、同時に、デコーダ73は、レジスタ87に論理値「0」を出力し、メインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラから入力したハイライト演算の加算データHiをレジスタ85に出力するように、マルチプレクサ77,75を制御する。
【0128】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「5」を示しており、LIP回路61がMIPMAP処理のレベル補間処理に続いてハイライト処理を行う場合には、対応する1クロックサイクルの間、LIP回路61のOUT端子からフィードバックされたレベル補間データをレジスタ88に出力し、フラグメントデータCflagをレジスタ86に出力するように、マルチプレクサ78,76を制御する。
また、同時に、デコーダ73は、レジスタ87に論理値「0」を出力し、メインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラから入力したハイライト演算の加算データHiをレジスタ85に出力するように、マルチプレクサ77,75を制御する。
【0129】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「6」を示しており、LIP回路61がデカル処理のみを行う場合には、対応する1クロックサイクルの間、LIP回路54から入力した4点近傍補間データCpixel0をレジスタ78を介してレジスタ88に出力し、論理値「0xff(0xFFと同じ )」をレジスタ86に出力するように、マルチプレクサ78,76を制御する。
また、同時に、デコーダ73は、レジスタ87に論理値「0」を出力し、レジスタ85に論理値「0」を出力するように、マルチプレクサ77,75を制御する。
【0130】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「7」を示しており、LIP回路61がフォギング処理のみを行う場合には、対応する1クロックサイクルの間、トライアングルDDA回路11から入力したDDAデータS11に含まれる(R,G,B)データS11b(フラグメントデータCflag)をレジスタ74を介してレジスタ88に出力し、例えば図示しないフォグレジスタに設定されたフォグデータCfog をレジスタ87に出力するように、マルチプレクサ78,77を制御する。
また、同時に、デコーダ73は、トライアングルDDA回路11から入力したDDAデータS11に含まれるフォギング係数COEfog をレジスタ86に出力するように、マルチプレクサ76を制御する。
また、同時に、デコーダ73は、論理値「0」をレジスタ85に出力するように、マルチプレクサ75を制御する。
【0131】
また、デコーダ73は、ファンクションモードデータFMDが図11に示す「8」を示しており、LIP回路61がモジュレート処理に続いてフォギング処理を行う場合には、対応する1クロックサイクルの間、LIP回路61のOUT端子からフィードバックされたレベル補間データをレジスタ88に出力し、図示しないフォグレジスタから読み出したフォグデータCfog をレジスタ87に出力するように、マルチプレクサ78,77を制御する。
また、同時に、デコーダ73は、トライアングルDDA回路11から入力したDDAデータS11に含まれるフォギング係数COEfog をレジスタ86に出力するように、マルチプレクサ76を制御する。
また、同時に、デコーダ73は、論理値「0」をレジスタ85に出力するように、マルチプレクサ75を制御する。
【0132】
また、デコーダ73は、MIMPAP処理のレベル補間処理と、2以上のテクスチャファンクション処理とでLIP回路61を共用する場合、すなわち合計3以上の処理でLIP回路61を共用する場合には、共用する処理の数に応じたクロックサイクルの間、例えば図4に示す読み出し回路51および図1に示すトライアングルDDA回路11にウェイト(待ち)指示を出力する。
例えば、レベル補間処理と、2個のテクスチャファンクション処理とでLIP回路61を共用する場合には、LIP回路61が2番目のテクスチャファンクション処理を処理している1クロックサイクルの間、ウェイト指示を読み出し回路51およびトライアングルDDA回路11に出力する。
【0133】
LIP回路61は、前記式(15)の演算を行う場合に、それぞれ8ビットのデータA,B,COEおよびCを、INA 端子、INB 端子、INcoe 端子およびINC 端子からそれぞれ入力し、8ビットのデータDをOUT端子から出力する。
【0134】
LIP回路61は、図13に示すように、補正データF、データCOEの対応するビットの論理値に基づいてデータAまたはBを選択した部分積out_0〜out_7、および、積和演算項であるデータCを、シフトさせて加算することで、前記式(15)に示す演算を行う。
【0135】
補正データFは、データCOE=0xFF(COE=1.0)の場合には、データAを、それ以外の場合にはデータBを選択した値を持つ。
補正データFは、8ビットのうち全ビットが論理値「1」の場合に、「1」と見るシステムにおいて、例えば、下記式(17)に示す演算を、下記式(18)となるように補正するために用いられる。すなわち、「X×1.0=X」となるように補正を行う。
【0136】
【数17】
0xFF×0xFF=0xFE …(17)
【0137】
【数18】
0xFF×0xFF=0xFF …(18)
【0138】
部分積out_0〜out_7は、それぞれデータCOEのビット0〜7が、論理値「1」であればデータAを示し、論理値「0」であればデータBを示している。
ここで、データCOEのLSBをビット0とし、MSBをビット7とする。
部分積out_n(0≦n≦7)は、例えば、図14に示すように、8個のマルチプレクサ800 〜807 を用いて生成される。
具体的には、0≦m≦7とした場合に、マルチプレクサ80m に、データAのビットmのビットデータA〔m〕と、データBのビットmのビットデータB〔m〕と、データCOEのnのビットデータCOE〔n〕とを入力し、ビットデータCOE〔n〕が論理値「1」であればビットデータA〔m〕を選択して、ビットデータout_n〔m〕として出力する。
なお、ビットデータout_n〔0〕〜out_n〔7〕によって、部分積out_nが構成される。
【0139】
部分積out_nは、MSBに向けて、nビットだけシフトされた後に、wallace_tree型のアーキテクチャを採用した加算回路81に出力される。
また、積和演算項であるデータCは、8ビット×8ビットの乗算結果の上位8ビットに加算されるように、図13に示すように、MSBに向けて8ビットシフトされた後に加算回路81に出力される。
【0140】
加算回路81は、wallace_tree型のアーキテクチャを採用しており、入力を3個づつ集めて和と桁上げの2個の出力に絞り込み、最終的に加算回路82において2入力加算器を用いて加算を行うことを可能にする。
これにより、補正データFおよび積和演算項Cによる部分積が追加されても、回路規模は殆ど増加せず、加算速度も殆ど落とさずにすむ。
【0141】
図15は、wallace_tree型のアーキテクチャを採用した加算回路8の部分構成図である。
図15では、図13に示す矢印92,93,94に示される図中縦方向のビットデータの加算を行う構成のみを示し、それ以外の加算を行う部分は省略してある。
図13に示す矢印91に示される図中縦方向のビットデータの加算は、加算回路82において行われる。
図15に示すように、加算回路81は、加算器1000 〜1006 を有する。
加算器1000 は、矢印92の加算を行い、補正データFのビット1と、部分積out_0のビット1と、部分積out_1のビット0との加算を行い、和Sumを加算回路82に出力し、桁上げCarryを加算器1001 に出力する。
【0142】
加算器1001 ,1002 ,1003 は、矢印93の部分の加算を行う。
加算器1001 は、補正データFのビット2と、部分積out_0のビット2との加算を行い、和Sumを加算器1003 に出力し、桁上げCarryを加算器1004 に出力する。
加算器1002 は、部分積out_1のビット1と、部分積out_2のビット0との加算を行い、和Sumを加算器1003 に出力し、桁上げCarryを加算器1005 に出力する。
加算器1003 は、加算器1001 からの桁上げCarryと、加算器1002 からの桁上げCarryとを加算し、和Sumおよび桁上げCarryを加算回路82に出力する。
【0143】
加算器1004 ,1005 ,1006 は、矢印94の部分の加算を行う。
加算器1004 は、補正データFのビット3と、部分積out_0のビット3との加算を行い、和Sumを加算器1006 に出力し、桁上げCarryを後段の加算器に出力する。
加算器1005 は、部分積out_1のビット2と、部分積out_2のビット1との加算を行い、和Sumを加算器1006 に出力し、桁上げCarryを後段の加算器に出力する。
加算器1006 は、加算器1004 からの桁上げCarryと、加算器1005 からの桁上げCarryとを加算し、和Sumおよび桁上げCarryを加算回路82に出力する。
【0144】
加算回路82は、補正データFのビット0および部分積out_0のビット0、加算回路81から入力した和Sumおよび桁上げCarryを、複数の2入力の加算器を用いて加算して、上記式(15)の演算結果である16ビットのデータを算出し、当該16ビットのデータのうち上位8ビットをデータDとして出力する。
LIP回路61は、例えば、図10に示すカウンタ72がカウント値「0」を示す場合には、当該算出したデータDを図4に示すOUT端子からレジスタ62に出力し、それ以外の場合には、当該算出したデータDを図4に示すマルチプレクサ78にフィードバックする。
【0145】
以下、図10に示すテクスチャエンジン回路12の動作形態について説明する。
第1の動作形態
本動作形態では、MIPMAP処理のレベル補間処理と、モジュレート処理とでLIP回路61を共用する場合を説明する。
この場合には、図1に示すメインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラから図10に示すデコーダ71,73に、1クロックサイクル毎に、モード「1」および「3」を交互に示すファンクションモードデータFMDが出力される。
また、デコーダ71は、カウンタ72のカウント値の初期値として「1」を設定し、カウンタ72のカウント値が「0」になる度に、カウンタ72に「1」を設定する。
【0146】
具体的には、例えば、第1のクロックサイクルで、図4に示すLIP回路54からの4点近傍補間データCpixel0がレジスタ74に書き込まれる。
また、カウンタ72のカウント値に「1」がセットされる。
【0147】
次に、第1のクロックサイクルに続く第2のクロックサイクルで、ファンクションモードデータFMDがモード「1」を示し、4点近傍補間データCpixel0がレジスタ74から読み出されて、マルチプレクサ78およびレジスタ88を介してLIP回路61のINA 端子に出力される。それと同時に、図4に示すLIP回路54からの4点近傍補間データCpixel1が、マルチプレクサ77およびレジスタ87を介してLIP回路61のINB 端子に出力される。
それと同時に、図4に示す縮小率演算回路50からのデータCOEmipmapが、マルチプレクサ76およびレジスタ86を介してLIP回路61のINcoeff に出力される。
そして、LIP回路54において、上記式(9)に示す演算が行われ、レベル補間データCpixel が算出される。
そして、カウンタ72がカウント値が「1」であるため、レベル補間データCpixel がマルチプレクサ78にフィードバックされる。
そして、カウンタ72のカウント値が減少して「0」になる。
【0148】
次に、第3のクロックサイクルで、ファンクションモードデータFMDがモード「3」を示し、図4に示すLIP回路54からの次の画素に係わる4点近傍補間データがレジスタ74に書き込まれる。
それと同時に、第2のクロックサイクルで算出されたレベル補間データCpixel (=式(10)のCtex に対応)がマルチプレクサ78およびレジスタ88を介してLIP回路61のINA 端子に出力される。
それと同時に、トライアングルDDA回路11からのDDAデータS11に含まれる(R,G,B)データS11b(フラグメントカラー値Cflag)が、マルチプレクサ76およびレジスタ86を介してLIP回路61のINcoeff に出力される。
そして、LIP回路54において、上記式(10)に示す演算が行われ、モジュレート処理後のカラー値Cmod が算出される。
そして、カウンタ72のカウント値が「0」であるため、LIP回路61のOUT端子からレジスタ62にカラー値Cmod が出力される。
カラー値Cmod は、レジスタ62から読み出されて画素データS12として後段のメモリI/F回路13に出力される。
そして、カウンタ72のカウント値に「1」がセットされる。
以後、上述した第2のクロックサイクルの処理と、第3のクロックサイクルの処理とが交互に繰り返される。
【0149】
以上説明したように、本動作形態では、MIPMAP処理のレベル補間処理と、モジュレート処理とでLIP回路61とでLIP回路61を共用できる。そのため、レベル補間処理用の回路とモジュレート処理用の回路とを直列に接続した場合に比べて回路規模を縮小できる。また、本実施形態では、MIPMAP処理の4点近傍補間処理は1系統で2クロックサイクルかけて行われ、当該処理に係わる回路規模は従来と同じである。
また、本動作例では、LIP回路61において、レベル補間処理を行わない空き時間に、モジュレート処理を行うため、処理時間が長期化することはない。
【0150】
第2の動作形態
本動作形態では、MIPMAP処理のレベル補間処理と、モジュレート処理と、フォギング処理とでLIP回路61を共用する場合を説明する。
この場合には、図1に示すメインプロセッサ4あるいはテクスチャエンジン回路12内の図示しない主コントローラから図10に示すデコーダ71,73に、1クロックサイクル毎に、モード「1」、「3」、「8」を順に繰り返して示すファンクションモードデータFMDが出力される。
また、デコーダ71は、カウンタ72のカウント値の初期値として「2」をセットし、カウンタ72のカウント値が「0」になる度に、カウンタ72に「2」をセットする。
【0151】
具体的には、例えば、第1のクロックサイクルで、図4に示すLIP回路54からの4点近傍補間データCpixel0がレジスタ74に書き込まれる。
そして、カウンタ72のカウント値に「2」がセットされる。
【0152】
次に、第2のクロックサイクルで、ファンクションモードデータFMDがモード「1」を示し、4点近傍補間データCpixel0がレジスタ74から読み出されて、マルチプレクサ78およびレジスタ88を介してLIP回路61のINA 端子に出力される。それと同時に、図4に示すLIP回路54からの4点近傍補間データCpixel1が、マルチプレクサ77およびレジスタ87を介してLIP回路61のINB 端子に出力される。
それと同時に、図4に示す縮小率演算回路50からのデータCOEmipmapが、マルチプレクサ76およびレジスタ86を介してLIP回路61のINcoeff に出力される。
そして、LIP回路54において、上記式(9)に示す演算が行われ、レベル補間データCpixel が算出される。
そして、カウンタ72がカウント値が「2」であるため、レベル補間データCpixel がマルチプレクサ78にフィードバックされる。
そして、カウンタ72のカウント値が減少して「1」になる。
【0153】
次に、第3のクロックサイクルで、ファンクションモードデータFMDがモード「3」を示し、図4に示すLIP回路54からの次の画素に係わる4点近傍補間データCpixel0がレジスタ74に書き込まれる。
それ同時に、第2のクロックサイクルで算出されたレベル補間データCpixel (式(10)のCtex に対応)がマルチプレクサ78およびレジスタ88を介してLIP回路61のINA 端子に出力される。
それと同時に、トライアングルDDA回路11からのDDAデータS11に含まれる(R,G,B)データS11b(フラグメントカラー値Cflag)が、マルチプレクサ76およびレジスタ86を介してLIP回路61のINcoeff に出力される。
そして、LIP回路54において、上記式(10)に示す演算が行われ、モジュレート処理後のカラー値Cmod が算出される。
そして、カラー値Cmod は、カウンタ72がカウント値が「1」であるため、マルチプレクサ78にフィードバックされる。
そして、カウンタ72のカウント値が減少して「0」になる。
また、4点近傍補間データCpixel0の出力を1クロックサイクルだけ待つことを指示するウェイト指示が図4に示す読み出し回路51に出力され、フラグメントデータCflagの出力を1クロックサイクルだけ待つことを指示するウェイト指示が図1に示すトライアングルDDA回路11に出力される。
【0154】
次に、第4のクロックサイクルで、ファンクションモードデータFMDがモード「8」を示し、フォグイネーブルデータFEDが論理値「1」であれば、第3のクロックサイクルで算出されたカラー値Cmod (式(13)のCflagに対応)が、マルチプレクサ78およびレジスタ88を介してLIP回路61のINA 端子に出力される。
それと同時に、例えば、図示しないフォグレジスタから読み出したフォグデータCfog が、マルチプレクサ77およびレジスタ87を介して、LIP回路61のINB 端子に出力される。
それと同時に、例えば、トライアングルDDA回路11からのDDAデータS11に含まれるフォギング係数COEfog が、マルチプレクサ76およびレジスタ86を介して、LIP回路61のINcoeff 端子に出力される。
そして、LIP回路54において、上記式(13)に示す演算が行われ、フォギング処理後のカラー値Cfoggedが算出される。
そして、カウンタ72のカウント値が「0」であるため、LIP回路61のOUT端子からレジスタ62にカラー値Cfoggedが出力される。
カラー値Cfoggedは、レジスタ62から読み出されて画素データS12として後段のメモリI/F回路13に出力される。
以後、上述した第2のクロックサイクルの処理と、第3のクロックサイクルの処理と、第4のクロックサイクルの処理とが交互に繰り返される。
【0155】
以上説明したように、本動作形態では、MIPMAP処理のレベル補間処理と、モジュレート処理とでLIP回路61と、フォギング処理とでLIP回路61を共用できる。そのため、レベル補間処理用の回路とモジュレート処理用の回路とを直列に接続した場合に比べてゲート数を少なくでき、回路規模を縮小できる。
【0156】
このように、テクスチャエンジン回路12では、MIMPAP処理のレベル補間処理と、テクスチャファンクション処理とで図10に示すLIP回路61を共用することで、回路規模を縮小できる。この場合に、レベル補間処理と、1個のテクスチャファンクション処理とでLIP回路61を共用した場合には、処理時間が長期化することはない。
【0157】
また、テクスチャエンジン回路12では、図4に示すLIP回路52,53,61において、図13に示すように補正データFを用いて演算を行うため、全ビットが論理値「1」の場合に「1」と見なすシステムにおいて、上記式(15)のCOEが「1.0」の場合の演算を、回路規模を殆ど増大させることなく、正確に行うことができる。
すなわち、補正を行わないで適切な結果を得るために、1ビット増やして9ビットを用い、「0x100」を「1」と見なすと、前段のパイプレジスタのゲート数増加を招き、全体的にゲートを増加させることになるが、本実施形態では、ビット数を増やす必要がなく、このような問題は生じない。
【0158】
なお、テクスチャエンジン回路12は、フルカラー方式の場合には、SRAM17あるいはテクスチャバッファ20から読み出した(R,G,B)データを直接用いる。一方、テクスチャエンジン回路12は、インデックスカラー方式の場合には、予め作成したカラールックアップテーブル(CLUT)をテクスチャCLUTバッファ23から読み出して、内蔵するSRAMに転送および記憶し、このカラールックアップテーブルを用いて、SRAM17あるいはテクスチャバッファ20から読み出したカラーインデックスに対応する(R,G,B)データを得る。
【0159】
メモリI/F回路13
メモリI/F回路13は、テクスチャエンジン回路12から入力した画素データS12に対応するzデータと、zバッファ22に記憶されているzデータとの比較を行い、入力した画素データS12によって描画される画像が、前回、ディスプレイバッファ21に書き込まれた画像より、手前(視点側)に位置するか否かを判断し、手前に位置する場合には、画像データS12に対応するzデータでzバッファ22に記憶されたzデータを更新する。
【0160】
CRTコントローラ回路14
CRTコントローラ回路14は、与えられた水平および垂直同期信号に同期して、図示しないCRTに表示するアドレスを発生し、ディスプレイバッファ21から表示データを読み出す要求をメモリI/F回路13に出力する。この要求に応じて、メモリI/F回路13は、ディスプレイバッファ21から一定の固まりで表示データを読み出す。CRTコントローラ回路14は、ディスプレイバッファ21から読み出した表示データを記憶するFIFO(First In First Out)回路を内蔵し、一定の時間間隔で、RAMDAC回路15に、RGBのインデックス値を出力する。
【0161】
RAMDAC回路15
RAMDAC回路15は、各インデックス値に対応するR,G,Bデータを記憶しており、CRTコントローラ回路14から入力したRGBのインデックス値に対応するデジタル形式のR,G,Bデータを、D/Aコンバータに転送し、アナログ形式のR,G,Bデータを生成する。RAMDAC回路15は、この生成されたR,G,BデータをCRTに出力する。
【0162】
レンダリング回路5の実現手法
以下、本実施形態に係る同一半導体チップ内に混載されるレンダリング回路5のロジック回路とDRAM16およびSRAM17等からなる2次メモリとの好適な構成、配置および配線方法について、図16〜図18に関連付けて説明する。
【0163】
本実施形態においては、DRAM16は、たとえば図16に示すように、4つのDRAMモジュール1471〜1474に分割されており、メモリI/F回路13には、各DRAMモジュール1471〜1474に対応したメモリコントローラ1441〜1444、並びにこれらメモリコントローラ1441にデータを分配するディストリビュータ1445が設けられている。
そして、メモリI/F回路13は、各DRAMモジュール1471〜1474に対して、図16に示すように、ピクセルデータを、表示領域において隣接した部分は、異なるDRAMモジュールとなるように配置する。
これにより、三角形のような平面を描画する場合には面で同時に処理できることになるため、それぞれのDRAMモジュールの動作確率は非常に高くなっている。
【0164】
前述した描画処理においては、最終的にはピクセルの一つ一つのアクセスにまで集約されてくることになる。したがって、ピクセル一つ一つの処理が同時並行処理されることにより、描画性能は並行処理の数だけ増加できることが理想である。
そのために、3次元コンピュータグラフィックスシステム1におけるメモリシステムを構成するメモリI/F回路13においても、同時並行処理が行える構成がとられている。
【0165】
グラフィック描画処理においては、前述したように、ピクセルに打ち込むところの処理回路は、DRAMと頻繁にデータのやりとりを行う必要があることがわかる。
そのため、本実施形態では、図17に示すように、ピクセル処理を制御する機能ブロックであるピクセル処理モジュール1446,1447,1448,1449をメモリコントローラから物理的に分離し、かつ、これらピクセル処理モジュール1446,1447,1448,1449を対応するDRAMモジュール1471,1472,1473,1474の近くに配置(近接配置)している。
【0166】
ピクセル処理モジュール1446,1447,1448,1449は、(R,G,B)カラーのリード(Read)/モディファイ(Modify)/ライト(Write)処理および、隠面処理のための以前に描画している深さデータと、今から描画しようとしているデータの深さを比較して、その結果により書き戻したりする作業に関する処理を全て行う。
これら作業をすべてピクセル処理モジュール1446,1447,1448,1449で行うことで、DRAMモジュール1471,1472,1473,1474との配線長が短いモジュール内で、DRAMとのやりとりを完結することが可能となる。
そのため、DRAMとの配線数、すなわち、転送のビット数を多くとっても、面積に対する配線が占める割合を、少なく抑えることができることから、動作速度向上および、配線面積の縮小化が可能となっている。
【0167】
ディストリビュータ等を含むDRAM間制御モジュール1450に関しては、描画処理としての、DDAセットアップ回路10のDDAセットアップ演算、トライアングルDDA回路11のトライアングルDDA演算、テクスチャエンジン回路12のテクスチャ貼り付け、並びに、CRTコントロール回路14による表示処理等に比較して、それぞれのDRAMモジュール(DRAM+ピクセル処理)との関連も強く、DRAMモジュール1471,1472,1473,1474との間の信号線が最も多くなるところである。
そのため、DRAM間制御モジュール1450は、それぞれのDRAMモジュール1471,1472,1473,1474の中心付近に配置して、最長配線長ができるだけ短くなるように考慮している。
【0168】
また、ピクセル処理モジュール1446,1447,1448,1449とDRAM間制御モジュール1450との接続のための信号入出力端子については、図17に示すように、それぞれのピクセル処理モジュール1446,1447,1448,1449における入出力端子を同じにするのではなく、個々のピクセル処理モジュールと、DRAM間制御モジュール1450間が最適(最短)に配線されるように、個々のピクセル処理モジュールにおける信号の入出力端子位置を調整してある。
【0169】
具体的には、ピクセル処理モジュール1446は、図17においてモジュール下縁部の右端側に入出力端子T1446aが形成されている。そして、この入出力端子T1446aがDRAM間制御モジュール1450の上縁部の左端側に形成された入出力端子T1450aと対向するように配置されて、両端子T1446aおよびT1450aが最短距離をもって接続されている。
そして、ピクセル処理モジュール1446には、図17において上縁部の中央部にDRAMモジュール1471との接続用入出力端子T1446bが形成されている。
【0170】
ピクセル処理モジュール1447は、図17においてモジュール下縁部の左端側に入出力端子T1447aが形成されている。そして、この入出力端子T1447aがDRAM間制御モジュール1450の上縁部の右端側に形成された入出力端子T1450bと対向するように配置されて、両端子T1447aおよびT1450bが最短距離をもって接続されている。
そして、ピクセル処理モジュール1447には、図17において上縁部の中央部にDRAMモジュール1472との接続用入出力端子T1447bが形成されている。
【0171】
ピクセル処理モジュール1448は、図17においてモジュール上縁部の右端側に入出力端子T1448aが形成されている。そして、この入出力端子T1448aがDRAM間制御モジュール1450の下縁部の左端側に形成された入出力端子T1450cと対向するように配置されて、両端子T1448aおよびT1450cが最短距離をもって接続されている。
そして、ピクセル処理モジュール1448には、図17において下縁部の中央部にDRAMモジュール1473との接続用入出力端子T1448bが形成されている。
【0172】
ピクセル処理モジュール1449は、図17においてモジュール上縁部の左端側に入出力端子T1449aが形成されている。そして、この入出力端子T1449aがDRAM間制御モジュール1450の下縁部の右端側に形成された入出力端子T1450dと対向するように配置されて、両端子T1449aおよびT1450dが最短距離をもって接続されている。
そして、ピクセル処理モジュール1449には、図17において下縁部の中央部にDRAMモジュール1474との接続用入出力端子T1449bが形成されている。
【0173】
なお、ピクセル処理モジュール1446,1447,1448,1449は、各DRAMモジュール1471,1472,1473,1474からDRAM間制御モジュール1450に至る経路を、上記のようにして最適な長さにしても、処理速度要求が満足できない処理に関しては、たとえばレジスタで分断した少なくとも1段のパイプライン処理をとり得、所望の処理速度を達成できるように構成されている。
【0174】
また、本実施形態に係るDRAMモジュール1471〜1474は図18に示すように構成されている。なお、ここでは、DRAMモジュール1471を例に説明するが、他のDRAMモジュール1472〜1474も同様の構成を有することから、その説明は省略する。
【0175】
DRAMモジュール1471は、図18に示すように、メモリセルがマトリクス状に配置され、ロウアドレスRA、カラムアドレスCAに基づいて選択される図示しないワード線およびビット線を通してアクセスされるDRAMコア1480、ロウデコーダ1481、センスアンプ1482、カラムデコーダ1483、およびSRAM等からなるいわゆるキャッシュメモリと同様の機能を備えた2次メモリ1484を有している。
【0176】
本実施形態のように、DRAMモジュール毎に、グラフィックス描画におけるピクセル処理を制御する機能ブロックとしてのピクセル処理モジュール1446〜1449と、DRAMモジュールの2次メモリ1484とがDRAMモジュールに近接配置されている。
そして、この場合、DRAMのいわゆる長辺方向が、DRAMコア1480のカラム方向になるように配置されている。
【0177】
図18の構成においてランダムな読み出し(リード)に関して見てみると、ピクセル処理モジュール1446から制御信号と必要なアドレス信号S1446が、アドレス制御パスからDRAMモジュール1471に供給され、それをもとに、ロウアドレスRAとカラムアドレスCAが生成され、所望のロウに相当するDRAMのデータがセンスアンプ1482を通して読み出される。
センスアンプ1480を通ったデータは所望のカラムアドレスCAに従って、カラムデコーダにて必要なカラムが集約され、ランダムアクセスポートから所望のロウ/カラムに対応した、DRAMのデータD1471がパスを介してピクセル処理モジュール1446に転送される。
【0178】
2次メモリにデータを書き込む場合は、ピクセル処理モジュール1446から制御信号と必要なアドレス信号S1446が、アドレス制御パスからDRAMモジュール1471に供給され、それをもとにロウアドレスのみが生成され、1ロウ分のデータが一気にDRAM16からSRAM17等からなる2次メモリ1484に書き込まれる。
この場合、DRAMのいわゆる長辺方向が、DRAMコア1480のカラム方向になるように配置されていることから、ロウ方向に配置する場合に比較して、ロウアドレス指定のみで、そのロウアドレスに対応している1ロウ分のデータを、一度に2次メモリ1484にロードできるビット数が格段に増加する。
【0179】
また、テクスチャ処理モジュールとしてのテクスチャエンジン回路143への2次メモリ(SRAM)1484からのデータD1484の読み込みは、テクスチャエンジン回路143から、制御信号と必要なアドレス信号が、アドレス制御パスからDRAMに供給され、それに対応したデータD1484がデータパスを介してテクスチャエンジン回路143へ転送される。
【0180】
また、本実施形態においては、図18に示すように、ピクセル処理モジュールとDRAMモジュールの2次メモリとが、それぞれ互いにDRAMモジュールの長辺側の同一側に近接配置されている。
これにより、ピクセル処理モジュールとDRAMモジュールの2次メモリへのデータは、同一のセンスアンプを使うことができるため、DRAMコア1480の面積増加を最小限に抑えて2ポート化することが可能となっている。
【0181】
以下、3次元コンピュータグラフィックシステム1の全体動作について説明する。
ポリゴンレンダリングデータS4が、メインバス6を介してメインプロセッサ4からDDAセットアップ回路10に出力され、DDAセットアップ回路10において、ポリゴンの辺と水平方向の差分などを示す変分データS10が生成される。
この変分データS10は、トライアングルDDA回路11に出力され、トライアングルDDA回路11において、ポリゴン内部の各画素における線形補間された(z,R,G,B,COEblend ,s,t,q,COEfog )データが算出される。そして、この算出された(z,R,G,B,COEblend ,s,t,q,COEfog )データと、ポリゴンの各頂点の(x,y)データとが、DDAデータS11として、トライアングルDDA回路11からテクスチャエンジン回路12に出力される。
【0182】
次に、図4に示すテクスチャエンジン回路12の代表点決定回路301において代表点が決定され、当該代表点を示す代表点指示データS301に基づいて代表点決定回路301においてqデータS302が選択される。
次に、図4および図8に示す縮小率演算回路50において、qデータS302およびmaxeデータS11cを用いて縮小率LODが算出される。
次に、図4に示すテクスチャエンジン回路12の第2のバッファメモリ51において、DDAデータS11に含まれる(s,t,q)データS11a1 〜S11a8 について、sデータをqデータで除算する演算と、tデータをqデータで除算する演算とが行われる。
そして、除算結果「s/q」および「t/q」に、それぞれテクスチャサイズUSIZEおよびVSIZEが乗算され、テクスチャ座標データ(u,v)が生成される。
次に、第2のバッファメモリ51によって、前記生成されたテクスチャ座標データ(u,v)を含む読み出し要求が出力され、メモリI/F回路13を介して、DRAM16あるいはSRAM17に記憶された(R,G,B)データS17が読み出される。
そして、このとき、上述したように、図4および図10に示す構成を用いて、前述したMIPMAP処理およびテクスチャファンクション処理が行われ、画素データS12が生成される。
この画素データS12は、テクスチャエンジン回路12からメモリI/F回路13に出力される。
【0183】
そして、メモリI/F回路13において、テクスチャエンジン回路12から入力した画素データS12に対応するzデータと、zバッファ22に記憶されているzデータとの比較が行なわれ、入力した画素データS12によって描画される画像が、前回、ディスプレイバッファ21に書き込まれた画像より、手前(視点側)に位置するか否かが判断され、手前に位置する場合には、画像データS12がディスプレイバッファ21に書き込まれると共に、対応するzデータでzバッファ22に記憶されたzデータが更新される。
【0184】
本発明は上述した第1実施形態には限定されない。
例えば、上述した実施形態では、図5に示すモード「1」〜「8」を指定するファンクションモードデータFMDに基づいて、LIP回路61が動作する場合を例示したが、例えば、LIP回路61がアルファブレンディング処理を行うようにしてもよい。
【0185】
また、LIP回路61を共用する処理の内容および数は任意である。例えば、LIP回路61において、テクスチャファンクション処理として、デカル処理やアルファブレンディング処理などを行うようにしてもよい。
【0186】
第2実施形態
本実施形態の3次元コンピュータグラフィックシステム501は、基本的に前述した第1実施形態の3次元コンピュータグラフィックシステム1と同じであるが、図1に示すテクスチャエンジン回路12およびメモリI/F回路13においてパイプライン処理を行う点に特徴を有している。
以下、3次元コンピュータグラフィックシステム501の構成要素の機能のうち、前述した第1実施形態の3次元コンピュータグラフィックシステム1と異なる点を説明する。
【0187】
DDAセットアップ回路10
また、DDAセットアップ回路10は、同時に処理を行う8画素のそれぞれについて、処理対象となる三角形の内部に位置するか否かを示す1ビットの有効指示データvalを決定する。具体的には、有効指示データvalは、三角形の内部に位置する画素について「1」とし、三角形の外部に位置する画素について「0」とする。
DDAセットアップ回路10は、算出した変分データS10と、各画素の有効指示データvalとをトライアングルDDA回路11に出力する。
【0188】
トライアングルDDA回路11
トライアングルDDA回路11は、DDAセットアップ回路10から入力した変分データS10を用いて、三角形内部の各画素の線形補間された(z,R,G,B,α,s,t,q)データを算出する。
トライアングルDDA回路11は、各画素の(x,y)データと、当該(x,y)座標の画素についての(z,R,G,B,α,s,t,q,val)データとを、DDAデータ(補間データ)S11としてテクスチャエンジン回路12に出力する。
本実施形態では、トライアングルDDA回路11は、並行して処理を行う矩形内に位置する8画素分のDDAデータS11を単位としてテクスチャエンジン回路12に出力する。
【0189】
ここで、DDAデータS11の(z,R,G,B,α,s,t,q,val)データは、図19に示すように、161ビットのデータである。
具体的には、R,G,B,αデータがそれぞれ8ビットであり、z,s,t,qデータがそれぞれ32ビットであり、valデータが1ビットである。
なお、以下、並行して処理を行う8画素についての(z,R,G,B,α,s,t,q,val)データのうち、valデータをvalデータS2201 〜S2208 とし、(z,R,G,B,α,s,t,q)データを被演算データS2211 〜S2218 とする。
すなわち、トライアングルDDA回路11は、8画素分の(x,y)データと、valデータS2201 〜S2208 と、被演算データS2211 〜S2218 からなるDDAデータS11を図1に示すテクスチャエンジン回路12に出力する。
【0190】
テクスチャエンジン回路12およびメモリI/F回路13
テクスチャエンジン回路12による、DDAデータS11を用いた、縮小率LODの算出処理と、「s/q」および「t/q」の算出処理、テクスチャ座標データ(u,v)の算出処理、および、テクスチャバッファ20からの(R,G,B,α)データの読み出し処理と、メモリI/F回路13によるz比較処理とを、図3に示す演算ブロック200,201,202,204,205でパイプライン方式で順に実行する。
ここで、演算ブロック199,200,201,202,204,205は、それぞれ8個の演算サブブロックを内蔵しており、8画素分の演算処理を並行して行う。
ここで、テクスチャエンジン回路12が演算ブロック199,200,201,202を内蔵し、メモリI/F回路13が演算ブロック204を内蔵している。
また、演算ブロック199は図4に示す縮小率演算回路50、代表点決定回路301およびqデータ選択回路302に対応し、演算ブロック200,201,202は図4に示す読み出し回路51に対応し、演算ブロック203は図4に示すLIP回路52,53,54およびLIP/テクスチャファンクション回路55に対応している。
なお、LIP/テクスチャファンクション回路55では、例えば、MIMAP処理のレベル補間処理と、モジュレート処理、デカル処理、ハイライト処理、フォギング処理、テクスチャブレンディング処理およびアルファブレンディング処理などのテクスチャファンクション処理のうち一の処理が選択的に行われる。
【0191】
〔演算ブロック199〕
演算ブロック199は、第1実施形態で説明した縮小率演算回路304、代表点決定回路301およびqデータ選択回路302に対応する処理を行ってテクスチャデータの縮小率LODを算出して演算ブロック200に出力する。
縮小率LODは、演算ブロック200,201,202,203に順にシフトされる。
また、演算ブロック199は、トライアングルDDA回路11から入力したDDAデータS11を後段の演算ブロック200に出力する。
演算ブロック199は、valデータS2201 〜S2208 が示す値とは無関係に常に動作する。
【0192】
〔演算ブロック200〕
演算ブロック200は、DDAデータS11に含まれる(s,t,q)データを用いて、sデータをqデータで除算する演算と、tデータをqデータで除算する演算とを行う。
演算ブロック200は、図20に示すように、8個の演算サブブロック2001 〜2008 を内蔵する。
ここで、演算サブブロック2001 は、被演算データS2211 およびvalデータS2201 を入力し、valデータS2201 が「1」、すなわち有効であることを示す場合には、「s/q」および「t/q」を算出し、その算出結果を除算結果S2001 として演算ブロック201の演算サブブロック2011 に出力する。
【0193】
また、演算サブブロック2001 は、valデータS2201 が「0」、すなわち無効であることを示す場合には、演算は行わず、除算結果S2001 を出力しないか、あるいは、所定の仮値を示す除算結果S2001 を演算ブロック201の演算サブブロック2011 に出力する。
また、演算サブブロック2001 は、valデータS2201 を後段の演算サブブロック2011 に出力する。
なお、演算サブブロック2002 〜2008 も、それぞれ対応する画素について、演算サブブロック2001 と同じ演算を行い、それぞれ除算結果S2002 〜S2008 およびvalデータS2202 〜S2208 を後段の演算ブロック201の演算サブブロック2012 〜2018 にそれぞれ出力する。
【0194】
図21は、演算サブブロック2001 の内部構成図である。
なお、図3に示す、全ての演算サブブロックは、基本的に、図21に示す構成をしている。
図21に示すように、演算サブブロック2001 は、クロックイネーブラ2101 、データ用フリップフロップ222、プロセッサエレメント223およびフラグ用フリップフロップ224を有する。
クロックイネーブラ2101 は、システムクロック信号S225を基準としたタイミングでvalデータS2201 を入力し、valデータS2201 のレベルを検出する。そして、クロックイネーブラ2101 は、valデータS2201 が、「1」である場合には、例えば、クロック信号S2101 にパルス発生させ、「0」である場合には、クロック信号S2101 にパルス発生させない。
【0195】
データ用フリップフロップ222は、クロック信号S2101 のパルスを検出すると、被演算データS2211 を取り込み、プロセッサエレメント223に出力する。
プロセッサエレメント223は、入力した被演算データS2211 を用いて前述した除算を行い、除算結果S2001 を演算サブブロック2011 のデータ用フリップフロップ222に出力する。
フラグ用フリップフロップ224は、システムクロック信号S225を基準としたタイミングで、valデータS2201 を取り込み、後段の演算ブロック201の演算サブブロック2011 のフラグ用フリップフロップ224に出力する。
なお、図21に示すシステムクロック信号S225は、図20に示す演算ブロック199、並びに全ての演算サブブロック2001 〜2008 ,2011 〜2018 ,2021 〜2028 ,2041 〜2048 のクロックイネーブラおよびフラグ用フリップフロップ224に供給される。
すなわち、演算サブブロック2001 〜2008 ,2011 〜2018 ,2021 〜2028 ,2041 〜2048 における処理は同期して行われ、同一の演算ブロックに内蔵された8個の演算サブブロックは並行して処理を行う。
【0196】
〔演算ブロック201〕
演算ブロック201は、演算サブブロック2011 〜2018 を有し、演算ブロック200から入力した除算結果S2001 〜S2008 が示す「s/q」および「t/q」に、それぞれテクスチャサイズUSIZEおよびVSIZEを乗じて、テクスチャ座標データ(u,v)を生成する。
演算サブブロック2011 〜2018 は、それぞれクロックイネーブラ2111 〜2118 によりvalデータS2201 〜S2208 のレベル検出を行った結果、当該レベルが「1」の場合にのみ演算を行い、それぞれ演算結果であるテクスチャ座標データS2011 〜S2018 を、演算ブロック202の演算サブブロック2021 〜2028 に出力する。
【0197】
〔演算ブロック202〕
演算ブロック202は、演算サブブロック2021 〜2028 を有し、メモリI/F回路13を介して、SRAM17あるいはDRAM16に、演算ブロック201で生成したテクスチャ座標データ(u,v)を含む読み出し要求を出力し、メモリI/F回路13を介して、SRAM17あるいはテクスチャバッファ20に記憶されているテクスチャデータを読み出すことで、(u,v)データに対応したテクスチャアドレスに記憶された(R,G,B,α)データS17を得る。
なお、テクスチャバッファ20には、MIPMAP(複数解像度テクスチャ)などの複数の縮小率に対応したテクスチャデータが記憶されている。ここで、何れの縮小率のテクスチャデータを用いるかは、所定のアルゴリズムを用いて、前記三角形を単位として決定される。
また、SRAM17には、テクスチャバッファ20に記憶されているテクスチャデータのコピーが記憶されている。
演算サブブロック2021 〜2028 は、それぞれクロックイネーブラ2121 〜2128 によりvalデータS2201 〜S2208 のレベル検出を行った結果、当該レベルが「1」の場合にのみ読み出し処理を行い、それぞれ読み出した(R,G,B,α)データS17を、(R,G,B,α)データS2021 〜S2028 として、それぞれ演算ブロック203の演算サブブロック2031 〜2038 に出力する。
【0198】
なお、テクスチャエンジン回路12は、フルカラー方式の場合には、テクスチャバッファ20から読み出した(R,G,B,α)データを直接用いる。一方、テクスチャエンジン回路12は、インデックスカラー方式の場合には、予め作成したカラールックアップテーブル(CLUT)をテクスチャCLUTバッファ23から読み出して、内蔵するSRAMに転送および記憶し、このカラールックアップテーブルを用いて、テクスチャバッファ20から読み出したカラーインデックスに対応する(R,G,B)データを得る。
【0199】
〔演算ブロック203〕
演算ブロック203は、演算サブブロック2031 〜2038 を有し、図4に示すLIP回路52,53,54およびLIP/テクスチャファンクション回路55を用いて、例えば、MIMAP処理のレベル補間処理と、モジュレート処理、デカル処理、ハイライト処理、フォギング処理、テクスチャブレンディング処理およびアルファブレンディング処理などのテクスチャファンクション処理のうち一の処理を選択的に行う。
【0200】
そして、演算ブロック203は、処理結果である(R,G,B,α)データS2031 〜S2038 を、演算ブロック204に出力する。
演算サブブロック2031 〜2038 は、それぞれクロックイネーブラ2131 〜2138 によりvalデータS2201 〜S2208 のレベル検出を行った結果、当該レベルが「1」の場合にのみ混合テクスチャファンクション処理および(R,G,B,α)データS2031 〜S2038 の出力を行う。
【0201】
〔演算ブロック204〕
演算ブロック204は、演算サブブロック2041 〜2048 を有し、入力した(R,G,B,α)データS2031 〜S2038 について、zバッファ22に記憶されたzデータの内容を用いて、z比較を行い、(R,G,B,α)データS2031 〜S2038 によって描画する画像が、前回、ディスプレイバッファ21に描画した値よりも手前(視点側)に位置する場合には、zバッファ22を更新すると共に、(R,G,B,α)データS2031 〜S2038 を、(R,G,B,α)データS2041 〜S2048 として、ディスプレイバッファ21に書き込む。
演算サブブロック2041 〜2048 は、それぞれクロックイネーブラ2141 〜2148 によりvalデータS2201 〜S2208 のレベル検出を行った結果、当該レベルが「1」の場合にのみ上述したz比較およびディスプレイバッファ21への書き込みを行う。
なお、メモリI/F回路13によるDRAM16に対してのアクセスは、16画素について同時に行なわれる。
【0202】
以下、3次元コンピュータグラフィックシステム501の全体動作について説明する。
ポリゴンレンダリングデータS4が、メインバス6を介してメインプロセッサ4からDDAセットアップ回路10に出力され、DDAセットアップ回路10において、三角形の辺と水平方向の差分などを示す変分データS10が生成される。
この変分データS10は、トライアングルDDA回路11に出力され、トライアングルDDA回路11において、三角形内部の各画素における線形補間された(z,R,G,B,α,s,t,q)データが算出される。そして、この算出された(z,R,G,B,α,s,t,q)データと、三角形の各頂点の(x,y)データとが、DDAデータS11として、トライアングルDDA回路11からテクスチャエンジン回路12に出力される。
【0203】
次に、テクスチャエンジン回路12およびメモリI/F回路13において、DDAデータS11を用いて、縮小率LODの算出処理、「s/q」および「t/q」の算出処理、テクスチャ座標データ(u,v)の算出処理、テクスチャバッファ20からのデジタルデータとしての(R,G,B,α)データの読み出し処理、テクスチャファンクション処理、および、z比較処理が、図20に示す演算ブロック199,200,201,202,,203,204でパイプライン方式で順に実行される。
【0204】
次に、図1に示すテクスチャエンジン回路12およびメモリI/F回路13のパイプライン処理の動作について説明する。
ここでは、例えば、図7に示す矩形251内の8画素について同時処理する場合を考える。この場合には、valデータS2201 ,S2202 ,S2203 ,S2205 ,S2206 が「0」を示し、valデータS2204 ,S2207 ,S2208 が「1」を示している。
【0205】
そして、valデータS2201 〜S2208 および被演算データS2211 〜S2218 が、演算ブロック199に入力され、演算ブロック199において、I7 の画素を代表点として縮小率LODが算出され、当該算出された縮小率LOD、valデータS2201 〜S2208 および被演算データS2211 〜S2218 が演算ブロック200に出力される。
【0206】
次に、valデータS2201 〜S2208 および被演算データS2211 〜S2218 が、それぞれ対応する演算サブブロック2001 〜2008 のクロックイネーブラ2101 〜2108 に入力される。
そして、クロックイネーブラ2101 〜2108 において、それぞれvalデータS2201 〜S2208 のレベルが検出される。具体的には、クロックイネーブラ2104 ,2107 ,2108 において「1」が検出され、クロックイネーブラ2101 ,2102 ,2103 ,2105 ,2106 において「0」が検出される。
その結果、演算サブブロック2004 ,2007 ,2008 においてのみ、被演算データS2214 ,S2217 ,S2218 を用いて、「s/q」および「t/q」が算出され、当該除算結果S2004 ,S2007 ,S2008 が演算ブロック201の演算ブロック2014 ,2017 ,2018 に出力される。
一方、演算サブブロック2001 ,2002 ,2003 ,2005 ,2006 では、除算は行なわれない。
また、除算結果S2004 ,S2007 ,S2008 の出力と同期して、valデータS2201 〜S2208 が、演算ブロック201の演算サブブロック2011 〜2018 に出力される。
【0207】
次に、演算サブブロック2011 〜2018 のクロックイネーブラ2101 〜2108 において、それぞれvalデータS2201 〜S2208 のレベルが検出される。
そして、この検出結果に基づいて、演算サブブロック2014 ,2017 ,2018 においてのみ、除算結果S2004 ,S2007 ,S2008 が示す「s/q」および「t/q」に、それぞれテクスチャサイズUSIZEおよびVSIZEを乗じて、テクスチャ座標データS2024 ,S2027 ,S2028 が生成され、それぞれ演算ブロック202の演算サブブロック2024 ,2027 ,2028 に出力される。
一方、演算サブブロック2011 ,2012 ,2013 ,2015 ,2016 では、演算は行なわれない。
また、テクスチャ座標データS2024 ,S2027 ,S2028 の出力と同期して、valデータS2201 〜S2208 が、演算ブロック202の演算サブブロック2021 〜2028 に出力される。
【0208】
次に、演算サブブロック2021 〜2028 のクロックイネーブラ2121 〜2128 において、それぞれvalデータS2201 〜S2208 のレベルが検出される。
そして、この検出結果に基づいて、演算サブブロック2024 ,2027 ,2028 においてのみ、SRAM17あるいはテクスチャバッファ20に記憶されているテクスチャデータの読み出し処理が行なわれ、(s,t)データに対応したテクスチャアドレスに記憶された(R,G,B,α)データが読み出される。そして、この読み出した(R,G,B,α)データS2024 ,S2027 ,S2028 が、演算ブロック204の演算サブブロック2034 ,2037 ,2038 に出力される。
一方、演算サブブロック2021 ,2022 ,2023 ,2025 ,2026 では、読み出し処理は行なわれない。
また、(R,G,B,α)データS2024 ,S2027 ,S2028 の出力と同期して、valデータS2201 〜S2208 が、演算ブロック203の演算サブブロック2031 〜2038 に出力される。
【0209】
次に、演算サブブロック2031 〜2038 のクロックイネーブラ2121 〜2128 において、それぞれvalデータS2201 〜S2208 のレベルが検出される。
そして、この検出結果に基づいて、演算サブブロック2034 ,2037 ,2038 においてのみ、テクスチャファンクション処理が行われ、それによって得られた(R,G,B,α)データS2034 ,2037 ,2038 を、演算ブロック204に出力する。
一方、演算サブブロック2031 ,2032 ,2033 ,2035 ,2036 では、テクスチャファンクション処理は行なわれない。
【0210】
次に、演算サブブロック2041 〜2048 のクロックイネーブラ2141 〜2148 において、それぞれvalデータS2201 〜S2208 のレベルが検出される。
そして、この検出結果に基づいて、演算サブブロック2044 ,2047 ,2048 においてのみ、(R,G,B,α)データS2034 ,S2037 ,S2038 について、zバッファ22に記憶されたzデータの内容を用いて、z比較が行なわれ、(R,G,B,α)データS2034 ,S2037 ,S2038 によって描画する画像が、前回、ディスプレイバッファ21に描画した値よりも手前に位置する場合には、zバッファ22が更新されると共に、(R,G,B,α)データS2034 ,S2037 ,S2038 がディスプレイバッファ21に書き込まれる。
【0211】
すなわち、テクスチャエンジン回路12およびメモリI/F回路13では、図6に示す矩形251の画素について同時に処理を行なう場合に、三角形250の外に位置する画素についての処理は行なわない。すなわち、図6に示す矩形251内の画素についての演算を行なっている間は、演算サブブロック2001 ,2002 ,2003 ,2005 ,2006 ,2011 ,2012 ,2013 ,2015 ,2016 ,2021 ,2022 ,2023 ,2025 ,2026 ,2041 ,2042 ,2043 ,2045 ,2046 は停止した状態になり、これらの演算サブブロックは電力を消費しない。
【0212】
以上説明したように、3次元コンピュータグラフィックシステム501は、前述した第1実施形態の3次元コンピュータグラフィックシステム1の効果に加えて以下に示す効果をさらに有する
すなわち、3次元コンピュータグラフィックシステム501によれば、テクスチャエンジン回路12におけるパイプライン処理において、同時処理する8画素のうち、処理対象となる三角形の外部に位置する画素についての演算は行なわないようにすることができる。
そのため、テクスチャエンジン回路12における消費電力を大幅に低減できる。その結果、3次元コンピュータグラフィックシステム501の電源として、簡単かつ安価なものを用いることができる。
なお、テクスチャエンジン回路12は、図20および図21に示すように、各演算サブブロックに、クロックイネーブラおよび1ビットのフラグ用フリップフロップを組み込むことで、上述した機能を実現するが、クロックイネーブラおよび1ビットのフラグ用フリップフロップの回路規模は小さいため、テクスチャエンジン回路12の回路規模が大幅に増大することはない。
【0213】
本発明は上述した実施形態には限定されない。
上述した実施形態では、同時に処理を行おうとする複数の画素データについて共通の縮小率を用いて記憶回路からテクスチャデータを読み出す場合を例示したが、前記複数の画素データについての個別に縮小率を算出する複数の縮小率算出回路を設けてもよい。この場合に、読み出し回路は、同時に処理を行おうとする複数の画素データにそれぞれ対応した複数設けられ、記憶回路、複数の縮小率算出回路および複数の読み出し回路が一つの半導体チップに混載される。
また、読み出し回路によって読み出したテクスチャデータを用いて同時に処理を行って複数の表示データを生成する複数の画像処理回路と、当該生成した表示データをDRAMなどの記憶回路に書き込む複数の書き込み回路とをさらに設け、記憶回路、複数の縮小率算出回路、複数の読み出し回路、複数の画像処理回路および複数の書き込み回路を一つの半導体チップに混載してもよい。
【0214】
【発明の効果】
以上説明したように、本発明の画像処理装置によれば、小規模な装置構成で、高画質を安定して提供できる。
【図面の簡単な説明】
【図1】図1は、本発明の実施形態の3次元コンピュータグラフィックシステムの構成図である。
【図2】図2は、図1に示すDDAセットアップ回路における有効ビットデータの生成方法を説明するための図である。
【図3】図3は、図1に示すSARAMおよひテクスチャバッファに記憶されているMIPMAP処理に用いられるテクスチャデータを説明するための図である。
【図4】図4は、図1に示すテクスチャエンジン回路の構成図である。
【図5】図5は、図4に示す代表点決定回路における処理のフローチャートである。
【図6】図6は、図4に示す代表点決定回路における処理を説明するための図である。
【図7】図7は、図2に示す三角形を処理対象としている場合の代表点の具体例を説明するための図である。
【図8】図8は、図4に示す縮小率算出回路の構成図である。
【図9】図9は、図8に示す縮小率算出回路の処理内容を説明するための図である。
【図10】図10は、図4に示すLIP/テクスチャファンクション回路の構成図である。
【図11】図11は、各モードにおいて、LIP回路に入力されるデータを説明するための図である。
【図12】図12は、LIP回路からLIP/テクスチャファンクション回路へのミップマップデータの入力タイミングおよびレベル補間処理の実行タイミングを説明するための図である。
【図13】図13は、図4に示すLIP回路の処理を説明するための図である。
【図14】図14は、図4に示すLIP回路の処理を説明するための図である。
【図15】図15は、図13に示す前段の加算回路の部分構成図である。
【図16】図16は、図1に示すDRAMに対してのデータ格納方法を説明するための図である。
【図17】図17は、図1に示すレンダリング回路のロジック回路とDARAMおよび2次メモリとの好適な構成、配置および配線方法を説明するための図である。
【図18】図18は、図17に示すDRAMモジュールの構成を説明するための図である。
【図19】図19は、本発明の第2実施形態の3次元コンピュータグラフィックシステムにおいて、図1に示すトライアングルDDA回路から出力されるDDAデータのフォーマットを説明するための図である。
【図20】図20は、本発明の第2実施形態の3次元コンピュータグラフィックシステムにおけるテクスチャエンジン回路およびメモリI/F回路の部分構成図である。
【図21】図21は、図20に示す演算サブブロックの構成図である。
【図22】図22は、MIPMAPフィルタリング処理を説明するための図である。
【図23】図23は、従来の一般的なテクスチャマッピング装置を説明するための図である。
【図24】図24は、図23に示すテクスチャマッピング装置における処理のフローチャートである。
【図25】図25は、高速処理を実現するテクスチャマッピング装置を説明するための図である。
【符号の説明】
1…3次元コンピュータグラフィックシステム、2…メインメモリ、3…I/Oインタフェース回路、4…メインプロセッサ、5…レンダリング回路、10…DDAセットアップ回路、11…トライアングルDDA回路、12…テクスチャエンジン回路、13…メモリI/F回路、14…CRTコントローラ回路、15…RAMDAC回路、16…DRAM、17…SRAM、20…テクスチャバッファ、21…ディスプレイバッファ、22…Zバッファ、23…テクスチャCLUTバッファ、301…代表点決定回路、302…stq選択回路、50…縮小率演算回路、51…テクスチャデータ読み出し回路、55…LIP/テクスチャファンクション回路[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus capable of providing a high-quality image with a small configuration.
[0002]
[Prior art]
Computer graphics are often used in various CAD (Computer Aided Design) systems and amusement machines. In particular, with the recent development of image processing technology, systems using three-dimensional computer graphics are rapidly spreading.
In such 3D computer graphics, when determining the color corresponding to each pixel (pixel), the color value of each pixel is calculated, and the calculated color value is used as the display buffer corresponding to the pixel. Rendering processing to write to the (frame buffer) address.
One of the rendering processing methods is polygon rendering. In this method, a three-dimensional model is expressed as a combination of triangular unit graphics (polygons), and the color of the display screen is determined by drawing with the polygon as a unit.
[0003]
In polygon rendering, the coordinates (x, y, z), color data (R, G, B), and the homogeneous coordinates (s of texture data indicating the image pattern of pasting for each vertex of the triangle in the physical coordinate system. , T) and the value of the homogeneous term q are interpolated inside the triangle.
Here, simply speaking, the homogeneous term q is like an enlargement / reduction ratio, and the coordinates in the UV coordinate system of the actual texture buffer, that is, the texture coordinate data (U, V), are represented by the homogeneous coordinates (s , T) divided by the homogeneous term q and (s / q, t / q) = (u, v) are multiplied by the texture sizes USIZE and VSIZE, respectively, according to the multiplication results.
[0004]
In such a three-dimensional computer graphic system using polygon rendering, when drawing is performed, texture data is read from the texture buffer, and the read texture data is pasted on the surface of the three-dimensional model to obtain highly realistic image data. Perform texture mapping.
When texture mapping is performed on the stereo model, the enlargement / reduction ratio of the image indicated by the texture data to be pasted changes for each pixel.
[0005]
By the way, there is MIP (Multum In Parvo) MAP (Multiple Resolution Texture) filtering as a technique for obtaining high image quality when performing texture mapping.
In this MIPMAP filtering, as shown in FIG. 22, a plurality of filtered
[0006]
Hereinafter, a conventional three-dimensional computer graphic system employing the above-described MIPMAP filtering will be described.
FIG. 23 is a diagram for explaining the configuration of a conventional three-dimensional computer graphic system, and FIG. 24 is a flowchart of processing in the
As shown in FIG. 23, in a conventional three-dimensional computer graphic system, a
[0007]
Hereinafter, processing in the
Step S1: First, the
Step S2: Next, the
[0008]
Step S3: The
Step S4: The
Next, the
[0009]
Step S5: The
Step S6: The
Thereby, access to the texture data corresponding to the reduction rate lod among the plurality of texture data stored in the
[0010]
In order to realize high-speed drawing, there is a high-speed texture mapping apparatus that performs texture mapping processing on a plurality of pixels in parallel and simultaneously writes the pixel data in a display buffer.
In such a high-speed texture mapping apparatus, as shown in FIG. 25, (s1, t1, q1), (s2, t2, q2), (s3, t3, q3) data about the vertices of a triangle are converted into n pieces of data.
That is, texture mapping processing for a plurality of pixels is performed in parallel (simultaneously).
[0011]
Note that the texture mapping process is performed in units of triangles that are unit graphics, and processing conditions such as the reduction rate of texture data are determined in units of triangles, and among the plurality of pixels that are processed simultaneously, the inside of the triangle Only the processing result for the pixel located at is valid, and the processing result for the pixel located outside the triangle is invalid.
[0012]
[Problems to be solved by the invention]
However, in the above-described conventional three-dimensional computer graphic system, the data transfer speed between the
[0013]
Further, in the conventional three-dimensional computer graphic system described above, the
[0014]
In addition, the calculation for obtaining the reduction ratio lod includes a large number of multiplications and divisions and requires a huge amount of calculation.
Accordingly, as shown in FIG. 25, n
In order to solve such a problem, among a plurality of texture mapping devices that perform processing in parallel, only one texture mapping device incorporates a reduction rate calculation device, and a pixel to be processed by the texture mapping device is determined. A method of using the reduction rate obtained by the reduction rate calculation device as a representative point for obtaining the reduction rate in all the texture mapping devices can be considered.
In this case, the position of the pixel serving as the representative point among the plurality of pixels that are processed simultaneously is fixed.
Therefore, a pixel located outside the triangle that is the unit graphic described above may be a representative point among a plurality of pixels that are processed simultaneously.
However, the reduction ratio may be greatly different between the inside and outside of the triangle, and when the pixel located outside the triangle to be processed is the representative point, the pixel located inside the triangle is optimal. Cannot select the correct texture data. As a result, there is a problem that the image quality is greatly reduced.
[0015]
The present invention has been made in view of the above-described problems of the prior art, and an object thereof is to provide an image processing apparatus that can stably provide high image quality with a small-scale apparatus configuration.
[0016]
[Means for Solving the Problems]
According to the present invention, an image that represents a display model by combining unit graphics composed of a plurality of pixels to which common processing conditions are applied, and generates pixel data corresponding to the pixels using texture data as necessary. In the processing device,
The display model is a three-dimensional model;
The unit figure is a triangle;
A storage circuit for storing display data and a plurality of texture data corresponding to different reduction ratios for the same pattern;
A reduction ratio calculation circuit for calculating a reduction ratio commonly used for a plurality of pixel data to be processed simultaneously;
A readout circuit for reading out the texture data corresponding to the calculated reduction ratio from the storage circuit;
An image processing circuit that generates display data by simultaneously processing the plurality of pixel data using the read texture data;
A writing circuit for writing the generated display data into the storage circuit;
A representative point determination circuit for determining a pixel as a representative point from among the pixels corresponding to the plurality of pixel data to be processed at the same time, among the pixels located inside the unit graphic to be processed;
Have
The reduction rate calculation circuit substantially calculates LOD indicating the reduction rate based on the following formula,
LOD = Clamp (((log 2 1 / q) + maxe)
<< L + K)
here,
LOD is composed of an integer part and a decimal part, and is a symbol indicating an unsigned reduction rate,
Clamp is a symbol indicating clamping in the following clamp circuit,
q is a symbol indicating the homogeneous term,
maxe is data consisting only of an integer part indicating the maximum coordinate of the homogeneous coordinates (s, t) and the homogeneous term q of the vertex of the unit graphic to be processed;
<< L indicates that data is shifted by L bits in the shift circuit described below.
K is composed of an integer part and a decimal part, is signed, and is data used for addition in the following addition circuit,
A normalization circuit that normalizes the homogeneous term data q to generate an exponent qe and a mantissa qm;
A first shift circuit that shifts data obtained by bit-combining the exponent qe and the mantissa qm toward a MSB (Most Significant Bit) by a value indicated by the data L;
A first inverting circuit for inverting the output of the first shift circuit;
Enter the mantissa qm and enter "log 2 Data output means for outputting data μ indicating ({1, qm}) − qm ”;
A second shift circuit that shifts data obtained by bit-combining the data maxe and the data μ toward the MSB by a value indicated by the data L;
A second inverting circuit for inverting the output of the second shift circuit;
An addition circuit for adding the data obtained by bit-combining the data K and the binary number “10”, the output of the first inversion circuit, and the output of the second inversion circuit;
A clamp circuit for clamping the output of the adder circuit within a predetermined bit to generate the reduction ratio LOD;
Have
The readout circuit receives texture data specified by the determined reduction ratio, the homogeneous coordinates (s, t), and the homogeneous term q from the storage circuit for each of the plurality of pixel data to be processed simultaneously. read out,
An image processing apparatus is provided.
[0038]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, in this embodiment, a three-dimensional computer graphic that displays a desired three-dimensional image of an arbitrary three-dimensional object model applied to a home game machine or the like on a display such as a CRT (Cathode Ray Tube) at high speed. A case where the image processing apparatus of the present invention is applied to the system will be described.
FIG. 1 is a system configuration diagram of a three-dimensional computer
The three-dimensional computer
Further, in the three-dimensional computer
[0039]
As shown in FIG. 1, a three-dimensional computer
Here, the
Hereinafter, the function of each component will be described.
The
The I /
[0040]
Here, the polygon rendering data includes (x, y, z, R, G, B, COE at each of the three vertices of the polygon.blend, S, t, q, COEfog) Data.
Here, (x, y, z) data indicates the three-dimensional coordinates of the vertices of the polygon, and (R, G, B) data indicates the red, green, and blue luminance values in the three-dimensional coordinates. ing.
Data COEblendIndicates a blend coefficient of R, G, B data of a pixel to be drawn from now and a pixel already stored in the
Of the (s, t, q) data, (s, t) indicates the homogeneous coordinates of the corresponding texture, and q indicates the homogeneous term. Here, “s / q” and “t / q” are multiplied by the texture sizes USIZE and VSIZE, respectively, to obtain texture coordinate data (u, v). Access to the texture data stored in the
Data COEfogIndicates a mixing coefficient used in the fogging process.
[0041]
Hereinafter, the
As shown in FIG. 1, the
Here, the
[0042]
The
The clock signal S18 from the clock
[0043]
DRAM16
The
[0044]
Prior to obtaining the color and depth information of each pixel inside the triangle by linearly interpolating the value of each vertex of the triangle on the physical coordinate system in the
Specifically, this set-up calculation uses the start point value, end point value, and distance between the start point and end point to calculate the variation of the value to be obtained when the unit length is moved. .
[0045]
That is, the
The
[0046]
The
In addition, the
Effective bit data I1~ I8Is, for example, “1” for a pixel located inside the triangle and “0” for a pixel located outside the triangle.
Specifically, as shown in FIG. 2, the effective bit data I for a
In FIG. 2, a solid line indicates a rectangular area to which 8 (= 2 × 4) pixels to be processed simultaneously belong.
The
Here, (R, G, B) data S11b and (s, t, q) data S11a shown in FIG.1~ S11a8Is (z, R, G, B, COEblend, S, t, q, COEfog) Obtained from the data.
In this embodiment, the
[0047]
The
Note that the
The
[0048]
The
[0049]
In the MIPMAP processing, 4-point neighborhood interpolation processing for calculating (R, G, B) data of a pixel at a desired position in two dimensions from (R, G, B) data S17, and a reduction rate LOD (Level Of Detail). Level interpolation processing is performed to interpolate the levels.
In the
Which reduction rate LOD texture data is to be used is determined using the reduction rate LOD calculated in units of polygons using a predetermined algorithm.
Note that the
[0050]
First, the 4-point neighborhood interpolation process of the MIPMAP process performed by the
In the 4-point neighborhood interpolation process, (R, G, B) data of points near 4 of the coordinates are obtained from the coordinates of the pixels to which the texture data is assigned.
For example, when the reduction ratio LOD is 1.0, the (R, G, B) data S17 of the
Then, 4-point neighborhood interpolation data C, which is (R, G, B) data at position pixel0 shown in FIG.pixel0(R, G, B) data C of the four neighboring points A0, B0, C0, D0 of the position pixel0A0, CB0, CC0, CD0Is obtained based on the following formulas (3) to (5).
At this time, (R, G, B) data CA0, CB0, CC0, CD0Is obtained from the (R, G, B) data S17 of the
In the following formulas (3) to (5), a and b indicate the decimal part of the u coordinate and v coordinate of the position pixel0, respectively.
[0051]
[Equation 3]
CAB0= CB0× a + CA0× (1-a) (3)
[0052]
[Expression 4]
CCD0= CD0× a + CC0× (1-a) (4)
[0053]
[Equation 5]
Cpixel0= CCD0Xb + CAB0× (1-b) (5)
[0054]
Next, reduction level level interpolation processing will be described.
Here, a level interpolation process called tri-linear will be described as an example.
For example, when the reduction ratio LOD is 1.5, the
[0055]
That is, the 4-point neighborhood interpolation data C described abovepixel0Following this calculation process, the (R, G, B) data S17 of the
Then, the
At this time, (R, G, B) data CA1, CB1, CC1, CD1Is obtained from the (R, G, B) data S17 of the
In the following formulas (6) to (8), c and d indicate the decimal part of the u and v coordinates of the position pixel1, respectively.
[0056]
[Formula 6]
CAB1= CB1× c + CA1× (1-c) (6)
[0057]
[Expression 7]
CCD1= CD1× c + CC1× (1-c) (7)
[0058]
[Equation 8]
Cpixel1= CCD1Xd + CAB1× (1-d) (8)
[0059]
Next, the
[0060]
[Equation 9]
Cpixel= Cpixel1× COEmipmap+ Cpixel0× (1-COEmipmap)
... (9)
[0061]
Next, texture function processing performed by the
The texture function processing performed in the
Here, the modulation process is a process of modulating the color indicated by the fragment data with the color indicated by the texture data.
In the present embodiment, the fragment data is (R, G, B) data S11b included in the DDA data S11 input from the
The decal process is a process for replacing the color indicated by the fragment data with the color indicated by the texture data.
The highlight process is a process of adding the addition data Hi to the multiplication result in order to produce a highlight effect.
The fogging process is a process that produces an effect of blurring a distant object.
The alpha blending process is a process of mixing the color indicated by the source data and the color indicated by the destination data at a predetermined mixing ratio.
Here, the color indicated by the source data is the color indicated by the data stored in the
[0062]
These texture function processes convert texture data into Ctex, Fragment data into CflagThe addition data of the highlight processing is Hi, and the data after the modulation processing is Cmod, C after decal processingdclThe data after highlight processing is ChghThen, it can be expressed as the following formulas (10) to (12).
In Expression (12), Hi indicates addition data for highlighting.
[0063]
[Expression 10]
Cmod= Ctex× Cflag (10)
[0064]
## EQU11 ##
Cdcl= Ctex ... (11)
[0065]
[Expression 12]
Chgh= Ctex× Cflag+ Hi (12)
[0066]
In addition, the fogging process and the alpha blending process convert the fragment data into Cflag, Fog data is Cfog, Fog coefficient datafog, Source (color) data Csrc, Destination (color) data to Cdst, COE blending coefficientblendAnd the data after fogging is Cfogged, C after blending datablendThen, the following equations (13) and (14) are given.
[0067]
[Formula 13]
Cfogged= Cflag× COEfog+ Cfog× (1-COEfog)
... (13)
[0068]
[Expression 14]
Cblend= Csrc× COEblend+ Cdst× (1-COEblend)
... (14)
[0069]
As described above, the level interpolation process and the texture function process of the MIPMAP process expressed by the expressions (9) to (14) can be expressed by the following expression (15) using the data A, B, COE, C, and D. .
In the present embodiment, utilizing this, the
[0070]
[Expression 15]
D = A * COE + B (1-COE) (15)
[0071]
FIG. 4 is a partial circuit diagram of the
As shown in FIG. 4, the
Here, the reduction
Each component in the
The
[0072]
Hereinafter, the components of the
[Representative point determination circuit 301]
The representative
Specifically, the representative
[0073]
FIG. 5 is a flowchart of representative point determination processing in the representative
Step S11: First, the representative
Step S12: The representative
[0074]
Step S13: The representative
At this time, if there are a plurality of pixels closest to the center of the rectangular area, it is determined whether or not these x coordinates are the same. If these x coordinates are different, the processing shown in step S16 is performed. Executed. In step S16, the pixel having the smallest x coordinate among the plurality of pixels closest to the center of the rectangular area is determined as the representative point.
[0075]
Step S14: When there are a plurality of pixels closest to the center of the rectangular area and these x coordinates are the same, the representative
[0076]
Hereinafter, the determination of the representative point in the representative
FIG. 6 is a diagram for explaining representative point determination in the representative
Effective bit data I1~ I8The pixel arrangement corresponding to is set as shown in FIG. Here, A is the center of the rectangular area of the pixels to be processed simultaneously.
For example, as shown in FIG.FourIf only one is “1”, the representative
[0077]
As shown in FIG. 6C, the effective bit data I6And I7Is “1” and the x-coordinates of the corresponding pixels are different, the effective bit data I having a small x-coordinate6The pixel corresponding to is determined as a representative point.
As shown in FIG. 6D, the effective bit data IThreeAnd I7Is “1” and the corresponding pixel has the same x-coordinate, the effective bit data I having a small y-coordinate7The pixel corresponding to is determined as a representative point.
Further, as shown in FIG. 6E, the effective bit data I2, IThree, I6And I7Is "1", the effective bit data I having the smallest x-coordinate and y-coordinate6The pixel corresponding to is determined as a representative point.
[0078]
Further, for the
In this way, the representative
As a result, appropriate texture data can be reliably selected for the pixels located inside the triangle, and high image quality can be stably provided.
In this embodiment, simultaneous processing is performed for 8 pixels, but only one reduction
[0079]
[Q data selection circuit 302]
The q
[0080]
[Reduction ratio calculation circuit 304]
The reduction ratio calculation circuit 304 calculates the texture data reduction ratio LOD based on the maxe data S11c from the
Here, the maxe data S11c indicates the maximum index among the indices of the s, t, and q data of the vertices of the triangle to be processed as shown in FIG.
As described above, the reduction ratio calculation circuit 304 calculates the reduction ratio using the q data of the pixel determined as the representative point by the representative
[0081]
Here, the reduction ratio LOD indicates how much the texture data of the original image is reduced. When the reduction ratio of the original image is 1/1, 1/2, 1 / 4, 1/8,...
The reduction rate LOD calculation processing in the reduction rate calculation circuit 304 is expressed by the following equation (16).
[0082]
[Expression 16]
LOD = Clamp (((log21 / q) −maxe) << L + K)
... (16)
[0083]
In the above formula (16),
LOD: Indicates reduction ratio,
maxe: indicates the maximum exponent of s, t, q of the vertices of the triangle shown in FIG. 2,
q:
L: 2 bits, unsigned data, the maximum value of L is decimal number “3”
K:
[0084]
Hereinafter, the reduction
FIG. 8 is a configuration diagram of the reduction
As illustrated in FIG. 8, the reduction
Here, the
The reduction
[0085]
The
[0086]
The
[0087]
The data “a” output from the
[0088]
The
[0089]
The
[0090]
The table 203 includes data qm and “log”2({1, qm}) − qm ”, and“ log ”corresponding to the data qm using the data qm (= b2) input from the
In addition, instead of the table 203, the input data qm is used and “log”2A program that automatically generates ({1, qm}) − qm ”may be used.
[0091]
The maxe data S11c input from the
[0092]
The
[0093]
The
[0094]
Further, data K and “10” are combined by adding “0” of 1 bit before “10” so that the decimal part becomes 7 bits, and the data {K, 3′b0 after the bit combination is combined. , 10} is output to the
[0095]
The
[0096]
The
[0097]
In the reduction
In the reduction
[0098]
FIG. 9 is a diagram for explaining processing in the reduction
Hereinafter, the operation of the reduction
Here, a case where the calculation process of the equation (16) is performed in the reduction
[0099]
q = (0001001110.10100):
maxe = (00000001.0000000):
L = (01):
K = (00010011.0000):
[0100]
q (0001001110.10100) which is q data S302 output from the
Next, in the
[0101]
Next, in the
Next, in the table 203, 4-bit data μ (“log” corresponding to the mantissa qm (0011101) is stored.2Μ (1000) which is ({1, qm}) − qm ″) is obtained, and μ (1000) is output.
[0102]
Next, data maxe (00000001) and data μ (1000) input from the
[0103]
Next, the
Next, in the
[0104]
Also, the data a (00000110) output from the
[0105]
Next, in the
[0106]
Next, in the
[0107]
Further, data K (00010011.0000) and “10” are combined by adding “0” of 1 bit before “10” so that the decimal part becomes 7 bits, and the data { K, 3′b0,10} = (00010011.0000010) is output to the
[0108]
Next, the
[0109]
Next, in the
[0110]
[Read circuit 51]
The
At this time, when the decimal part of the reduction ratio LOD input from the reduction
[0111]
[
The
Subsequently, the
[0112]
The
Subsequently, the
The operation of the
[0113]
[LIP circuit 54]
The
At this time, if the fractional part of the reduction ratio LOD is not 0, the
For example, when the reduction ratio LOD is 1.5 as described above, the
The configuration and processing of the
[0114]
[LIP / texture function circuit 55]
FIG. 10 is a configuration diagram of the LIP /
The LIP /
Specifically, the LIP /
Further, the LIP /
[0115]
As shown in FIG. 10, the LIP /
As shown in FIG. 10, the
As shown in FIG. 10, the mode controller 70 includes a
[0116]
The
For example, the
In this embodiment, the case where “0”, “1”, and “2” are used as the initial values to be set in the
The
The function mode data FMD designates, for example, modes “1” to “8” shown in FIG. 11 for each clock cycle, and controls to input data corresponding to each mode to the
For example, based on the function mode data FMD, the
[0117]
The
The
[0118]
As described above, the function mode data FMD designates, for example, the modes “1” to “8” shown in FIG. 11 for each clock cycle, and sends data corresponding to each mode to the
In this case, as shown in FIG. 11, for example, module processing and highlight processing are assigned different modes depending on whether only the processing is performed or the level interpolation processing of the MIPMAP processing is performed. Yes. Also, the fogging process has different modes depending on whether only the process or the modulation process is performed. This is because it is necessary for the
Note that the mode shown in FIG. 11 is an example, and various other modes can be designated.
[0119]
For example, the fog enable data FED indicates a logical value “1” when the fogging process is performed, and indicates a logical value “0” when the fogging process is not performed.
[0120]
Further, the mipmap number data MND is the four-point neighboring interpolation data C when the
The mipmap number data MND is four-point neighboring interpolation data C when performing level interpolation processing.pixel0The logical value “0” is indicated at the timing of inputting “”.
The mipmap number data MND is used for controlling the
[0121]
Based on the function mode data FMD, the mipmap number data MND, and the fog enable data FED, the
[0122]
Specifically, the
In the
Further, the
As a result, 4-point neighborhood interpolation data Cpixel0, Cpixel1And mipmap coefficient COEmipmapAre simultaneously written in the
[0123]
12 shows four-point neighborhood interpolation data C from the
In FIG. 12, data with the same (a), (b), and (c) indicate data related to the same level interpolation processing.
[0124]
For example, based on the clock signal S18 shown in FIG. 12A, four-point neighborhood interpolation that is the target of level interpolation input from the
Then, in the next clock cycle, the 4-point neighborhood interpolation data C read from the
Then, in the next clock cycle, as shown in FIG. 12C, in the
As can be seen from FIG. 12C, the throughput of the 4-point neighborhood interpolation process of the MIPMAP process performed using the
[0125]
Further, in the
At the same time, the
[0126]
In addition, when the function mode data FMD indicates “3” shown in FIG. 11 and the
At the same time, the
[0127]
Further, in the
At the same time, the
[0128]
In addition, when the function mode data FMD indicates “5” shown in FIG. 11 and the
At the same time, the
[0129]
Further, when the function mode data FMD indicates “6” shown in FIG. 11 and the
At the same time, the
[0130]
Further, in the
At the same time, the
At the same time, the
[0131]
In the
At the same time, the
At the same time, the
[0132]
Further, the
For example, when the
[0133]
When the
[0134]
As shown in FIG. 13, the
[0135]
The correction data F has a value in which the data A is selected when the data COE = 0xFF (COE = 1.0), and the data B is selected otherwise.
In the system in which the correction data F is viewed as “1” when all of the 8 bits have the logical value “1”, for example, the calculation shown in the following formula (17) is changed to the following formula (18). Used to correct. That is, correction is performed so that “X × 1.0 = X”.
[0136]
[Expression 17]
0xFF × 0xFF = 0xFE (17)
[0137]
[Formula 18]
0xFF × 0xFF = 0xFF (18)
[0138]
The partial products out_0 to out_7 indicate data A if
Here, the LSB of the data COE is
The partial product out_n (0 ≦ n ≦ 7) is, for example, as shown in FIG.0~ 807Is generated using
Specifically, when 0 ≦ m ≦ 7, the multiplexer 80mBit data A [m] of bit m of data A, bit data B [m] of bit m of data B, and bit data COE [n] of n of data COE are input, and bit data COE [ If n] is a logical value “1”, bit data A [m] is selected and output as bit data out_n [m].
Note that the partial product out_n is configured by the bit data out_n [0] to out_n [7].
[0139]
The partial product out_n is shifted by n bits toward the MSB, and then output to the
Further, the data C as the product-sum operation term is shifted by 8 bits toward the MSB so as to be added to the upper 8 bits of the multiplication result of 8 bits × 8 bits, as shown in FIG. 81 is output.
[0140]
The
As a result, even when the partial product based on the correction data F and the product-sum operation term C is added, the circuit scale is hardly increased and the addition speed is hardly reduced.
[0141]
FIG. 15 is a partial configuration diagram of the
FIG. 15 shows only a configuration for adding bit data in the vertical direction in the figure indicated by
Addition of bit data in the vertical direction in the figure indicated by an
As shown in FIG. 15, the
[0142]
[0143]
[0144]
The
For example, when the
[0145]
Hereinafter, an operation mode of the
First mode of operation
In this operation mode, a case will be described in which the
In this case, modes "1" and "3" are alternately switched from the
In addition, the
[0146]
Specifically, for example, in the first clock cycle, the 4-point neighborhood interpolation data C from the
Further, “1” is set to the count value of the
[0147]
Next, in the second clock cycle following the first clock cycle, the function mode data FMD indicates the mode “1”, and the 4-point neighborhood interpolation data Cpixel0Is read from the
At the same time, the data COE from the reduction
Then, in the
Since the
Then, the count value of the
[0148]
Next, in the third clock cycle, the function mode data FMD indicates the mode “3”, and the 4-point neighborhood interpolation data relating to the next pixel from the
At the same time, the level interpolation data C calculated in the second clock cyclepixel(= C in formula (10)texCorresponds to IN of the
At the same time, (R, G, B) data S11b (fragment color value C) included in the DDA data S11 from the triangle DDA circuit 11flag) Of the
In the
Since the count value of the
Color value CmodAre read from the
Then, “1” is set to the count value of the
Thereafter, the process of the second clock cycle and the process of the third clock cycle described above are alternately repeated.
[0149]
As described above, in this operation mode, the
Further, in this operation example, the
[0150]
Second operation mode
In this operation mode, a case will be described in which the
In this case, the
Further, the
[0151]
Specifically, for example, in the first clock cycle, the 4-point neighborhood interpolation data C from the
Then, “2” is set to the count value of the
[0152]
Next, in the second clock cycle, the function mode data FMD indicates the mode “1”, and the 4-point neighborhood interpolation data Cpixel0Is read from the
At the same time, the data COE from the reduction
Then, in the
Since the
Then, the count value of the
[0153]
Next, in the third clock cycle, the function mode data FMD indicates the mode “3”, and the 4-point neighborhood interpolation data C relating to the next pixel from the
At the same time, the level interpolation data C calculated in the second clock cyclepixel(C in formula (10)texCorresponds to IN of the
At the same time, (R, G, B) data S11b (fragment color value C) included in the DDA data S11 from the triangle DDA circuit 11flag) Of the
In the
And the color value CmodThe
Then, the count value of the
Also, four-point neighboring interpolation data Cpixel0Is output to the
[0154]
Next, in the fourth clock cycle, if the function mode data FMD indicates the mode “8” and the fog enable data FED is the logical value “1”, the color value C calculated in the third clock cycle is displayed.mod(C in formula (13)flagCorresponds to IN of the
At the same time, for example, fog data C read from a fog register (not shown)fogIs connected to the IN of the
At the same time, for example, the fogging coefficient COE included in the DDA data S11 from the
In the
Since the count value of the
Color value CfoggedAre read from the
Thereafter, the process of the second clock cycle, the process of the third clock cycle, and the process of the fourth clock cycle described above are alternately repeated.
[0155]
As described above, in this operation mode, the
[0156]
Thus, in the
[0157]
In the
That is, in order to obtain an appropriate result without performing correction, if 9 bits are used by increasing 1 bit and “0x100” is regarded as “1”, the number of gates of the pipe register in the previous stage is increased, and the entire gate is gated. However, in this embodiment, it is not necessary to increase the number of bits, and such a problem does not occur.
[0158]
Note that the
[0159]
Memory I /
The memory I /
[0160]
The
[0161]
The
[0162]
Realization method of
Hereinafter, a preferred configuration, arrangement, and wiring method of the logic circuit of the
[0163]
In the present embodiment, for example, as shown in FIG. 16, the
Then, as shown in FIG. 16, the memory I /
As a result, when a plane such as a triangle is drawn, processing can be performed simultaneously on the plane, so that the operation probability of each DRAM module is very high.
[0164]
In the above-described drawing process, the pixels are finally aggregated to access each pixel. Therefore, it is ideal that the rendering performance can be increased by the number of parallel processes by processing each pixel individually in parallel.
Therefore, the memory I /
[0165]
In the graphic drawing process, as described above, it can be seen that the processing circuit for driving into the pixel needs to frequently exchange data with the DRAM.
Therefore, in the present embodiment, as shown in FIG. 17, the
[0166]
All of these operations are performed by the
For this reason, even if the number of wirings to the DRAM, that is, the number of transfer bits is increased, the ratio of the wiring to the area can be reduced, so that the operation speed can be improved and the wiring area can be reduced.
[0167]
Regarding the
Therefore, the
[0168]
As for signal input / output terminals for connection between the
[0169]
Specifically, in the
In the
[0170]
In the pixel processing module 1447, an input / output terminal T1447a is formed on the left end side of the lower edge of the module in FIG. The input / output terminal T1447a is disposed so as to face the input / output terminal T1450b formed on the right end side of the upper edge portion of the
In the pixel processing module 1447, an input / output terminal T1447b for connection to the
[0171]
In the
In the
[0172]
In the
In the
[0173]
Note that the
[0174]
Further, the
[0175]
As shown in FIG. 18, the
[0176]
As in the present embodiment, for each DRAM module,
In this case, the so-called long side direction of the DRAM is arranged to be the column direction of the
[0177]
Looking at random reading (reading) in the configuration of FIG. 18, a control signal and a necessary address signal S1446 are supplied from the
The data passed through the
[0178]
When data is written to the secondary memory, a control signal and a necessary address signal S1446 are supplied from the
In this case, since the so-called long side direction of the DRAM is arranged so as to be the column direction of the
[0179]
In addition, when the data D1484 is read from the secondary memory (SRAM) 1484 to the
[0180]
Further, in the present embodiment, as shown in FIG. 18, the pixel processing module and the secondary memory of the DRAM module are arranged close to each other on the same side of the long side of the DRAM module.
As a result, since the same sense amplifier can be used for the data to the secondary memory of the pixel processing module and the DRAM module, it is possible to reduce the increase in the area of the
[0181]
Hereinafter, the overall operation of the three-dimensional computer
Polygon rendering data S4 is output from the
The variation data S10 is output to the
[0182]
Next, a representative point is determined by the representative
Next, in the reduction
Next, in the
The division results “s / q” and “t / q” are multiplied by the texture sizes USIZE and VSIZE, respectively, to generate texture coordinate data (u, v).
Next, a read request including the generated texture coordinate data (u, v) is output from the
At this time, as described above, the above-described MIPMAP processing and texture function processing are performed using the configuration shown in FIGS. 4 and 10, and pixel data S12 is generated.
The pixel data S12 is output from the
[0183]
Then, the memory I /
[0184]
The present invention is not limited to the first embodiment described above.
For example, in the above-described embodiment, the case where the
[0185]
The contents and number of processes sharing the
[0186]
Second embodiment
The three-dimensional computer graphic system 501 of this embodiment is basically the same as the three-dimensional computer
Hereinafter, of the functions of the components of the three-dimensional computer graphic system 501, differences from the three-dimensional computer
[0187]
Further, the
The
[0188]
The
The
In the present embodiment, the
[0189]
Here, (z, R, G, B, α, s, t, q, val) data of the DDA data S11 is 161-bit data as shown in FIG.
Specifically, R, G, B, and α data are each 8 bits, z, s, t, and q data are each 32 bits, and val data is 1 bit.
Hereinafter, among the (z, R, G, B, α, s, t, q, val) data for 8 pixels that are processed in parallel, the val data is the val data S220.1~ S2208And (z, R, G, B, α, s, t, q) data is processed data S221.1~ S2218And
That is, the
[0190]
A process of calculating a reduction ratio LOD using the DDA data S11 by the
Here, each of the operation blocks 199, 200, 201, 202, 204, and 205 incorporates 8 operation sub-blocks, and performs operation processing for 8 pixels in parallel.
Here, the
The arithmetic block 199 corresponds to the reduction ratio
In the LIP /
[0191]
[Calculation block 199]
The calculation block 199 performs processing corresponding to the reduction ratio calculation circuit 304, the representative
The reduction ratio LOD is sequentially shifted to the operation blocks 200, 201, 202, and 203.
The calculation block 199 outputs the DDA data S11 input from the
The operation block 199 is composed of val data S220.1~ S2208Always works regardless of the value indicated by.
[0192]
[Calculation block 200]
The
As shown in FIG. 20, the
Here, the
[0193]
Also, the
Also, the
Note that the
[0194]
FIG. 21 shows an operation sub-block 200.1FIG.
Note that all the arithmetic sub-blocks shown in FIG. 3 basically have the configuration shown in FIG.
As shown in FIG. 21, the
[0195]
The data flip-
The
The flag flip-
Note that the system clock signal S225 shown in FIG. 21 is sent from the arithmetic block 199 shown in FIG.1~ 2008, 2011~ 2018, 2021~ 2028, 2041~ 2048To the clock enabler and flag flip-
That is, the
[0196]
[Calculation block 201]
The
[0197]
[Calculation block 202]
The
The
The
[0198]
The
[0199]
[Calculation block 203]
The
[0200]
Then, the
[0201]
[Calculation block 204]
The
Note that the memory I /
[0202]
The overall operation of the three-dimensional computer graphic system 501 will be described below.
Polygon rendering data S4 is output from the
The variation data S10 is output to the
[0203]
Next, the
[0204]
Next, the pipeline processing operations of the
Here, for example, consider a case where 8 pixels in a
[0205]
And the val data S2201~ S2208And operand data S2211~ S2218Is input to the arithmetic block 199, and in the arithmetic block 199, I7The reduction ratio LOD is calculated with the pixel of the representative point as a representative point, and the calculated reduction ratio LOD and val data S220 are calculated.1~ S2208And operand data S2211~ S2218Is output to the
[0206]
Next, the val data S2201~ S2208And operand data S2211~ S2218Are corresponding
And the
As a result, the
On the other hand, the
Also, the division result S200Four, S2007, S2008In synchronization with the output of the val data S2201~ S2208Is the
[0207]
Next, the
Then, based on the detection result, the
On the other hand, the
The texture coordinate data S202Four, S2027, S2028In synchronization with the output of the val data S2201~ S2208Is a
[0208]
Next, the
Based on the detection result, the
On the other hand, the
In addition, (R, G, B, α) data S202Four, S2027, S2028In synchronization with the output of the val data S2201~ S2208Is a
[0209]
Next, the
Based on the detection result, the
On the other hand, the
[0210]
Next, the
Based on the detection result, the
[0211]
That is, in the
[0212]
As described above, the three-dimensional computer graphic system 501 further has the following effects in addition to the effects of the three-dimensional computer
That is, according to the three-dimensional computer graphic system 501, in the pipeline processing in the
Therefore, power consumption in the
As shown in FIGS. 20 and 21, the
[0213]
The present invention is not limited to the embodiment described above.
In the above-described embodiment, the case where texture data is read from the storage circuit using a common reduction ratio for a plurality of pixel data to be processed simultaneously is described. A plurality of reduction rate calculation circuits may be provided. In this case, a plurality of readout circuits are provided respectively corresponding to a plurality of pixel data to be processed simultaneously, and a storage circuit, a plurality of reduction rate calculation circuits, and a plurality of readout circuits are mixedly mounted on one semiconductor chip.
In addition, a plurality of image processing circuits that simultaneously process using the texture data read by the reading circuit to generate a plurality of display data, and a plurality of writing circuits that write the generated display data to a storage circuit such as a DRAM. Further, a storage circuit, a plurality of reduction ratio calculation circuits, a plurality of reading circuits, a plurality of image processing circuits, and a plurality of writing circuits may be mounted on one semiconductor chip.
[0214]
【The invention's effect】
As described above, according to the image processing apparatus of the present invention, high image quality can be stably provided with a small-scale apparatus configuration.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a three-dimensional computer graphic system according to an embodiment of the present invention.
FIG. 2 is a diagram for explaining a method for generating effective bit data in the DDA setup circuit shown in FIG. 1;
FIG. 3 is a diagram for explaining texture data used for the MIPMAP processing stored in the SARAM and the texture buffer shown in FIG. 1;
4 is a configuration diagram of a texture engine circuit shown in FIG. 1. FIG.
FIG. 5 is a flowchart of processing in the representative point determination circuit shown in FIG. 4;
6 is a diagram for explaining processing in the representative point determination circuit shown in FIG. 4; FIG.
7 is a diagram for explaining a specific example of representative points when the triangle shown in FIG. 2 is a processing target. FIG.
FIG. 8 is a configuration diagram of a reduction ratio calculation circuit shown in FIG. 4;
FIG. 9 is a diagram for explaining the processing contents of the reduction ratio calculation circuit shown in FIG. 8;
FIG. 10 is a configuration diagram of the LIP / texture function circuit shown in FIG. 4;
FIG. 11 is a diagram for explaining data input to the LIP circuit in each mode;
FIG. 12 is a diagram for explaining the input timing of mipmap data from the LIP circuit to the LIP / texture function circuit and the execution timing of the level interpolation process;
FIG. 13 is a diagram for explaining processing of the LIP circuit shown in FIG. 4;
FIG. 14 is a diagram for explaining processing of the LIP circuit shown in FIG. 4;
15 is a partial configuration diagram of the previous stage adder circuit shown in FIG. 13;
16 is a diagram for explaining a data storage method for the DRAM shown in FIG. 1; FIG.
FIG. 17 is a diagram for explaining a preferable configuration, arrangement, and wiring method of the logic circuit of the rendering circuit shown in FIG. 1, the DARAM, and the secondary memory.
FIG. 18 is a diagram for explaining the configuration of the DRAM module shown in FIG. 17;
FIG. 19 is a diagram for explaining the format of DDA data output from the triangle DDA circuit shown in FIG. 1 in the three-dimensional computer graphic system according to the second embodiment of the present invention.
FIG. 20 is a partial configuration diagram of a texture engine circuit and a memory I / F circuit in the three-dimensional computer graphic system according to the second embodiment of the present invention.
FIG. 21 is a configuration diagram of a calculation sub block shown in FIG. 20;
FIG. 22 is a diagram for explaining MIPMAP filtering processing;
FIG. 23 is a diagram for explaining a conventional general texture mapping apparatus;
FIG. 24 is a flowchart of processing in the texture mapping apparatus shown in FIG.
FIG. 25 is a diagram for explaining a texture mapping apparatus that realizes high-speed processing;
[Explanation of symbols]
DESCRIPTION OF
Claims (6)
前記表示モデルは立体モデルであり、
前記単位図形が三角形であり、
表示データと、同一のパターンについて相互に異なる縮小率に対応した複数のテクスチャデータとを記憶する記憶回路と、
同時に処理を行おうとする複数の画素データに対して共通して用いられる縮小率を算出する縮小率算出回路と、
前記算出された縮小率に対応する前記テクスチャデータを前記記憶回路から読み出す読み出し回路と、
前記読み出されたテクスチャデータを用いて前記複数の画素データの処理を同時に行って表示データを生成する画像処理回路と、
前記生成された表示データを前記記憶回路に書き込む書き込み回路と、
前記同時に処理を行おうとする複数の画素データに対応する画素のうち、処理対象となっている前記単位図形の内側に位置する画素のなかから代表点となる画素を決定する代表点決定回路と
を有し、
前記縮小率算出回路は、下記式に基づいて前記縮小率を示すLODを実質的に算出するため、
LOD=Clamp(((log 2 1/q)+maxe)
<<L+K)
ここで、
LODは、整数部と少数部とで構成され、符号なしの縮小率を示す記号であり、
Clampは、下記のクランプ回路においてクランプすることを示す記号であり、
qは、前記同次項を示す記号であり、
maxeは、前記処理対象となっている前記単位図形の頂点の同次座標(s,t)および同次項qの最大指数を示す整数部のみからなるデータであり、
<<Lは、下記のシフト回路においてデータをLビットシフトすることを示すものであり、
Kは、整数部と少数部とで構成され、符号有りで、下記の加算回路において加算に使用するデータであり、
前記同次項データqを正規化して指数qeおよび仮数qmを生成する正規化回路と、
前記指数qeと前記仮数qmとをビット結合したデータを、前記データLが示す値だけMSB(Most Significant Bit)に向けてシフトする第1のシフト回路と、
前記第1のシフト回路の出力を反転する第1の反転回路と、
前記仮数qmを入力して、「log 2 ({1,qm})−qm」を示すデータμを出力するデータ出力手段と、
前記データmaxeと前記データμとをビット結合したデータを、前記データLが示す値だけMSBに向けてシフトする第2のシフト回路と、
前記第2のシフト回路の出力を反転する第2の反転回路と、
前記データKと2進数の「10」とをビット結合したデータと、前記第1の反転回路の出力と、前記第2の反転回路の出力とを加算する加算回路と、
前記加算回路の出力を所定ビット内にクランプ処理して前記縮小率LODを生成するクランプ回路と
を有し、
前記読み出し回路は、前記同時に処理が行われる複数の画素データの各々について、前記決定された縮小率、前記同次座標(s,t)および同次項qによって特定されるテクスチャデータを前記記憶回路から読み出す、
画像処理装置。In an image processing apparatus that represents a display model by combining unit graphics composed of a plurality of pixels to which common processing conditions are applied, and generates pixel data corresponding to the pixels using texture data as necessary.
The display model is a three-dimensional model;
The unit figure is a triangle;
A storage circuit for storing display data and a plurality of texture data corresponding to different reduction ratios for the same pattern;
A reduction ratio calculation circuit for calculating a reduction ratio commonly used for a plurality of pixel data to be processed simultaneously;
A readout circuit for reading out the texture data corresponding to the calculated reduction ratio from the storage circuit;
An image processing circuit that generates display data by simultaneously processing the plurality of pixel data using the read texture data;
A writing circuit for writing the generated display data into the storage circuit;
A representative point determination circuit for determining a pixel as a representative point from among the pixels corresponding to the plurality of pixel data to be processed at the same time, among the pixels located inside the unit graphic to be processed ; Have
The reduction rate calculation circuit substantially calculates LOD indicating the reduction rate based on the following formula,
LOD = Clamp (((log 2 1 / q) + maxe)
<< L + K)
here,
LOD is composed of an integer part and a decimal part, and is a symbol indicating an unsigned reduction rate,
Clamp is a symbol indicating clamping in the following clamp circuit,
q is a symbol indicating the homogeneous term,
maxe is data consisting only of an integer part indicating the maximum coordinate of the homogeneous coordinates (s, t) and the homogeneous term q of the vertex of the unit graphic to be processed;
<< L indicates that data is shifted by L bits in the shift circuit described below.
K is composed of an integer part and a decimal part, is signed, and is data used for addition in the following addition circuit,
A normalization circuit that normalizes the homogeneous term data q to generate an exponent qe and a mantissa qm;
A first shift circuit that shifts data obtained by bit-combining the exponent qe and the mantissa qm toward a MSB (Most Significant Bit) by a value indicated by the data L;
A first inverting circuit for inverting the output of the first shift circuit;
Data output means for inputting the mantissa qm and outputting data μ indicating “log 2 ({1, qm}) − qm”;
A second shift circuit that shifts data obtained by bit-combining the data maxe and the data μ toward the MSB by a value indicated by the data L;
A second inverting circuit for inverting the output of the second shift circuit;
An addition circuit for adding the data obtained by bit-combining the data K and the binary number “10”, the output of the first inversion circuit, and the output of the second inversion circuit;
A clamp circuit for clamping the output of the adder circuit within a predetermined bit to generate the reduction ratio LOD;
Have
The readout circuit receives texture data specified by the determined reduction ratio, the homogeneous coordinates (s, t), and the homogeneous term q from the storage circuit for each of the plurality of pixel data to be simultaneously processed. Read ,
Image processing device.
請求項1に記載の画像処理装置。The image processing apparatus according to claim 1.
請求項2に記載の画像処理装置。The image according to claim 2, wherein among the pixels corresponding to the plurality of pixel data to be processed simultaneously, only the processing result of the pixel located inside the unit graphic to be processed is used as an effective one. Processing equipment.
第1の縮小率の表示パターンを示す第1のテクスチャデータを補間して2次元上の所定位置の画素に対応する第1の画素データを算出し、第2の縮小率の表示パターンを示す第2のテクスチャデータを補間して前記画素に対応する第2の画素データを算出する第1の補間処理を行う第1の画像処理回路と、
前記第1の画素データと前記第2の画素データとを用いて第2の補間処理を行って、前記第1の縮小率と前記第2の縮小率との間の第3の縮小率の表示パターンに応じた前記画素に対応する第3の画素データを算出する第2の画像処理回路と
を有し、
前記第2の画像処理回路は、前記第2の補間処理を前記第1の補間処理に比べて短時間で行える場合に、前記第3の画素データをフィードバックし、当該フィードバックした前記第3の画素データを用いて所定の画像処理を行う
請求項1または2に記載の画像処理装置。The image processing circuit includes:
The first texture data indicating the display pattern of the first reduction ratio is interpolated to calculate the first pixel data corresponding to the pixel at a predetermined position in two dimensions, and the second display pattern of the second reduction ratio is shown. A first image processing circuit for performing a first interpolation process for interpolating two texture data and calculating second pixel data corresponding to the pixels;
Display of a third reduction ratio between the first reduction ratio and the second reduction ratio by performing a second interpolation process using the first pixel data and the second pixel data. A second image processing circuit for calculating third pixel data corresponding to the pixel according to a pattern,
The second image processing circuit feeds back the third pixel data when the second interpolation processing can be performed in a shorter time than the first interpolation processing, and the fed back third pixel Perform predetermined image processing using data
The image processing apparatus according to claim 1 .
前記第2の画像処理回路は、前記第2の補間処理および前記所定の画像処理を順次複数回繰り返して行う
請求項4に記載の画像処理装置。The first image processing circuit repeatedly performs the first interpolation processing a plurality of times;
The second image processing circuit sequentially repeats the second interpolation processing and the predetermined image processing a plurality of times.
The image processing apparatus according to claim 4 .
前記所定の画像処理として、モジュレート処理、デカル処理、ハイライト処理、フォギング処理およびアルファブレンディング処理のうち少なくとも一の処理を行う
請求項4に記載の画像処理装置。The second image processing circuit includes:
As the predetermined image processing, at least one of modulation processing, decal processing, highlight processing, fogging processing, and alpha blending processing is performed.
The image processing apparatus according to claim 4 .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP29891899A JP4325038B2 (en) | 1999-10-20 | 1999-10-20 | Image processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP29891899A JP4325038B2 (en) | 1999-10-20 | 1999-10-20 | Image processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001118056A JP2001118056A (en) | 2001-04-27 |
JP4325038B2 true JP4325038B2 (en) | 2009-09-02 |
Family
ID=17865872
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP29891899A Expired - Fee Related JP4325038B2 (en) | 1999-10-20 | 1999-10-20 | Image processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4325038B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4635379B2 (en) * | 2001-05-30 | 2011-02-23 | ソニー株式会社 | Image processing device |
JP4622165B2 (en) * | 2001-06-15 | 2011-02-02 | ソニー株式会社 | Image memory control device, graphic operation device, and rendering processing method |
JP5653541B2 (en) * | 2012-01-27 | 2015-01-14 | 三菱電機株式会社 | Drawing data generation apparatus and image drawing apparatus |
-
1999
- 1999-10-20 JP JP29891899A patent/JP4325038B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2001118056A (en) | 2001-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3860859B2 (en) | Computer graphics system with high performance primitive clipping preprocessing | |
CA2272567C (en) | Multiplier for performing 3d graphics interpolations | |
US20030122815A1 (en) | Graphics system configured to determine triangle orientation by octant identification and slope comparison | |
US6172687B1 (en) | Memory device and video image processing apparatus using the same | |
KR20080067840A (en) | 3-dimensional graphics accelerator and method of distributing pixel thereof | |
US20040012611A1 (en) | Anti-aliasing interlaced video formats for large kernel convolution | |
US6778188B2 (en) | Reconfigurable hardware filter for texture mapping and image processing | |
JP4325038B2 (en) | Image processing device | |
US5732248A (en) | Multistep vector generation for multiple frame buffer controllers | |
JP3985321B2 (en) | Arithmetic apparatus and image processing apparatus | |
JPH11345218A (en) | Image processor and its method | |
JP4069486B2 (en) | Memory circuit control device and graphic operation device | |
JP4300650B2 (en) | Arithmetic processing circuit and method and image processing apparatus | |
JP4665268B2 (en) | Image processing device | |
US6985153B2 (en) | Sample request mechanism for supplying a filtering engine | |
JP4224887B2 (en) | Signal processing apparatus and image processing apparatus | |
CA2261245C (en) | Division circuit and graphic display processing apparatus | |
JP4042204B2 (en) | Graphic operation apparatus and method | |
JP4622165B2 (en) | Image memory control device, graphic operation device, and rendering processing method | |
JP4635379B2 (en) | Image processing device | |
JPH11185052A (en) | Device and method for calculating texture mapping coordinate of three-dimensional computer graphics | |
US20030164842A1 (en) | Slice blend extension for accumulation buffering | |
EP0485833A2 (en) | A method for executing graphics color saturating arithmetic instructions in a data processor | |
US20030169279A1 (en) | Reconfigurable pixel computation unit | |
JP4386124B2 (en) | Video signal processing apparatus and video signal processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060214 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090210 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090217 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090417 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090519 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090601 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130619 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |