JP2014219739A - Image processing apparatus which processes graphics by dividing space, and image processing method - Google Patents

Image processing apparatus which processes graphics by dividing space, and image processing method Download PDF

Info

Publication number
JP2014219739A
JP2014219739A JP2013096577A JP2013096577A JP2014219739A JP 2014219739 A JP2014219739 A JP 2014219739A JP 2013096577 A JP2013096577 A JP 2013096577A JP 2013096577 A JP2013096577 A JP 2013096577A JP 2014219739 A JP2014219739 A JP 2014219739A
Authority
JP
Japan
Prior art keywords
processing
shader
processing unit
post
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2013096577A
Other languages
Japanese (ja)
Other versions
JP5864474B2 (en
Inventor
栄作 大渕
Eisaku Obuchi
栄作 大渕
カザコフ マキシム
Kazakov Maxim
カザコフ マキシム
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.)
DIGITAL MEDIA PROFESSIONAL KK
Digital Media Professionals Inc
Original Assignee
DIGITAL MEDIA PROFESSIONAL KK
Digital Media Professionals 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 DIGITAL MEDIA PROFESSIONAL KK, Digital Media Professionals Inc filed Critical DIGITAL MEDIA PROFESSIONAL KK
Priority to JP2013096577A priority Critical patent/JP5864474B2/en
Publication of JP2014219739A publication Critical patent/JP2014219739A/en
Application granted granted Critical
Publication of JP5864474B2 publication Critical patent/JP5864474B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus which processes graphics efficiently at a high speed in space-partitioning drawing, and an image processing method.SOLUTION: A compiler processing unit outputs a shader program divided into a pre-processing shader formed by extracting a function required for generating a color/depth value and a post-processing shader. A spatial index addition unit generates a spatial index after vertex processing to create a vertex buffer with spatial index. A pre-processing unit performs rasterization to acquire a pixel for each space defined by the spatial index, and generates a color value and a depth value on the basis of the pre-processing shader. A post-processing unit performs texture shading processing based on the post-processing shader, on a pixel decided to be written on an output color buffer. A pixel output unit outputs a color value of the pixel obtained by the pre-processing unit and the post-processing unit to the output color buffer.

Description

本発明は,空間を分割した上でグラフィックスの描画処理を行うことのできる画像処理装置及び画像処理方法に関するものである。具体的に説明すると,本発明は,空間を分割してグラフィックスの描画を行うことで,ユーザの画面操作等により描画の更新が必要となったような場合に,その描画の更新が必要な空間のみについてポリゴンの描画更新を実行することができる。これにより,本発明の画像処理装置等は,描画処理を高速化し,描画遅延を最小に抑える。   The present invention relates to an image processing apparatus and an image processing method capable of performing graphics drawing processing after dividing a space. More specifically, according to the present invention, when graphics are drawn by dividing a space, the drawing needs to be updated when the drawing needs to be updated by a user's screen operation or the like. Polygon drawing update can be executed for only space. As a result, the image processing apparatus of the present invention speeds up the drawing process and minimizes the drawing delay.

従来から,ゲーム機やカーナビゲーション装置などの分野においては,3次元コンピュータグラフィックスをリアルタイムに描画する3次元画像表示装置が普及している。3次元コンピュータグラフィックスでは,一般的に3次元空間のオブジェクトを多数のポリゴンにより表現するポリゴンモデルが利用される。ポリゴンモデルの描画処理においては,光源,視点位置,視線方向,物体表面の反射率などを考慮してポリゴン表面に陰影をつけるシェーディングが行われる。また,写実性の高い画像を生成するために,ポリゴンモデルの表面にテクスチャ画像を貼り付けるテクスチャマッピングが行われる。   Conventionally, in fields such as game machines and car navigation devices, 3D image display devices that draw 3D computer graphics in real time have become widespread. In the three-dimensional computer graphics, a polygon model that represents an object in a three-dimensional space with a large number of polygons is generally used. In the polygon model drawing process, shading is performed to shade the polygon surface in consideration of the light source, viewpoint position, line-of-sight direction, reflectance of the object surface, and the like. In addition, in order to generate an image with high realism, texture mapping is performed by attaching a texture image to the surface of the polygon model.

また,3次元画像表示装置は,例えばグラフィック処理チップなどにより実現されている。このグラフィックス処理チップには,プロセッサが搭載されており,このプロセッサは,プログラマが画像生成アルゴリズムを定義するシェーダが組み込まれることによって画像処理に特化した機能を有するものとなっている。シェーダは,主として,ライティング(光源計算),シェーディング(陰影処理),及びレンダリング(ピクセル化)等を実行するためにグラフィックリソースに対して使用するソフトウェア命令の組み合わせである。グラフィック処理チップで3次元の画像表示を行う方法としては,CPU側で処理を行うほか,グラフィック処理チップにおいて実装されたシェーダをプログラム可能に構成し,各シェーダを通じて最終的にレンダリングされるオブジェクトに対して処理を行うようにすることもできる。   The three-dimensional image display device is realized by, for example, a graphic processing chip. This graphics processing chip is equipped with a processor, and this processor has a function specialized for image processing by incorporating a shader in which a programmer defines an image generation algorithm. A shader is primarily a combination of software instructions used on graphic resources to perform lighting (light source calculations), shading (shading), rendering (pixelation), and the like. As a method of displaying a three-dimensional image on a graphic processing chip, processing is performed on the CPU side, and a shader mounted on the graphic processing chip is configured to be programmable, and an object finally rendered through each shader is processed. It is also possible to perform processing.

また,近年では,タイルベースでグラフィックス処理を行うシステムも開発されている(特許文献1等)。タイルベースのグラフィックスシステムは,各フレームを表示するために,フレームをタイルと呼ばれる複数領域に分割する。また,このシステムは,フレーム内に各グラフィックスプリミティブ(点,線,又は三角形等)を表示するためのビニング部を有している。ビニング部は,多様なタイルのうち,グラフィックスプリミティブが交差するものを決定するためのビニング動作を行うために用いられる。すなわち,ビニング部は,基本的に,複数のビン(例えば,各タイルにつき1つのビン)を指定し,グラフィックスプリミティブ用の座標データに基づいて,そのグラフィックスプリミティブが交差するタイル(単数または複数)を決定し,各交差するタイルについて,関連ビン内のグラフィックスプリミティブの識別子を記録するという処理を行う。そして,このグラフィックスシステムでは,ビニング動作の終了後,各タイルについてグラフィックスデータが生成される。すなわち,ビニング動作が終了した段階で,グラフィックスシステムのラスタライゼーション部に特定のタイルが割り当てられ,そのタイルに適用可能なタイルリストに応じ,割り当てられたタイルについてのグラフィックスデータが生成される。   In recent years, a system for performing graphics processing on a tile basis has been developed (Patent Document 1, etc.). In order to display each frame, the tile-based graphics system divides the frame into a plurality of areas called tiles. The system also has a binning section for displaying each graphics primitive (point, line, triangle, etc.) in the frame. The binning unit is used to perform a binning operation for determining the intersection of graphics primitives among various tiles. In other words, the binning unit basically designates a plurality of bins (for example, one bin for each tile) and, based on the coordinate data for the graphics primitive, the tile (single or plural) that the graphics primitive intersects with. ) And the process of recording the identifier of the graphics primitive in the associated bin for each intersecting tile. In this graphics system, after the binning operation is finished, graphics data is generated for each tile. That is, when the binning operation is completed, a specific tile is assigned to the rasterization unit of the graphics system, and graphics data for the assigned tile is generated according to a tile list applicable to the tile.

特開2012−168951号公報JP 2012-168951 A

ところで,従来のタイルベースのグラフィックスシステムは,各フレームを,画一的に,タイルと呼ばれる複数の領域に分割するものである。例えば,特許文献1に示されたシステムでは,各フレームを256個のタイルに分割し,各タイルは256×256個の画素の解像度を有するものと定められている。しかしながら,描画を更新するグラフィックスの性質等に応じて処理の高速化が必要な空間領域は異なるものである。例えば,フレームの空間によってはプリミティブが密集する領域や,プリミティブが散在している領域がある。これに対し,従来のシステムのように,各フレームを画一的に分割して処理することとすると,処理の高速化が必要な空間領域についても,特に高速化の必要のない領域についても平等にタイルが振り分けられることとなるため,特に処理の高速化が必要な空間領域について重点的にグラフィックス処理を進めることができず,効率的でないという問題があった。また,従来のタイルベースのグラフィックスシステムのように,タイルベースでグラフィックス処理を行う場合,複数のタイルに跨ったプリミティブが多く存在すると処理の遅延に繋がるものであるが,従来のシステムでは,各タイルの大きさは全て等しいものであり,タイルそれぞれの大きさを変更することはできなくなっている。従って,従来のシステムでは,プリミティブの大きさ等に応じて,分割する大きさを変更するなどの柔軟な対応を行うことができず,この点においてもグラフィックスの効率性が低下するという問題があった。このように,従来の技術は,アプリケーションの重い部分の処理を負荷分散するために,空間領域分割を明示的に行うことが難しかった。さらに,任意の画面の一部分に対し更新処理を行う場合に,従来の技術では,その任意の一部の空間だけを分割して処理を実行することが出来なかった。   Incidentally, the conventional tile-based graphics system divides each frame uniformly into a plurality of areas called tiles. For example, in the system disclosed in Patent Document 1, each frame is divided into 256 tiles, and each tile is determined to have a resolution of 256 × 256 pixels. However, the space area that requires high-speed processing differs depending on the nature of graphics for which rendering is updated. For example, depending on the frame space, there are areas where primitives are densely populated and areas where primitives are scattered. On the other hand, if each frame is divided and processed as in the conventional system, the spatial area that requires high-speed processing is equal even in areas that do not require high-speed processing. Since tiles are assigned to each other, graphics processing cannot be advanced especially in a space area that requires high-speed processing, which is inefficient. In addition, when performing tile-based graphics processing as in the conventional tile-based graphics system, if there are many primitives that straddle multiple tiles, this will lead to processing delay. Each tile has the same size, and the size of each tile cannot be changed. Therefore, in the conventional system, it is not possible to flexibly deal with such as changing the size of the division according to the size of the primitive, and this also causes a problem that the efficiency of graphics is lowered. there were. As described above, in the conventional technique, it is difficult to explicitly perform the space area division in order to distribute the processing of a heavy part of the application. Furthermore, when updating a part of an arbitrary screen, the conventional technology cannot execute the process by dividing only the arbitrary part of the space.

このため,現在では,空間分割描画を行うにあたり,効率的かつ高速にグラフィックスを処理することが可能な画像処理装置等が求められている。   For this reason, at the present time, an image processing device capable of processing graphics efficiently and at high speed is required for space division drawing.

そこで,本発明の発明者は,上記の従来発明の問題点を解決する手段について鋭意検討した結果,ポリゴンを構成する頂点データに対し頂点処理(座標変換や照度計算)を行った後,ユーザから与えられた任意の空間情報等に基づいて空間インデックスを生成し,ポリゴンの構成情報,処理済み頂点データ,及び空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファを作成して,このインデックス付き頂点バッファを利用したグラフィックス処理を行うようにすることで,グラフィックスの性質等に応じて分割する空間の位置,大きさ,範囲を柔軟に決定することができ,効率的かつ高速なグラフィックスの描画処理を実現することができるという知見を得た。そして,本発明者は,上記知見に基づけば,従来技術の課題を解決できることに想到し,本発明を完成させた。
具体的に説明すると,本発明は以下の構成を有する。
Therefore, as a result of intensive studies on the means for solving the above-described problems of the conventional invention, the inventor of the present invention has performed vertex processing (coordinate conversion and illuminance calculation) on the vertex data constituting the polygon, and the user then Creates a spatial index based on given spatial information, etc., creates a spatial indexed vertex buffer that stores the polygon configuration information, processed vertex data, and spatial index in association, and creates this indexed vertex buffer By performing graphics processing using, it is possible to flexibly determine the position, size, and range of the space to be divided according to the nature of the graphics, and to render graphics efficiently and quickly The knowledge that processing was realizable was acquired. The inventor has conceived that the problems of the prior art can be solved based on the above knowledge, and has completed the present invention.
More specifically, the present invention has the following configuration.

