JP3735325B2 - Image generator - Google Patents

Image generator Download PDF

Info

Publication number
JP3735325B2
JP3735325B2 JP2002232029A JP2002232029A JP3735325B2 JP 3735325 B2 JP3735325 B2 JP 3735325B2 JP 2002232029 A JP2002232029 A JP 2002232029A JP 2002232029 A JP2002232029 A JP 2002232029A JP 3735325 B2 JP3735325 B2 JP 3735325B2
Authority
JP
Japan
Prior art keywords
image
frame buffer
data
pixel data
drawing command
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 - Lifetime
Application number
JP2002232029A
Other languages
Japanese (ja)
Other versions
JP2003150975A (en
Inventor
真 古橋
正善 田中
雅一 鈴置
禎治 豊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Interactive Entertainment Inc
Original Assignee
Sony Computer Entertainment Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Computer Entertainment Inc filed Critical Sony Computer Entertainment Inc
Priority to JP2002232029A priority Critical patent/JP3735325B2/en
Publication of JP2003150975A publication Critical patent/JP2003150975A/en
Application granted granted Critical
Publication of JP3735325B2 publication Critical patent/JP3735325B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Image Generation (AREA)

Description

【0001】
【産業上の利用分野】
この発明は、ビデオゲーム機やグラフィックコンピュータなど、コンピュータグラフィックスを応用した機器で、限られたハードウエア資源の中で、高い可視化(ビジュアライゼーション)性能が要求される場合に適用して好適な画像生成装置に関し、特に、いわゆる半透明処理に関する。
【0002】
【従来の技術】
コンピュータグラフィックスにおいて、通常、3D(3ディメンション=3次元)グラフィックスシステムと呼ばれるものは、現実感のある物体(描画対象の物体をオブジェクトと称する)を描画するに際して、まず、オブジェクトの表面を複数のポリゴン(描画装置が扱う図形の最小単位(三角形や四角形)をポリゴンという)に分解し、各ポリゴンを、モニター表示画面に対応したフレームメモリ(以下フレームバッファという)に、順に、描画することで、立体的に見える画像を再構成する。
【0003】
通常のこの種の画像生成装置では、処理を高速に行わせるために、CPUとフレームバッファの間に専用の描画装置を設ける。CPUは、画像を生成する際に、直接フレームバッファをアクセスするのではなく、三角形や四角形の基本的な図形(ポリゴン)を描画する命令(以下、描画命令と略称する)を生成して描画装置に送る。描画装置は、送られた描画命令を解釈して、フレームバッファに図形を描画する。
【0004】
ところで、コンピュータグラフィックスにおいては、前に表示されていた画像の画素データ(例えば3原色データからなる。以下同じ)と、次に描画しようとする画像の画素データとを所定の比率で混合することにより、半透明処理を行うようにしている。この半透明処理は描画装置で行われ、従来は、描画装置の半透明処理部は、図11に示すような構成とされている。
【0005】
図11において、10はフレームバッファであり、20は描画装置を示している。
描画装置20は、半透明処理のための混合回路21と、フレームバッファ10から画素データを読み出す読み出し回路22と、フレームバッファ10に画素データを書き込む書き込み回路23と、描画装置20に転送されてきた描画命令をデコードする描画命令デコード部24と、描画命令デコード部24でデコードされた描画命令にしたがって描画画像を生成する画像生成回路25と、混合比率メモリ26と、半透明処理の全体を制御する制御部27とを備えている。
【0006】
この場合、描画命令は、混合比率のデータを備えており、描画命令デコード部24で、その混合比率のデータが抽出されて、混合比率メモリ26に格納される。混合比率メモリ26は、画像生成部25からの描画画素位置情報に基づいて、画像生成部25で生成される描画画像を構成する各ピクセル(画素)ごとに混合比率を記憶する。
【0007】
半透明処理は、次のように行われる。すなわち、読み出し回路22によりフレームバッファ10から、これから描画しようとする画素位置の前の画素データVmが読み出され、混合回路21に供給される。また、画像生成部25から、これから描画しようとする画素データVcが混合回路21に供給される。そして、混合比率メモリ26から、これから描画しようとする画素についての混合比率αが読み出されて、混合回路21に供給される。
【0008】
混合回路21では、前記混合比率αで、画素データVmと画素データVcとが混合される。すなわち、(1−α)Vm+αVc=Voなる演算が行われて、混合出力画素データVoが得られる。そして、その混合結果の画素データVoが、書き込み回路23により、フレームバッファ10の、前記読み出された画素データVmと同じアドレス位置に書き戻される。
【0009】
この場合、混合比率αに応じて前の画素の色が新たな画素に残り、半透明の色となって表示される。なお、混合比率α=1であれば、完全不透明であり、混合比率α=0であれば、完全透明となる。
【0010】
【発明が解決しようとする課題】
以上のように、従来の半透明処理においては、混合比率αの値は、描画命令が有していて、それに基づいて混合比率メモリ26に、画素ごとに蓄えられようにされている。このため、混合比率を細かく設定しようとすると、混合比率αのビット数が大きくなり、描画命令のデータ量が大きくなると共に、混合比率メモリ26を容量の大きなものにしなければならなくなる。
【0011】
また、描画装置の構成を簡略化するためには、半透明処理を用いて完全透明処理及び完全不透明処理をも行えるようにする方がよいが、上述のように、半透明処理の場合には、1画素ごとに、フレームバッファ10からの読み出し、混合処理、フレームバッファ10への書き戻し処理の3段階の処理が必要となり、比較的処理時間が長くなる欠点がある。
【0012】
この発明の第1の目的は、描画命令のデータ量が大きくならず、また、混合比率メモリとして容量の小さいものを使用可能である画像生成装置を提供することである。
【0013】
また、この発明の第2の目的は、半透明処理を用いて完全透明処理及び完全不透明処理を、高速に行うことができる画像生成装置を提供することである。
【0014】
【課題を解決するための手段】
上記課題を解決するため、請求項1の発明の画像生成装置は、後述の図1の実施例の参照符号を対応させると、
CPU42で生成した描画命令を描画装置部61に転送し、この描画装置部61で、前記描画命令にしたがって描画を順次実行してフレームバッファ63上に画像を生成する装置において、
描画装置部61は、
フレームバッファ63から前に描画された画像の画素データを読み出す手段102と、
フレームバッファ63から読み出された画素データと、次に描画しようとする対応する位置の画素データとを、指定された混合比率で混合する混合回路101と、
この混合回路101の混合結果の画素データを、フレームバッファ63の対応する画素位置に書き込む書き込み手段103と、
前記混合比率の複数個を記憶する混合比率記憶部106と、
前記描画命令に含まれる混合比率選択情報に応じて混合比率記憶部106から、混合回路101に供給する混合比率を選択する選択手段107と
を備えることを特徴とする。
【0015】
また、請求項2の発明による画像生成装置は、後述の図8の実施例の参照符号を対応させると、
CPU42で生成した描画命令を描画装置部61に転送し、この描画装置部61で、前記描画命令にしたがって描画を順次実行してフレームバッファ上63に画像を生成する装置において、
描画装置部61は、
フレームバッファ63から前に描画された画像の画素データを読み出す読み出し手段102と、
フレームバッファ63から読み出された画素データと、次に描画しようとする対応する位置の画素データとを、指定された混合比率で混合する混合回路101と、
この混合回路101の混合結果の画素データを、フレームバッファ63の対応する画素位置に書き込む書き込み手段103と、
混合回路101に供給する前記混合比率を記憶する混合比率記憶部106と、
前記描画命令に含まれる混合処理に関するフラグを抽出して、このフラグの状態を判別するフラグ判別手段109と、
フラグ判別手段109の判別結果から、前記フラグが一の状態のときには、読み出し手段102によるフレームバッファ63からの画素データの読み出しを省略すると共に、前記次に描画しようとする対応する位置の画素データを、そのまま書き込み手段103によりフレームバッファ63の対応する画素位置に書き込むように制御し、前記フラグが他の状態のときには、読み出し手段102によるフレームバッファ63からの画素データの読み出し及び書き込み手段103によるフレームバッファ63への書き込みを省略するように制御する制御手段18とを備えることを特徴とする。
【0016】
【作用】
上記の構成の請求項1の発明においては、描画装置部61の混合比率記憶部106には、あらかじめ混合比率の情報が格納されている。描画命令には、この混合比率記憶部106に格納されている混合比率のどれを使用するかの選択情報が含められ、この選択情報により混合回路101に供給する混合比率が決定される。したがって、各画素単位には、この選択情報を用意すればよい。この選択情報は、混合比率記憶部106に格納されている混合比率の個数分を選択可能なビット数でよいので、混合比率をそのまま持たなければならない従来の場合に比べて少ないビット数でよく、描画命令のデータ量を小さくすることができると共に、混合比率の選択のために必要なメモリ容量も小さくすることができる。
【0017】
また、請求項2の発明においては、判別手段109において、描画命令に含まれる1ビットのフラグにより、完全透明処理(混合比率=0)の場合と、完全不透明処理(混合比率=1)の場合とが判別される。
【0018】
そして、完全透明処理の場合には、読み出し回路102によるフレームバッファ63からの画素データの読み出しが行われず、また、書き込み回路103によるフレームバッファ63への書き戻しも行われない。このため、混合回路101と、読み出し回路102と、書き込み回路103とを備える半透明処理装置を使用する場合であっても、読み出し処理と、書き込み処理とを省略した分だけ、完全透明処理を高速に行える。
【0019】
また、完全不透明処理の場合には、読み出し回路102によるフレームバッファ63からの画素データの読み出しは行われず、書き込み回路103による新たな画素データのみがフレームバッファに書き込まれる。したがって、この場合も、フレームバッファ63からの画素データの読み出し処理が省略される分だけ、高速処理になる。
【0020】
【実施例】
以下、この発明の一実施例について図面を参照しながら説明する。図2は、この発明の一実施例の画像生成装置の構成例を示すもので、この例は3Dグラフィック機能と、動画再生機能とを備えるゲーム機の実施例である。
【0021】
図2において、41はシステムバス(メインバス)である。このシステムバス41には、CPU42、メインメモリ43、ソーティングコントローラ45が接続されている。
【0022】
システムバス41には、また、画像伸長装置部51が、入力用のFIFO(First In First Out)バッファメモリ(以下、FIFOバッファメモリをFIFOバッファと略称する)54及び出力用のFIFOバッファ55を介して接続されている。また、CD−ROMデコーダ52がFIFOバッファ56を介して、描画装置部61がFIFOバッファ62を介して、それぞれシステムバス41に接続されている。
【0023】
また、71は操作入力手段としてのコントロールパッドで、インターフェース72を介してシステムバス41に接続されている。さらに、システムバス41には、ゲーム機としての立ち上げを行うためのプログラムが格納されているブートROM73が接続されている。
【0024】
CD−ROMデコーダ52は、CD−ROMドライバ53に接続されており、CD−ROMドライバ53に装着されたCD−ROMディスクに記録されているアプリケーションプログラム(例えばゲームのプログラム)やデータをデコードする。CD−ROMディスクには、例えば離散コサイン変換(DCT)により画像圧縮された動画や静止画の画像データや、ポリゴンを修飾するためのテクスチャー画像の画像データが記録されている。CD−ROMディスクのアプリケーションプログラムには、ポリゴン描画命令が含まれている。FIFOバッファ56は、CD−ROMディスクの記録データの1セクタ分の容量を有する。
【0025】
CPU42は、システム全体の管理を行なう。また、このCPU42は、物体を多数のポリゴンの集まりとして描画する場合の処理の一部を行う。すなわち、CPU42は、後述もするように、描画命令を生成すると共に、制御命令をメインメモリ43上に生成する。そして、後述するようにして、これら描画命令と制御命令との混在したものである描画命令例をメインメモリ43上において作成する。
【0026】
また、このCPU42は、キャッシュメモリ46を有し、CPUインストラクションの一部は、システムバス41からフェッチすることなく実行できる。さらに、CPU42には、描画命令や制御命令を作成する際にポリゴンについての座標変換演算や制御のための座標値の演算を行なうための座標演算装置部44が、CPU内部コプロセッサとして設けられている。座標演算装置部44は、3次元座標変換及び3次元から表示画面上の2次元への変換の演算を行なう。
【0027】
このように、CPU42は、内部に命令キャッシュ46と座標演算装置部44を有しているため、その処理をシステムバス41を使用しなくても、ある程度行うことができるため、システムバス41を開放しやすい。
【0028】
画像伸長装置部51は、CD−ROMディスクから再生された圧縮画像データの伸長処理を行なうもので、ハフマン符号のデコーダと、逆量子化回路と、逆離散コサイン変換回路のハードウエアを備える。ハフマン符号のデコーダの部分は、CPU42がソフトウエアとしてその処理を行うようにしてもよい。
【0029】
この例の場合、画像伸長装置部51は、1枚(1フレーム)の画像を、例えば16×16ピクセル(画素)程度の小領域(これを以下マクロブロックと称する)に分割して、このマクロブロック単位で画像伸長デコードを行う。そして、このマクロブロック単位でメインメモリ43との間でデータ転送が行われる。したがって、FIFOバッファ54及び55は、マクロブロック分の容量を備えるものとされている。
【0030】
描画装置部61には、ローカルバス11を介してフレームメモリ63が接続されている。描画装置部61は、FIFOバッファ62を介してメインメモリ43から転送されてくる描画命令を実行して、その結果をフレームメモリ63に書き込む。FIFOバッファ62は、1命令分のメモリ容量を有する。
【0031】
フレームメモリ63は、描画画像を記憶する画像メモリ領域と、テクスチャー画像を記憶するテクスチャーメモリ領域と、カラールックアップテーブル(色変換テーブルCLUT)が格納されるテーブルメモリ領域とを備える。
【0032】
図3は、フレームメモリ63のメモリ空間を示すものである。フレームメモリ63は、カラムとロウの2次元アドレスでアドレシングされる。この2次元アドレス空間のうち、領域ATがテクスチャーメモリ領域とされる。このテクスチャー領域ATには、複数種類のテクスチャーパターンを配置することができる。ACは色変換テーブルCLUTのテーブルメモリ領域である。
【0033】
後述するように、色変換テーブルCLUTのデータは、CD−ROMディスクからCD−ROMデコーダ52を通じて、ソーティングコントローラ45により、フレームメモリ63に転送される。CD−ROMのテクスチャー画像のデータは、画像伸長装置部51によりデータ伸長され、メインメモリ43を介してフレームメモリ63に転送される。
【0034】
また、図3において、ADは画像メモリ領域であり、描画するエリアと、表示するエリアの2面分のフレームバッファ領域を備えている。この例では、現在表示用として用いているフレームバッファ領域を表示バッファ、描画を行っているフレームバッファ領域を描画バッファと呼ぶこととする。この場合、一方を描画バッファとして描画を行っている間は、他方は表示バッファとして用い、描画が終了したら、両バッファを互いに切り換える。この描画バッファと表示バッファの切り換えは、描画終了時に、垂直同期に合わせて行う。
【0035】
フレームメモリ63の表示バッファから読み出された画像データは、D/Aコンバータ64を介して画像モニター装置65に出力され、その画面に表示される。
【0036】
ソーティングコントローラ45は、いわゆるDMAコントローラと同様の機能を備え、メインメモリ43と画像伸長装置部51との間での画像データの転送を行ったり、メインメモリ43から描画装置部61に描画命令列を転送したりするもので、転送手段を構成している。このソーティングコントローラ45は、CPU42やコントロールパッド71などの他の装置がシステムバス41を開放している間隙をぬって、CPU42の介在なしに前記の転送処理を行う。この場合、CPU42がシステムバス41の開放をソーティングコントローラ45に知らせるようにすることもできるし、ソーティングコントローラ45が強制的にCPU42にバスの開放を要求するようにすることもできる。
【0037】
メインメモリ43は、動画や静止画の画像データに対しては、圧縮された画像データのメモリ領域と、伸長デコード処理された伸長画像データのメモリ領域とを備えている。また、メインメモリ43は、描画命令列などのグラフィックスデータのメモリ領域(これを以下パケットバッファという)を備える。
【0038】
このパケットバッファは、CPU42による描画命令列の設定と、描画命令列の描画装置部への転送とに使用され、CPU42と、描画装置部61とが共有することになる。CPU42と、描画装置部61とで処理を並列に動作するようにするため、この例では、描画命令列の設定用のパケットバッファ(以下、これを設定パケットバッファという)と、転送用のパケットバッファ(以下、これを実行パケットバッファという)との2つのパケットバッファが用意されており、一方を設定パケットバッファとしているときには、他方は実行パケットバッファとして使用し、実行パケットバッファで実行が終了したら、2つのパケットバッファの機能を交換するようにしている。
【0039】
図2の例の装置(ゲーム機)に電源が投入され、CD−ROMディスクが装填されると、ブートROM73のゲームを実行するためのいわゆる初期化処理をするためのプログラムがCPU42により実行される。そして、CD−ROMディスクの記録データが取り込まれる。このとき、CD−ROMディスクの各セクタのユーザーデータ中の識別用情報IDに基づいて各ユーザーデータのデコード処理がなされ、データのチェックが行われる。このチェック結果により、CPU42は、各IDで示される内容の再生データに応じた処理を実行する。
【0040】
すなわち、CD−ROMディスクから、圧縮画像データ、描画命令及びCPU42が実行するプログラムが、CD−ROMドライバ53、CD−ROMデコーダ52を介して読み出され、ソーティングコントローラ45によってメインメモリ43にロードされる。そして、ロードされたデータのうち、色変換テーブルの情報は、フレームメモリ63の領域CLUTに転送される。
【0041】
[圧縮画像データの伸長及び転送]
メインメモリ43の入力データのうち、圧縮画像データは、CPU42がハフマン符号のデコード処理を行った後、再びCPU42によりメインメモリ43に書き込まれる。そして、ソーティングコントローラ45は、このハフマン符号のデコード処理後の画像データをメインメモリ43からFIFOバッファ54を介して画像伸長装置部51に転送する。
【0042】
伸長された画像データは、ソーティングコントローラ45が、FIFOバッファ55を介してメインメモリ43に転送する。この場合、画像伸長装置部51は、前述したように、マクロブロック単位で画像データの伸長処理を行う。このため、メインメモリ43からは前記マクロブロック単位の圧縮データが入力用FIFOバッファ54に、ソーティングコントローラ45により転送される。そして、画像伸長装置部51は、1マクロブロックの伸長デコード処理が終了すると、その結果の伸長画像データを出力用FIFOバッファ55に入れると共に、入力用FIFOバッファ54から次のマクロブロックの圧縮データを取り出して、伸長デコード処理を行う。
【0043】
ソーティングコントローラ45は、システムバス41が開放されていて、かつ、画像伸長装置部51の出力用FIFOバッファ55が空でなければ、1マクロブロックの伸長画像データをメインメモリ43に転送し、次の1マクロブロックの圧縮画像データをメインメモリ43から画像伸長装置部51の入力用FIFOバッファ54に転送する。
【0044】
CPU42は、伸長された画像データのマクロブロックが一定量、メインメモリ43に蓄積された時点で、当該伸長データを描画装置部61を介してフレームメモリ63に転送する。この際に、伸長画像データがフレームメモリ63の画像メモリ領域ADに転送されれば、そのまま背景動画像として画像モニター装置65で表示されることになる。また、フレームメモリ63のテクスチャーメモリ領域ATに転送される場合もある。このテクスチャーメモリ領域ATの画像データは、テクスチャー画像として、ポリゴンの修飾に使用される。
【0045】
[描画命令列についての処理と転送]
物体の面を構成するポリゴンは、3次元的な奥行きの情報であるZデータに従って奥行き方向の深い位置にあるポリゴンから順に描画することにより、2次元画像表示面に立体的に画像を表示することができる。CPU42は、このように奥行き方向の深い位置にあるポリゴンから順に、描画装置部61で描画が行われるようにするための描画命令の列をメインメモリ43上に作成する。
【0046】
図4Aは、この例の命令IPのデータ構造の一例の概略を示すものである。すなわち、このデータ構造は、ヘッダ部と、命令データ部とからなる。
【0047】
ヘッダ部は、タグTGとコマンド識別コードCODEとからなる。タグTGには、次の描画命令あるいは制御命令が格納されているメインメモリ43上のアドレスが書き込まれる。コマンド識別コードCODEは、その命令がどのような命令であるかを示す識別データIDPを備えると共に、必要に応じてその命令にとって必要な他の情報を含む。命令データ部PDには、座標値やその他のパラメータが書き込まれる。この命令データ部PDのパラメータは、命令IPごとに定まっている。
【0048】
タグTGは、次のような役割をする。コンピュータグラフィックスでは、3次元画像を2次元画面に描画するため、奥行きの深い方から順に描画を行う必要がある。このためには、メインメモリ43から、描画順序にしたがった描画命令を、順次に描画装置部61に転送する必要がある。
【0049】
従来のDMAコントローラによりメインメモリ43から描画装置部61にDMA転送する場合には、描画命令を実行順にメインメモリ43上で並べ変える処理、つまり、描画命令の格納アドレス位置を変更する処理を行わなければならない。しかし、それでは、並べ換えの処理のために時間がかかり、リアルタイム処理が困難になる。
【0050】
そこで、この例では、描画命令に前述のようなタグTGを設け、このタグTGをCPU42が描画命令順となるように書き換える。ソーティングコントロール45は、このタグTGを辿って描画命令を描画装置部61に転送する。CPU42は、描画命令自身のメインメモリ43上でのアドレス位置を変更することなく、ポリゴン描画の表示優先順位を決定する処理をメインメモリ43上において行うことができる。
【0051】
図4Bは、ポリゴン描画命令の一例を示すものである。このポリゴン描画命令は三角形ポリゴンの描画命令であり、この場合、コマンド識別コードCODEの識別データIDPは、それを示す内容となっている。また、そのポリゴンの中を1色でマッピングする場合には、コードCODEの、必要な他の情報として、マッピングする3原色の色データ(R,G,B)を含んでいる。そして、命令データのパラメータとして、3頂点の座標(X0,Y0),(X1,Y1),(X2,Y2)が記述されている。さらに、パラメータには、後で詳述するように、半透明処理のためのインデックスデータINDXが含まれている。
【0052】
CPU42は、コントロールパッド71からのユーザーの操作入力に基づいて、物体や視点の動きを計算し、メインメモリ43上に描画命令を作成する。ついで、Zデータによって、描画命令のタグTGを、描画順序の通りに書き換えて、メインメモリ43上において、描画命令列を生成するようにする。このとき、メインメモリ43上の各命令のアドレスは、変更されずに、タグのみが書き換わる。
【0053】
この描画命令列が完成すると、ソーティングコントローラ45は、図5に示すように、各描画命令IP1,IP2,IP3,…,IPnを、そのタグTG1,TG2,TG3,…,TGnに従って順番にたどって、1命令毎に、メインメモリ43から描画装置部61に転送する。このため、FIFOバッファ62は、1命令分の容量を備えていればよい。
【0054】
描画装置部61では、送られてきたデータが、既にソーティングされた状態にあるので、命令IP1,IP2,IP3,…,IPnを、順次実行してフレームメモリ63の描画領域ADに結果を格納する。
【0055】
なお、ポリゴン描画の際、データは、描画装置部61の勾配計算ユニットに送られ、勾配計算が行なわれる。勾配計算は、ポリゴン描画で多角形の内側をマッピングデータで埋めていく際、マッピングデータの平面の傾きを求める計算である。テクスチャーの場合はテクスチャー画像データでポリゴンが埋められ、また、グーローシェーディングの場合は輝度値でポリゴンが埋められる。
【0056】
物体の表面を構成するポリゴンにテクスチャーを貼り付ける場合には、テクスチャー領域ATのテクスチャーデータが2次元写像変換される。例えば、図6Aに示すようなテクスチャーパターンT1,T2,T3は、図6Bに示すような物体の各面のポリゴンに適合するように、2次元スクリーン上の座標に変換される。このように写像変換されたテクスチャーパターンT1,T2,T3が図6Cに示すように、物体OB1の表面に貼り付けられる。そして、これが、画像メモリ領域ADに配置され、画像表示モニター65の表示画面上に表示される。
【0057】
静止画テクスチャーの場合には、メインメモリ43上のテクスチャーパターンが、描画装置部61を介して、フレームメモリ63上のテクスチャー領域ATに転送される。描画装置部61は、これをポリゴンに貼り付ける。これにより、物体に静止画のテクスチャーが実現される。この静止画のテクスチャーパターンのデータは、CD−ROMディスクに記録しておくことができる。
【0058】
更に、動画のテクスチャーが可能である。つまり、動画テクスチャーの場合には、前述したように、CD−ROMディスクからの圧縮された動画データは、一旦、メインメモリ43に読み込まれる。そして、この圧縮画像データは、画像伸長装置部51に送られる。画像伸長装置部51で、画像データが伸長される。
【0059】
そして、伸長された動画データはフレームメモリ63上のテクスチャー領域ATに送られる。テクスチャー領域ATは、フレームメモリ63内に設けられているので、テクスチャーパターン自身も、フレーム毎に書き換えることが可能である。このように、テクスチャー領域ATに動画を送ると、テクスチャーが1フレーム毎に動的に書き換えられて変化する。このテクスチャー領域の動画により、ポリゴンへのテクスチャーマッピングを行えば、動画のテクスチャーが実現される。
【0060】
前述したように、画像伸長装置部51で伸長した画像データを、フレームメモリ63上の画像メモリ領域ADに送れば、背景画の動画を画像モニター装置65のスクリーン上に表示することができるし、CPU42により作成した描画命令により生成される描画画像のみで画像メモリ領域ADを埋めて、画像表示モニター65のスクリーンに描画することもできる。また、画像メモリ領域AD上で、CD−ROMディスクからの画像データを伸長して得た静止画の上に、CPU42によるポリゴン描画により物体を描画することも可能である。
【0061】
[半透明処理の第1の実施例の説明]
図1は、描画装置部61における半透明処理回路部分の第1の実施例のブロック図を示すものである。
【0062】
すなわち、半透明処理のために、描画装置部61は、混合回路101と、フレームバッファ63から画素データを読み出す読み出し回路102と、フレームバッファ63に画素データを書き込む書き込み回路103と、描画装置部61に転送されてきた描画命令をデコードする描画命令デコード部104と、描画命令デコード部104でデコードされた描画命令にしたがって描画画像を生成する画像生成回路105と、混合比率テーブルメモリ106と、混合比率テーブルメモリ106から、いずれの混合比率を選択して混合回路101に供給させるかを指定するインデックスデータを記憶するインデックスメモリ107と、半透明処理の全体を制御する制御部108とを備えている。
【0063】
混合比率テーブルメモリ106には、例えば図7に示すような混合比率βが、あらかじめ格納されている。ここで用意される混合比率βは、半透明処理によく使用される混合比率である。この混合比率テーブルは、あらかじめメモリ106に初めからに設定しておいてもよいが、CD−ROMディスクから転送するようにしてもよい。
【0064】
前述の図3Bに示した描画命令に含まれるインデックスデータは、この混合比率テーブルの各混合比率を選択するための選択情報となる。つまり、描画命令中のインデックスデータは、図7の混合比率テーブルのインデックス番号に対応(メモリ106のアドレスに対応)するものであり、これによりメモリ106から当該インデックス番号の混合比率を選択して読み出すことができる。
【0065】
この描画命令中のインデックスデータは、描画命令デコード部104で抽出され、インデックスメモリ107に供給されて、格納される。この場合、インデックスメモリ107は、画像生成部105からの描画画素位置情報に基づいて、画像生成部105で生成される描画画像を構成する各ピクセル(画素)ごとにインデックスデータを記憶する。
【0066】
この場合、半透明処理は、次のように行われる。すなわち、読み出し回路102によりフレームバッファ63から、これから描画しようとする画素位置の画素データVaが読み出され、混合回路101に供給される。また、画像生成部105から、これから描画しようとする画素データVbが混合回路101に供給される。
【0067】
一方、インデックスメモリ107から、これから描画しようとする画素についてのインデックスデータが読み出され、読み出されたインデックスデータにより混合比率テーブルメモリ106から混合比率βが選択されて、読み出される。
【0068】
そして、この混合比率βが、混合回路101に供給される。混合回路101では、前記混合比率βで、画素データVaと画素データVbとが混合される。すなわち、(1−β)Va+βVb=Veなる演算が行われて、混合出力画像データVeが得られる。そして、その混合結果の画素データVeが、書き込み回路103により、フレームバッファ63の、前記読み出された画素データVaと同じアドレス位置に書き戻される。
【0069】
この場合、混合比率βに応じて前の画素の色が、新たな画素に残り、半透明の色となって表示される。なお、混合比率β=1であれば、完全不透明であり、混合比率β=0であれば、完全透明となる。
【0070】
[半透明処理の第2の実施例の説明]
図8は、描画装置部61における半透明処理回路部分の第2の実施例のブロック図を示すものである。この例の場合には、描画命令のデータには、完全透明処理か、完全不透明処理のためのフラグが含められる。
【0071】
図9は、この例の場合の描画命令の一例を示す。すなわち、この例の場合の描画命令は、命令識別コードCODEの部分に前記フラグFを、1ビットのデータとして有する。命令データのパラメータにインデックスデータINDXを含むのは、前述の第1の実施例と同様である。
【0072】
そして、この例の場合、混合比率テーブルとしては、図10に示すように、混合比率β=0と、β=1とを有しない。
【0073】
そして、図8に示すように、半透明処理のための描画装置部61の構成は、前述の図1の例の各回路ブロックに加えて、フラグ判別回路109が設けられる。そして、描画命令デコード部104は、描画命令中からのフラグFを抽出してこのフラグ判別回路109に供給する。フラグ判別回路109は、フラグFが完全不透明処理を示すときには、完全不透明の処理として認識し、その判別結果を制御部108に供給する。また、フラグFが完全透明処理を示すときには、完全透明の処理として認識し、その判別結果を制御部108に供給する。描画命令デコード部104からのフラグFは、当該描画命令による画像生成が行われている間、常にフラグ判別回路109に供給される。
【0074】
制御部108は、フラグFの判別出力により、完全不透明処理であるときには、読み出し回路102によるフレームバッファ63からの画素データの読み出し処理をさせない。そして、制御部108は、画像生成回路105からの画素データを混合回路101を通じてのそのままフレームバッファ63に供給するように制御し、書き込み回路103を、その画素データを描画しようとする画素位置に書き込むように制御する。これにより、当該画素は、新たな画素データのみとなり、完全に前の画素が新たな画素により隠される。
【0075】
制御部108は、また、フラグFの判別出力により、完全透明処理であるときには、読み出し回路102によるフレームバッファ63からの画素データの読み出し処理と、書き込み回路103による書き込み処理を行わせない。この結果、描画を行おうとする画素位置には、前の画素データがそのまま残り、完全透明の状態となって、表示される。
【0076】
なお、図8の例は、インデックスデータにより混合比率テーブルから混合比率を読み出すようにする発明と、高速処理のための発明とを合わせた実施例であるが、高速処理のためには、従来のような混合比率αを描画命令ごとに備え、この混合比率αを記憶するメモリを使用する半透明処理であってもよい。
【0077】
なお、以上の例では、CD−ROMディスクに画像データやアプリケーションプログラムを記録したが、記録媒体としては、例えば磁気ディスク、メモリカードのような半導体メモリなどの他の記録媒体を使用することもできる。
【0078】
【発明の効果】
以上説明したように、第1の発明によれば、描画命令は、半透明処理のための混合比率そのものを持つ必要はなく、描画装置部が備える混合比率テーブルの内の希望する混合比率を選択するためのインデックスデータを持てばよいので、少ないビット数でよくなる。また、描画装置部は、混合比率テーブルを記憶するメモリと、インデックスデータとを記憶するメモリを備えればよいので、メモリ容量の小さいメモリを使用することができる。
【0079】
また、第2の発明によれば、半透明処理回路を使用する場合であっても、完全不透明処理の場合には、フレームバッファからの画素データの読み出しを省略することができ、また、完全透明処理の場合には、フレームバッファからの画素データの読み出しと、フレームバッファへの画素データの書き戻しを省略することができるので、高速の処理が可能になる。
【図面の簡単な説明】
【図1】この発明による画像生成装置の要部の一実施例のブロック図である。
【図2】この発明による画像生成装置の一実施例の全体の構成のブロック図である。
【図3】この発明の一実施例におけるフレームメモリ領域の説明のための図である。
【図4】この発明の一実施例における命令のデータ構造例を示す図である。
【図5】この発明の一実施例における描画命令の転送例を示す図である。
【図6】テクスチャーマッピングの説明のための図である。
【図7】この発明の第1の実施例における混合比率テーブルの例を示す図である。
【図8】この発明の第2の実施例の要部のブロック図である。
【図9】この発明の第2の実施例の場合の描画命令の例を示す図である。
【図10】この発明の第2の実施例の場合の混合比率テーブルの例を示す図である。
【図11】従来の半透明処理回路を説明するためのブロック図である。
【符号の説明】
41 システムバス
42 CPU
43 メインメモリ
44 座標演算装置部
45 ソーティングコントローラ
46 キャッシュメモリ
51 画像伸長装置部
52 CD−ROMデコーダ
53 CD−ROMドライバ
54、55 FIFOバッファ
61 描画装置部
62 FIFOバッファ
63 フレームメモリ
65 画像表示モニター装置
71 コントロールパッド
AD 画像メモリ領域
AT テクスチャー領域
101 混合回路
102 読み出し回路
103 書き込み回路
104 描画命令デコード部
105 画像生成回路
106 混合比率テーブルメモリ
107 インデックスメモリ
108 制御部
109 フラグ判別回路
[0001]
[Industrial application fields]
The present invention is an image suitable for application when high visualization performance is required in a limited hardware resource, such as a video game machine or a graphic computer. In particular, the present invention relates to a so-called translucent process.
[0002]
[Prior art]
In computer graphics, what is usually called a 3D (three-dimensional = three-dimensional) graphics system first draws a plurality of surfaces of an object when drawing a realistic object (the object to be drawn is called an object). By dividing each polygon into the frame memory (hereinafter referred to as the frame buffer) corresponding to the monitor display screen. Reconstruct an image that looks stereoscopic.
[0003]
In this type of ordinary image generating apparatus, a dedicated drawing device is provided between the CPU and the frame buffer in order to perform processing at high speed. When generating an image, the CPU does not directly access the frame buffer, but generates a command for drawing a basic figure (polygon) such as a triangle or a quadrangle (hereinafter abbreviated as a drawing command) to generate a drawing device. Send to. The drawing apparatus interprets the sent drawing command and draws a figure in the frame buffer.
[0004]
By the way, in computer graphics, pixel data of a previously displayed image (for example, composed of three primary color data; the same applies hereinafter) and pixel data of an image to be rendered next are mixed at a predetermined ratio. Therefore, semi-transparent processing is performed. This translucent process is performed by a drawing apparatus. Conventionally, the translucent processing unit of the drawing apparatus is configured as shown in FIG.
[0005]
In FIG. 11, reference numeral 10 denotes a frame buffer, and 20 denotes a drawing apparatus.
The drawing device 20 has been transferred to the drawing device 20, a mixing circuit 21 for translucent processing, a read circuit 22 that reads pixel data from the frame buffer 10, a write circuit 23 that writes pixel data to the frame buffer 10, and the drawing device 20. A drawing command decoding unit 24 that decodes a drawing command, an image generation circuit 25 that generates a drawing image according to the drawing command decoded by the drawing command decoding unit 24, a mixing ratio memory 26, and the entire translucent process. And a control unit 27.
[0006]
In this case, the drawing command includes data of the mixing ratio, and the drawing command decoding unit 24 extracts the data of the mixing ratio and stores it in the mixing ratio memory 26. The mixing ratio memory 26 stores the mixing ratio for each pixel (pixel) constituting the drawing image generated by the image generation unit 25 based on the drawing pixel position information from the image generation unit 25.
[0007]
The translucent process is performed as follows. That is, the pixel data Vm before the pixel position to be drawn is read from the frame buffer 10 by the reading circuit 22 and supplied to the mixing circuit 21. Further, the pixel data Vc to be drawn from now is supplied from the image generation unit 25 to the mixing circuit 21. Then, the mixture ratio α for the pixel to be drawn is read from the mixture ratio memory 26 and supplied to the mixing circuit 21.
[0008]
In the mixing circuit 21, the pixel data Vm and the pixel data Vc are mixed at the mixing ratio α. That is, the calculation of (1−α) Vm + αVc = Vo is performed to obtain mixed output pixel data Vo. Then, the pixel data Vo obtained as a result of the mixing is written back to the same address position as the read pixel data Vm in the frame buffer 10 by the writing circuit 23.
[0009]
In this case, the color of the previous pixel remains in the new pixel in accordance with the mixing ratio α, and is displayed as a translucent color. If the mixing ratio α = 1, it is completely opaque, and if the mixing ratio α = 0, it is completely transparent.
[0010]
[Problems to be solved by the invention]
As described above, in the conventional translucent processing, the value of the mixing ratio α is included in the drawing command and is stored in the mixing ratio memory 26 for each pixel based on the drawing command. For this reason, if the mixing ratio is to be set finely, the number of bits of the mixing ratio α increases, the amount of data of the drawing command increases, and the mixing ratio memory 26 must have a large capacity.
[0011]
In order to simplify the configuration of the drawing apparatus, it is better to be able to perform completely transparent processing and completely opaque processing using semi-transparent processing. However, as described above, in the case of semi-transparent processing, For each pixel, three steps of reading from the frame buffer 10, mixing processing, and writing back processing to the frame buffer 10 are required, which has a disadvantage that the processing time is relatively long.
[0012]
A first object of the present invention is to provide an image generation apparatus in which the data amount of a drawing command does not increase and a mixture ratio memory having a small capacity can be used.
[0013]
A second object of the present invention is to provide an image generation apparatus capable of performing a complete transparency process and a complete opaque process at high speed using a translucent process.
[0014]
[Means for Solving the Problems]
In order to solve the above-described problem, the image generation apparatus according to the first aspect of the present invention corresponds to the reference numerals in the embodiment of FIG.
In the device that transfers the drawing command generated by the CPU 42 to the drawing device unit 61 and sequentially executes drawing according to the drawing command in the drawing device unit 61 to generate an image on the frame buffer 63.
The drawing device unit 61
Means 102 for reading out the pixel data of the previously drawn image from the frame buffer 63;
A mixing circuit 101 that mixes pixel data read from the frame buffer 63 and pixel data at a corresponding position to be drawn next at a specified mixing ratio;
Writing means 103 for writing the pixel data of the mixing result of the mixing circuit 101 to the corresponding pixel position of the frame buffer 63;
A mixing ratio storage unit 106 for storing a plurality of the mixing ratios;
Selection means 107 for selecting a mixing ratio to be supplied to the mixing circuit 101 from the mixing ratio storage unit 106 in accordance with the mixing ratio selection information included in the drawing command;
It is characterized by providing.
[0015]
Further, the image generation apparatus according to the invention of claim 2 corresponds to the reference numerals of the embodiment of FIG.
In the device that transfers the drawing command generated by the CPU 42 to the drawing device unit 61 and sequentially executes drawing in accordance with the drawing command to generate an image on the frame buffer 63.
The drawing device unit 61
Reading means 102 for reading pixel data of an image previously drawn from the frame buffer 63;
A mixing circuit 101 that mixes pixel data read from the frame buffer 63 and pixel data at a corresponding position to be drawn next at a specified mixing ratio;
Writing means 103 for writing the pixel data of the mixing result of the mixing circuit 101 to the corresponding pixel position of the frame buffer 63;
A mixing ratio storage unit 106 that stores the mixing ratio supplied to the mixing circuit 101;
A flag determination means 109 for extracting a flag relating to the mixing process included in the drawing command and determining the state of the flag;
From the determination result of the flag determining means 109, when the flag is in the state of 1, the reading of the pixel data from the frame buffer 63 by the reading means 102 is omitted and the pixel data at the corresponding position to be drawn next is omitted. The writing means 103 controls the writing to the corresponding pixel position of the frame buffer 63, and when the flag is in another state, the reading means 102 reads the pixel data from the frame buffer 63 and the writing means 103 uses the frame buffer. And a control means 18 for controlling the writing to 63 to be omitted.
[0016]
[Action]
In the first aspect of the invention having the above-described configuration, the mixing ratio storage unit 106 of the drawing device unit 61 stores information on the mixing ratio in advance. The drawing command includes selection information indicating which one of the mixing ratios stored in the mixing ratio storage unit 106 is used, and the mixing ratio to be supplied to the mixing circuit 101 is determined based on the selection information. Therefore, this selection information may be prepared for each pixel unit. Since this selection information may be the number of bits that can be selected for the number of mixing ratios stored in the mixing ratio storage unit 106, the number of bits may be smaller than in the conventional case where the mixing ratio must be maintained as it is, The data amount of the drawing command can be reduced, and the memory capacity necessary for selecting the mixing ratio can be reduced.
[0017]
Further, in the invention of claim 2, in the case where the discriminating means 109 performs a completely transparent process (mixing ratio = 0) and a completely opaque process (mixing ratio = 1) according to a 1-bit flag included in the drawing command. Is determined.
[0018]
In the case of complete transparency processing, the readout circuit 102 does not read out pixel data from the frame buffer 63, and the writing circuit 103 does not write back to the frame buffer 63. For this reason, even when a translucent processing apparatus including the mixing circuit 101, the reading circuit 102, and the writing circuit 103 is used, the complete transparent processing is performed at a high speed by the amount that the reading process and the writing process are omitted. Can be done.
[0019]
In the case of complete opacity processing, pixel data is not read from the frame buffer 63 by the read circuit 102, and only new pixel data is written to the frame buffer by the write circuit 103. Accordingly, in this case as well, high-speed processing is performed by the amount that the pixel data reading processing from the frame buffer 63 is omitted.
[0020]
【Example】
An embodiment of the present invention will be described below with reference to the drawings. FIG. 2 shows a configuration example of an image generation apparatus according to an embodiment of the present invention. This example is an embodiment of a game machine having a 3D graphic function and a moving image reproduction function.
[0021]
In FIG. 2, reference numeral 41 denotes a system bus (main bus). A CPU 42, a main memory 43, and a sorting controller 45 are connected to the system bus 41.
[0022]
In addition, an image decompression unit 51 is connected to the system bus 41 via an input FIFO (First In First Out) buffer memory (hereinafter, FIFO buffer memory is abbreviated as a FIFO buffer) 54 and an output FIFO buffer 55. Connected. Further, the CD-ROM decoder 52 is connected to the system bus 41 via the FIFO buffer 56, and the drawing unit 61 is connected to the system bus 41 via the FIFO buffer 62.
[0023]
Reference numeral 71 denotes a control pad as operation input means, which is connected to the system bus 41 via an interface 72. Further, the system bus 41 is connected to a boot ROM 73 that stores a program for starting up the game machine.
[0024]
The CD-ROM decoder 52 is connected to a CD-ROM driver 53 and decodes application programs (for example, game programs) and data recorded on a CD-ROM disc mounted on the CD-ROM driver 53. The CD-ROM disc stores, for example, image data of moving images and still images compressed by discrete cosine transform (DCT), and image data of texture images for modifying polygons. The application program on the CD-ROM disc includes a polygon drawing command. The FIFO buffer 56 has a capacity for one sector of the recording data of the CD-ROM disc.
[0025]
The CPU 42 manages the entire system. In addition, the CPU 42 performs a part of processing when an object is drawn as a collection of many polygons. That is, the CPU 42 generates a drawing command and generates a control command on the main memory 43 as will be described later. Then, as will be described later, a drawing command example that is a mixture of these drawing commands and control commands is created on the main memory 43.
[0026]
Further, the CPU 42 has a cache memory 46, and a part of the CPU instructions can be executed without fetching from the system bus 41. Further, the CPU 42 is provided with a coordinate calculation device unit 44 as a CPU internal coprocessor for performing coordinate conversion calculation for polygons and calculation of coordinate values for control when creating drawing commands and control commands. Yes. The coordinate arithmetic unit 44 performs three-dimensional coordinate conversion and three-dimensional to two-dimensional conversion on the display screen.
[0027]
As described above, since the CPU 42 has the instruction cache 46 and the coordinate arithmetic unit 44 inside, the processing can be performed to some extent without using the system bus 41, so the system bus 41 is released. It's easy to do.
[0028]
The image decompression unit 51 performs decompression processing of compressed image data reproduced from a CD-ROM disc, and includes hardware of a Huffman code decoder, an inverse quantization circuit, and an inverse discrete cosine transform circuit. The CPU 42 may process the Huffman code decoder as software.
[0029]
In the case of this example, the image expansion device unit 51 divides one image (one frame) into small regions (hereinafter referred to as macroblocks) of about 16 × 16 pixels (pixels), for example. Performs image decompression decoding in block units. Data transfer is performed with the main memory 43 in units of macroblocks. Therefore, the FIFO buffers 54 and 55 have a capacity corresponding to a macro block.
[0030]
A frame memory 63 is connected to the drawing device unit 61 via the local bus 11. The drawing device unit 61 executes a drawing command transferred from the main memory 43 via the FIFO buffer 62 and writes the result into the frame memory 63. The FIFO buffer 62 has a memory capacity for one instruction.
[0031]
The frame memory 63 includes an image memory area for storing a drawing image, a texture memory area for storing a texture image, and a table memory area for storing a color lookup table (color conversion table CLUT).
[0032]
FIG. 3 shows the memory space of the frame memory 63. The frame memory 63 is addressed with two-dimensional addresses of columns and rows. Of this two-dimensional address space, the area AT is a texture memory area. A plurality of types of texture patterns can be arranged in the texture area AT. AC is a table memory area of the color conversion table CLUT.
[0033]
As will be described later, the data of the color conversion table CLUT is transferred from the CD-ROM disk to the frame memory 63 by the sorting controller 45 through the CD-ROM decoder 52. The texture image data of the CD-ROM is decompressed by the image decompressing unit 51 and transferred to the frame memory 63 via the main memory 43.
[0034]
In FIG. 3, AD is an image memory area, and includes a frame buffer area for two areas, a drawing area and a display area. In this example, a frame buffer area currently used for display is referred to as a display buffer, and a frame buffer area where drawing is performed is referred to as a drawing buffer. In this case, while drawing is performed using one as a drawing buffer, the other is used as a display buffer. When drawing is completed, the two buffers are switched to each other. Switching between the drawing buffer and the display buffer is performed in synchronization with vertical synchronization when drawing is completed.
[0035]
The image data read from the display buffer of the frame memory 63 is output to the image monitor device 65 via the D / A converter 64 and displayed on the screen.
[0036]
The sorting controller 45 has the same function as a so-called DMA controller, transfers image data between the main memory 43 and the image decompression unit 51, and sends a drawing command sequence from the main memory 43 to the drawing unit 61. The transfer means constitutes the transfer means. The sorting controller 45 performs the above-described transfer process without the intervention of the CPU 42 through a gap where other devices such as the CPU 42 and the control pad 71 open the system bus 41. In this case, the CPU 42 can notify the sorting controller 45 of the opening of the system bus 41, or the sorting controller 45 can forcibly request the CPU 42 to release the bus.
[0037]
The main memory 43 includes a memory area for compressed image data and a memory area for decompressed image data subjected to decompression decoding processing for moving image and still image data. The main memory 43 includes a memory area for graphics data such as a drawing command sequence (hereinafter referred to as a packet buffer).
[0038]
This packet buffer is used for setting the drawing command sequence by the CPU 42 and transferring the drawing command sequence to the drawing device unit, and is shared by the CPU 42 and the drawing device unit 61. In this example, a packet buffer for setting a drawing command sequence (hereinafter referred to as a setting packet buffer) and a packet buffer for transfer are used so that the CPU 42 and the drawing device unit 61 operate in parallel. (Hereinafter referred to as an execution packet buffer), and when one is a setting packet buffer, the other is used as an execution packet buffer. The functions of two packet buffers are exchanged.
[0039]
When the apparatus (game machine) in the example of FIG. 2 is turned on and a CD-ROM disc is loaded, the CPU 42 executes a program for performing a so-called initialization process for executing the game in the boot ROM 73. . Then, the recording data of the CD-ROM disc is captured. At this time, each user data is decoded based on the identification information ID in the user data of each sector of the CD-ROM disc, and the data is checked. Based on the check result, the CPU 42 executes a process according to the reproduction data having the contents indicated by each ID.
[0040]
That is, compressed image data, a drawing command, and a program executed by the CPU 42 are read from the CD-ROM disk via the CD-ROM driver 53 and the CD-ROM decoder 52 and loaded into the main memory 43 by the sorting controller 45. The Of the loaded data, the information of the color conversion table is transferred to the area CLUT of the frame memory 63.
[0041]
[Decompression and transfer of compressed image data]
Of the input data to the main memory 43, the compressed image data is written again into the main memory 43 by the CPU 42 after the CPU 42 decodes the Huffman code. Then, the sorting controller 45 transfers the image data after the decoding process of the Huffman code from the main memory 43 to the image expansion device unit 51 via the FIFO buffer 54.
[0042]
The expanded image data is transferred to the main memory 43 by the sorting controller 45 via the FIFO buffer 55. In this case, as described above, the image expansion device unit 51 performs image data expansion processing in units of macroblocks. Therefore, the compressed data in units of macro blocks is transferred from the main memory 43 to the input FIFO buffer 54 by the sorting controller 45. When the decompression decoding process for one macroblock is completed, the image decompressing unit 51 puts the resulting decompressed image data into the output FIFO buffer 55 and also receives the compressed data of the next macroblock from the input FIFO buffer 54. Take out and perform decompression decoding.
[0043]
The sorting controller 45 transfers the decompressed image data of one macro block to the main memory 43 unless the system bus 41 is opened and the output FIFO buffer 55 of the image decompressing device 51 is empty. One macroblock of compressed image data is transferred from the main memory 43 to the input FIFO buffer 54 of the image decompression unit 51.
[0044]
The CPU 42 transfers the decompressed data to the frame memory 63 via the drawing device unit 61 when a certain amount of macroblocks of the decompressed image data is accumulated in the main memory 43. At this time, if the decompressed image data is transferred to the image memory area AD of the frame memory 63, it is displayed on the image monitor device 65 as a background moving image as it is. Further, it may be transferred to the texture memory area AT of the frame memory 63. The image data in the texture memory area AT is used for modifying the polygon as a texture image.
[0045]
[Processing and transfer of drawing instruction sequence]
Polygons that make up the surface of an object are displayed in a three-dimensional manner on a two-dimensional image display surface by drawing in order from polygons that are deep in the depth direction according to Z data that is three-dimensional depth information. Can do. The CPU 42 creates, on the main memory 43, a sequence of drawing commands for causing the drawing device unit 61 to perform drawing in order from the polygons at deep positions in the depth direction.
[0046]
FIG. 4A shows an outline of an example of the data structure of the instruction IP in this example. That is, this data structure includes a header part and an instruction data part.
[0047]
The header part includes a tag TG and a command identification code CODE. In the tag TG, an address on the main memory 43 in which the next drawing command or control command is stored is written. The command identification code CODE includes identification data IDP indicating what kind of instruction the instruction is, and includes other information necessary for the instruction as necessary. Coordinate values and other parameters are written in the command data portion PD. The parameter of the command data part PD is determined for each command IP.
[0048]
The tag TG plays the following role. In computer graphics, since a three-dimensional image is drawn on a two-dimensional screen, it is necessary to draw in order from the deepest. For this purpose, it is necessary to sequentially transfer drawing commands according to the drawing order from the main memory 43 to the drawing device unit 61.
[0049]
When the DMA transfer from the main memory 43 to the drawing device unit 61 is performed by the conventional DMA controller, a process for rearranging the drawing commands on the main memory 43 in the execution order, that is, a process for changing the storage address position of the drawing commands must be performed. I must. However, it takes time for the rearrangement process, and real-time processing becomes difficult.
[0050]
Therefore, in this example, the tag TG as described above is provided in the drawing command, and the tag TG is rewritten so that the CPU 42 is in the order of the drawing command. The sorting control 45 traces the tag TG and transfers a drawing command to the drawing device unit 61. The CPU 42 can perform processing for determining the display priority of polygon drawing on the main memory 43 without changing the address position of the drawing command itself on the main memory 43.
[0051]
FIG. 4B shows an example of a polygon drawing command. This polygon drawing command is a triangular polygon drawing command, and in this case, the identification data IDP of the command identification code CODE has the contents indicating it. In addition, when mapping the polygon with one color, the color data (R, G, B) of the three primary colors to be mapped are included as other necessary information of the code CODE. Then, the coordinates of the three vertices (X0, Y0), (X1, Y1), (X2, Y2) are described as parameters of the instruction data. Further, the parameter includes index data INDX for translucent processing, as will be described in detail later.
[0052]
The CPU 42 calculates the movement of the object and the viewpoint based on the user's operation input from the control pad 71 and creates a drawing command on the main memory 43. Next, the drawing command tag TG is rewritten in the drawing order with the Z data, and a drawing command sequence is generated on the main memory 43. At this time, only the tag is rewritten without changing the address of each instruction on the main memory 43.
[0053]
When this drawing command sequence is completed, the sorting controller 45 sequentially follows each drawing command IP1, IP2, IP3,..., IPn according to the tags TG1, TG2, TG3,. Each instruction is transferred from the main memory 43 to the drawing device unit 61. Therefore, the FIFO buffer 62 only needs to have a capacity for one instruction.
[0054]
In the drawing device unit 61, since the transmitted data is already sorted, the commands IP1, IP2, IP3,..., IPn are sequentially executed and the result is stored in the drawing area AD of the frame memory 63. .
[0055]
At the time of polygon drawing, the data is sent to the gradient calculation unit of the drawing device unit 61 to perform gradient calculation. The gradient calculation is a calculation for obtaining the inclination of the plane of the mapping data when the inside of the polygon is filled with the mapping data in polygon drawing. In the case of texture, the polygon is filled with texture image data, and in the case of Gouraud shading, the polygon is filled with luminance values.
[0056]
When a texture is pasted on a polygon constituting the surface of an object, the texture data in the texture area AT is two-dimensionally mapped. For example, texture patterns T1, T2, and T3 as shown in FIG. 6A are converted into coordinates on a two-dimensional screen so as to match the polygons on each surface of the object as shown in FIG. 6B. The texture patterns T1, T2, T3 thus mapped are pasted on the surface of the object OB1, as shown in FIG. 6C. This is arranged in the image memory area AD and displayed on the display screen of the image display monitor 65.
[0057]
In the case of a still image texture, the texture pattern on the main memory 43 is transferred to the texture area AT on the frame memory 63 via the drawing device unit 61. The drawing device unit 61 pastes this on the polygon. Thereby, a texture of a still image is realized on the object. This still image texture pattern data can be recorded on a CD-ROM disc.
[0058]
Furthermore, moving image textures are possible. That is, in the case of moving image texture, as described above, the compressed moving image data from the CD-ROM disk is once read into the main memory 43. Then, this compressed image data is sent to the image expansion device unit 51. Image data is decompressed by the image decompression device 51.
[0059]
The expanded moving image data is sent to the texture area AT on the frame memory 63. Since the texture area AT is provided in the frame memory 63, the texture pattern itself can be rewritten for each frame. As described above, when a moving image is sent to the texture area AT, the texture is dynamically rewritten and changed every frame. If the texture mapping to the polygon is performed by the moving image in the texture area, the moving image texture is realized.
[0060]
As described above, if the image data expanded by the image expansion device unit 51 is sent to the image memory area AD on the frame memory 63, a moving image of the background image can be displayed on the screen of the image monitor device 65, It is also possible to fill the image memory area AD with only the drawing image generated by the drawing command created by the CPU 42 and draw it on the screen of the image display monitor 65. It is also possible to draw an object by polygon drawing by the CPU 42 on a still image obtained by decompressing image data from a CD-ROM disc on the image memory area AD.
[0061]
[Description of First Example of Translucent Processing]
FIG. 1 is a block diagram showing a first embodiment of a translucent processing circuit portion in the drawing device section 61. As shown in FIG.
[0062]
That is, for the translucent processing, the drawing device unit 61 includes a mixing circuit 101, a reading circuit 102 that reads pixel data from the frame buffer 63, a writing circuit 103 that writes pixel data to the frame buffer 63, and the drawing device unit 61. A drawing command decoding unit 104 that decodes the drawing command transferred to the image generation unit, an image generation circuit 105 that generates a drawing image according to the drawing command decoded by the drawing command decoding unit 104, a mixing ratio table memory 106, and a mixing ratio An index memory 107 for storing index data for designating which mixing ratio to select from the table memory 106 to supply to the mixing circuit 101, and a control unit 108 for controlling the entire translucent process are provided.
[0063]
In the mixing ratio table memory 106, for example, a mixing ratio β as shown in FIG. 7 is stored in advance. The mixing ratio β prepared here is a mixing ratio often used for translucent processing. This mixing ratio table may be set in the memory 106 from the beginning in advance, but may be transferred from a CD-ROM disk.
[0064]
The index data included in the drawing command shown in FIG. 3B is selection information for selecting each mixing ratio in the mixing ratio table. That is, the index data in the drawing command corresponds to the index number of the mixing ratio table in FIG. 7 (corresponding to the address of the memory 106), and by this, the mixing ratio of the index number is selected and read from the memory 106. be able to.
[0065]
The index data in the drawing command is extracted by the drawing command decoding unit 104, supplied to the index memory 107, and stored. In this case, the index memory 107 stores index data for each pixel (pixel) constituting the drawing image generated by the image generation unit 105 based on the drawing pixel position information from the image generation unit 105.
[0066]
In this case, the translucent process is performed as follows. That is, the pixel data Va at the pixel position to be drawn is read from the frame buffer 63 by the reading circuit 102 and supplied to the mixing circuit 101. Further, the pixel data Vb to be drawn from now is supplied from the image generation unit 105 to the mixing circuit 101.
[0067]
On the other hand, the index data for the pixel to be drawn is read from the index memory 107, and the mixing ratio β is selected from the mixing ratio table memory 106 based on the read index data and read.
[0068]
This mixing ratio β is supplied to the mixing circuit 101. In the mixing circuit 101, the pixel data Va and the pixel data Vb are mixed at the mixing ratio β. That is, the calculation of (1−β) Va + βVb = Ve is performed to obtain mixed output image data Ve. Then, the pixel data Ve obtained as a result of the mixing is written back to the same address position as the read pixel data Va in the frame buffer 63 by the writing circuit 103.
[0069]
In this case, the color of the previous pixel remains in the new pixel according to the mixing ratio β, and is displayed as a translucent color. If the mixing ratio β = 1, it is completely opaque, and if the mixing ratio β = 0, it is completely transparent.
[0070]
[Description of Second Example of Translucent Processing]
FIG. 8 is a block diagram showing a second embodiment of the translucent processing circuit portion in the drawing device section 61. In FIG. In the case of this example, the drawing command data includes a flag for complete transparency processing or complete opaque processing.
[0071]
FIG. 9 shows an example of a drawing command in this example. That is, the drawing command in this example has the flag F as 1-bit data in the portion of the command identification code CODE. The parameter of the instruction data includes the index data INDX as in the first embodiment.
[0072]
In this example, the mixing ratio table does not have mixing ratios β = 0 and β = 1 as shown in FIG.
[0073]
As shown in FIG. 8, the configuration of the drawing device unit 61 for translucent processing is provided with a flag determination circuit 109 in addition to the circuit blocks in the example of FIG. Then, the drawing command decoding unit 104 extracts a flag F from the drawing command and supplies it to the flag determination circuit 109. The flag discriminating circuit 109 has a flag F Indicates fully opaque processing Sometimes, it is recognized as a completely opaque process, and the determination result is supplied to the control unit 108. Flag F Indicates fully transparent processing In some cases, it is recognized as a completely transparent process, and the determination result is supplied to the control unit 108. The flag F from the drawing command decoding unit 104 is always supplied to the flag determination circuit 109 while an image is generated according to the drawing command.
[0074]
Based on the determination output of the flag F, the control unit 108 does not cause the readout circuit 102 to read out the pixel data from the frame buffer 63 when the process is completely opaque. Then, the control unit 108 controls to supply the pixel data from the image generation circuit 105 to the frame buffer 63 as it is through the mixing circuit 101, and writes the writing circuit 103 to the pixel position where the pixel data is to be drawn. To control. As a result, the pixel becomes only new pixel data, and the previous pixel is completely hidden by the new pixel.
[0075]
Further, the control unit 108 does not perform the pixel data reading process from the frame buffer 63 by the reading circuit 102 and the writing process by the writing circuit 103 when the completely transparent process is performed based on the determination output of the flag F. As a result, the previous pixel data remains as it is at the pixel position to be drawn, and is displayed in a completely transparent state.
[0076]
The example of FIG. 8 is an embodiment that combines the invention for reading the mixing ratio from the mixing ratio table based on the index data and the invention for high-speed processing. Such a mixing ratio α may be provided for each drawing command, and a translucent process using a memory for storing the mixing ratio α may be used.
[0077]
In the above example, image data and application programs are recorded on the CD-ROM disc. However, as the recording medium, other recording media such as a magnetic disk and a semiconductor memory such as a memory card can be used. .
[0078]
【The invention's effect】
As described above, according to the first invention, the drawing command does not need to have the mixing ratio itself for the translucent processing, and selects a desired mixing ratio in the mixing ratio table provided in the drawing apparatus unit. Since it is sufficient to have index data to do this, a small number of bits is sufficient. In addition, the drawing apparatus unit only needs to include a memory for storing the mixture ratio table and a memory for storing the index data, so that a memory with a small memory capacity can be used.
[0079]
According to the second invention, even when a semi-transparent processing circuit is used, in the case of complete opaque processing, reading of pixel data from the frame buffer can be omitted, and complete transparency is achieved. In the case of processing, reading of pixel data from the frame buffer and writing back of pixel data to the frame buffer can be omitted, so that high-speed processing is possible.
[Brief description of the drawings]
FIG. 1 is a block diagram of an embodiment of a main part of an image generating apparatus according to the present invention.
FIG. 2 is a block diagram of an overall configuration of an embodiment of an image generating apparatus according to the present invention.
FIG. 3 is a diagram for explaining a frame memory area in one embodiment of the present invention;
FIG. 4 is a diagram showing an example of the data structure of an instruction in one embodiment of the present invention.
FIG. 5 is a diagram showing a transfer example of a drawing command in one embodiment of the present invention.
FIG. 6 is a diagram for explaining texture mapping;
FIG. 7 is a diagram showing an example of a mixing ratio table in the first embodiment of the present invention.
FIG. 8 is a block diagram of an essential part of a second embodiment of the present invention.
FIG. 9 is a diagram showing an example of a drawing command in the case of the second embodiment of the present invention.
FIG. 10 is a diagram showing an example of a mixing ratio table in the case of the second embodiment of the present invention.
FIG. 11 is a block diagram for explaining a conventional translucent processing circuit.
[Explanation of symbols]
41 System bus
42 CPU
43 Main memory
44 Coordinate operation unit
45 Sorting controller
46 Cache memory
51 Image decompression unit
52 CD-ROM decoder
53 CD-ROM driver
54, 55 FIFO buffer
61 Drawing unit
62 FIFO buffer
63 frame memory
65 Image display monitor device
71 Control pad
AD image memory area
AT texture area
101 Mixing circuit
102 Read circuit
103 Writing circuit
104 Drawing command decode unit
105 Image generation circuit
106 Mixing ratio table memory
107 Index memory
108 Control unit
109 Flag discrimination circuit

Claims (3)

CPUで生成した描画命令を描画装置部に転送し、この描画装置部で、前記描画命令にしたがって描画を順次実行してフレームバッファ上に画像を生成する装置において、
前記描画装置部は、
前記フレームバッファから前に描画された画像の画素データを読み出す手段と、
前記フレームバッファから読み出された画素データと、次に描画しようとする対応する位置の画素データとを、指定された混合比率で混合する混合回路と、
この混合回路の混合結果の画素データを、前記フレームバッファの対応する画素位置に書き込む書き込み手段と、
前記描画命令に含まれる識別情報を抽出して、この識別情報の状態を判別する識別情報判別手段と、
前記識別情報判別手段の判別結果から、前記識別情報が完全不透明処理を示すときは、前記読み出し手段によるフレームバッファからの画素データの読み出しを省略すると共に、前記次に描画しようとする対応する位置の画素データを、そのまま前記書き込み手段により前記フレームバッファの対応する画素位置に書き込むように制御する制御手段と、を備える画像生成装置。
In a device for transferring a drawing command generated by a CPU to a drawing device unit, and sequentially executing drawing according to the drawing command in the drawing device unit to generate an image on a frame buffer.
The drawing device section
Means for reading pixel data of an image previously drawn from the frame buffer;
A mixing circuit that mixes pixel data read from the frame buffer and pixel data at a corresponding position to be drawn next at a specified mixing ratio;
Writing means for writing pixel data of the mixing result of the mixing circuit into a corresponding pixel position of the frame buffer;
Identification information discriminating means for extracting the identification information contained in the drawing command and discriminating the state of the identification information;
When the identification information indicates complete opacity processing from the determination result of the identification information determination unit, reading of the pixel data from the frame buffer by the reading unit is omitted and the corresponding position to be drawn next is omitted. And an image generation apparatus comprising: control means for controlling the pixel data to be written as it is into the corresponding pixel position of the frame buffer by the writing means.
前記制御手段は、
前記識別情報判別手段の判別結果から、前記識別情報が完全透明処理を示すときは、前記読み出し手段によるフレームバッファからの画素データの読み出し及び前記書き込み手段による前記フレームバッファへの書き込みを省略するように制御する請求項1記載の画像生成装置。
The control means includes
From the determination result of the identification information determination means, when the identification information indicates complete transparency processing, reading of pixel data from the frame buffer by the reading means and writing to the frame buffer by the writing means are omitted. The image generation apparatus according to claim 1 to be controlled.
操作入力手段をさらに備え、
前記CPUは、操作入力手段が受け付けた操作入力に応じて、前記描画命令を生成すると共に、前記描画命令中の識別情報の設定を行う請求項1または2のいずれかに記載の画像生成装置。
It further comprises an operation input means,
The image generation apparatus according to claim 1, wherein the CPU generates the drawing command and sets identification information in the drawing command in accordance with an operation input received by an operation input unit.
JP2002232029A 2002-08-08 2002-08-08 Image generator Expired - Lifetime JP3735325B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002232029A JP3735325B2 (en) 2002-08-08 2002-08-08 Image generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002232029A JP3735325B2 (en) 2002-08-08 2002-08-08 Image generator

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP09571694A Division JP3462566B2 (en) 1994-04-08 1994-04-08 Image generation device

Publications (2)

Publication Number Publication Date
JP2003150975A JP2003150975A (en) 2003-05-23
JP3735325B2 true JP3735325B2 (en) 2006-01-18

Family

ID=19196300

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002232029A Expired - Lifetime JP3735325B2 (en) 2002-08-08 2002-08-08 Image generator

Country Status (1)

Country Link
JP (1) JP3735325B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005107780A (en) * 2003-09-30 2005-04-21 Sony Corp Image blending method and blended image data generation device
JP4539828B2 (en) * 2004-08-30 2010-09-08 富士ゼロックス株式会社 Drawing processing apparatus and drawing processing method
JP2009261756A (en) * 2008-04-28 2009-11-12 Daito Giken:Kk Game table
JP6821924B2 (en) * 2016-03-02 2021-01-27 株式会社リコー Image processing device, image processing method

Also Published As

Publication number Publication date
JP2003150975A (en) 2003-05-23

Similar Documents

Publication Publication Date Title
KR100380705B1 (en) Image generation method and apparatus, game playback apparatus
JP3492761B2 (en) Image generation method and apparatus
KR100411534B1 (en) Video data generation method, generation device and generation circuit, and game playback device
JPH07281652A (en) Image processor
JP3462566B2 (en) Image generation device
JP3454914B2 (en) Image generation method and image generation device
JP3735325B2 (en) Image generator
JP3238567B2 (en) Image generation method and apparatus
JP4174026B2 (en) Image processing device
CA2350844C (en) Method and apparatus for producing a polygonal image representation through operation of plotting commands on image data

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050622

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050705

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050829

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: 20051018

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051021

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20091028

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101028

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121028

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20131028

Year of fee payment: 8

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term