本発明の第1の側面は,コンピュータグラフィックス処理用の画像処理装置に関する。
本発明の画像処理装置は,コンパイラ処理部10と,空間インデックス追加部20と,前段処理部30と,後段処理部40と,ピクセル出力部50と,を備えている。
コンパイラ処理部10は,グラフィックスアプリケーション内のシェーダプログラムを読み込み,カラー・奥行き値の生成に必要な機能を抽出した前段処理用シェーダと,当該前段処理用シェーダに含まれていないテクスチャ・シェーディング処理を含む後段処理用シェーダとを,出力する。
空間インデックス追加部20は,グラフィックスアプリケーション内のポリゴンを構成する頂点データを読み込んで,座標変換を含む頂点処理を行い,処理済み頂点データを得ると共に,変換後の座標系における空間インデックスを生成し,当該ポリゴンの構成情報,当該処理済み頂点データ,及び当該空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファ21を作成する。
前段処理部30は,空間インデックス付き頂点バッファ21を読み込んでポリゴンを構築し,空間インデックスにより定義される空間ごとに,当該ポリゴンにラスタライズ処理を行なってピクセルに変換し,前段処理用シェーダに基づいて,ラスタライズ処理済みのピクセルのカラー値及び奥行き値を生成する。
後段処理部40は,ラスタライズ処理済みのピクセルの奥行き値を参照して出力カラーバッファ51に書き込むことが決定されたピクセルについて,後段処理用シェーダに基づいたテクスチャ・シェーディング処理を行い,テクスチャ・シェーディング処理済みのピクセルのカラー値を生成する。
ピクセル出力部50は,前段処理部30及び後段処理部40により得られたピクセルのカラー値を出力カラーバッファ51に出力する。
A first aspect of the present invention relates to an image processing apparatus for computer graphics processing.
The image processing apparatus of the present invention includes a compiler processing unit 10, a spatial index addition unit 20, a pre-processing unit 30, a post-processing unit 40, and a pixel output unit 50.
The compiler processing unit 10 reads a shader program in a graphics application, extracts a function necessary for generating a color / depth value, and performs a texture / shading process not included in the preceding process shader. Output post-processing shader including it.
The spatial index adding unit 20 reads vertex data constituting a polygon in the graphics application, performs vertex processing including coordinate conversion, obtains processed vertex data, and generates a spatial index in the coordinate system after conversion. , A vertex buffer 21 with a spatial index in which the configuration information of the polygon, the processed vertex data, and the spatial index are stored in association with each other is created.
The pre-processing unit 30 reads the vertex buffer 21 with the spatial index to construct a polygon, performs rasterization processing on the polygon for each space defined by the spatial index, converts the polygon into pixels, and based on the pre-processing shader , Generate color values and depth values of rasterized pixels.
The post-processing unit 40 performs a texture shading process based on the post-processing shader on the pixel determined to be written to the output color buffer 51 with reference to the depth value of the rasterized pixel, and the texture shading process Generate the color value of the completed pixel.
The pixel output unit 50 outputs the pixel color values obtained by the pre-processing unit 30 and the post-processing unit 40 to the output color buffer 51.

ここで,本発明の画像処理装置において,前段処理部30は,ラスタライズ処理を行う前段プロセッサコア31を有し,後段処理部40は,テクスチャ・シェーディング処理を行う後段プロセッサコア41を有することが好ましい。そして,これらの前段プロセッサコア31と後段プロセッサコア41は,互いに異なるハードウェアであることが好ましい。   Here, in the image processing apparatus of the present invention, the pre-processing unit 30 preferably includes a pre-processor core 31 that performs rasterization processing, and the post-processing unit 40 preferably includes a post-processor core 41 that performs texture shading processing. . The front processor core 31 and the rear processor core 41 are preferably different hardware.

また,本発明の画像処理装置において,空間インデックス追加部20は,ユーザによって任意に与えられた空間情報に基づいて空間分割を行い,空間インデックスを生成することが好ましい。   In the image processing apparatus of the present invention, it is preferable that the space index adding unit 20 performs space division based on space information arbitrarily given by the user and generates a space index.

また,本発明の画像処理装置において,コンパイラ処理部10は,フロントエンド処理部11と,機能抽出部12と,バックエンド処理部13と,を有することが好ましい。
フロントエンド処理部11は,前記シェーダプログラムに対してフロントエンド処理を行い,中間表現へと変換する。
機能抽出部12は,中間表現と,事前に用意されたカラー・奥行き値の生成に関する処理パターンとのターンマッチ処理を行うことにより,当該中間表現から,カラー・奥行き値の生成に必要な機能を抽出する。
バックエンド処理部13は,中間表現に対してバックエンド処理を行い,機能抽出部12が抽出したカラー・奥行き値の生成に必要な機能を前段処理用シェーダとして出力すると共に,シェーダプログラムのうちのカラー・奥行き値の生成に必要な機能以外の機能を後段処理用シェーダとして出力する。
In the image processing apparatus of the present invention, the compiler processing unit 10 preferably includes a front end processing unit 11, a function extraction unit 12, and a back end processing unit 13.
The front-end processing unit 11 performs front-end processing on the shader program and converts it into an intermediate representation.
The function extraction unit 12 performs turn-match processing between the intermediate representation and a processing pattern relating to generation of the color / depth value prepared in advance, so that functions necessary for generating the color / depth value can be obtained from the intermediate representation. Extract.
The back-end processing unit 13 performs back-end processing on the intermediate representation, outputs functions necessary for generating the color / depth values extracted by the function extracting unit 12 as a pre-processing shader, Functions other than those necessary for generating color / depth values are output as a post-processing shader.

本発明の第2の側面は,コンピュータグラフィックス処理用の画像処理装置により実行される画像処理方法に関する。
本発明の画像処理方法では,画像処理装置が,コンパイラ処理工程と,空間インデックス追加工程と,前段処理工程と,後段処理工程と,ピクセル出力工程と,を行う。
コンパイラ処理部10は,グラフィックスアプリケーション内のシェーダプログラムを読み込み,カラー・奥行き値の生成に必要な機能を抽出した前段処理用シェーダと,当該前段処理用シェーダに含まれていないテクスチャ・シェーディング処理を含む後段処理用シェーダとを,出力する。
空間インデックス追加工程では,グラフィックスアプリケーション内のポリゴンを構成する頂点データを読み込んで,座標変換を含む頂点処理を行い,処理済み頂点データを得ると共に,変換後の座標系における空間インデックスを生成し,当該ポリゴンの構成情報,当該処理済み頂点データ,及び当該空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファ21を作成する。
前段処理部工程では,空間インデックス付き頂点バッファ21を読み込んでポリゴンを構築し,空間インデックスにより定義される空間ごとに,当該ポリゴンにラスタライズ処理を行なってピクセルに変換し,前段処理用シェーダに基づいて,ラスタライズ処理済みのピクセルのカラー値及び奥行き値を生成する。
後段処理部工程では,ラスタライズ処理済みのピクセルの奥行き値を参照して出力カラーバッファ51に書き込むことが決定されたピクセルについて,後段処理用シェーダに基づいたテクスチャ・シェーディング処理を行い,テクスチャ・シェーディング処理済みのピクセルのカラー値を生成する。
ピクセル出力部工程では,前段処理工程及び後段処理工程により得られたピクセルのカラー値を出力カラーバッファ51に出力する。
The second aspect of the present invention relates to an image processing method executed by an image processing apparatus for computer graphics processing.
In the image processing method of the present invention, the image processing apparatus performs a compiler processing step, a spatial index addition step, a pre-stage processing step, a post-stage processing step, and a pixel output step.
The compiler processing unit 10 reads a shader program in the graphics application, extracts a function necessary for generating a color / depth value, and performs a texture / shading process not included in the preceding process shader. Output post-processing shader including it.
In the spatial index addition process, the vertex data constituting the polygon in the graphics application is read and the vertex processing including coordinate transformation is performed to obtain the processed vertex data, and the spatial index in the coordinate system after the transformation is generated, A vertex buffer 21 with a spatial index that stores the configuration information of the polygon, the processed vertex data, and the spatial index in association with each other is created.
In the pre-processing unit process, the vertex buffer 21 with a spatial index is read to construct a polygon, and for each space defined by the spatial index, the polygon is rasterized and converted into pixels. Based on the pre-processing shader , Generate color values and depth values of rasterized pixels.
In the post-processing unit process, texture shading processing based on the post-processing shader is performed on the pixels determined to be written to the output color buffer 51 with reference to the depth value of the rasterized pixel, and the texture shading processing is performed. Generate the color value of the completed pixel.
In the pixel output unit process, the color value of the pixel obtained by the pre-processing process and the post-processing process is output to the output color buffer 51.

本発明の他の側面は,第1の側面に係る画像処理装置を具備するコンピュータに関する。   Another aspect of the present invention relates to a computer including the image processing apparatus according to the first aspect.

本発明の他の側面は,第1の側面に係る画像処理装置を具備するゲーム機に関する。   Another aspect of the present invention relates to a game machine including the image processing apparatus according to the first aspect.

本発明は,空間インデックスを生成し,この空間インデックスに基づいた空間分割描画を行うことで,ユーザの画面操作等により描画の更新が必要となった場合にも,その描画の更新が必要な空間のみについてポリゴンの描画更新を実行することができるようになる。これにより,本発明は,描画処理を高速化し,描画遅延を最小に抑えることができる。また,本発明における空間分割は,フレームを画一的に複数の領域(タイル)に分割するものではなく,任意に与えられる空間インデックスに基づいて,ラスタライズによる変換後の座標系における空間を複数の領域に分割することが可能であるため,グラフィックスの性質等に応じて柔軟に空間の大きさ等を決定することができる。また,本発明の画像処理装置は,上記機構を有することで,ローカルのバッファ内で描画処理を行うことができるため,外部メモリへのアクセスを低減させることが可能であり,結果として,消費電力やメモリアクセスの際のオーバヘッドが低下し,グラフィックス処理の高速化を達成できる。   The present invention generates a space index and performs space-division drawing based on the space index, so that even when a drawing update is required due to a user's screen operation or the like, the space that needs to be updated is updated. Only the polygon drawing update can be executed. Accordingly, the present invention can speed up the drawing process and minimize drawing delay. The space division in the present invention does not uniformly divide a frame into a plurality of areas (tiles), but a plurality of spaces in a coordinate system after conversion by rasterization are divided into a plurality of areas based on arbitrarily given space indexes. Since it can be divided into regions, the size of space can be determined flexibly according to the nature of graphics. In addition, since the image processing apparatus according to the present invention has the above-described mechanism, drawing processing can be performed in a local buffer, so that access to an external memory can be reduced, resulting in power consumption. In addition, the overhead during memory access is reduced, and the graphics processing speed can be increased.

さらに,本発明の画像処理装置は,シェーダプログラムを,主としてカラー・奥行き値の生成に必要な機能を持つ前段処理用シェーダと,主としてテクスチャ・シェーディング処理に必要とされる後段処理用シェーダとに分割する。そして,この前段処理用シェーダに基づいて前段処理部でピクセルを処理した後,テクスチャ・シェーディング処理が必要なピクセルのみを後段処理部に入力して後段処理用シェーダに基づいた処理を実行するものである。従って,後段処理部においては不必要なピクセル処理を行う必要がなくなるため,処理時間の低減を図ることができる。また,前段処理部が処理するシェーダは,コンパイラよってカラー・奥行き値の生成に必要な機能に限定して抽出されたものである。従って,前段処理部は,不要な処理が省かれたシェーダを処理すればよいため,前段処理部用のプロセッサコアのサイズを最小限のものとすることができ,結果としてコスト低減に繋がる。   Furthermore, the image processing apparatus of the present invention divides the shader program into a front-end processing shader mainly having functions necessary for generating color and depth values, and a rear-stage processing shader mainly required for texture shading processing. To do. Then, after processing the pixels in the pre-processing unit based on this pre-processing shader, only the pixels that require texture / shading processing are input to the post-processing unit and the processing based on the post-processing shader is executed. is there. Therefore, it is not necessary to perform unnecessary pixel processing in the post-processing unit, and the processing time can be reduced. Further, the shader processed by the pre-processing unit is extracted by a compiler limited to functions necessary for generating color / depth values. Therefore, since the pre-processing unit only needs to process a shader from which unnecessary processing is omitted, the size of the processor core for the pre-processing unit can be minimized, resulting in cost reduction.

以上の通り,本発明は,空間分割描画を行うにあたり,効率的かつ高速にグラフィックスを処理することが可能な画像処理装置等を提供することができる。   As described above, the present invention can provide an image processing apparatus and the like capable of processing graphics efficiently and at high speed when performing space division drawing.

図1は,本発明に係る画像処理装置の構成の例を示すブロック図である。FIG. 1 is a block diagram showing an example of the configuration of an image processing apparatus according to the present invention. 図2は,コンパイラにおける処理の一例を示すフロー図である。FIG. 2 is a flowchart showing an example of processing in the compiler. 図3は,空間インデックス追加部における処理の一例を示すフロー図である。FIG. 3 is a flowchart showing an example of processing in the spatial index adding unit. 図4は,空間インデックス付き頂点バッファ内のデータ構造の一例を示している。FIG. 4 shows an example of the data structure in the vertex buffer with spatial index. 図5は,本発明に係る画像処理装置の変形例を示すブロック図である。FIG. 5 is a block diagram showing a modification of the image processing apparatus according to the present invention. 図6は,グラフィックス処理用のコンピュータの構成の例を示すブロック図である。FIG. 6 is a block diagram illustrating an example of the configuration of a computer for graphics processing. 図7は,ゲーム機の構成の例を示すブロック図である。FIG. 7 is a block diagram showing an example of the configuration of the game machine.

以下,図面を用いて本発明を実施するための形態について説明する。本発明は,以下に説明する形態に限定されるものではなく,以下の形態から当業者が自明な範囲で適宜修正したものも含む。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. The present invention is not limited to the embodiments described below, but includes those appropriately modified by those skilled in the art from the following embodiments.

[1.画像処理装置,画像処理方法]
図1は,本発明に係る画像処理装置1のブロック図を示している。本発明に係る画像処理装置1は,3次元コンピュータグラフィックス処理用のハードウェアとして利用される。
図1に示されるように,画像処理装置1は,グラフィックスアプリケーション60を読み込んで,所定のグラフィックス描画処理を行い,描画処理の結果を出力カラーバッファ51に出力する。画像処理装置1は,図1の上段に示されているコンパイラ処理部10と,図1の下段に示されているグラフィックスパイプラインを備えている。グラフィックスパイプラインは,空間インデックス追加部20と,前段処理部30と,後段処理部40と,ピクセル出力部50を含む。コンパイラ処理部10は,グラフィックスアプリケーション60からシェーダプログラム61を読み込んで,このシェーダプログラム61を前段処理用シェーダ62と後段処理用シェーダ63とに分割する。すなわち,コンパイラ処理部10は,シェーダプログラム61に記述された指令を,前段処理部30と後段処理部40に割り当てる処理を行う。グラフィックスパイプラインでは,空間インデックス追加部20によって空間インデックス付き頂点バッファ21を作成する処理を行った後,前段処理部30が,空間インデックス付き頂点バッファ21を読み込んで,空間ごとにラスタライズ処理を行うと共に,前処理用シェーダに基づいて,ピクセルのカラー値及び奥行き値を生成する。その後,後段処理部40は,必要なピクセルに対し,後段処理用シェーダ63に基づいてテクスチャ処理及びシェーディング処理を行う。ピクセル出力部50は,前段処理部30及び後段処理部40におけるピクセル処理の結果を,出力カラーバッファ51へと出力する。出力カラーバッファ51に蓄積されたピクセルのカラー値は,公知のディスプレイ装置によって動画像又は静止画像を表示する際に参照される。
[1. Image processing apparatus and image processing method]
FIG. 1 shows a block diagram of an image processing apparatus 1 according to the present invention. The image processing apparatus 1 according to the present invention is used as hardware for three-dimensional computer graphics processing.
As shown in FIG. 1, the image processing apparatus 1 reads a graphics application 60, performs a predetermined graphics drawing process, and outputs the result of the drawing process to the output color buffer 51. The image processing apparatus 1 includes a compiler processing unit 10 shown in the upper part of FIG. 1 and a graphics pipeline shown in the lower part of FIG. The graphics pipeline includes a spatial index adding unit 20, a pre-processing unit 30, a post-processing unit 40, and a pixel output unit 50. The compiler processing unit 10 reads a shader program 61 from the graphics application 60 and divides the shader program 61 into a pre-processing shader 62 and a post-processing shader 63. In other words, the compiler processing unit 10 performs a process of assigning commands described in the shader program 61 to the pre-processing unit 30 and the post-processing unit 40. In the graphics pipeline, after the spatial index adding unit 20 performs processing for creating the spatial index-added vertex buffer 21, the pre-processing unit 30 reads the spatial index-added vertex buffer 21 and performs rasterization processing for each space. , Generate a color value and a depth value of the pixel based on the preprocessing shader. Thereafter, the post-processing unit 40 performs texture processing and shading processing on necessary pixels based on the post-processing shader 63. The pixel output unit 50 outputs the result of the pixel processing in the pre-processing unit 30 and the post-processing unit 40 to the output color buffer 51. The pixel color values stored in the output color buffer 51 are referred to when a moving image or a still image is displayed by a known display device.

コンパイラ処理部10には,グラフィックスアプリケーション60内のシェーダプログラム61が入力される。コンパイラ処理部10は,シェーダプログラム61を解析してコンパイルを行うことにより,コンパイル済のバイナリファイルである前段処理用シェーダ62と後段処理用シェーダ63とを出力する。前段処理用シェーダ62は,ピクセルのカラー値及び奥行き値の生成に必要な機能を抽出したシェーダコードである。前段処理用シェーダ62には,カラー値と奥行き値の生成に関わる処理として,例えば,奥行きテストや,アルファテスト,ステンシルテストなどが含まれる。また,後段処理用シェーダ63は,シェーダプログラム61のうち前段処理用シェーダ62以外のシェーダコードである。後段処理用シェーダ63には,少なくとも,テクスチャ処理及びシェーディング処理に必要な機能が含まれる。例えば,後段処理用シェーダ63には,テクスチャ処理やシェーディング処理の他にも,環境マッピング処理や,光の屈折率の計算処理等が含まれていてもよい。   A shader program 61 in the graphics application 60 is input to the compiler processing unit 10. The compiler processing unit 10 analyzes and compiles the shader program 61 to output a pre-processing shader 62 and a post-processing shader 63, which are compiled binary files. The pre-processing shader 62 is a shader code that extracts functions necessary for generating pixel color values and depth values. The pre-processing shader 62 includes, for example, a depth test, an alpha test, a stencil test, and the like as processes related to generation of color values and depth values. The post-processing shader 63 is a shader code other than the pre-processing shader 62 in the shader program 61. The post-processing shader 63 includes at least functions necessary for texture processing and shading processing. For example, the post-processing shader 63 may include environment mapping processing, light refractive index calculation processing, and the like in addition to texture processing and shading processing.

また,図1に示されるように,コンパイラ処理部10は,フロントエンド処理部11と,機能抽出部12と,バックエンド処理部13と,を有している。コンパイラ処理部10では,フロントエンド処理部11が,プログラミング言語のソースコードを中間表現に変換し,バックエンド処理部13が,その中間表現をさらに変換して機械語などの出力言語のバイナリコードを生成する。このとき,バックエンド処理部13は,バックエンドにおいて高速に動作する最適化したコードを生成する。また,コンパイラ処理部10では,フロントエンド処理部11とバックエンド処理部13の間に,機能抽出部12が設けられている。機能抽出部12は,シェーダプログラム61に記述された指令のうち,ピクセルのカラー値及び奥行き値の生成に必要な機能を抽出したシェーダコード(前段処理用シェーダ62)を抽出し,それ以外の機能を持つシェーダコード(後段処理用シェーダ63)とは別に出力を行う。   As shown in FIG. 1, the compiler processing unit 10 includes a front-end processing unit 11, a function extraction unit 12, and a back-end processing unit 13. In the compiler processing unit 10, the front-end processing unit 11 converts the programming language source code into an intermediate representation, and the back-end processing unit 13 further converts the intermediate representation into an output language binary code such as a machine language. Generate. At this time, the back end processing unit 13 generates optimized code that operates at high speed in the back end. In the compiler processing unit 10, a function extraction unit 12 is provided between the front end processing unit 11 and the back end processing unit 13. The function extraction unit 12 extracts a shader code (predecessor processing shader 62) from which functions necessary for generating the color value and depth value of the pixel are extracted from the commands described in the shader program 61, and other functions. Is output separately from the shader code (the post-processing shader 63) having

フロントエンド処理部11は,グラフィックスアプリケーション60内のシェーダプログラム61が入力されると,構文解析等の一般的なフロントエンド処理を行い,シェーダ内演算機能を示す中間表現へと変換する。例えば,構文解析では,ソースプログラムの字句解析及び意味解析を行うことにより,ソースプログラムが中間表現(中間プログラム)へと変換される。   When the shader program 61 in the graphics application 60 is input, the front-end processing unit 11 performs general front-end processing such as syntax analysis, and converts it into an intermediate representation indicating the intra-shader operation function. For example, in syntax analysis, the source program is converted into an intermediate representation (intermediate program) by performing lexical analysis and semantic analysis of the source program.

フロントエンド処理後の中間表現は,機能抽出部12において解析される。機能抽出部12は,ピクセルのカラー値及び奥行き値の生成に必要な機能の処理パターンを予め保持している。この処理パターンは,ユーザによって任意に設定されるものであってもよいし,カラー値及び奥行き値を生成するプロセッサコアの機能に応じたものであってもよい。例えば,機能抽出部12は,プロセッサコアの処理機能を解析し,当該プロセッサコアにて処理可能な形式に準拠したものを上記処理パターンとして保持していてもよい。ここで,機能抽出部12は,中間表現と,予め用意されたカラー値及び奥行き値に対する処理パターンとのマッチ処理を行う。そして,機能抽出部12は,中間表現のうち,上記処理パターンとマッチした部分(機能)を,カラー値及び奥行き値の生成に必要な機能として抽出する。マッチングに必要な処理パターンは,画像処理装置1が具備するプロセッサコアの能力を分析して,そのプロセッサコアにおいて実行可能な処理パターンを,予めグラフィックス処理用のローカルメモリ等に記憶しておけばよい。例えば,マッチングに必要とされる処理パターンとしては,例えば,奥行きテストやアルファテストの条件式等を含む情報を用いることができる。このようにして,機能抽出部12は,シェーダプログラム61の中から,カラー値及び奥行き値の生成に必要な機能を抽出することで,フロントエンド処理後の中間表現を,カラー値及び奥行き値の生成に必要な機能のための中間表現と,この機能以外の機能のための中間表現とに分離する。   The intermediate representation after the front-end processing is analyzed by the function extraction unit 12. The function extraction unit 12 holds in advance processing patterns for functions necessary for generating pixel color values and depth values. This processing pattern may be arbitrarily set by the user, or may be in accordance with the function of the processor core that generates the color value and the depth value. For example, the function extraction unit 12 may analyze the processing function of the processor core and hold the one that conforms to a format that can be processed by the processor core as the processing pattern. Here, the function extraction unit 12 performs a matching process between the intermediate representation and a processing pattern for color values and depth values prepared in advance. Then, the function extraction unit 12 extracts a portion (function) that matches the processing pattern in the intermediate representation as a function necessary for generating the color value and the depth value. The processing pattern required for matching is obtained by analyzing the capability of the processor core included in the image processing apparatus 1 and storing the processing pattern executable in the processor core in a local memory for graphics processing in advance. Good. For example, as processing patterns required for matching, for example, information including a conditional expression of a depth test or an alpha test can be used. In this way, the function extraction unit 12 extracts the functions necessary for generating the color value and the depth value from the shader program 61, thereby converting the intermediate representation after the front end processing into the color value and the depth value. Separate the intermediate representation for functions required for generation and the intermediate representation for functions other than this function.

機能抽出部12における機能抽出処理の後,バックエンド処理部13は,バックエンド処理を行なって,前段処理部30と後段処理部40のそれぞれに応じたシェーダコードを生成する。すなわち,バックエンド処理部13は,機能抽出部12によって抽出されたカラー値及び奥行き値の生成に必要な機能(中間表現)についてバックエンド処理を行うことで,前段処理用シェーダ62を出力する。同時に,バックエンド処理部13は,機能抽出部12によって抽出されなかった機能,例えばテクスチャ処理及びシェーディング処理に必要な機能(中間表現)についてバックエンド処理を行うことで,後段処理用シェーダ63を出力する。このように,バックエンド処理部13では,カラー値及び奥行き値の生成に必要な機能のための中間表現と,この機能以外の機能のための中間表現のそれぞれにバックエンド処理を行うことで,前段処理部30向けの前段処理用シェーダ62と,後段処理部40向けの後段処理用シェーダ63とを出力する。その他,バックエンド処理部13は,各中間表現を,前段処理部30に備えられたハードウェア又は後段処理部40に備えられたハードウェアにおいて,高速に動作する最適化したコードに変換する通常のバックエンド処理を行えばよい。   After the function extraction processing in the function extraction unit 12, the back end processing unit 13 performs back end processing and generates shader codes corresponding to the pre-processing unit 30 and the post-processing unit 40, respectively. That is, the back-end processing unit 13 performs the back-end processing on the functions (intermediate representation) necessary for generating the color value and the depth value extracted by the function extracting unit 12, and outputs the pre-processing shader 62. At the same time, the back-end processing unit 13 outputs a post-processing shader 63 by performing back-end processing for functions not extracted by the function extracting unit 12, for example, functions necessary for texture processing and shading processing (intermediate representation). To do. As described above, the back-end processing unit 13 performs back-end processing on each of intermediate representations for functions necessary for generating color values and depth values and intermediate representations for functions other than this function. A pre-processing shader 62 for the pre-processing unit 30 and a post-processing shader 63 for the post-processing unit 40 are output. In addition, the back-end processing unit 13 converts each intermediate representation into an optimized code that operates at high speed in the hardware provided in the pre-processing unit 30 or the hardware provided in the post-processing unit 40. What is necessary is just to perform backend processing.

ここで,図2には,コンパイラ処理部10による処理工程の一実施形態が示されている。図2に示されるように,コンパイラ処理部10に入力されたシェーダプログラムは,構文解析などのフロントエンド処理が行われた後,シェーダ内演算機能を示す中間表現への変換処理が行われる。その後,変換された中間表現と,事前に用意されたカラー値及び奥行き値に対する処理パターンとのパターンマッチ処理が行われる。そして,中間表現のうち,カラー値及び奥行き値に対する処理パターンとマッチした部分は,バックエンド処理を経て,前段処理用シェーダ62としてとして出力処理される。他方,中間表現のうち,カラー値及び奥行き値に対する処理パターンとマッチしなかった部分は,バックエンド処理を経て,後段処理用シェーダ63として出力処理される。   Here, FIG. 2 shows an embodiment of processing steps performed by the compiler processing unit 10. As shown in FIG. 2, the shader program input to the compiler processing unit 10 is subjected to front-end processing such as syntax analysis, and then converted to an intermediate representation indicating an intra-shader operation function. Thereafter, pattern matching processing is performed between the converted intermediate representation and processing patterns for color values and depth values prepared in advance. Then, the portion of the intermediate representation that matches the processing pattern for the color value and the depth value is subjected to output processing as the pre-stage processing shader 62 through back-end processing. On the other hand, the portion of the intermediate representation that does not match the processing pattern for the color value and the depth value is subjected to output processing as a back-end processing shader 63 through back-end processing.

なお,本実施形態において,上記コンパイラ処理部10によるコンパイラ処理は,グラフィックスアプリケーション60の実行時に行われるものであるが,例えば,コンパイラ処理は,アプリケーション実行前に事前に行われるものであってもよい。例えば,グラフィックスアプリケーション60の実行前に,このグラフィックスアプリケーション60を解析し,カラー値及び奥行き値に対する処理パターンとマッチングした部分を抽出して予め保持しておくこととしてもよい。   In the present embodiment, the compiler processing by the compiler processing unit 10 is performed when the graphics application 60 is executed. For example, the compiler processing may be performed in advance before executing the application. Good. For example, before executing the graphics application 60, the graphics application 60 may be analyzed, and a portion matching the processing pattern for the color value and the depth value may be extracted and held in advance.

その後,上記コンパイラ処理部10から出力された前段処理用シェーダ62と後段処理用シェーダ63とを含むグラフィックスプログラムを用いて,図1の下段に示したグラフィックスパイプラインにより,実際のグラフィックス描画処理が行われる。   Thereafter, an actual graphics rendering process is performed by the graphics pipeline shown in the lower part of FIG. 1 using a graphics program including the pre-processing shader 62 and the post-processing shader 63 output from the compiler processing unit 10. Is done.

図1に示されるように,グラフィックスパイプラインにおいては,まず,空間インデックス追加部20に,グラフィックスアプリケーション60内のポリゴンを構成する頂点データが入力される。空間インデックス追加部20は,入力された各頂点データについて頂点処理を行うと共に,空間インデックスを生成し,空間インデックス付き頂点バッファ21を作成する機能を持つ。   As shown in FIG. 1, in the graphics pipeline, first, vertex data constituting a polygon in the graphics application 60 is input to the spatial index adding unit 20. The spatial index adding unit 20 has a function of performing vertex processing on each input vertex data, generating a spatial index, and creating a vertex buffer 21 with a spatial index.

図3には,空間インデックス追加部20によって行われる処理のフローが示されている。図3に示されるように,空間インデックス追加部20は,まず,グラフィックスアプリケーションから頂点データとポリゴンの構成データを読み込んで,頂点処理を行う。すなわち,グラフィックスアプリケーションには,例えばゲーム空間内のキャラクタや構造物等のオブジェクトに関し,このオブジェクトをポリゴンでモデリングしたときの頂点の座標情報を含む頂点データと,どの頂点を結んでポリゴンが構成されるかを示す情報を含んだ構成情報が含まれている。このため,空間インデックス追加部20は,グラフィックスアプリケーションから,これらの頂点データとポリゴンの構成情報とを読み込む。そして,空間インデックス追加部20は,読み込んだ頂点データとポリゴンの構成情報に基づいて,頂点処理を実行する。この頂点処理には,例えば,座標変換処理や照度計算処理などが含まれる。   FIG. 3 shows a flow of processing performed by the spatial index adding unit 20. As shown in FIG. 3, the spatial index adding unit 20 first reads vertex data and polygon configuration data from a graphics application and performs vertex processing. In other words, for a graphics application, for example, an object such as a character or a structure in a game space, a polygon is formed by connecting vertex data including vertex data including vertex coordinate information when the object is modeled with polygons. The configuration information including the information indicating whether or not is included. For this reason, the spatial index adding unit 20 reads these vertex data and polygon configuration information from the graphics application. Then, the spatial index adding unit 20 executes vertex processing based on the read vertex data and polygon configuration information. This vertex processing includes, for example, coordinate conversion processing and illuminance calculation processing.

頂点処理について具体的に説明すると,空間インデックス追加部20は,まず,グラフィックスアプリケーションから,モデリングされたオブジェクトのローカル座標を含む頂点データを取得し,取得した頂点データのローカル座標を,ワールド座標に変換する。この第1の座標変換は,1つのワールド座標系の所定の位置に,オブジェクトを配置するために行うものであり,ローカル座標系からワールド座標系への座標変換が実行される。なお,第1の座標変換において,オブジェクトの向き指定する回転角,位置を指定する並進ベクトル,大きさを指定するスケール比等のパラメータがメモリから読み出される。次に,空間インデックス追加部20は,ワールド座標系におけるオブジェクトの座標を,カメラ位置を原点としてカメラから見たカメラ座標系でのワールド座標へと座標変換する。この第2の座標変換を行なって,視点をカメラ位置に決定し,カメラの方向やズームレベルを指定することにより,オブジェクトを投影するスクリーンが決定される。また,空間インデックス追加部20は,特定の光源位置から照射される光をオブジェクトに当てたときの各頂点における照度の計算を行う。また,空間インデックス追加部20は,特定の光源位置から照射される光をオブジェクトに当てたときの各頂点の色などの他の特性についても,同様に計算を行う。最後に,空間インデックス追加部20は,ディスプレイの解像度等を含んだディスプレイ情報を読み出し,3次元のワールド座標をスクリーンに投影する座標変換を行う。この第3の座標変換によって,3次元の仮想空間上にある頂点の座標は,2次元のスクリーン座標に変換される。このように,空間インデックス追加部20は,頂点処理を行なって,ローカル座標系で定義されたオブジェクトの頂点データを,スクリーン平面上の2次元座標と照度等の頂点の特性を示す情報を含んだ頂点データに変換にする。これにより,空間インデックス追加部20は,上記頂点処理済みの頂点データを得ることができる。   Specifically, the vertex processing will be described. The spatial index adding unit 20 first acquires vertex data including local coordinates of the modeled object from the graphics application, and uses the acquired local coordinates of the vertex data as world coordinates. Convert. This first coordinate transformation is performed to place an object at a predetermined position in one world coordinate system, and coordinate transformation from the local coordinate system to the world coordinate system is executed. In the first coordinate conversion, parameters such as the rotation angle for designating the direction of the object, the translation vector for designating the position, and the scale ratio for designating the size are read from the memory. Next, the space index adding unit 20 converts the coordinates of the object in the world coordinate system into world coordinates in the camera coordinate system viewed from the camera with the camera position as the origin. By performing this second coordinate transformation, the viewpoint is determined as the camera position, and the screen on which the object is projected is determined by designating the camera direction and zoom level. In addition, the spatial index adding unit 20 calculates the illuminance at each vertex when light irradiated from a specific light source position is applied to the object. In addition, the spatial index adding unit 20 similarly calculates other characteristics such as the color of each vertex when light irradiated from a specific light source position is applied to the object. Finally, the spatial index adding unit 20 reads display information including the display resolution and the like, and performs coordinate conversion for projecting three-dimensional world coordinates onto the screen. By this third coordinate conversion, the coordinates of the vertices on the three-dimensional virtual space are converted into two-dimensional screen coordinates. As described above, the spatial index adding unit 20 performs vertex processing, and includes vertex data of an object defined in the local coordinate system, including information indicating two-dimensional coordinates on the screen plane and vertex characteristics such as illuminance. Convert to vertex data. As a result, the spatial index adding unit 20 can obtain the vertex data subjected to the vertex processing.

上記頂点処理後,空間インデックス追加部20は,ユーザから与えられた空間情報に基づき,頂点処理による変換後の座標系において,空間インデックスを生成する。後述するように,本発明において前段処理部30は,空間ごとにラスタライズ処理を行うものであるが,ここで作成される空間インデックスは,前段処理部30がラスタライズ処理を行う空間を定義する参照値となる。すなわち,空間インデックスは,グラフィックス処理が行われる空間の位置,大きさ,及び範囲を定義する情報である。そして,空間インデックス追加部20は,空間インデックスの生成処理後,ポリゴンの構成情報と,頂点処理済みの頂点データと,生成した空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファ21を作成する。なお,この空間インデックス付き頂点バッファ21は,ローカルメモリに設けられることとすればよい。   After the vertex processing, the spatial index adding unit 20 generates a spatial index in the coordinate system after conversion by the vertex processing based on the spatial information given by the user. As will be described later, in the present invention, the pre-processing unit 30 performs rasterization processing for each space, but the spatial index created here is a reference value that defines the space in which the pre-processing unit 30 performs rasterization processing. It becomes. That is, the space index is information that defines the position, size, and range of a space in which graphics processing is performed. Then, after the spatial index generation process, the spatial index adding unit 20 creates a vertex buffer 21 with a spatial index that stores the polygon configuration information, the vertex data that has been subjected to vertex processing, and the generated spatial index in association with each other. Note that the vertex buffer 21 with a spatial index may be provided in a local memory.

ここで,図4には,空間インデックス付き頂点バッファ21内のデータ構造の一例が示されている。図4に示されるように,空間インデックス付き頂点バッファ21内のデータには,ポリゴンを構成する頂点データを示す情報(ポリゴンの構成データ)と,各頂点データの座標情報と共に,ポリゴンが属する空間を示す情報(空間インデックス)が登録されている。例えば,図4に示された例を参照して説明すると,空間インデックス付き頂点バッファ21内のデータを見れば,三角形0は,v,v,及びvの頂点により構成されることがわかる。また,頂点vの座標は(x,y,z)であり,頂点vの座標は(x,y,z)であり,頂点vの座標は(x,y,z)である。また,各頂点v〜vの座標値も,空間インデックス付き頂点バッファ21内に登録されている。さらに,三角形0は,頂点処理による変換後の座標系において,Spaseとして定義されている空間に属していることがわかる。このように,空間インデックス付き頂点バッファ21は,各ポリゴンが空間インデックスにより定義される空間に属するものであるか否かを示すと共に,ポリゴンが空間内に属するものである場合に,どの空間に属するものであるかを示している。また,空間インデックス付き頂点バッファ21を参照すると,空間インデックスにより定義される空間は,SpaseとSpaseとが存在していることがわかる。このように,本発明では,複数の空間に分割される。さらに,空間Spaseと空間Spaseとは,互いに一部が重畳している。このように,本発明では,複数の空間は互いに画一的に区分けされている必要はなく,一部が重畳したものであってもよい。さらに,図4に示された例では,三角形1は,頂点処理による変換後の座標系において,Spaseとして定義されている空間,及びSpaseとして定義されている空間の両方に跨って属していることがわかる。このように,本発明では,1つのポリゴン(三角形)が,複数の空間に跨って存在することも考えうる。 Here, FIG. 4 shows an example of the data structure in the vertex buffer 21 with the spatial index. As shown in FIG. 4, the data in the vertex buffer 21 with space index includes information indicating the vertex data constituting the polygon (polygon configuration data) and coordinate information of each vertex data, and the space to which the polygon belongs. Information (spatial index) to be indicated is registered. For example, referring to the example shown in FIG. 4, if the data in the spatial indexed vertex buffer 21 is viewed, the triangle 0 is composed of vertices of v 0 , v 1 , and v 2. Recognize. The coordinates of the vertex v 0 are (x 0 , y 0 , z 0 ), the coordinates of the vertex v 1 are (x 1 , y 1 , z 1 ), and the coordinates of the vertex v 2 are (x 2 , y 2 , z 2 ). Further, the coordinate values of the vertices v 0 to v 2 are also registered in the vertex buffer 21 with a spatial index. Further, it can be seen that the triangle 0 belongs to the space defined as Space 0 in the coordinate system after the conversion by the vertex processing. As described above, the vertex buffer 21 with space index indicates whether each polygon belongs to a space defined by the space index, and belongs to which space when the polygon belongs to the space. It shows what it is. Further, referring to the vertex buffer 21 with the space index, it can be seen that the space defined by the space index includes Space 0 and Space 1 . Thus, in this invention, it divides | segments into several space. Furthermore, the space Space 0 and the space Space 1 partially overlap each other. As described above, in the present invention, the plurality of spaces do not need to be uniformly divided from each other, and may be partially overlapped. Furthermore, in the example shown in FIG. 4, the triangle 1 belongs to both the space defined as Space 0 and the space defined as Space 1 in the coordinate system after conversion by the vertex processing. I understand that. Thus, in the present invention, it can be considered that one polygon (triangle) exists across a plurality of spaces.

上述したように,本発明は,頂点処理による変換後の座標系を複数の空間に分割した上で,その後のグラフィックス描画処理を行う。この各空間を定義する空間インデックスは,ユーザが任意に決定することができる。例えば,ユーザは,空間を区画する空間インデックスとして,各空間を構成する各頂点の座標値や,各空間を構成する複数の頂点を示す空間構成情報を指定すればよい。すなわち,空間インデックスには,各空間を構成する各頂点の座標値や,各空間の構成情報が含まれる。これらの空間を構成する頂点の座標値や構成情報は,空間インデックス付き頂点バッファ21に記憶されている。また,空間の形状は,円形,三角形,又は四角形であってもよいし,五角形以上の多角形であってもよい。さらに,図4に示されるように,複数の空間は互いに一部が重畳するものであってもよい。   As described above, the present invention divides the coordinate system converted by the vertex processing into a plurality of spaces, and then performs subsequent graphics drawing processing. A spatial index defining each space can be arbitrarily determined by the user. For example, the user may specify the coordinate value of each vertex constituting each space or the space configuration information indicating a plurality of vertices constituting each space as a space index for partitioning the space. That is, the space index includes the coordinate value of each vertex constituting each space and the configuration information of each space. The coordinate values and configuration information of vertices constituting these spaces are stored in the vertex buffer 21 with space index. The shape of the space may be a circle, a triangle, or a quadrangle, or may be a pentagon or more polygon. Furthermore, as shown in FIG. 4, the plurality of spaces may partially overlap each other.

また,空間インデックスを作成するにあたり,この空間インデックスにより定義される空間の中にポリゴン全体やポリゴンを構成する頂点が属するか否かを判定することとしてもよい。例えば,空間の形状が矩形である場合には,
−w≦x≦w,
−w≦y≦w,
−w≦z≦w,
のような判定式を用いればよい。
他方,空間が任意形状の場合,クリッピングインデックスを定義するためには,例えば空間が4辺によって定義される場合を例に挙げて説明すると,
x+by+c= 0
x+by+c= 0
x+by+c= 0
x+by+c= 0
のような3つ以上の直線の方程式により空間を定義し,これら式に判定する対象(ポリゴンの頂点)のx,y座標を代入することで,計算結果の符号により空間の内外判定を行うことができる。なお,z方向については従来通り−w<z<wのような判定式で合わせて行うことも出来る。また,空間インデックスを生成する処理は,空間インデックス追加部20が,グラフィックスアプリケーション内の頂点シェーダプログラムに従って行うものであってもよい。
Further, when creating a spatial index, it may be determined whether or not the entire polygon or vertices constituting the polygon belong to the space defined by the spatial index. For example, if the space is rectangular,
−w ≦ x ≦ w,
−w ≦ y ≦ w,
−w ≦ z ≦ w,
A determination formula such as
On the other hand, when the space has an arbitrary shape, in order to define the clipping index, for example, the case where the space is defined by four sides will be described as an example.
a 0 x + b 0 y + c 0 = 0
a 1 x + b 1 y + c 1 = 0
a 2 x + b 2 y + c 2 = 0
a 3 x + b 3 y + c 3 = 0
By defining the space by three or more straight line equations such as, and substituting the x and y coordinates of the object to be judged (polygon vertices) into these expressions, the inside / outside judgment of the space is made by the sign of the calculation result Can do. Note that the z direction can be determined by a conventional determination formula such as -w <z <w. Further, the process of generating the spatial index may be performed by the spatial index adding unit 20 according to the vertex shader program in the graphics application.

空間インデックス追加部20による処理の終了後,前段処理部30は,空間インデックス付き頂点バッファ21を読み込み,ポリゴンの構成情報と頂点処理済みの頂点データに基づいて,変換後の座標系におけるポリゴンを再構築する。そして,前段処理部30は,空間インデックスにより定義される空間ごとに,再構築したポリゴンに対しラスタライズ処理を行い,ピクセルに変換する。すなわち,前段処理部30は,ラスタライズ処理を行うことにより,3次元空間上のポリゴンを投影変換により描画平面上のフラグメントに変換するビュー変換を行うと共に,さらに,描画平面上のフラグメントを描画平面の水平方向に沿ってスキャンしながら,ラスタライン毎に量子化されたピクセルに変換する。このラスタライズ処理を行うにあたり,前段処理部30は,空間インデックス付き頂点バッファ21を参照し,空間インデックスにより定義される空間ごとに,ラスタライズ処理を実行する。このため,前段処理部30は,ユーザによる画面操作などにより,描画の更新が必要となった空間のみについてラスタライズ処理を行うことができる。例えば,前段処理部30は,現在描画処理を行なっているフレームと処理済みのフレーム(例えば既に処理を行った1つ前のフレーム)とを比較し,処理済みのフレームに対し変化があったと判定した空間についてのみラスタライズ処理を実行することとすればよい。他方,前段処理部30は,現在描画処理を行なっているフレームと処理済みのフレームとを比較し,処理済みのフレームに対し変化がないと判定した空間については,当該処理済みのフレームを構成しているピクセル情報を援用することで,ラスタライズ処理を省略することが可能になる。これにより,フレーム全体の描画を更新する必要がなくなり,更新が必要な空間についての処理を高速で行うことができる。   After the processing by the spatial index adding unit 20 is completed, the pre-processing unit 30 reads the vertex buffer with spatial index 21 and re-creates the polygon in the coordinate system after conversion based on the polygon configuration information and the vertex processed vertex data. To construct. Then, the pre-processing unit 30 performs rasterization processing on the reconstructed polygon for each space defined by the space index, and converts it into pixels. That is, the pre-processing unit 30 performs a rasterization process to perform view conversion in which a polygon in the three-dimensional space is converted into a fragment on the drawing plane by projection conversion, and the fragment on the drawing plane is further converted to a drawing plane. While scanning along the horizontal direction, each raster line is converted into a quantized pixel. In performing this rasterization process, the pre-processing unit 30 refers to the vertex buffer 21 with a spatial index and executes the rasterization process for each space defined by the spatial index. For this reason, the pre-processing unit 30 can perform the rasterization process only on the space that needs to be updated by drawing operation by the user. For example, the pre-processing unit 30 compares the currently processed frame with a processed frame (for example, the previous frame that has already been processed) and determines that there has been a change with respect to the processed frame. The rasterization process may be executed only for the space that has been processed. On the other hand, the pre-processing unit 30 compares the currently processed frame with the processed frame, and configures the processed frame for a space that is determined to have no change with respect to the processed frame. The rasterization process can be omitted by using the pixel information. As a result, it is not necessary to update the drawing of the entire frame, and the processing for the space that needs to be updated can be performed at high speed.

上記のように,本発明の画像処理装置は,空間インデックスを生成し,この空間インデックスに基づいた空間分割描画を行うことで,ユーザの画面操作等により描画の更新が必要となった場合には,その描画の更新が必要な空間のみについてポリゴンの描画更新を実行することができるようになる。これにより,本発明は,描画処理を高速化し,描画遅延を最小に抑えることができる。また,本発明における空間分割は,フレームを画一的に複数の領域(タイル)に分割するものではなく,任意に与えられる空間インデックスに基づいて,カメラ座標系における空間を複数の領域に分割することが可能であるため,グラフィックスの性質等に応じて柔軟に空間の大きさ等を決定することができる。また,ローカルのバッファ内で描画処理を行うことができるため,外部メモリへのアクセスを低減させることが可能であり,結果として,消費電力やメモリアクセスの際のオーバヘッドが低下し,グラフィックス処理の高速化を達成できる。   As described above, the image processing apparatus according to the present invention generates a spatial index, and performs spatial division drawing based on the spatial index, so that it is necessary to update drawing due to a user's screen operation or the like. , The polygon drawing update can be executed only in the space where the drawing update is necessary. Accordingly, the present invention can speed up the drawing process and minimize drawing delay. The space division in the present invention does not uniformly divide a frame into a plurality of areas (tiles), but divides the space in the camera coordinate system into a plurality of areas based on a spatial index arbitrarily given. Therefore, the size of the space can be determined flexibly according to the nature of the graphics. In addition, since drawing processing can be performed in the local buffer, it is possible to reduce access to the external memory. As a result, power consumption and overhead during memory access are reduced, and graphics processing is reduced. High speed can be achieved.

前段処理部30は,上記ラスタライズ処理の後,コンパイラ処理部10から出力された前段処理用シェーダ62をロードして,この前段処理用シェーダ62に基づいた処理を実行する。すなわち,前段処理用シェーダ62には,カラー値及び奥行き値の生成に必要な機能が記述されている。このため,前段処理部30は,前段処理用シェーダ62に従い,ラスタライズ処理により得られた各ピクセルについて,少なくとも,RGB3原色で表されるカラー値や,奥行きを示す奥行き値(Z値)を算出する。このとき,前段処理用シェーダ62は,カラーの透明度を示すアルファ値を求めることとしてもよい。ただし,前段処理部30による前段処理には,ポリゴンの表面にテクスチャ画像を貼り付けるテクスチャ処理や,ポリゴン表面に陰影をつけるシェーディング処理などは行われない。これらの,テクスチャ処理やシェーディング処理が必要である場合,これらの処理は,後述する後段処理部40によって行われる。   After the rasterization process, the pre-processing unit 30 loads the pre-processing shader 62 output from the compiler processing unit 10 and executes processing based on the pre-processing shader 62. That is, the pre-processing shader 62 describes functions necessary for generating color values and depth values. For this reason, the pre-processing unit 30 calculates at least a color value represented by RGB three primary colors and a depth value (Z value) indicating the depth for each pixel obtained by the rasterizing process according to the pre-processing shader 62. . At this time, the pre-processing shader 62 may obtain an alpha value indicating the transparency of the color. However, the pre-processing by the pre-processing unit 30 does not perform texture processing for pasting a texture image on the surface of the polygon, shading processing for shading the polygon surface, or the like. When these texture processing and shading processing are necessary, these processing is performed by a later stage processing unit 40 described later.

前段処理部30は,ポリゴンから変換されたフラグメントに対して,ブレンディングや,アルファテスト,奥行きテストを実行し,ピクセルのカラー値及び奥行き値を求め,そのレンダリングの結果をピクセルデータとして,カラー・奥行き値バッファ32に書き込む。このカラー・奥行き値バッファ32は,ローカルメモリ内に設けられたものであることが好ましい。   The pre-processing unit 30 performs blending, alpha test, and depth test on the fragment converted from the polygon, obtains the color value and depth value of the pixel, and uses the rendering result as pixel data to obtain the color / depth. Write to the value buffer 32. The color / depth value buffer 32 is preferably provided in a local memory.

前段処理部30による処理の後,後段処理部40は,カラー・奥行き値バッファ32を読み込み,ラスタライズ処理済みのピクセルの奥行き値を参照して,画面上に表示するために,カラー値を出力カラーバッファ51に書き込むピクセルを決定する。すなわち,後段処理部40は,ラスタライズ処理済みのピクセルの奥行き値に基づいて奥行きテストを行い,この奥行きテストに合格したピクセルのカラー値を,出力カラーバッファ51に書き込むものとして決定すればよい。なお,この出力カラーバッファ51に書き込むピクセルを決定する処理は,前段処理部30によって行うこととしてもよい。   After the processing by the pre-processing unit 30, the post-processing unit 40 reads the color / depth value buffer 32, refers to the depth value of the rasterized pixel, and outputs the color value for display on the screen. A pixel to be written to the buffer 51 is determined. That is, the post-processing unit 40 may perform a depth test based on the depth value of the rasterized pixel and determine that the color value of the pixel that has passed the depth test is written in the output color buffer 51. Note that the process for determining the pixels to be written in the output color buffer 51 may be performed by the pre-processing unit 30.

その後,後段処理部40は,コンパイラ処理部10から出力された後段処理用シェーダ63をロードし,出力カラーバッファ51にカラー値を書き込むことを決定したピクセルについて,ロードした後段処理用シェーダ63に基づいた描画処理を行う。すなわち,後段処理用シェーダ63には,シェーダプログラムのうちのカラー・奥行き値の生成に必要な機能以外の機能が記述されている。例えば,この後段処理用シェーダ63には,少なくとも,テクスチャ処理及びシェーディング処理が含まれる。このため,後段処理部40は,後段処理用シェーダ63に従い,前段処理部30により算出されたピクセル情報をもとに,シェーディング処理を行って,シェーディング処理後のピクセルのカラー値を算出する。さらに,後段処理部40は,テクスチャマッピングを行う場合は,テクスチャ画像のカラー値を合成して最終的なピクセルのカラー値を算出する。   Thereafter, the post-processing unit 40 loads the post-processing shader 63 output from the compiler processing unit 10 and, based on the loaded post-processing shader 63, for the pixels determined to write color values in the output color buffer 51. Perform the drawing process. That is, the post-processing shader 63 describes functions other than those necessary for generating color / depth values in the shader program. For example, the post-processing shader 63 includes at least texture processing and shading processing. Therefore, the post-processing unit 40 performs a shading process based on the pixel information calculated by the pre-processing unit 30 according to the post-processing shader 63, and calculates the color value of the pixel after the shading process. Furthermore, when performing texture mapping, the post-processing unit 40 synthesizes the color values of the texture image and calculates the final pixel color value.

このように,本発明の画像処理装置は,シェーダプログラム61を,主としてカラー・奥行き値の生成に必要な機能を持つ前段処理用シェーダ62と,主としてテクスチャ・シェーディング処理に必要とされる後段処理用シェーダ63とに分割すると共に,この前段処理用シェーダ62に基づいて前段処理部30によってピクセルを処理した後,テクスチャ・シェーディング処理が必要なピクセルのみを後段処理部40に入力して後段処理用シェーダ63に基づいた処理を実行するものである。従って,後段処理部40においては不必要なピクセル処理を行う必要がなくなるため,処理時間の低減を図ることができる。   As described above, the image processing apparatus of the present invention uses the shader program 61 for the former stage processing shader 62 mainly having the functions necessary for generating the color and depth values, and the latter stage processing mainly necessary for the texture shading process. After being divided into shaders 63 and processing pixels by the pre-processing unit 30 based on the pre-processing shader 62, only the pixels that require texture shading processing are input to the post-processing unit 40 to input the post-processing shader. The process based on 63 is executed. Accordingly, it is not necessary for the post-processing unit 40 to perform unnecessary pixel processing, and thus the processing time can be reduced.

また,図1に示されるように,前段処理部30は,前段プロセッサコア31を備え,後段処理部40は,後段プロセッサコア41を備える。前段プロセッサコア31は,前段処理部30おけるラスタライズ処理を実行するハードウェアであり,後段プロセッサコア41は,後段処理部40におけるテクスチャ処理やシェーディング処理を実行するハードウェアである。これらの,前段プロセッサコア31と後段プロセッサコア41は,ハードウェア的に互いに異なるものであることが好ましい。本発明において,前段処理部30の前段プロセッサコア31が処理するシェーダコード(前段処理用シェーダ62)は,コンパイラ処理部10よってカラー値及び奥行き値の生成に必要な機能に限定して抽出されたものである。従って,前段プロセッサコア31は,不要な処理が省かれたシェーダコードを処理すればよいため,そのサイズを最小限のものとすることができ,結果としてコスト低減に繋がる。また,後段処理部40に含まれる後段プロセッサコア41には,カラー・奥行き値バッファ32に記憶されているピクセルの奥行き値に基づく奥行きテストに合格したピクセルデータのみが入力されることが好ましい。例えば,後段処理部40は,後段プロセッサコア41の他に,奥行きテストを実行する別のハードウェアを備えていてもよい。また,奥行きテストを実行して出力カラーバッファ51にカラー値を書き込むピクセルを決定する処理は,前段処理部30を構成するハードウェア,例えば前段プロセッサコア31によって行われるものであってもよい。なお,前段処理部30と後段処理部40とを異なるハードウェアで構成する形態は,本発明の好ましい形態であり,他の実施形態においては,前段処理部30と後段処理部40とが実質的に同一のハードウェアにより構成されたものであってもよい。   Further, as shown in FIG. 1, the pre-processing unit 30 includes a pre-processor core 31 and the post-processing unit 40 includes a post-processor core 41. The upstream processor core 31 is hardware that executes rasterization processing in the upstream processor 30, and the downstream processor core 41 is hardware that executes texture processing and shading processing in the downstream processor 40. These pre-stage processor core 31 and post-stage processor core 41 are preferably different from each other in terms of hardware. In the present invention, the shader code (pre-stage processing shader 62) processed by the pre-stage processor core 31 of the pre-stage processing unit 30 is extracted by the compiler processing unit 10 limited to functions necessary for generating color values and depth values. Is. Therefore, the pre-processor core 31 only needs to process the shader code from which unnecessary processing is omitted, so that the size of the processor core 31 can be minimized, resulting in cost reduction. In addition, it is preferable that only the pixel data that has passed the depth test based on the pixel depth value stored in the color / depth value buffer 32 is input to the subsequent processor core 41 included in the subsequent processing unit 40. For example, the post-processing unit 40 may include other hardware for executing the depth test in addition to the post-processor core 41. Further, the process of executing the depth test and determining the pixel for writing the color value in the output color buffer 51 may be performed by hardware constituting the pre-processing unit 30, for example, the pre-processor core 31. The form in which the pre-processing unit 30 and the post-processing unit 40 are configured by different hardware is a preferred form of the present invention. In other embodiments, the pre-processing unit 30 and the post-processing unit 40 are substantially different. The same hardware may be used.

後段処理部40による処理の後,前段処理部30及び後段処理部40によるピクセル処理により得られた最終的なピクセルのカラー値は,ピクセル出力部50に入力される。ピクセル出力部50は,後段処理部40から最終的なピクセルのカラー値を受け取り,出力カラーバッファ51に出力する。出力カラーバッファ51は,ピクセルのカラー値をスクリーン座標に対応付けて格納するバッファであり,格納されたピクセルのカラー値は,ディスプレイ装置に画像を表示する際に参照される。   After the processing by the post-processing unit 40, the final pixel color value obtained by the pixel processing by the pre-processing unit 30 and the post-processing unit 40 is input to the pixel output unit 50. The pixel output unit 50 receives the final color value of the pixel from the post-processing unit 40 and outputs it to the output color buffer 51. The output color buffer 51 is a buffer that stores pixel color values in association with screen coordinates, and the stored pixel color values are referred to when an image is displayed on a display device.

ここで,図5には,本発明の画像処理装置の変形例の構成が示されている。図5に示された変形例では,前段処理部30と後段処理部40の間に,スペースクリップ処理部70が設けられる。スペースクリップ処理部70は,前段処理部30によるラスタライズ処理後に,クリッピング処理を行う。クリッピング処理は,オブジェクトのスクーンへの投影像が予め定義されたスペースからはみ出した場合に,そのはみ出した部分について,オブジェクトのピクセルデータをカットする処理である。スクリーンに表示するためのスペースに関する情報は,グラフィックスアプリケーション60に含まれている。このため,スペースクリップ処理部70は,グラフィックスアプリケーション60に含まれる情報に基づいて,上記したクリッピング処理を行うことができる。クリッピング処理後のピクセル情報は,後段処理部40に入力され,前述したテクスチャ処理やシェーディング処理が施される。スペースからはみ出した部分はディスプレイに描画する必要がないものであるため,上記したクリッピング処理を行うことで,後段処理部40によって無駄なピクセル処理をしなくて済むようになる。   Here, FIG. 5 shows a configuration of a modification of the image processing apparatus of the present invention. In the modification shown in FIG. 5, a space clip processing unit 70 is provided between the pre-processing unit 30 and the post-processing unit 40. The space clip processing unit 70 performs clipping processing after the rasterization processing by the pre-processing unit 30. The clipping process is a process of cutting the pixel data of the object for the protruding part when the projection image of the object onto the scoon protrudes from a predefined space. Information regarding the space for display on the screen is included in the graphics application 60. For this reason, the space clip processing unit 70 can perform the above-described clipping processing based on information included in the graphics application 60. The pixel information after the clipping processing is input to the post-processing unit 40, and the above-described texture processing and shading processing are performed. Since the portion protruding from the space does not need to be drawn on the display, the clipping processing described above eliminates unnecessary pixel processing by the post-processing unit 40.

[2.コンピュータ]
図6は,本発明の一実施態様に係るコンピュータを示すブロック図である。この実施態様は,コンピュータグラフィックスによるコンピュータ(グラフィック用コンピュータなど)に関する。図6に示されるとおり,このコンピュータは,中央演算装置(CPU)102,ジオメトリ演算回路103などのジオメトリ演算部,レンダラー104などの描画部,テクスチャ生成回路105などのテクスチャ生成部,照明処理回路107などの照光処理部,表示回路108などの表示情報作成部,フレームバッファ109,及びモニター110を具備する。これらの要素は,バスなどにより接続され,相互にデータを伝達できる。そのほか,図示しないメインメモリや,各種テーブル,ワーク領域となるワークメモリ111,テクスチャを格納するテクスチャメモリ112などを具備する記憶部などを有してもよい。各部を構成するハードウェアは,例えばバスなどを介して連結されている。なお,記憶部は,VRAMなどのRAMや,CR−ROM,DVD,ハードディスクなどにより構成されても良い。本発明に係る画像処理装置は,このようなコンピュータグラフィックス用のコンピュータに具備されて,実装されたものであってもよい。
[2. Computer]
FIG. 6 is a block diagram showing a computer according to an embodiment of the present invention. This embodiment relates to a computer based on computer graphics (such as a graphic computer). As shown in FIG. 6, this computer includes a central processing unit (CPU) 102, a geometry calculation unit such as a geometry calculation circuit 103, a rendering unit such as a renderer 104, a texture generation unit such as a texture generation circuit 105, and an illumination processing circuit 107. An illumination processing unit such as a display circuit 108, a display information generation unit such as a display circuit 108, a frame buffer 109, and a monitor 110. These elements are connected by a bus or the like and can transmit data to each other. In addition, the storage unit may include a main memory (not shown), various tables, a work memory 111 serving as a work area, a texture memory 112 that stores textures, and the like. The hardware constituting each unit is connected via a bus, for example. The storage unit may be configured by a RAM such as a VRAM, a CR-ROM, a DVD, a hard disk, or the like. The image processing apparatus according to the present invention may be provided and implemented in such a computer graphics computer.

中央演算装置(CPU)102は,画像を生成するためのプログラムなどを制御するための装置である。ワークメモリ111は,CPU102で使用するデータ及びディスプレイリストなどを記憶してもよい。そして,CPU102は,メインメモリに記憶されたプログラムなどを読み出して,所定の処理を行ってもよい。ただし,ハードウェア処理のみにより所定の処理を行っても良い。CPU102は,たとえばワークメモリ111から,ワールド座標の3次元オブジェクトデータとしてのポリゴンデータを読出し,ポリゴンデータをジオメトリ演算回路103へ出力する。具体的には,メインプロセッサ,コプロセッサ,データ処理プロセッサ,四則演算回路又は汎用演算回路などを適宜有するものがあげられる。これらはバスなどにより連結され,信号の授受が可能とされる。また,圧縮された情報を伸張するためのデータ伸張プロセッサを備えても良い。   A central processing unit (CPU) 102 is a device for controlling a program or the like for generating an image. The work memory 111 may store data used by the CPU 102, a display list, and the like. Then, the CPU 102 may read a program stored in the main memory and perform predetermined processing. However, the predetermined processing may be performed only by hardware processing. For example, the CPU 102 reads polygon data as world coordinate three-dimensional object data from the work memory 111 and outputs the polygon data to the geometry calculation circuit 103. Specifically, those having a main processor, a coprocessor, a data processor, four arithmetic circuits, a general-purpose arithmetic circuit, and the like as appropriate. These are connected by a bus or the like so that signals can be exchanged. In addition, a data expansion processor for expanding compressed information may be provided.

具体的に説明すると,ジオメトリ演算回路103は,入力されたポリゴンデータに対して,視点を原点とするカメラ座標系のデータに座標変換などを行うための回路である。ジオメトリ演算回路103は,処理したポリゴンデータを,レンダラー104へ出力する。具体的なジオメトリ演算回路としては,前記メインプロセッサとバスなどで連結された,ジオメトリプロセッサ,コプロセッサ,データ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。   More specifically, the geometry calculation circuit 103 is a circuit for performing coordinate transformation or the like on the input polygon data to data in the camera coordinate system having the viewpoint as the origin. The geometry calculation circuit 103 outputs the processed polygon data to the renderer 104. Specific geometry operation circuits include a geometry processor, a coprocessor, a data processor, four arithmetic operation circuits, or a general-purpose operation circuit that are connected to the main processor through a bus or the like.

レンダラー104は,ポリゴン単位のデータをピクセル単位のデータに変換するための回路又は装置である。レンダラー104は,ピクセル単位のデータをテクスチャ生成回路105へ出力する。具体的なレンダラー104としては,前記メインプロセッサとバスなどで連結されたデータ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。   The renderer 104 is a circuit or device for converting polygon unit data into pixel unit data. The renderer 104 outputs the pixel unit data to the texture generation circuit 105. Specific examples of the renderer 104 include a data processor connected to the main processor through a bus, a four arithmetic operation circuit, or a general-purpose operation circuit.

テクスチャ生成回路105は,テクスチャメモリ112に記憶されるテクスチャデータに基づき,ピクセル単位のテクスチャカラーを生成するための回路である。テクスチャ生成回路105は,テクスチャカラー情報を有するピクセル単位のデータを,照明処理回路107へ出力する。具体的なテクスチャ生成回路105としては,前記メインプロセッサとバスなどで連結されたデータ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。   The texture generation circuit 105 is a circuit for generating a texture color in units of pixels based on the texture data stored in the texture memory 112. The texture generation circuit 105 outputs pixel unit data having texture color information to the illumination processing circuit 107. Specific examples of the texture generation circuit 105 include a data processor connected to the main processor through a bus, a four arithmetic operation circuit, a general-purpose operation circuit, and the like.

照明処理回路107は,テクスチャカラー情報を有するポリゴンに対し,ピクセル単位で法線ベクトル,重心座標などを利用して陰影付けなどを行うための回路である。照明処理回路107は,陰影付けした画像データを,表示回路108へ出力する。具体的な照明処理回路107としては,前記メインプロセッサとバスなどで連結されたデータ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。そして,メモリに格納されたテーブルなどから適宜光に関する情報を読み出して陰影付けを行えばよい。   The illumination processing circuit 107 is a circuit for performing shading on a polygon having texture color information using a normal vector, a barycentric coordinate, and the like in pixel units. The illumination processing circuit 107 outputs the shaded image data to the display circuit 108. Specific examples of the illumination processing circuit 107 include a data processor connected to the main processor through a bus, four arithmetic operation circuits, or a general-purpose operation circuit. Then, information relating to light may be appropriately read out from a table stored in the memory and the like to perform shading.

表示回路108は,照明処理回路107から入力された画像データをフレームバッファ109に書き込み,またフレームバッファ109に書き込まれた画像データを読み出し,制御して表示画像情報を得るための回路である。表示回路108は,表示画像情報をモニター110へ出力する。具体的な表示回路としては,前記メインプロセッサとバスなどで連結された描画プロセッサ,データ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。   The display circuit 108 is a circuit for writing the image data input from the illumination processing circuit 107 to the frame buffer 109, reading the image data written in the frame buffer 109, and controlling it to obtain display image information. The display circuit 108 outputs display image information to the monitor 110. Specific examples of the display circuit include a drawing processor, a data processor, a four arithmetic operation circuit, and a general-purpose arithmetic circuit connected to the main processor through a bus.

モニター110は,入力された表示画像情報にしたがって,コンピュータグラフィックス画像を表示するための装置である。   The monitor 110 is a device for displaying a computer graphics image in accordance with input display image information.

[3.ゲーム機]
図7は,本発明の他の実施形態に係るゲーム機のブロック図である。このブロック図で表される実施形態は,特に携帯用,家庭用又は業務用のゲーム機として好適に利用されうる。そこで,以下では,ゲーム機として説明する。なお,同図に示されるゲーム機は,少なくとも処理部200を含めばよく(又は処理部200と記憶部270,又は処理部200と記憶部270と情報記憶媒体280を含んでもよく),それ以外のブロック(例えば操作部260,表示部290,音出力部292,携帯型情報記憶装置294,通信部296)については,任意の構成要素とすることができる。本発明に係る画像処理装置は,このようなゲーム機に具備されて,実装されたものであってもよい。
[3. game machine]
FIG. 7 is a block diagram of a game machine according to another embodiment of the present invention. The embodiment represented by this block diagram can be suitably used particularly as a portable, home or business game machine. Therefore, in the following, it will be described as a game machine. Note that the game machine shown in the figure may include at least the processing unit 200 (or may include the processing unit 200 and the storage unit 270, or the processing unit 200, the storage unit 270, and the information storage medium 280). These blocks (for example, the operation unit 260, the display unit 290, the sound output unit 292, the portable information storage device 294, and the communication unit 296) can be arbitrary constituent elements. The image processing apparatus according to the present invention may be provided and mounted on such a game machine.

処理部200は,システム全体の制御,システム内の各ブロックへの命令の指示,ゲーム処理,画像処理,音処理などの各種の処理を行うものである。処理部200の機能は,各種プロセッサ(CPU,DSP等),又はASIC(ゲートアレイ等)などのハードウェアや,所与のプログラム(ゲームプログラム)により実現できる。   The processing unit 200 performs various processing such as control of the entire system, instruction instruction to each block in the system, game processing, image processing, and sound processing. The function of the processing unit 200 can be realized by hardware such as various processors (CPU, DSP, etc.) or ASIC (gate array, etc.), or a given program (game program).

操作部260は,プレーヤが操作データを入力するためのものである。操作部260は,の機能は,例えば,レバー,ボタン,外枠,及びハードウェアを備えたコントローラにより実現できる。なお,特に携帯用ゲーム機の場合は,操作部260は,ゲーム機本体と一体として形成されても良い。コントローラからの処理情報は,シリアルインターフェース(I/F)やバスを介してメインプロセッサなどに伝えられる。   The operation unit 260 is for a player to input operation data. The function of the operation unit 260 can be realized by, for example, a controller including a lever, a button, an outer frame, and hardware. In particular, in the case of a portable game machine, the operation unit 260 may be formed integrally with the game machine body. Processing information from the controller is transmitted to the main processor or the like via a serial interface (I / F) or a bus.

記憶部270は,処理部200や通信部296などのワーク領域となるものである。また,プログラムや各種テーブルなどを格納しても良い。記憶部270は,例えば,メインメモリ272,フレームバッファ274,及びテクスチャ記憶部276を含んでもよく,そのほか各種テーブルなどを記憶しても良い。記憶部270の機能は,ROMやRAMなどのハードウェアにより実現できる。RAMとして,VRAM,DRAM又はSRAMなどがあげられ,用途に応じて適宜選択すればよい。フレームバッファ274を構成するVRAMなどは,各種プロセッサの作業領域として用いられる。   The storage unit 270 is a work area such as the processing unit 200 or the communication unit 296. In addition, programs and various tables may be stored. The storage unit 270 may include, for example, a main memory 272, a frame buffer 274, and a texture storage unit 276, and may store various tables. The function of the storage unit 270 can be realized by hardware such as ROM and RAM. Examples of the RAM include VRAM, DRAM, and SRAM, and may be appropriately selected depending on the application. A VRAM or the like constituting the frame buffer 274 is used as a work area for various processors.

情報記憶媒体(コンピュータにより使用可能な記憶媒体)280は,プログラムやデータなどの情報を格納するものである。情報記憶媒体280は,いわゆるゲームソフトなどとして販売されうる。そして,情報記憶媒体280の機能は,光ディスク(CD,DVD),光磁気ディスク(MO),磁気ディスク,ハードディスク,磁気テープ,又はメモリ(ROM)などのハードウェアにより実現できる。処理部200は,この情報記憶媒体280に格納される情報に基づいて種々の処理を行う。情報記憶媒体280には,本発明(本実施形態)の手段(特に処理部200に含まれるブロック)を実行するための情報(プログラム又はプログラム及びデータ)が格納される。   The information storage medium (storage medium usable by a computer) 280 stores information such as programs and data. The information storage medium 280 can be sold as so-called game software. The functions of the information storage medium 280 can be realized by hardware such as an optical disk (CD, DVD), a magneto-optical disk (MO), a magnetic disk, a hard disk, a magnetic tape, or a memory (ROM). The processing unit 200 performs various processes based on information stored in the information storage medium 280. The information storage medium 280 stores information (program or program and data) for executing the means of the present invention (this embodiment) (particularly, blocks included in the processing unit 200).

表示部290は,本実施形態により生成された画像を出力するものであり,その機能は,CRT(ブラウン管),LCD(液晶),OEL(有機電界発光素子),PDP(プラズマディスプレイパネル)又はHMD(ヘッドマウントディスプレイ)などのハードウェアにより実現できる。   The display unit 290 outputs an image generated according to the present embodiment, and functions thereof are CRT (CRT), LCD (Liquid Crystal), OEL (Organic Electroluminescent Device), PDP (Plasma Display Panel), or HMD. It can be realized by hardware such as (head mounted display).

音出力部292は,音を出力するものである。音出力部292の機能は,スピーカなどのハードウェアにより実現できる。音出力は,例えばバスを介してメインプロセッサなどと接続されたサウンドプロセッサにより,音処理が施され,スピーカなどの音出力部から出力される。   The sound output unit 292 outputs sound. The function of the sound output unit 292 can be realized by hardware such as a speaker. The sound output is processed by a sound processor connected to the main processor or the like via a bus, for example, and output from a sound output unit such as a speaker.

携帯型情報記憶装置294は,プレーヤの個人データやセーブデータなどが記憶されるものである。この携帯型情報記憶装置294としては,メモリカードや携帯型ゲーム装置などがあげられる。携帯型情報記憶装置294の機能は,メモリカード,フラッシュメモリ,ハードディスク,USBメモリなど公知の記憶手段により達成できる。   The portable information storage device 294 stores player personal data, save data, and the like. Examples of the portable information storage device 294 include a memory card and a portable game device. The functions of the portable information storage device 294 can be achieved by known storage means such as a memory card, flash memory, hard disk, USB memory and the like.

通信部296は,外部(例えばホスト装置や他の画像生成システム)との間で通信を行うための各種の制御を行う任意のものである。通信部296の機能は,各種プロセッサ,又は通信用ASICなどのハードウェアや,プログラムなどにより実現できる。   The communication unit 296 is an arbitrary unit that performs various controls for communicating with the outside (for example, a host device or other image generation system). The function of the communication unit 296 can be realized by various processors, hardware such as a communication ASIC, a program, or the like.

ゲーム機を実行するためのプログラム又はデータは,ホスト装置(サーバー)が有する情報記憶媒体からネットワーク及び通信部296を介して情報記憶媒体280に配信するようにしてもよい。   The program or data for executing the game machine may be distributed from the information storage medium included in the host device (server) to the information storage medium 280 via the network and the communication unit 296.

処理部200は,ゲーム処理部220,画像処理部230,及び音処理部250を含むものがあげられる。具体的には,メインプロセッサ,コプロセッサ,ジオメトリプロセッサ,描画プロセッサ,データ処理プロセッサ,四則演算回路又は汎用演算回路などがあげられる。これらは適宜バスなどにより連結され,信号の授受が可能とされる。また,圧縮された情報を伸張するためのデータ伸張プロセッサを備えても良い。   An example of the processing unit 200 includes a game processing unit 220, an image processing unit 230, and a sound processing unit 250. Specific examples include a main processor, a coprocessor, a geometry processor, a drawing processor, a data processor, four arithmetic operation circuits, or a general-purpose operation circuit. These are appropriately connected by a bus or the like so that signals can be exchanged. In addition, a data expansion processor for expanding compressed information may be provided.

ここでゲーム処理部220は,コイン(代価)の受け付け処理,各種モードの設定処理,ゲームの進行処理,選択画面の設定処理,オブジェクトの位置や回転角度(X,Y又はZ軸回り回転角度)を求める処理,オブジェクトを動作させる処理(モーション処理),視点の位置(仮想カメラの位置)や視線角度(仮想カメラの回転角度)を求める処理,マップオブジェクトなどのオブジェクトをオブジェクト空間へ配置する処理,ヒットチェック処理,ゲーム結果(成果,成績)を演算する処理,複数のプレーヤが共通のゲーム空間でプレイするための処理,又はゲームオーバー処理などの種々のゲーム処理を,操作部260からの操作データや,携帯型情報記憶装置294からの個人データ,保存データや,ゲームプログラムなどに基づいて行う。   Here, the game processing unit 220 accepts coins (price), sets various modes, progresses the game, sets the selection screen, and positions and rotation angles of objects (rotation angles around the X, Y, or Z axes). , Processing to move the object (motion processing), processing to determine the position of the viewpoint (virtual camera position) and line-of-sight angle (virtual camera rotation angle), processing to place objects such as map objects in the object space, Operation data from the operation unit 260 includes various game processes such as a hit check process, a process for calculating game results (results, results), a process for a plurality of players to play in a common game space, or a game over process. Or based on personal data, stored data, game programs, etc. from portable information storage device 294 Do.

画像処理部230は,ゲーム処理部220からの指示等にしたがって,各種の画像処理を行うものである。また,音処理部250は,ゲーム処理部220からの指示等にしたがって,各種の音処理を行う。   The image processing unit 230 performs various types of image processing in accordance with instructions from the game processing unit 220 and the like. The sound processing unit 250 performs various types of sound processing in accordance with instructions from the game processing unit 220 and the like.

ゲーム処理部220,画像処理部230,音処理部250の機能は,その全てをハードウェアにより実現してもよいし,その全てをプログラムにより実現してもよい。又は,ハードウェアとプログラムの両方により実現してもよい。画像処理部230は,ジオメトリ演算部232(3次元座標演算部),描画部240(レンダリング部)を含むものがあげられる。   All of the functions of the game processing unit 220, the image processing unit 230, and the sound processing unit 250 may be realized by hardware, or all of them may be realized by a program. Alternatively, it may be realized by both hardware and a program. The image processing unit 230 includes one including a geometry calculation unit 232 (three-dimensional coordinate calculation unit) and a drawing unit 240 (rendering unit).

ジオメトリ演算部232は,座標変換,クリッピング処理,透視変換,又は光源計算などの種々のジオメトリ演算(3次元座標演算)を行う。そして,ジオメトリ処理後(透視変換後)のオブジェクトデータ(オブジェクトの頂点座標,頂点テクスチャ座標,又は輝度データ等)は,例えば,記憶部270のメインメモリ272に格納されて,保存される。   The geometry calculation unit 232 performs various geometry calculations (three-dimensional coordinate calculation) such as coordinate conversion, clipping processing, perspective conversion, or light source calculation. Then, the object data (object vertex coordinates, vertex texture coordinates, luminance data, etc.) after the geometry processing (after perspective transformation) is stored and saved in the main memory 272 of the storage unit 270, for example.

描画部240は,ジオメトリ演算後(透視変換後)のオブジェクトデータと,テクスチャ記憶部276に記憶されるテクスチャなどに基づいて,オブジェクトをフレームバッファ274に描画する。   The drawing unit 240 draws an object in the frame buffer 274 based on the object data after the geometry calculation (after perspective transformation) and the texture stored in the texture storage unit 276.

描画部240は,例えば,テクスチャマッピング部242,シェーディング処理部244を含むものがあげられる。具体的には,描画プロセッサにより実装できる。描画プロセッサは,テクスチャ記憶部,各種テーブル,フレームバッファ,VRAMなどとバスなどを介して接続され,更にディスプレイと接続される。   Examples of the drawing unit 240 include a texture mapping unit 242 and a shading processing unit 244. Specifically, it can be implemented by a drawing processor. The drawing processor is connected to a texture storage unit, various tables, a frame buffer, a VRAM, and the like via a bus and further connected to a display.

テクスチャマッピング部242は,環境テクスチャをテクスチャ記憶部276から読み出し,読み出された環境テクスチャを,オブジェクトに対してマッピングする。   The texture mapping unit 242 reads the environment texture from the texture storage unit 276 and maps the read environment texture to the object.

シェーディング処理部244は,オブジェクトに対するシェーディング処理を行う。例えば,ジオメトリ処理部232が光源計算を行い,シェーディング処理用の光源の情報や,照明モデルや,オブジェクトの各頂点の法線ベクトルなどに基づいて,オブジェクトの各頂点の輝度(RGB)を求める。シェーディング処理部244は,この各頂点の輝度に基づいて,プリミティブ面(ポリゴン,曲面)の各ドットの輝度を例えば,ホンシェーディングや,グーローシェーディングなどにより求める。   The shading processing unit 244 performs shading processing on the object. For example, the geometry processing unit 232 performs light source calculation, and obtains the luminance (RGB) of each vertex of the object based on the light source information for shading processing, the illumination model, the normal vector of each vertex of the object, and the like. Based on the luminance of each vertex, the shading processing unit 244 obtains the luminance of each dot on the primitive surface (polygon, curved surface) by, for example, phone shading or goo shading.

ジオメトリ演算部232は,法線ベクトル処理部234を含むものがあげられる。法線ベクトル処理部234は,オブジェクトの各頂点の法線ベクトル(広義にはオブジェクトの面の法線ベクトル)を,ローカル座標系からワールド座標系への回転マトリクスで回転させる処理を行ってもよい。   An example of the geometry calculation unit 232 includes a normal vector processing unit 234. The normal vector processing unit 234 may perform a process of rotating the normal vector of each vertex of the object (in a broad sense, the normal vector of the surface of the object) using a rotation matrix from the local coordinate system to the world coordinate system. .

なお,ゲーム機における構成を適宜利用すれば,スロットマシーンやパチンコ遊技機などにおける画像表示装置としても機能しうるものを得ることができる。   If the configuration of the game machine is used as appropriate, it is possible to obtain a device that can also function as an image display device in a slot machine, a pachinko gaming machine, or the like.

本発明は,空間を分割してグラフィックスを処理する画像処理装置及び画像処理方法等に関する。従って,本発明はコンピュータ産業において好適に利用されうる。   The present invention relates to an image processing apparatus and an image processing method for processing graphics by dividing a space. Therefore, the present invention can be suitably used in the computer industry.

1…画像処理装置
10…コンパイラ処理部
11…フロントエンド処理部
12…機能抽出部
13…バックエンド処理部
20…空間インデックス追加部
21…空間インデックス付き頂点バッファ
30…前段処理部
31…前段プロセッサコア
32…カラー・奥行き値バッファ
40…後段処理部
41…後段プロセッサコア
50…ピクセル出力部
51…出力カラーバッファ
60…グラフィックスアプリケーション
61…シェーダプログラム
62…前段処理用シェーダ
63…後段処理用シェーダ
70…スペースクリップ処理部
DESCRIPTION OF SYMBOLS 1 ... Image processing apparatus 10 ... Compiler process part 11 ... Front end process part 12 ... Function extraction part 13 ... Back end process part 20 ... Spatial index addition part 21 ... Vertex buffer 30 with space index ... Pre-stage process part 31 ... Pre-stage processor core 32 ... Color / depth value buffer 40 ... Subsequent processing unit 41 ... Subsequent processor core 50 ... Pixel output unit 51 ... Output color buffer 60 ... Graphics application 61 ... Shader program 62 ... Pre-stage processing shader 63 ... Post-stage processing shader 70 ... Space clip processing section

Claims (7)

コンピュータグラフィックス処理用の画像処理装置であって,
グラフィックスアプリケーション内のシェーダプログラムを読み込み,カラー・奥行き値の生成に必要な機能を抽出した前段処理用シェーダと,当該前段処理用シェーダに含まれていないテクスチャ・シェーディング処理を含む後段処理用シェーダとを,出力するコンパイラ処理部(10)と,
グラフィックスアプリケーション内のポリゴンを構成する頂点データを読み込んで,座標変換を含む頂点処理を行い,処理済み頂点データを得ると共に,変換後の座標系における空間インデックスを生成し,当該ポリゴンの構成情報,当該処理済み頂点データ,及び当該空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファ(21)を作成する空間インデックス追加部(20)と,
前記空間インデックス付き頂点バッファ(21)を読み込んでポリゴンを構築し,前記空間インデックスにより定義される空間ごとに,当該ポリゴンにラスタライズ処理を行なってピクセルに変換し,前記前段処理用シェーダに基づいて,ラスタライズ処理済みのピクセルのカラー値及び奥行き値を生成する前段処理部(30)と,
前記ラスタライズ処理済みのピクセルの奥行き値を参照して出力カラーバッファ(51)に書き込むことが決定されたピクセルについて,前記後段処理用シェーダに基づいたテクスチャ・シェーディング処理を行い,テクスチャ・シェーディング処理済みのピクセルのカラー値を生成する後段処理部(40)と,
前記前段処理部(30)及び前記後段処理部(40)により得られたピクセルのカラー値を出力カラーバッファ(51)に出力するピクセル出力部(50)と,を備える
画像処理装置。
An image processing apparatus for computer graphics processing,
A shader for pre-processing that reads the shader program in the graphics application and extracts the functions necessary for generating color and depth values, and a shader for post-processing that includes texture shading that is not included in the pre-processing shader. A compiler processing unit (10) for outputting,
Reads the vertex data that constitutes the polygon in the graphics application, performs vertex processing including coordinate transformation, obtains the processed vertex data, generates a spatial index in the coordinate system after the transformation, A spatial index addition unit (20) for creating a vertex buffer (21) with a spatial index that stores the processed vertex data and the spatial index in association with each other;
The vertex buffer (21) with the spatial index is read to construct a polygon, and for each space defined by the spatial index, the polygon is rasterized and converted into pixels. Based on the pre-processing shader, A pre-processing unit (30) for generating color values and depth values of rasterized pixels;
The pixel determined to be written to the output color buffer (51) with reference to the depth value of the rasterized pixel is subjected to texture shading processing based on the post-processing shader, and texture shading processed A post-processing unit (40) for generating pixel color values;
An image processing apparatus comprising: a pixel output unit (50) that outputs a color value of a pixel obtained by the pre-stage processing unit (30) and the post-stage processing unit (40) to an output color buffer (51).
前記前段処理部(30)は,前記ラスタライズ処理を行う前段プロセッサコア(31)を有し,
前記後段処理部(40)は,前記テクスチャ・シェーディング処理を行う後段プロセッサコア(41)を有し,
前記前段プロセッサコア(31)と後段プロセッサコア(41)は,異なるハードウェアである
請求項1に記載の画像処理装置。
The pre-processing unit (30) includes a pre-processor core (31) that performs the rasterization process.
The post-processing unit (40) includes a post-processor core (41) that performs the texture / shading process,
The image processing apparatus according to claim 1, wherein the former processor core (31) and the latter processor core (41) are different hardware.
前記空間インデックス追加部(20)は,ユーザによって任意に与えられた空間情報に基づいて空間分割を行い,前記空間インデックスを生成する
請求項1又は請求項2に記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the spatial index adding unit (20) performs spatial division based on spatial information arbitrarily given by a user and generates the spatial index.
前記コンパイラ処理部(10)は,
前記シェーダプログラムに対してフロントエンド処理を行い,中間表現へと変換するフロントエンド処理部(11)と,
前記中間表現と,事前に用意されたカラー・奥行き値の生成に関する処理パターンとのターンマッチ処理を行うことにより,当該中間表現から,カラー・奥行き値の生成に必要な機能を抽出する機能抽出部(12)と,
前記中間表現に対してバックエンド処理を行い,前記機能抽出部(12)が抽出した前記カラー・奥行き値の生成に必要な機能を前段処理用シェーダとして出力すると共に,前記シェーダプログラムのうちの前記カラー・奥行き値の生成に必要な機能以外の機能を後段処理用シェーダとして出力するバックエンド処理部(13)と,を有する。
請求項1から請求項3のいずれかに記載の画像処理装置。
The compiler processing unit (10)
A front-end processing unit (11) for performing front-end processing on the shader program and converting it into an intermediate representation;
A function extraction unit that extracts functions necessary for generating color / depth values from the intermediate representation by performing turn-match processing between the intermediate representation and a processing pattern relating to generation of color / depth values prepared in advance. (12),
Back-end processing is performed on the intermediate representation, and the functions necessary for generating the color / depth values extracted by the function extraction unit (12) are output as a pre-processing shader, and the shader program And a back-end processing unit (13) for outputting functions other than those necessary for generating color / depth values as a post-processing shader.
The image processing apparatus according to claim 1.
コンピュータグラフィックス処理用の画像処理装置により実行される画像処理方法であって,
前記画像処理装置が,
グラフィックスアプリケーション内のシェーダプログラムを読み込み,カラー・奥行き値の生成に必要な機能を抽出した前段処理用シェーダと,当該前段処理用シェーダに含まれていないテクスチャ・シェーディング処理を含む後段処理用シェーダとを,出力するコンパイラ処理工程と,
グラフィックスアプリケーション内のポリゴンを構成する頂点データを読み込んで,座標変換を含む頂点処理を行い,処理済み頂点データを得ると共に,変換後の座標系における空間インデックスを生成し,当該ポリゴンの構成情報,当該処理済み頂点データ,及び当該空間インデックスを関連付けて記憶した空間インデックス付き頂点バッファ(21)を作成する空間インデックス追加工程と,
前記空間インデックス付き頂点バッファ(21)を読み込んでポリゴンを構築し,前記空間インデックスにより定義される空間ごとに,当該ポリゴンにラスタライズ処理を行なってピクセルに変換し,前記前段処理用シェーダに基づいて,ラスタライズ処理を行ったピクセルのカラー値及び奥行き値を生成する前段処理工程と,
前記ラスタライズ処理済みのピクセルの奥行き値を参照して出力カラーバッファ(51)に書き込むことが決定されたピクセルについて,前記後段処理用シェーダに基づいたテクスチャ・シェーディング処理を行い,テクスチャ・シェーディング処理を行ったピクセルのカラー値を生成する後段処理工程と,
前記前段処理工程及び前記後段処理工程により得られたピクセルのカラー値を出力カラーバッファ(51)に出力するピクセル出力工程と,を行う
画像処理方法。
An image processing method executed by an image processing apparatus for computer graphics processing,
The image processing device is
A shader for pre-processing that reads the shader program in the graphics application and extracts the functions necessary for generating color and depth values, and a shader for post-processing that includes texture shading that is not included in the pre-processing shader. The compiler processing step to output,
Reads the vertex data that constitutes the polygon in the graphics application, performs vertex processing including coordinate transformation, obtains the processed vertex data, generates a spatial index in the coordinate system after the transformation, A spatial index adding step for creating a vertex buffer (21) with a spatial index that stores the processed vertex data and the spatial index in association with each other;
The vertex buffer (21) with the spatial index is read to construct a polygon, and for each space defined by the spatial index, the polygon is rasterized and converted into pixels. Based on the pre-processing shader, A pre-processing step for generating color values and depth values of rasterized pixels;
A texture shading process is performed on the pixel determined to be written to the output color buffer (51) by referring to the depth value of the rasterized pixel, and the texture shading process is performed based on the post-processing shader. A post-processing step to generate a color value for each pixel;
A pixel output step of outputting a color value of a pixel obtained by the pre-stage processing step and the post-stage processing step to an output color buffer (51).
請求項1に記載の画像処理装置を具備するコンピュータ。   A computer comprising the image processing apparatus according to claim 1. 請求項1に記載の画像処理装置を具備するゲーム機。   A game machine comprising the image processing apparatus according to claim 1.
JP2013096577A 2013-05-01 2013-05-01 Image processing apparatus and image processing method for processing graphics by dividing space Active JP5864474B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013096577A JP5864474B2 (en) 2013-05-01 2013-05-01 Image processing apparatus and image processing method for processing graphics by dividing space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013096577A JP5864474B2 (en) 2013-05-01 2013-05-01 Image processing apparatus and image processing method for processing graphics by dividing space

Publications (2)

Publication Number Publication Date
JP2014219739A true JP2014219739A (en) 2014-11-20
JP5864474B2 JP5864474B2 (en) 2016-02-17

Family

ID=51938150

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013096577A Active JP5864474B2 (en) 2013-05-01 2013-05-01 Image processing apparatus and image processing method for processing graphics by dividing space

Country Status (1)

Country Link
JP (1) JP5864474B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204408A (en) * 2014-12-23 2016-12-07 联发科技股份有限公司 Drawing processes circuit and preposition depth information process method thereof
CN114820990A (en) * 2022-06-29 2022-07-29 浙江远算科技有限公司 Digital twin-based drainage basin flood control visualization method and system
JP2022137826A (en) * 2021-03-09 2022-09-22 株式会社Mawari 3d object streaming method, device and program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0944697A (en) * 1995-07-27 1997-02-14 Toshiba Corp Graphic plotting device
JP2009295161A (en) * 2008-06-04 2009-12-17 Arm Ltd Graphics processing system
JP2011090648A (en) * 2009-10-26 2011-05-06 Sony Computer Entertainment Inc Image processing device and image processing method
JP2012503259A (en) * 2008-09-22 2012-02-02 コースティック グラフィックス インコーポレイテッド System and method for ray tracing shader API
WO2012147364A1 (en) * 2011-04-28 2012-11-01 Digital Media Professionals Inc. Heterogeneous graphics processor and configuration method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0944697A (en) * 1995-07-27 1997-02-14 Toshiba Corp Graphic plotting device
JP2009295161A (en) * 2008-06-04 2009-12-17 Arm Ltd Graphics processing system
JP2012503259A (en) * 2008-09-22 2012-02-02 コースティック グラフィックス インコーポレイテッド System and method for ray tracing shader API
JP2011090648A (en) * 2009-10-26 2011-05-06 Sony Computer Entertainment Inc Image processing device and image processing method
WO2012147364A1 (en) * 2011-04-28 2012-11-01 Digital Media Professionals Inc. Heterogeneous graphics processor and configuration method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204408A (en) * 2014-12-23 2016-12-07 联发科技股份有限公司 Drawing processes circuit and preposition depth information process method thereof
JP2022137826A (en) * 2021-03-09 2022-09-22 株式会社Mawari 3d object streaming method, device and program
JP7430411B2 (en) 2021-03-09 2024-02-13 マワリ コーポレーション 3D object streaming method, device, and program
CN114820990A (en) * 2022-06-29 2022-07-29 浙江远算科技有限公司 Digital twin-based drainage basin flood control visualization method and system
CN114820990B (en) * 2022-06-29 2022-09-20 浙江远算科技有限公司 Digital twin-based river basin flood control visualization method and system

Also Published As

Publication number Publication date
JP5864474B2 (en) 2016-02-17

Similar Documents

Publication Publication Date Title
EP3308359B1 (en) Rendering using ray tracing to generate a visibility stream
US10510183B2 (en) Graphics processing enhancement by tracking object and/or primitive identifiers
CN106575228B (en) Post-processing object order rearrangement in graphics process
CN106233326B (en) In graphics process based on show target flexibly show
CN110084875B (en) Using a compute shader as a front-end for a vertex shader
CN103946895B (en) The method for embedding in presentation and equipment based on tiling block
CN105518742B (en) Fault-tolerant preemption mechanism at arbitrary control points for graphics processing
JP4579262B2 (en) Early Z-test method and system for rendering three-dimensional images
CN110097625B (en) Fragment shaders perform vertex shader computations
EP2946364B1 (en) Rendering graphics data using visibility information
US7394464B2 (en) Preshaders: optimization of GPU programs
JP5864474B2 (en) Image processing apparatus and image processing method for processing graphics by dividing space
US10062140B2 (en) Graphics processing systems
JP4754385B2 (en) Program, information recording medium, and image generation system
Es et al. Accelerated regular grid traversals using extended anisotropic chessboard distance fields on a parallel stream processor
JP6205200B2 (en) Image processing apparatus and image processing method having sort function
JP2014229217A (en) Image processing apparatus enabling high-speed two-dimensional graphics processing, and image processing method
KR20230028373A (en) Control segmentation playback in binning hardware
Bateman et al. Optimizing Tips and Tricks

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141127

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150918

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151006

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151029

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151224

R150 Certificate of patent or registration of utility model

Ref document number: 5864474

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250