JP6424329B2 - Image data processing method in image processing processor and program thereof - Google Patents

Image data processing method in image processing processor and program thereof Download PDF

Info

Publication number
JP6424329B2
JP6424329B2 JP2016165442A JP2016165442A JP6424329B2 JP 6424329 B2 JP6424329 B2 JP 6424329B2 JP 2016165442 A JP2016165442 A JP 2016165442A JP 2016165442 A JP2016165442 A JP 2016165442A JP 6424329 B2 JP6424329 B2 JP 6424329B2
Authority
JP
Japan
Prior art keywords
pixel
texture
pixels
grid
division pattern
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.)
Active
Application number
JP2016165442A
Other languages
Japanese (ja)
Other versions
JP2018032301A (en
Inventor
一樹 客野
一樹 客野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Axell Corp
Original Assignee
Axell Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Axell Corp filed Critical Axell Corp
Priority to JP2016165442A priority Critical patent/JP6424329B2/en
Publication of JP2018032301A publication Critical patent/JP2018032301A/en
Application granted granted Critical
Publication of JP6424329B2 publication Critical patent/JP6424329B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)
  • Image Processing (AREA)

Description

本発明は、画像処理プロセッサにおける画像データ処理方法及びそのプログラムに関し、特に、プログラマブルシェーダを搭載した画像処理プロセッサにおける画像データ処理方法及びそのプログラムに関する。   The present invention relates to an image data processing method and program thereof in an image processing processor, and more particularly, to an image data processing method and program thereof in an image processor equipped with a programmable shader.

三次元コンピュータグラフィックスにおいては、描画すべきオブジェクトを、多数のポリゴンにより表現されるポリゴンモデルを利用して生成するのが一般的である。ポリゴンモデルの描画処理においては、ポリゴン表面に陰影をつけるシェーディング処理や、ポリゴンモデルの表面にテクスチャ画像を貼り付けるテクスチャマッピング処理が行われる。   In three-dimensional computer graphics, it is common to generate an object to be drawn using a polygon model represented by a large number of polygons. In the drawing process of the polygon model, a shading process for shading the surface of the polygon and a texture mapping process for attaching a texture image to the surface of the polygon model are performed.

これらの処理は、高速処理を期して、初期においては、専用のハードウェア回路を用いた固定パイプラインによって実現していたが、更に技術開発が進むに応じて、表現力の向上を目的として、三次元座標から二次元座標への変換およびシェーディング処理のプログラマブル化が進展し、全体として“プロセッサ”としての性格を帯びるようになった。従って、CPUに対して、画像処理プロセッサ(例えば、GPU(Graphic Processing Unit))と称されるようなった。   Although these processes were initially realized by fixed pipelines using dedicated hardware circuits for high-speed processing, in order to further improve their expressiveness as technology development progresses, Programmability of transformation from three-dimensional coordinates to two-dimensional coordinates and shading processing has progressed, and has become a character of "processor" as a whole. Accordingly, the CPU is called an image processing processor (for example, a GPU (Graphic Processing Unit)).

かかるGPUにおいては、上記座用変換からテクスチャマッピングまでの処理を行う機能部が全体として慣例上“シェーダ”とも称されているが、それを構成する各処理のプログラマブル化が進んでおり、固定処理ではなく、ユーザが自由に可変的に各種シェーディング処理を選択実行できるようになってきている。具体的には、ポリゴンの頂点単位でのプログラマブル化から、ラスタライズ後のピクセル単位でのプログラマブル化を経て、最近では、GPU内のプログラマブルな機能部分を、画像処理のみならず汎用計算にも利用可能なようにした“コンピュートシェーダ”と称される構成を有するものまで登場している。   In such a GPU, the functional units that perform the processing from the above seat transformation to the texture mapping are generally also commonly referred to as "shaders" as a whole, but the programmization of each processing that constitutes them is in progress, and fixed processing Instead, the user can select and execute various shading processes freely and variably. Specifically, after programmable from polygon vertex units to programmable pixel units after rasterization, recently, programmable functional parts in the GPU can be used not only for image processing but also for general-purpose calculations What has appeared to have a configuration called "compute shader".

特表2002−520748号公報Japanese Patent Application Publication No. 2002-520748 特開2013−251717号公報JP, 2013-251717, A

X. Yu, B. S. Morse, and T. W. Sederberg, “Image Reconstruction Using Data-Dependent Triangulation”, IEEE Computer Graphics and Applications, Vol. 21, No. 3, pp. 62-68 May/Jun. (2001)X. Yu, B. S. Morse, and T. W. Sederberg, "Image Reconstruction Using Data-Dependent Triangulation", IEEE Computer Graphics and Applications, Vol. 21, No. 3, pp. 62-68 May / Jun. (2001)

ところで、上述のようなGPUにおけるレンダリング処理においては、ポリゴンへテクスチャ画像を貼り付ける処理の際に、テクスチャ画像を拡大したり、縮小したり、あるいは変形したりする処理が行われ、これらの拡大・縮小・変形の各処理にはバイリニアフィルタリングやバイキュービックフィルタリングが用いられる(例えば、特許文献1参照)。   By the way, in the rendering process in the above-described GPU, in the process of attaching a texture image to a polygon, a process of enlarging, reducing or deforming the texture image is performed, and these enlargements Bilinear filtering and bicubic filtering are used for each processing of reduction and deformation (see, for example, Patent Document 1).

しかしながら、バイリニアフィルタリングやバイキュービックフィルタリングの各処理では、オブジェクトの斜め方向のエッジにいわゆるシャギーが発生し、全体的にぼやけてしまうという課題がある。   However, in each process of bilinear filtering and bicubic filtering, there is a problem that so-called shaggy occurs at the edge in the diagonal direction of the object and the entire image is blurred.

一方、高品質な拡大手法として、コスト関数やエッジ方向などに応じて、画像領域を三角形に分割して画素を補間する三角形分割手法が提案されており、代表的なものとして、Data Dependent Triangulationが挙げられる(例えば、非特許文献1参照)。これは、各画素を頂点とする格子状の各領域に渡って、コスト関数に基づいて分割といわゆる”edge swap”とを繰り返して領域を分割し、補間すべき画素の値を算出する際のサンプリング(参照)画素点を決定する手法である。   On the other hand, as a high-quality enlargement method, a triangle division method has been proposed in which the image area is divided into triangles and the pixels are interpolated according to the cost function, the edge direction, etc. (See, for example, Non-Patent Document 1). This is based on the cost function in which division and so-called "edge swap" are repeated based on the cost function across each lattice-like area having each pixel as a vertex to divide the area and calculate the value of the pixel to be interpolated. This is a method of determining sampling (reference) pixel points.

この“三角形分割手法”を画像拡大処理に応用したものとして、例えば特許文献2がある。当該文献においては、2次元コンピュータグラフィックス処理において描画する際の補間処理として三角形分割手法を採用し、デコーダにより伸長された画像データと三角形分割評価回路により決定された各領域の分割パターンとを対応付けて画像メモリに格納すると共に、補間により値を決定すべき画素がある場合に、補間すべき画素を含む格子の領域についての分割パターンの情報と、その格子に係る所定の画素値を画像メモリから読み込み、補間すべき画素の値を求める画像表示処理装置及び画像表示処理方法が開示されている。   Patent Document 2 is an example of applying this "triangle division method" to image enlargement processing. In this document, a triangle division method is adopted as interpolation processing at the time of drawing in two-dimensional computer graphics processing, and the image data expanded by the decoder corresponds to the division pattern of each area determined by the triangle division evaluation circuit. And store in the image memory, and when there is a pixel whose value is to be determined by interpolation, information of the division pattern for the area of the grid including the pixel to be interpolated and a predetermined pixel value related to the grid An image display processing apparatus and an image display processing method are disclosed which are read from the above to obtain values of pixels to be interpolated.

しかしながら、特許文献2に開示された技術においては、デコーダによりライン又はブロック単位で得られる二次元画像データをシーケンシャルに入力し、入力データに対して三角形分割手法を適用して処理を行ったデータをワークバッファ等のメモリに格納し、描画回路がワークバッファに格納されたデータにアクセスして補間データを得ているので、三次元コンピュータグラフィックスの描画回路のようにテクスチャマッピングのための特定アドレスのテクスチャをUV値で指定するような処理とは、前提の構成が異なる。   However, in the technique disclosed in Patent Document 2, two-dimensional image data obtained in units of lines or blocks by the decoder is sequentially input, and data obtained by processing the input data by applying the triangle division method is used. Since it is stored in a memory such as a work buffer and the drawing circuit accesses the data stored in the work buffer to obtain interpolation data, it is possible to use a specific address for texture mapping like a drawing circuit of three-dimensional computer graphics. The configuration of the premise is different from the process of specifying a texture by a UV value.

すなわち、三次元コンピュータグラフィックスにおけるテクスチャマッピングにように、任意の座標の補間データがランダムに要求される場合には、特許文献2に開示された技術のように画像データをシーケンシャル処理できず、また分割パターン情報を格納しておくためのワークバッファが必要であるが、例えば、ゲーム開発用のエンジンであるUnityなどの3Dレンダラのマテリアルにピクセルシェーダとして補間方法を与える場合など、レンダラ等の制約によりワークバッファを利用できない場合では、特許文献2に開示された技術を利用することができない。   That is, as in the case of texture mapping in three-dimensional computer graphics, when interpolation data at arbitrary coordinates is randomly required, image data can not be sequentially processed as in the technique disclosed in Patent Document 2, and A work buffer for storing division pattern information is necessary. For example, when providing an interpolation method as a pixel shader to a 3D renderer material such as Unity, which is an engine for game development, due to limitations of the renderer etc. When the work buffer can not be used, the technology disclosed in Patent Document 2 can not be used.

また、コンピュートシェーダが搭載されてそれを利用する場合のように、ブロック単位で任意のブロック座標の補間データをランダムに要求されるような態様においては、特許文献2とは前提が異なり、新たな適用方法を模索する必要がある。   Also, in a mode in which interpolation data of arbitrary block coordinates is randomly requested in block units as in the case where a compute shader is mounted and used, the premise is different from Patent Document 2, and new Need to find out how to apply.

本発明は上述のような事情から為されたものであり、本発明の目的は、三角形分割手法を採用してより滑らかな拡大画像を得ることができる、プログラマブルシェーダ機能を有した画像処理プロセッサにおける画像データ処理方法及びそのプログラムを提供することにある。   The present invention has been made under the circumstances as described above, and it is an object of the present invention to provide an image processing processor having a programmable shader function capable of obtaining a smoother enlarged image by employing a triangulation method. An image data processing method and its program are provided.

上記目的を達成するため、本発明の画像処理プロセッサにおける画像データ処理方法は、入力されるポリゴンの頂点データに基づき、その頂点データに対応する、表示部上で位置を求める頂点シェーダと、前記頂点シェーダにより求められた前記表示部上での頂点の位置から、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するのに必要な、前記表示部上の画素を求めるラスタライザと、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するために、前記ラスタライザから、画素値の必要な前記表示部上の個々の画素の位置の情報が与えられるごとに、当該位置の画素値を、当該位置の所定の周辺のテクスチャ画素の値を補間することにより求めるピクセルシェーダと、を備えた画像処理プロセッサにおける画像データ処理方法であって、前記ピクセルシェーダは、当該位置が含まれる、前記テクスチャの画素格子に係る、三角形分割手法における三角形分割パターンを、前記画素格子を構成する画素及びその周辺の画素から決定し、決定された前記三角形分割パターンに基づき前記所定の周辺のテクスチャ画素の値を補間して、当該位置の画素値を求めることを要旨とする。   In order to achieve the above object, according to an image data processing method in an image processor of the present invention, there is provided a vertex shader for obtaining a position on a display unit corresponding to the vertex data based on vertex data of input polygons; From the position of the vertex on the display unit determined by the shader, the pixel on the display unit required to display an image having the specified texture mapped to the polygon on the display unit is determined In order to display on the display unit a rasterizer and an image in which a specified texture is mapped to the polygon, the rasterizer gives information on the position of each pixel on the display unit which requires a pixel value. Pixel shape at each position is determined by interpolating the values of texture pixels at predetermined positions around the position. An image data processing method in an image processing processor, wherein the pixel shader configures a triangle division pattern in a triangle division method according to the pixel grid of the texture including the position, the pixel grid The present invention is characterized in that the value of the predetermined surrounding texture pixel is determined based on the determined triangle division pattern, and the pixel value of the position is determined based on the determined pixel and the surrounding pixels.

ここで、前記ピクセルシェーダは、前記三角形分割パターンを決定する際に、前記画素格子を構成する画素及びその周辺の画素の各値について、低域濾過フィルタを施しつつ勾配値を求めることが望ましい。   Here, when the pixel shader determines the triangle division pattern, it is preferable that a low pass filter is applied to each value of pixels constituting the pixel grid and pixels therearound to obtain a gradient value.

また、詳細には、前記ピクセルシェーダは、前記三角形分割パターンを決定する際に、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンと、当該画素格子の上下左右の格子に係る前記三角形分割パターンとを仮決定し、仮決定された、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンと、当該画素格子の上下左右の格子に係る前記三角形分割パターンとが不整合の場合には、整合させることにより、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンを最終決定する。   Also, in detail, when the pixel shader determines the triangle division pattern, the pixel shader relates to the triangle division pattern related to the pixel grid of the texture and the grids above and below and to the left and right of the pixel grid. The triangle division pattern according to the pixel grid of the texture, which temporarily determines the triangle division pattern and includes the position determined temporarily, and the triangle division pattern according to the top, bottom, left, and right grids of the pixel grid include In the case of misalignment, the final determination of the triangle division pattern of the texture pixel grid including the position is performed by matching.

また、上記目的を達成するため、本発明の画像処理プロセッサにおける画像データ処理プログラムは、入力されるポリゴンの頂点データに基づき、その頂点データに対応する、表示部上で位置を求める頂点シェーダ処理と、前記頂点シェーダ処理により求められた前記表示部上での頂点の位置から、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するのに必要な、前記表示部上の画素を求めるラスタライザ処理と、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するために、前記ラスタライザ処理から、画素値の必要な前記表示部上の個々の画素の位置の情報が与えられるごとに、当該位置の画素値を、当該位置の所定の周辺のテクスチャ画素の値を補間することにより求めるピクセルシェーダ処理と、を有し、画像処理プロセッサにレンダリング処理を行わせる画像データ処理プログラムであって、前記ピクセルシェーダ処理は、当該位置が含まれる、前記テクスチャの画素格子に係る、三角形分割手法における三角形分割パターンを、前記画素格子を構成する画素及びその周辺の画素から決定し、決定された前記三角形分割パターンに基づき前記所定の周辺のテクスチャ画素の値を補間して、当該位置の画素値を求めることを要旨とする。   Further, in order to achieve the above object, an image data processing program in an image processor of the present invention executes vertex shader processing for obtaining a position on a display unit corresponding to the vertex data based on vertex data of an input polygon. A position on the display unit, which is necessary for displaying on the display unit an image in which a designated texture is mapped to the polygon from the position of the vertex on the display unit determined by the vertex shader processing Rasterizer processing for obtaining the pixels of each of the pixels, and individual pixels on the display unit requiring pixel values from the rasterizer processing to display on the display unit an image in which a designated texture is mapped to the polygon Each time the information on the position is given, the pixel value at the position is interpolated by the value of the texture pixel at a predetermined periphery of the position. An image data processing program for causing an image processing processor to perform rendering processing, the pixel shader processing includes triangle division according to the pixel grid of the texture in which the position is included The triangle division pattern in the method is determined from the pixels constituting the pixel grid and pixels in the periphery thereof, and the values of the predetermined surrounding texture pixels are interpolated based on the determined triangle division pattern, and the pixels at the corresponding position The point is to determine the value.

また、上記目的を達成するため、本発明の画像処理プロセッサにおける画像データ処理方法は、複数のコンピュートユニットを有したコンピュートシェーダを備え、レンダリング処理を行う画像処理プロセッサにおける画像データ処理方法であって、各コンピュートユニットは、テクスチャを分割した各分割テクスチャを担当して並列的に処理するものであって、プログラムにより並列的に動作する複数のスレッドを有し、前記複数のスレッドを利用して、前記分割テクスチャを構成する各画素の値から、各画素により構成される各格子のうちの所定数の格子について、三角形分割手法で使用する三角形分割パターンを一括で決定し、ポリゴンに前記テクスチャがマッピングされた画像を表示部に表示するために、拡大した画像を格納するバッファ上の画素の位置に対応する前記所定数の格子上の位置を求め、各格子に含まれる前記位置に係る前記表示部上の画素の値を、各格子に対応する各スレッドを利用して、各格子に対して決定された前記三角形分割パターンに基づき当該分割テクスチャにおける周辺の画素の値を補間して求めることを要旨とする。   Further, in order to achieve the above object, an image data processing method in an image processing processor of the present invention is an image data processing method in an image processing processor that includes a compute shader having a plurality of compute units and performs rendering processing, Each compute unit takes charge of each divided texture obtained by dividing the texture and processes it in parallel, and has a plurality of threads operated in parallel by a program, and using the plurality of threads, From the values of each pixel constituting the divided texture, for a predetermined number of grids of each grid formed by each pixel, a triangle division pattern to be used in the triangle division method is determined at once, and the texture is mapped to polygons Stores the enlarged image in order to display the displayed image on the display unit. The predetermined number of grid positions corresponding to the pixel positions on the grid are determined, and the values of the pixels on the display unit related to the positions included in each grid are used for each thread corresponding to each grid. The gist of the present invention is to interpolate and obtain the values of peripheral pixels in the divided texture based on the triangle division pattern determined for each grid.

ここで、前記複数のスレッドは、前記三角形分割パターンを一括で決定する際に、処理の過程で得られた値を、前記複数のスレッドに共通のメモリに格納しつつ処理を行うことが好適である。   Here, when the plurality of threads collectively determine the triangle division pattern, it is preferable that the processing is performed while storing values obtained in the process of processing in a memory common to the plurality of threads. is there.

また、前記各コンピュートユニットは、前記複数のスレッドを利用して前記三角形分割パターンを一括で決定する際に、各格子を構成する画素及びその周辺の画素の各値について、低域濾過フィルタを施しつつ勾配値を求め、当該フィルタ処理により、利用する前記分割テクスチャの画素数に対して、得られる前記三角形分割パターンの数が減じてしまう分、前記各コンピュートユニットに、前記各分割テクスチャの境界部分が重複して割り当てられることが効果的である。   Further, when each of the compute units collectively determines the triangle division pattern using the plurality of threads, a low pass filter is applied to each value of pixels constituting each grid and pixels in the periphery thereof. While the gradient value is determined, the number of obtained triangle division patterns is reduced with respect to the number of pixels of the divided textures to be used by the filtering process, so that each compute unit has a boundary portion of each divided texture. It is effective that is assigned redundantly.

また、詳細には、前記各コンピュートユニットは、前記複数のスレッドを利用して前記三角形分割パターンを一括で決定する際に、各スレッドに対応する格子に係る前記三角形分割パターンと、当該格子の上下左右の格子に係る前記三角形分割パターンとを仮決定し、仮決定された、当該スレッドに対応する格子に係る前記三角形分割パターンと、当該格子の上下左右の格子に係る前記三角形分割パターンとが不整合の場合には、整合させることにより、当該スレッドに対応する格子に係る前記三角形分割パターンを最終決定する。   Further, in detail, when each of the compute units collectively determines the triangle division pattern using the plurality of threads, the triangle division pattern according to the grid corresponding to each thread, and the upper and lower sides of the grid The triangle division patterns for the left and right grids are temporarily determined, and the temporarily determined triangle division patterns for the grid corresponding to the thread and the triangle division patterns for the upper, lower, left, and right grids of the grid are not correct. In the case of matching, by matching, the triangulation pattern of the lattice corresponding to the thread is finally determined.

また、上記目的を達成するため、本発明の画像処理プロセッサにおける画像データ処理プログラムは、各々が複数の並列動作可能なスレッドを有する、複数の並列動作可能なコンピュートユニットを備えた画像処理プロセッサに、ポリゴンで構成される三次元モデルの情報と貼られるべきテクスチャの情報に基づきレンダリング処理を行わせる画像データ処理プログラムであって、前記テクスチャを複数に分割した分割テクスチャの各々を前記各コンピュートユニットに割り当てる処理と、前記複数のスレッドに、前記分割テクスチャを構成する各画素の値から、各画素により構成される各格子のうちの所定数の格子について、三角形分割手法で使用する三角形分割パターンを一括で決定させる処理と、前記ポリゴンに前記テクスチャがマッピングされた画像を表示部に表示するために、拡大した画像を格納するバッファ上の画素の位置に対応する前記所定数の格子上の位置を求める処理と、各格子に対応する各スレッドに、各格子に含まれる前記位置に係る前記表示部上の画素の値を、各格子に対して決定された前記三角形分割パターンに基づき当該分割テクスチャにおける周辺の画素の値を補間して求めさせる処理を有することを要旨とする。   Further, to achieve the above object, an image data processing program in an image processing processor according to the present invention comprises an image processing processor comprising a plurality of parallel operable compute units each having a plurality of parallel operable threads, An image data processing program that performs rendering processing based on information of a three-dimensional model configured by polygons and information of a texture to be attached, wherein each of divided textures obtained by dividing the texture into a plurality of pieces is allocated to each of the compute units Processing and, based on the values of the pixels constituting the divided texture, the triangle division patterns used in the triangle division method collectively for a predetermined number of grids of each grid formed of the pixels in the plurality of threads And the texture is mapped to the polygon. Processing for obtaining the positions on the predetermined number of grids corresponding to the positions of the pixels on the buffer storing the enlarged image, and displaying each of the threads corresponding to the grids, in order to display the scanned image on the display unit; Processing for interpolating values of surrounding pixels in the divided texture on the basis of the triangle division pattern determined for each lattice based on the triangle division pattern determined for each lattice; Make it a gist.

本発明の画像処理プロセッサにおける画像データ処理方法及びそのプログラムによれば、プログラマブルシェーダ機能を有した画像処理プロセッサにおいて、三角形分割手法を採用してより滑らかな拡大画像を得ることができる。   According to the image data processing method and program thereof in the image processing processor of the present invention, in the image processing processor having a programmable shader function, it is possible to obtain a smoother enlarged image by adopting a triangle division method.

特に、コンピュートシェーダを備えた画像処理プロセッサにおいては、三角形分割手法における複数の三角形分割パターンが一括で得られ、それにより、表示部での表示に必要な各画素の値も一括して求めることができる。   In particular, in an image processing processor provided with a compute shader, a plurality of triangle division patterns in the triangle division method can be obtained at once, thereby obtaining values of each pixel necessary for display on the display unit at once. it can.

また、各格子について三角形分割パターンを決定する際に、当該格子を構成する画素及びその周辺の画素の各値について、低域濾過フィルタを施しつつ勾配値を求めているので、ノイズ等を除去できる。   In addition, when determining the triangle division pattern for each grid, since the gradient value is obtained while applying low-pass filtering for each value of the pixels constituting the grid and the pixels around it, noise and the like can be removed. .

本発明の画像データ処理方法及びそのプログラムの一実施形態が具現化される画像処理装置の構成を示すブロック図である。It is a block diagram showing composition of an image processing device with which an embodiment of an image data processing method of the present invention and its program is embodied. 図2(a)は、ラスタライザ22における処理の手順を示すフローチャートであり、同図(b)はラスタライズ処理を説明するための図である。FIG. 2A is a flowchart showing the procedure of processing in the rasterizer 22, and FIG. 2B is a diagram for explaining the rasterization processing. ラスタライザ22から画素値の算出の依頼があるごとに行われるピクセルシェーダ23における処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the process in the pixel shader 23 performed whenever there is a request of calculation of a pixel value from the rasterizer 22. FIG. 三角形分割パターンの決定処理の手順の詳細を示すフローチャートである。It is a flowchart which shows the detail of the procedure of the determination process of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 決定された三角形分割パターンに基づく補間処理を説明するための図である。It is a figure for demonstrating the interpolation process based on the determined triangle division | segmentation pattern. 本発明の画像データ処理方法及びそのプログラムにおける他の実施形態が具現化される画像処理装置の構成を示すブロック図である。It is a block diagram showing composition of an image processing device with which another embodiment in an image data processing method of the present invention and its program is embodied. 各コンピュートユニット251の詳細構成を示すブロック図である。FIG. 6 is a block diagram showing a detailed configuration of each compute unit 251. テクスチャをどのように分割して処理するかの例を示す図である。It is a figure which shows the example of how to divide | segment and process a texture. 各コンピュートユニット251の処理手順を示すフローチャートである。It is a flow chart which shows the processing procedure of each compute unit 251. ステップS32における、16×16個の分割テクスチャ画素値TPVから、9×9個の分割パターンを一括して決定する処理の詳細手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the process which determines 9x9 division patterns collectively from 16x16 division | segmentation texture pixel value TPV in step S32. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern. 三角形分割パターンの決定処理を説明するための図である。It is a figure for demonstrating the decision processing of a triangle division pattern.

以下、図面を参照して、本発明の実施の形態について詳細に説明する。
<プログラマブルピクセルシェーダ機能を有するGPUでの実施形態>
図1は、本発明の画像データ処理方法及びそのプログラムの一実施形態が具現化される画像処理装置の構成を示すブロック図である。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
<Embodiment with GPU Having Programmable Pixel Shader Function>
FIG. 1 is a block diagram showing a configuration of an image processing apparatus in which an embodiment of an image data processing method and a program thereof according to the present invention is embodied.

同図に示した画像処理装置は、三次元グラフィックス画像が表示される表示部5と、複数のテクスチャのデータが格納されるVRAM3と、ポリゴンで構成される3Dモデルの頂点データと貼り付けるべき各テクスチャを特定する情報を供給するCPU1と、CPU1から供給された頂点データとテクスチャを特定する情報に基づき、頂点データから、表示部5上で表示される範囲に対応する各画素を求めると共に、VRAM3に格納された対応するテクスチャのデータを読み込んできて、それに基づき、上記対応する各画素の値を算出して出力するGPU2Aと、表示部5の前段に位置し、GPU2Aから出力された各画素データが格納されるフレームバッファ4と、を備えている。   The image processing apparatus shown in the figure should be attached with the display unit 5 on which a three-dimensional graphics image is displayed, the VRAM 3 in which data of a plurality of textures are stored, and vertex data of a 3D model composed of polygons Based on the CPU 1 supplying information specifying each texture, the vertex data supplied from the CPU 1 and the information specifying the texture, each pixel corresponding to the range displayed on the display unit 5 is obtained from the vertex data, A GPU 2A that can read the data of the corresponding texture stored in the VRAM 3 and calculate and output the value of each corresponding pixel based on it, and each pixel output from the GPU 2A located in front of the display unit 5 And a frame buffer 4 for storing data.

GPU2Aは、頂点シェーダ21、ラスタライザ22、ピクセルシェーダ23、及びテクスチャフェッチ部24を有している。以下、図1と併せて、図2乃至図10を参照しつつ、GPU2Aにおけるいわゆるレンダリング処理を詳細に説明する。なお、頂点シェーダ21、ラスタライザ22、及びピクセルシェーダ23は、いずれもプログラム可能なものである。   The GPU 2 A includes a vertex shader 21, a rasterizer 22, a pixel shader 23, and a texture fetch unit 24. Hereinafter, so-called rendering processing in the GPU 2A will be described in detail with reference to FIGS. 2 to 10 together with FIG. The vertex shader 21, the rasterizer 22, and the pixel shader 23 are all programmable.

頂点シェーダ21は、CPU1から供給された頂点データに対して、各種の座標変換を施し、それらの表示部5上での表示位置(座標)を求める。   The vertex shader 21 performs various coordinate transformations on the vertex data supplied from the CPU 1 and obtains the display position (coordinates) on the display unit 5.

図2(a)は、ラスタライザ22における処理の手順を示すフローチャートであり、同図(b)はラスタライズ処理を説明するための図である。そこで、ラスタライザ22は、まず、頂点シェーダ21から送られてきた表示部5上での頂点データから、図2(b)に示すようにラスタライズ処理を行い、値の必要な画素を導き出す(ステップS11)。図2(b)では頂点データから導出した境界において、画素の中心が境界の内側に位置する場合に画素値を求める例を示している。次に、ラスタライザ22は、値の必要な画素ごとに、ピクセルシェーダ23に対して、各画素の位置を、テクスチャのUV座標系の値UV(0〜1,0〜1)として与えることにより、ピクセルシェーダ23に画素値の算出を依頼する(ステップS12)。そして、値の必要な画素ごとに、ピクセルシェーダ23から画素値を取得する(ステップS13)。S11の処理で得られた、値の必要な画素すべてについて画素値が得られれば(ステップS14において肯定判定)、ステップS15に移行し、取得した各画素値をフレームバッファ4に書き込んで表示部5での表示に供する。なお、ここでは、説明の便宜上、すべての画素値が得られてから一括してフレームバッファ4に供給するような手順になっているが、各画素値が得られるたびに個々にフレームバッファ4に供給することも考えられ、いずれであってもよい。   FIG. 2A is a flowchart showing the procedure of processing in the rasterizer 22, and FIG. 2B is a diagram for explaining the rasterization processing. Therefore, the rasterizer 22 first performs rasterization processing as shown in FIG. 2B from the vertex data on the display unit 5 sent from the vertex shader 21 and derives pixels necessary for the value (step S11). ). FIG. 2B shows an example in which the pixel value is obtained when the center of the pixel is located inside the boundary at the boundary derived from the vertex data. Next, the rasterizer 22 gives the position of each pixel to the pixel shader 23 as the value UV (0 to 1, 0 to 1) of the texture UV coordinate system, for each pixel for which a value is required. The pixel shader 23 is requested to calculate the pixel value (step S12). Then, a pixel value is acquired from the pixel shader 23 for each pixel requiring a value (step S13). When the pixel values are obtained for all the pixels requiring values obtained in the process of S11 (affirmative determination in step S14), the process proceeds to step S15, and the acquired pixel values are written to the frame buffer 4 to display 5 Provide for display in Here, for convenience of explanation, the procedure is such that all pixel values are obtained and then collectively supplied to the frame buffer 4, but each time each pixel value is obtained, the frame buffer 4 is individually provided. It is also conceivable to supply, which may be any.

図3は、ラスタライザ22から画素値の算出の依頼があるごとに行われるピクセルシェーダ23における処理の手順を示すフローチャートであり、図4は、その一部の処理である三角形分割パターンの決定処理の手順の詳細を示すフローチャートであり、図5乃至図10は、三角形分割パターンの決定処理と決定された分割パターンに基づく補間処理を説明するための図である。図3に示したピクセルシェーダ23における処理は、今回、ユーザにより特徴的にプログラミングされる部分である。プログラミング言語は、例えば、HLSL(High Level Shading Language)やCgである。   FIG. 3 is a flow chart showing the procedure of processing in the pixel shader 23 performed each time there is a request for calculation of pixel values from the rasterizer 22, and FIG. 4 is a process of determining a triangle division pattern which is a part of the processing. FIG. 5 to FIG. 10 are diagrams for explaining the details of the procedure, and FIGS. 5 to 10 are diagrams for explaining the determination processing of the triangle division pattern and the interpolation processing based on the determined division pattern. The processing in the pixel shader 23 shown in FIG. 3 is a portion that is characteristically programmed by the user this time. The programming language is, for example, HLSL (High Level Shading Language) or Cg.

図3を参照して、まず、ピクセルシェーダ23は、ラスタライザ22からのUV座標値UVの入力を伴って、ピクセルシェーダ23から、値の必要な画素のその値の算出の依頼があったか否かを判定し(ステップS21)、その依頼があった場合(ステップS21において肯定判定)には、当該値を三角形分割手法を用いて求めるべく、当該値の必要な画素に対応した1つの三角形分割パターンを決定する(ステップS22)。   Referring to FIG. 3, first, the pixel shader 23 requests the calculation of the value of the pixel requiring the value from the pixel shader 23 with the input of the UV coordinate value UV from the rasterizer 22. If there is a request (Yes in step S21), one triangle division pattern corresponding to a pixel requiring the value is determined to obtain the value using the triangle division method. It determines (step S22).

三角形分割パターンの決定処理の詳細は、図4を参照して、ピクセルシェーダ23は、まず、ラスタライザ22から受け取ったUV座標値UVをテクスチャピクセル座標値に変換する(ステップS221)。これは簡単には、テクスチャ画像の解像度を乗ずることにより行える。次に、ピクセルシェーダ23は、得られたテクスチャピクセル座標値から、図5(a)に示すように、その位置を囲う4点のテクスチャ画素の左上の画素を便宜上、基準点(0,0)としたときの、(−3、−3)〜(4,4)までの画素、すなわち8×8の画素の各値を、テクスチャフェッチ部24にテクスチャアドレスTAを指定することにより、VRAM3からの読込みを指示する(ステップS222)。この(−3、−3)〜(4,4)の8×8の画素の値は、当該UV座標値UVとして与えられた、当該値の必要な画素のその値を三角形分割手法による補間により求めるための三角形分割パターンを決定するために必要な情報である。また、このように8×8の画素の値を必要としたのは、以下に説明する低域濾過フィルタ処理を施してノイズ耐性を高める等のためである。   For details of the process of determining the triangle division pattern, referring to FIG. 4, the pixel shader 23 first converts UV coordinate values UV received from the rasterizer 22 into texture pixel coordinate values (step S 221). This can easily be done by multiplying the resolution of the texture image. Next, as shown in FIG. 5A, the pixel shader 23 uses, as a reference point (0, 0) for convenience, the upper left pixel of the four texture pixels surrounding the position from the obtained texture pixel coordinate value. Of the pixels from (-3, -3) to (4, 4), that is, 8.times.8 pixels, by designating the texture address TA to the texture fetch unit 24. It instructs to read (step S222). The values of 8 × 8 pixels of (-3, -3) to (4, 4) are given as the UV coordinate values UV, and the values of the necessary pixels of the values are interpolated by the triangle division method. It is information necessary to determine a triangle division pattern to be determined. Also, the reason why the 8 × 8 pixel value is required in this way is to perform the low-pass filter process described below to enhance the noise resistance.

そこで、図5(a)に示すような8×8の画素の値を受け取ると、ピクセルシェーダ23は、次に、同図(b)に示すような3×3の画素をカバーするようなプリフィルタPFを用意し、同図(c)に示すように、8×8の画素を順次走査し、その都度、3×3の画素の値を平均化することにより、走査終了時に、図6(a)に示すような6×6の画素値を得る(ステップS223)。   Therefore, when the value of 8 × 8 pixels as shown in FIG. 5A is received, the pixel shader 23 next pre-covers the 3 × 3 pixels as shown in FIG. 5B. As shown in FIG. 6C, the filter PF is prepared, and the 8 × 8 pixels are sequentially scanned, and each time the values of the 3 × 3 pixels are averaged, the scanning is completed as shown in FIG. A 6 × 6 pixel value as shown in a) is obtained (step S223).

次に、ピクセルシェーダ23は、得られた6×6の画素値に対して、図6(b)に示すような2×2の画素をカバーするような勾配フィルタGFを用意し、同図(c)に示すように、6×6の画素を順次走査し、その都度、2×2の画素の値に基づく勾配を求めることにより、言い換えれば、各格子に対応する勾配値を求めることにより、走査終了時に、図7(a)に示すような5×5の格子に対応した5×5の勾配値を得る(ステップS224)。   Next, the pixel shader 23 prepares a gradient filter GF that covers 2 × 2 pixels as shown in FIG. 6B with respect to the obtained 6 × 6 pixel values, as shown in FIG. As shown in c), the 6 × 6 pixels are sequentially scanned, and each time the gradient is determined based on the value of the 2 × 2 pixel, in other words, by determining the gradient value corresponding to each grid, At the end of the scan, 5 × 5 gradient values corresponding to the 5 × 5 grid as shown in FIG. 7A are obtained (step S224).

次に、ピクセルシェーダ23は、得られた5×5の勾配値に対して、図7(b)に示すような3×3の勾配値をカバーするような平均化フィルタAFを用意し、同図(c)に示すように、5×5の勾配値を順次走査し、その都度、3×3の勾配値を平均化することにより、走査終了時に、図9(a)に示すような3×3の勾配値を得る(ステップS225)。   Next, the pixel shader 23 prepares an averaging filter AF that covers the 3 × 3 gradient values as shown in FIG. 7B with respect to the obtained 5 × 5 gradient values, As shown in FIG. 9C, 5 × 5 gradient values are sequentially scanned, and in each case, 3 × 3 gradient values are averaged to obtain 3 as shown in FIG. A gradient value of × 3 is obtained (step S225).

上述のように得られた3×3の勾配値から、値を得たい位置を含む格子、すなわち(0,0)〜(1,1)で構成された格子についての三角形分割パターンを決定するのであるが、前提として、まず、その三角形分割パターンについて、図8を参照して説明する。ここでは、画素値の傾斜を360度/16の精度、すなわち22.5度単位の精度まで近似する場合を説明する。画素値の傾斜を22.5度単位の精度まで近似する場合、注目する4つの画素点が形成する格子領域の各々に決定される分割パターンは、図8に示した15通りとなる。   From the 3 × 3 gradient values obtained as described above, we determine the triangulation pattern for the grid that contains the position we want to obtain, ie, the grid composed of (0,0) to (1,1) As a premise, first, the triangle division pattern will be described with reference to FIG. Here, the case where the inclination of the pixel value is approximated to an accuracy of 360 degrees / 16, that is, an accuracy of 22.5 degrees will be described. When the inclination of the pixel value is approximated to an accuracy of 22.5 degrees, the division patterns determined for each of the lattice regions formed by the four pixel points of interest are fifteen shown in FIG.

そこで、図9(a)のように得られた3×3の勾配値から、中央の格子について、言い換えれば、テクスチャ画素(0,0)、(0,1)、(1,0)、(1,1)で構成された格子について、図8に示した分割パターンのいずれかを決定するのであるが、そのとき当該9個の勾配値から、中央の格子に加えて、その上下左右の格子についても分割パターンを求める(ステップS226)。このとき、中央の格子についての分割パターンとその上下左右の分割パターンの接続が整合のとれた接続であるならば(ステップS227において肯定判定)、そのときの中央の格子についても分割パターンが最終的な求めたい分割パターンとなる。例えば、分割パターンが図9(b)のように求まった場合には、整合がとれているので、求めたい中央の格子についての分割パターンは、同図(c)のように決定される。   Therefore, from the 3 × 3 gradient values obtained as shown in FIG. 9A, in the central grid, in other words, texture pixels (0, 0), (0, 1), (1, 0), ((0) For the grid constructed in 1, 1), any one of the division patterns shown in FIG. 8 is determined, then, from the nine gradient values, in addition to the center grid, the grids above, below, left and right The division pattern is also obtained for (step S226). At this time, if the connection of the divided pattern for the central grid and the connection of the upper, lower, left, and right divided patterns is matched (affirmative determination in step S227), the divided pattern is finally obtained also for the central grid at that time. It is the division pattern that you want to obtain. For example, when the division pattern is obtained as shown in FIG. 9B, since the alignment is made, the division pattern for the central grid to be obtained is determined as shown in FIG.

一方、中央の格子についての分割パターンとその上下左右の分割パターンの接続が不整合の場合には(ステップS227において否定判定)、例えば、図9(d)に示すように、整合するようにパターンを修正する(ステップS228)。   On the other hand, if the connection between the division pattern for the central grid and the division patterns on the upper, lower, left, and right sides is mismatched (negative determination in step S227), for example, as shown in FIG. Are corrected (step S228).

図3に戻り、次に、上述のようにステップS22で得られた三角形分割パターンを使用して、三角形分割手法に基づく補間により、値を得たい位置、言い換えれば、ラスタライザ22によりUV座標値UVとして与えられた、値の算出を要求された画素の値を算出する(ステップS23)。   Returning to FIG. 3, next, using the triangle division pattern obtained in step S22 as described above, the position where the value is desired to be obtained by interpolation based on the triangle division method, in other words, the UV coordinate value UV by the rasterizer 22 To calculate the value of the pixel requested to calculate the value (step S23).

このとき、補間に使用する周囲のテクスチャ画素は、三角形分割手法によれば、求められた分割パターンに応じて決まる。そのことを図10を参照して簡単に説明する。
図10(a)〜(h)は、参照画素の取り方を示した分割パターンの例を示す図である。例えば、同図(a)のように、分割なしのパターンの場合には、格子の各頂点の画素p(ul),p(ur),p(dl),p(dr)の線形補間により、値の必要な位置rpの値を算出する。また、同図(b)の2分割の場合であって、値の必要な位置rpが同図に示すような場合、画素p(ul),p(ur),p(dl)の値に基づき、位置rpの値を算出する。また、同図(c)に示す3分割の1パターンであって、値の必要な位置rpが同図に示すような場合、画素p(ur),p(dl),p(dll)の値に基づき、位置rpの値を算出する。また、同図(d)に示す3分割の1パターンであって、値の必要な位置rpが同図に示すような場合、画素p(ur),p(dl),p(urr)の値に基づき、位置rpの値を算出する。また、同図(e)に示す3分割の1パターンであって、値の必要な位置rpが同図に示すような場合、画素p(ur),p(dl),p(uru)の値に基づき、位置rpの値を算出する。また、同図(f)に示す3分割の1パターンであって、値の必要な位置rpが同図に示すような場合、画素p(ur),p(dl),p(dld)の値に基づき、位置rpの値を算出する。また、同図(g)及び(h)に示す4分割の各パターンについても、各分割領域において同様である。更に、図には例示していない他の7つの分割パターンについても同様である。
At this time, according to the triangle division method, surrounding texture pixels used for interpolation are determined in accordance with the obtained division pattern. This will be briefly described with reference to FIG.
FIGS. 10 (a) to 10 (h) are diagrams showing examples of division patterns showing how to take reference pixels. For example, as shown in FIG. 6A, in the case of a pattern without division, linear interpolation of pixels p (ul), p (ur), p (dl) and p (dr) at each vertex of the grid is performed. Calculate the required position rp of the value. Also, in the case of the two divisions of FIG. 7B, when the required position rp of the values is as shown in the same drawing, based on the values of the pixels p (ul), p (ur) and p (dl). To calculate the value of the position rp. In addition, in the case of one pattern of three divisions shown in (c) of the same figure and the required position rp of the values is as shown in the same figure, the values of the pixels p (ur), p (dl), p (dll) The value of the position rp is calculated based on In addition, in the case of one pattern of three divisions shown in (d) of the same figure and the required position rp of the values is as shown in the same figure, the values of the pixels p (ur), p (dl), p (urr) The value of the position rp is calculated based on In addition, in the case of one pattern of three divisions shown in (e) of the same figure and the required position rp of the values is as shown in the same figure, the values of the pixels p (ur), p (dl), p (uru) The value of the position rp is calculated based on Further, in the case of one pattern of three divisions shown in (f) of the figure and the required position rp of the values is as shown in the same figure, the values of the pixels p (ur), p (dl), p (dld) The value of the position rp is calculated based on The same applies to each of the divided areas also for each of the four divided patterns shown in (g) and (h) in the same figure. Furthermore, the same applies to the other seven division patterns not illustrated in the figure.

従って、結局、図10(i)に示す12個のテクスチャ画素の値があれば、その格子内の補間すべき位置については、値が決定できることになる。この12個については、三角形分割パターンを決定するために読み込んでくる図5(a)に示した8×8の画素に完全に含まれているので、改めてVRAM3から読み込んでくる必要はないことになる。   Therefore, after all, if there are 12 texture pixel values shown in FIG. 10I, values can be determined for the position to be interpolated in the grid. Since these 12 are completely included in the 8 × 8 pixels shown in FIG. 5A which are read to determine the triangle division pattern, it is not necessary to read them from VRAM 3 again. Become.

再度、図3に戻り、最後に、ステップS23で得られた画素値を、ラスタライザ22により要求された画素値として、ラスタライザ22に返す(ステップS24)。   Referring back to FIG. 3, finally, the pixel value obtained in step S23 is returned to the rasterizer 22 as the pixel value requested by the rasterizer 22 (step S24).

以上が、プログラマブルピクセルシェーダ機能を有するGPUでの実施形態である。   The above is the embodiment of the GPU having the programmable pixel shader function.

なお、テクスチャフェッチ部24に標準仕様としてバイリニアやバイキュービック等のフィルタ処理が組み込まれている場合には、その機能は解除する。上述のようなピクセルシェーダ23でのフィルタ処理と競合してしまい、意図しないぼやけた画像等になってしまわないようにするためである。従って、上述のように、読み込んだ画素値をそのままピクセルシェーダ23に与える。   When the texture fetch unit 24 incorporates filtering processing such as bilinear or bicubic as a standard specification, the function is canceled. This is in order to prevent competition with the filtering process in the pixel shader 23 as described above, and an unintended blurry image or the like. Therefore, as described above, the read pixel value is given to the pixel shader 23 as it is.

なお、上述した各フィルタ処理は、想定されるノイズの種類やその大きさに応じて、変更することができる。   In addition, each filter process mentioned above can be changed according to the kind and the magnitude | size of the noise assumed.

以上のように、プログラマブルピクセルシェーダ機能を有するGPUでの実施形態においては、ラスタライザ22が、値の必要な表示部5上の画素位置を画素単位でピクセルシェーダ23に知らせることによりピクセルシェーダ23にその値を要求し、ピクセルシェーダ23が、テクスチャの画素値を使用して、三角形分割手法に基づく補間により、その値を算出してラスタライザ22に返すという処理を行っているので、より滑らかな拡大画像を得ることができる。   As described above, in the embodiment of the GPU having the programmable pixel shader function, the rasterizer 22 notifies the pixel shader 23 of the pixel position on the display unit 5 for which the value is necessary by notifying the pixel shader 23 in pixel units. Because a value is required, and the pixel shader 23 performs processing of calculating the value and returning it to the rasterizer 22 by interpolation based on the triangle division method using texture pixel values, a smoother enlarged image You can get

<コンピュートシェーダ機能を有するGPUでの実施形態>
図11は、本発明の画像データ処理方法及びそのプログラムにおける他の実施形態が具現化される画像処理装置の構成を示すブロック図である。
<Embodiment with GPU having Compute Shader Function>
FIG. 11 is a block diagram showing the configuration of an image processing apparatus in which another embodiment of the image data processing method and the program thereof of the present invention is embodied.

同図に示した画像処理装置は、三次元グラフィックス画像が表示される表示部5と、複数のテクスチャのデータが格納されるVRAM3と、少なくとも、ポリゴンで構成される3Dモデルの頂点データとテクスチャを特定する情報と共に、各テクスチャを分割して処理する際のその分割に係る情報を供給するCPU1と、CPU1から供給された頂点データ、テクスチャを特定する情報、及び上記分割情報に基づき、VRAM3に格納された対応するテクスチャを、分割された単位ごとに、一括してその三角形分割パターンを求めると共に、頂点データに基づく拡大率に応じて、表示部5における表示画素の値を、求めた全分割パターンに基づいて、三角形分割手法により、一括して補間して求めて出力するGPU2Bと、表示部5の前段に位置し、GPU2Aから出力された各画素データが格納されるフレームバッファ4と、を備えている。   The image processing apparatus shown in the figure includes a display unit 5 on which a three-dimensional graphics image is displayed, a VRAM 3 in which data of a plurality of textures are stored, and at least vertex data and textures of a 3D model composed of polygons. The CPU 1 supplies information related to the division when processing each texture together with the information specifying the image, the vertex data supplied from the CPU 1, the information for specifying the texture, and the VRAM 3 based on the division information. The corresponding texture stored is determined collectively for each divided unit, and the triangle division pattern is determined collectively, and the value of the display pixel in the display unit 5 is determined according to the enlargement factor based on the vertex data, all division Based on the pattern, the GPU 2 B, which is obtained by interpolation at a time using the triangle division method, and is output to the front stage of the display unit 5 And location, and a frame buffer 4 each pixel data outputted from GPU2A is stored, the.

また、図11に示すように、GPU2Bは、コンピュートシェーダ25及びディスパッチャ26を有しており、更に、コンピュートシェーダ25は、それぞれが、分割されたテクスチャの各々(以下、“分割テクスチャ”と称す)を担当して処理する複数のコンピュートユニット251a、251b、251c、・・・を有している。   Further, as shown in FIG. 11, the GPU 2B has a compute shader 25 and a dispatcher 26, and further, each of the compute shaders 25 is referred to as each of divided textures (hereinafter referred to as "divided texture") , And a plurality of compute units 251a, 251b, 251c,...

図12は、各コンピュートユニット251の詳細構成を示すブロック図である。同図に示すように、各コンピュートユニット251は、VRAM3から担当する分割テクスチャの各画素値TPVを読み込んでくるテクスチャフェッチ部2511と、テクスチャフェッチ部2511を介して読み込まれた分割テクスチャの各画素値TPVをそれぞれ並列的に処理する複数のスレッド2512a、2512b、2512c、・・・と、各スレッド2512における処理の過程の情報や処理結果が格納される共有メモリ2513と、を備えている。スレッド2512の数は、例えば768である。また、共有メモリ2513は、例えば32kバイトのキャッシュメモリである。   FIG. 12 is a block diagram showing the detailed configuration of each compute unit 251. As shown in FIG. As shown in the figure, each compute unit 251 has a texture fetch unit 2511 that reads in each pixel value TPV of the divided texture in charge from the VRAM 3, and each pixel value of the divided texture read via the texture fetch unit 2511. A plurality of threads 2512a, 2512b, 2512c,... Which respectively process TPVs in parallel, and a shared memory 2513 in which information and process results of processing in each thread 2512 are stored. The number of threads 2512 is, for example, 768. The shared memory 2513 is, for example, a cache memory of 32 k bytes.

次に、図11に示した画像処理装置の動作及び処理手順を説明する。
VRAM3に格納されたテクスチャが、どのように分割されて処理されるかは、予め設計される。図13は、テクスチャをどのように分割して処理するかの例を示す図である。ここでは、一つの分割テクスチャを16×16のテクスチャ画素で構成するものとし、テクスチャを3×2の分割テクスチャ((0,0)〜(1,2))として分割している。ここで、各分割テクスチャを6格子分重複させているのは、後述する三角形分割パターンを決定する処理において、分割の境界で欠落なく分割パターンを求められるようにするためである(当該重複がなければ、後述するフィルタ処理に応じて欠落が生じてしまう)。
Next, the operation and processing procedure of the image processing apparatus shown in FIG. 11 will be described.
How the texture stored in the VRAM 3 is divided and processed is designed in advance. FIG. 13 is a diagram showing an example of how to divide and process a texture. Here, one divided texture is configured by 16 × 16 texture pixels, and the texture is divided as 3 × 2 divided textures ((0, 0) to (1, 2)). Here, the reason why each divided texture is overlapped for six grids is to be able to obtain a divided pattern without omission at the boundary of division in the process of determining a triangular divided pattern to be described later (if there is no such overlapping (For example, a drop will occur according to the filter processing described later).

そこで、CPU1は、GPU2Bに対して、頂点データ、テクスチャを特定する情報と共に、“分割情報”、すなわち分割テクスチャを構成する画素の数(例えば、上記のように16×16)や、分割テクスチャの数の情報等を予め通知する。GPU2Bのディスパッチャ26は、CPU1から供給された当該情報に基づき、必要な数のコンピュートユニット251を把握すると共に、それらのコンピュートユニット251に、担当して処理すべき分割テクスチャを、グループIDで通知する。それにより、例えば、図13に示す例では、例えば、コンピュートユニット251a、251b、251c、251d、251e、251fが、それぞれ、分割テクスチャ(0,0)、(0,1)、(0,2)、(1,0)、(1,1)、(1,2)を担当するように設定され、グループIDとして(0,0)、(0,1)、(0,2)、(1,0)、(1,1)、(1,2)が渡される。   Therefore, the CPU 1 sends, to the GPU 2 B, “division information”, that is, the number of pixels constituting the division texture (for example, 16 × 16 as described above), and division information together with vertex data and information for specifying texture. The number information etc. are notified in advance. The dispatcher 26 of the GPU 2B recognizes the required number of compute units 251 based on the information supplied from the CPU 1 and notifies the compute units 251 of divided textures to be handled and processed by the group ID. . Thus, for example, in the example illustrated in FIG. 13, for example, the compute units 251a, 251b, 251c, 251d, 251e, and 251f respectively generate divided textures (0, 0), (0, 1), and (0, 2). , (1, 0), (1, 1), and (1, 2), and group IDs (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2) are passed.

図14は、各コンピュートユニット251の処理手順を示すフローチャートである。当該処理は、各コンピュートユニット251にプログラムにより組み込まれ、また、各コンピュートユニット251は並列的に動作可能である。プログラム言語は、例えばHLSLやCgである。   FIG. 14 is a flowchart showing the processing procedure of each compute unit 251. The processing is incorporated by program into each compute unit 251, and each compute unit 251 can operate in parallel. The program language is, for example, HLSL or Cg.

そこで、その処理手順を同図に沿って説明すると、まず、各コンピュートユニット251のテクスチャフェッチ部2511が、ディスパッチャ26から通知されたグループIDから計算されるUV座標値の範囲により、担当する分割テクスチャの各画素値TPV(16×16画素)を読み込んでくる(ステップS31)。次に、読み込んだ16×16個の分割テクスチャ画素値TPVから、9×9個の三角形分割パターンを一括して決定する(ステップS32)。   Therefore, the processing procedure will be described along the same figure. First, the texture fetch unit 2511 of each compute unit 251 takes charge of divided textures according to the range of UV coordinate values calculated from the group ID notified from the dispatcher 26. The pixel values TPV (16 × 16 pixels) of are read in (step S31). Next, 9 × 9 triangle division patterns are collectively determined from the 16 × 16 divided texture pixel values TPV read in (step S32).

図15は、ステップS32における、16×16個の分割テクスチャ画素値TPVから、9×9個の分割パターンを一括して決定する処理の詳細手順を示すフローチャートである。図16乃至図20は、当該手順を説明するための図である。   FIG. 15 is a flowchart showing a detailed procedure of a process of collectively determining 9 × 9 divided patterns from 16 × 16 divided texture pixel values TPV in step S32. 16 to 20 are diagrams for explaining the procedure.

前提として、読み込んできた担当する分割テクスチャの16×16の画素値TPVを、図16に示すようにローカルに画素(x,y)(x=−3〜12、y=−3〜12)と表すものとし、一方、スレッド2512a、2512b、・・・のうち、256個を選択して、それらを、二次元の画素(x,y)に対応させて、スレッド2512[i,j](i=1〜16、j=1〜16)と表記するものとし、各スレッド2512[i,j]が、各画素(x,y)又は平均値に対して1対1で担当して処理する構成となっている。なお、図16以下に示す具体例では、画素(−3,−3)がスレッド2512[1,1]に対応し、画素(12,−3)がスレッド2512[16,1]に対応し、画素(−3,12)がスレッド2512[1,16]に対応し、そして最後に画素(12,12)がスレッド2512[16,16]に対応するようにしているが、これは単なる説明の便宜上の対応関係である。   As a premise, the 16 × 16 pixel values TPV of the divided textures in charge that have been read in are locally represented as pixels (x, y) (x = −3 to 12, y = −3 to 12) as shown in FIG. On the other hand, 256 of the threads 2512a, 2512b,... Are selected, and they are made to correspond to two-dimensional pixels (x, y), and the thread 2512 [i, j] (i = 1 to 16 and j = 1 to 16), and each thread 2512 [i, j] takes charge of processing each pixel (x, y) or an average value on a one-to-one basis. It has become. In the specific example shown in FIG. 16 and thereafter, the pixel (-3, -3) corresponds to the thread 2512 [1, 1], and the pixel (12, -3) corresponds to the thread 2512 [16, 1], Pixel (-3, 12) corresponds to thread 2512 [1, 16] and finally pixel (12, 12) corresponds to thread 2512 [16, 16], but this is merely illustrative It is the correspondence of convenience.

そこで、まず、スレッド2512[i,j](i=1〜16、j=1〜16)の各々は、対応する担当の画素(x,y)(x=−3〜12、y=−3〜12)の値TPVを、共有メモリ2513に格納する(ステップS321)。そして、メモリバリア処理、すなわち、各スレッド2512におけるすべての格納が終了するまで待機する(ステップS322)。   Therefore, first, each of the threads 2512 [i, j] (i = 1 to 16, j = 1 to 16) corresponds to the corresponding pixel (x, y) (x = −3 to 12, y = −3) 12) is stored in the shared memory 2513 (step S321). Then, the process waits until the memory barrier process, ie, all storage in each thread 2512 is completed (step S322).

次に、14×14個のスレッド2512[i,j](i=2〜15、j=2〜15)の各々は、図16に示すように、共有メモリ2513から自身担当の画素を中心とした3×3画素の値を共有メモリ2513から読み込んできて、プリフィルタ処理により一の値を算出し、共有メモリ2513に格納する(ステップS323)。このプリフィルタ処理は、図5(b)、(c)を参照して説明した処理と同じであるが、各スレッド2512が並列的に当該プリフィルタ処理を行うところが先の実施形態とは異なる。そして、スレッド2512[i,j](i=2〜15、j=2〜15)によるすべての格納が終了するまで待機する(ステップS324)。当該ステップを抜けると、この時点、14×14個の情報が共有メモリ2513に格納される。   Next, as shown in FIG. 16, each of 14 × 14 threads 2512 [i, j] (i = 2 to 15, j = 2 to 15) has its own pixel in charge from shared memory 2513. The value of 3 × 3 pixels can be read from the shared memory 2513, and one value is calculated by prefiltering and stored in the shared memory 2513 (step S323). This pre-filtering process is the same as the process described with reference to FIGS. 5B and 5C, but is different from the previous embodiment in that each thread 2512 performs the pre-filtering process in parallel. Then, the process waits until all storage by the thread 2512 [i, j] (i = 2 to 15, j = 2 to 15) is completed (step S 324). Upon leaving the step, 14 × 14 pieces of information are stored in the shared memory 2513 at this time.

次に、13×13個のスレッド2512[i,j](i=2〜14、j=3〜15)の各々は、図17に示すように、自身担当の画素を左下画素として含む格子を構成する2×2画素の値を共有メモリ2513から読み込んできて、勾配フィルタ処理により一の値を算出し、共有メモリ2513に格納する(ステップS325)。この勾配フィルタ処理は、図6(b)、(c)を参照して説明した処理と同じであるが、各スレッド2512が並列的に当該勾配フィルタ処理を行うところが先の実施形態とは異なる。そして、スレッド2512[i,j](i=2〜14、j=3〜15)によるすべての格納が終了するまで待機する(ステップS326)。当該ステップを抜けると、この時点、13×13個の情報が共有メモリ2513に格納される。   Next, as shown in FIG. 17, each of the 13 × 13 threads 2512 [i, j] (i = 2 to 14, j = 3 to 15) has a grid including a pixel in charge of itself as a lower left pixel. The value of 2 × 2 pixels to be configured can be read from the shared memory 2513, one value is calculated by gradient filter processing, and stored in the shared memory 2513 (step S325). This gradient filter processing is the same as the processing described with reference to FIGS. 6B and 6C, but is different from the previous embodiment in that each thread 2512 performs the gradient filter processing in parallel. Then, the process waits until all storage by the thread 2512 [i, j] (i = 2 to 14, j = 3 to 15) is finished (step S 326). When this step is exited, 13 × 13 pieces of information are stored in the shared memory 2513 at this time.

次に、11×11個のスレッド2512[i,j](i=3〜13、j=4〜14)の各々は、図18に示すように、自身担当の画素が格子中心の左下側画素で、格子中心に最も近い画素として含まれる3×3の値を共有メモリ2513から読み込んできて、平均化フィルタ処理により一の値を算出し、共有メモリ2513に格納する(ステップS327)。この平均化フィルタ処理は、図7(b)、(c)を参照して説明した処理と同じであるが、各スレッド2512が並列的に当該平均化フィルタ処理を行うところが先の実施形態とは異なる。そして、スレッド2512[i,j](i=3〜13、j=4〜14)によるすべての格納が終了するまで待機する(ステップS328)。当該ステップを抜けると、この時点、11×11個の情報が共有メモリ2513に格納される。   Next, as shown in FIG. 18, each of the 11 × 11 threads 2512 [i, j] (i = 3 to 13, j = 4 to 14) has its own pixel at the lower left side of the lattice center Then, 3 × 3 values included as pixels closest to the lattice center can be read from the shared memory 2513, one value is calculated by averaging filter processing, and stored in the shared memory 2513 (step S327). Although this averaging filter process is the same as the process described with reference to FIGS. 7B and 7C, the place where each thread 2512 performs the averaging filter process in parallel is the same as the previous embodiment. It is different. Then, the process waits until all storage by the thread 2512 [i, j] (i = 3 to 13, j = 4 to 14) is finished (step S 328). When this step is exited, 11 × 11 pieces of information are stored in the shared memory 2513 at this time.

次に、9×9個のスレッド2512[i,j](i=4〜12、j=5〜13)の各々は、図19に示すように、自身担当の格子の値を中心とした3×3の値を共有メモリ2513から読み込んできて、それらの値に基づき、自身担当の格子に加えて、その上下左右の格子についても分割パターン(図8参照)を求め、図4の手順で説明したのと同様、上下左右の格子についての分割パターンと整合が取れていれば、中央の分割パターンを自身担当の格子についての分割パターンとして決定し、整合が取れていなければ修正し、最終的に決定された中央の分割パターンを自身担当の格子についての分割パターンとして共有メモリ2513に格納する(実際に格納するのは、パターン番号等)(ステップS329)。この処理は、図9を参照して説明した処理と同じであるが、各スレッド2512が並列的に当該処理を行うところが先の実施形態とは異なる。そして、スレッド2512[i,j](i=4〜12、j=5〜13)によるすべての格納が終了するまで待機する(ステップS330)。当該ステップを抜けると、最終的に、9×9個の三角形分割パターンに係る情報が共有メモリ2513に格納される。
図13に示したように各分割テクスチャを6格子分重複させているのは、図20に示すように、16×16のテクスチャ画素から、上記のように最終的に9×9個の三角形分割パターンに係る情報を得るためであり、分割テクスチャを重複させないと、三角形分割パターンに係る情報が得られない領域が発生するためである。
Next, as shown in FIG. 19, each of 9 × 9 threads 2512 [i, j] (i = 4 to 12, j = 5 to 13) is centered on the value of its own grid 3. A value of × 3 can be read from shared memory 2513, and based on those values, in addition to the grid in charge of itself, divided patterns (see FIG. 8) are obtained for the upper, lower, left, and right grids. Similarly to the above, if the division patterns for the upper, lower, left, and right grids are matched, the central divided pattern is determined as the divided pattern for the grid for which it is responsible, and if not matched, it is corrected. The determined central division pattern is stored in the shared memory 2513 as a division pattern for the grid in charge of itself (pattern number etc. is actually stored (step S329)). This process is the same as the process described with reference to FIG. 9, but the process performed by each thread 2512 in parallel is different from the previous embodiment. Then, the process waits until all storage by the thread 2512 [i, j] (i = 4 to 12, j = 5 to 13) is completed (step S330). After the step, finally, information related to the 9 × 9 triangle division pattern is stored in the shared memory 2513.
The reason why the divided textures are overlapped by six grids as shown in FIG. 13 is that, as shown in FIG. 20, it is finally divided into 9 × 9 triangles as described above from 16 × 16 texture pixels. This is for obtaining information related to the pattern, and if the divided textures are not overlapped, an area where information related to the triangle divided pattern can not be obtained occurs.

図14に戻り、各コンピュートユニット251a、b、c、・・・(図13の場合は、コンピュートユニット251a〜251f)は、CPU1から供給されるテクスチャの拡大率に応じて確保された拡大画像を格納するためのバッファ内の表示画素であって、それらの位置をUV座標値としたときに、自身担当の分割テクスチャのUV座標値範囲に含まれるそれらの位置(RGBの値を求めたい位置)と、自身担当の分割テクスチャの画素との対応関係(拡大率が大きくなれば、値を求めたい各位置の方が精細になる)を求める(ステップS33)。   Returning to FIG. 14, each of the compute units 251a, b, c,... (In the case of FIG. 13, the compute units 251a to 251f) enlarges the image secured according to the enlargement ratio of the texture supplied from the CPU 1 The display pixels in the buffer for storing, where their positions are UV coordinate values, those positions included in the UV coordinate value range of the divided textures for which they are responsible (positions for which it is desired to obtain RGB values) And the pixels of the divided textures in charge of itself (when the enlargement ratio is large, each position where the value is to be obtained becomes finer) (step S33).

そして、各コンピュートユニット251a、b、c、・・・(図13の場合は、コンピュートユニット251a〜251f)に含まれる9×9個のスレッド2512[i,j](i=4〜12、j=5〜13)の各々は、並列的に、自身が担当する格子に含まれる、値が求められるべき複数の位置の値を、自身が担当する格子について上記ステップS329において決定された三角形分割パターンに基づき、当該パターンに応じた周辺画素(図10参照)を利用して、三角形分割手法により求める(ステップS34)。   Then, 9 × 9 threads 2512 [i, j] (i = 4 to 12, j) included in each of the compute units 251a, b, c,... (In the case of FIG. 13, the compute units 251a to 251f). Each of (5) to (5) is, in parallel, the triangle division pattern determined in step S329 above for the grid for which it is responsible, for the plurality of position values to be determined, which are included in the grid for which it is responsible. Based on the above, using the peripheral pixels (see FIG. 10) corresponding to the pattern, it is determined by the triangle division method (step S34).

最後に、各コンピュートユニット251a、b、c、・・・(図13の場合は、コンピュートユニット251a〜251f)は、含まれる9×9個のスレッド2512[i,j](i=4〜12、j=5〜13)の各々により算出された表示部5上の画素のためのすべての値をフレームバッファ4に出力する(ステップS35)。尚、スレッドの仕様効率を上げるため、9×9個の三角形分割情報の各々に対して、複数のスレッドを割り当てることもできる。   Finally, each of the compute units 251a, b, c,... (In the case of FIG. 13, compute units 251a to 251f) includes 9 × 9 threads 2512 [i, j] (i = 4 to 12). , J = 5 to 13) and outputs all the values for the pixels on the display unit 5 to the frame buffer 4 (step S35). A plurality of threads can be allocated to each of 9 × 9 pieces of triangle division information in order to increase the specification efficiency of the threads.

なお、上述したコンピュートシェーダ機能を有するGPUでの実施形態において、各コンピュートユニット251が担当するテクスチャ画素の数を16×16画素としたが、これに限られることはなく、必要なフィルタ処理に応じて決定すればよい。但し、当然、各コンピュートユニット251に含まれるスレッド2512の数で制限される。   In the above-described embodiment using a GPU having a compute shader function, the number of texture pixels handled by each compute unit 251 is 16 × 16 pixels, but the present invention is not limited to this. It should be decided. However, naturally, the number of threads 2512 included in each compute unit 251 is limited.

以上で説明したコンピュートシェーダ機能を有するGPUでの実施形態においては、各コンピュートユニット251が、テクスチャを分割して得られた各分割テクスチャについて並列的に処理し、かつ、各コンピュートユニット251に含まれる各スレッド2512がそれぞれ1画素を担当して、並列的に三角形分割パターンを求め、それらの三角形分割パターンに基づき、三角形分割手法により、並列的に補間を行っているので、高速により滑らかな拡大画像を得ることができる。   In the GPU embodiment having the compute shader function described above, each compute unit 251 processes in parallel each split texture obtained by splitting the texture, and is included in each compute unit 251 Since each thread 2512 takes charge of one pixel each, finds a triangle division pattern in parallel, and performs interpolation in parallel by a triangle division method based on those triangle division patterns, so a high-speed and smooth enlarged image You can get

本発明の画像処理プロセッサにおける画像データ処理方法及びそのプログラムは、例えば、ゲーム機、汎用PC、遊技機、いわゆるスマートフォン等に搭載されるGPUに採用できる。   The image data processing method and the program thereof in the image processing processor of the present invention can be adopted, for example, as a GPU mounted on a game machine, a general-purpose PC, a game machine, a so-called smartphone or the like.

1 CPU
2A、2B GPU
21 頂点シェーダ
22 ラスタライザ
23 ピクセルシェーダ
24 テクスチャフェッチ部
25 コンピュートシェーダ
251 コンピュートユニット
2511 テクスチャフェッチ部
2512 スレッド
2513 共有メモリ
26 ディスパッチャ
3 VRAM
4 フレームバッファ
5 表示部
1 CPU
2A, 2B GPU
Reference Signs List 21 vertex shader 22 rasterizer 23 pixel shader 24 texture fetch unit 25 compute shader 251 compute unit 2511 texture fetch unit 2512 thread 2513 shared memory 26 dispatcher 3 VRAM
4 Frame buffer 5 Display

Claims (9)

入力されるポリゴンの頂点データに基づき、その頂点データに対応する、表示部上で位置を求める頂点シェーダと、
前記頂点シェーダにより求められた前記表示部上での頂点の位置から、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するのに必要な、前記表示部上の画素を求めるラスタライザと、
前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するために、前記ラスタライザから、画素値の必要な前記表示部上の個々の画素の位置の情報が与えられるごとに、当該位置の画素値を、当該位置の所定の周辺のテクスチャ画素の値を補間することにより求めるピクセルシェーダと、
を備えた画像処理プロセッサにおける画像データ処理方法であって、
前記ピクセルシェーダは、当該位置が含まれる、前記テクスチャの画素格子に係る、三角形分割手法における三角形分割パターンを、前記画素格子を構成する画素及びその周辺の画素から決定し、決定された前記三角形分割パターンに基づき前記所定の周辺のテクスチャ画素の値を補間して、当該位置の画素値を求めることを特徴とする画像データ処理方法。
A vertex shader for obtaining a position on the display unit corresponding to the vertex data of the input polygon based on the vertex data of the polygon;
Pixels on the display unit that are necessary for displaying on the display unit an image in which a designated texture is mapped to the polygon from the position of the vertex on the display unit determined by the vertex shader A rasterizer to determine
Each time the rasterizer gives information on the position of each pixel on the display unit for which a pixel value is required, in order to display on the display unit an image in which a designated texture is mapped to the polygon. A pixel shader which obtains the pixel value of the position by interpolating the values of texture pixels around predetermined positions of the position;
A method of processing image data in an image processing processor comprising:
The pixel shader determines a triangle division pattern in a triangle division method according to the texture grid of pixels including the position, from the pixels constituting the pixel grid and the peripheral pixels thereof, and is determined A method of processing image data comprising: interpolating values of the predetermined surrounding texture pixels based on a pattern to obtain pixel values at the corresponding positions.
前記ピクセルシェーダは、前記三角形分割パターンを決定する際に、前記画素格子を構成する画素及びその周辺の画素の各値について、低域濾過フィルタを施しつつ勾配値を求めることを特徴とする請求項1に記載の画像データ処理方法。   The pixel shader is characterized in that, when determining the triangle division pattern, gradient values are obtained while performing low-pass filtering for each value of pixels constituting the pixel grid and pixels in the periphery thereof. The image data processing method according to 1. 前記ピクセルシェーダは、前記三角形分割パターンを決定する際に、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンと、当該画素格子の上下左右の格子に係る前記三角形分割パターンとを仮決定し、仮決定された、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンと、当該画素格子の上下左右の格子に係る前記三角形分割パターンとが不整合の場合には、整合させることにより、当該位置が含まれる、前記テクスチャの画素格子に係る前記三角形分割パターンを最終決定することを特徴とする請求項1に記載の画像データ処理方法。   The pixel shader determines, when determining the triangle division pattern, the triangle division pattern according to the pixel grid of the texture, which includes the position, and the triangle division pattern according to the top, bottom, left, and right grids of the pixel grid. If the triangle division pattern according to the pixel grid of the texture, which has been temporarily determined and temporarily determined, includes the position, and the triangle division pattern according to the grid above, below, left and right of the pixel grid is mismatched The image data processing method according to claim 1, wherein the triangle division pattern of the texture pixel grid including the position is finally determined by matching. 入力されるポリゴンの頂点データに基づき、その頂点データに対応する、表示部上で位置を求める頂点シェーダ処理と、
前記頂点シェーダ処理により求められた前記表示部上での頂点の位置から、前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するのに必要な、前記表示部上の画素を求めるラスタライザ処理と、
前記ポリゴンに、指定されたテクスチャがマッピングされた画像を、前記表示部に表示するために、前記ラスタライザ処理から、画素値の必要な前記表示部上の個々の画素の位置の情報が与えられるごとに、当該位置の画素値を、当該位置の所定の周辺のテクスチャ画素の値を補間することにより求めるピクセルシェーダ処理と、
を有し、画像処理プロセッサにレンダリング処理を行わせる画像データ処理プログラムであって、
前記ピクセルシェーダ処理は、当該位置が含まれる、前記テクスチャの画素格子に係る、三角形分割手法における三角形分割パターンを、前記画素格子を構成する画素及びその周辺の画素から決定し、決定された前記三角形分割パターンに基づき前記所定の周辺のテクスチャ画素の値を補間して、当該位置の画素値を求めることを特徴とする画像データ処理プログラム。
Vertex shader processing for obtaining a position on the display unit corresponding to the vertex data based on vertex data of the input polygon;
From the position of the vertex on the display unit obtained by the vertex shader processing, it is necessary to display on the display unit an image in which the specified texture is mapped to the polygon, on the display unit Rasterizer processing to determine pixels,
Every time the rasterizer processing provides information on the position of each pixel on the display unit for which a pixel value is required, in order to display on the display unit an image in which a designated texture is mapped to the polygon. A pixel shader process for determining the pixel value of the position by interpolating the values of texture pixels around predetermined positions of the position;
And an image data processing program for causing an image processing processor to perform rendering processing,
The pixel shader process determines a triangle division pattern in a triangle division method according to the texture grid of pixels including the position, from the pixels constituting the grid of pixels and the pixels in the periphery thereof An image data processing program comprising: interpolating values of the predetermined surrounding texture pixels based on a division pattern; and determining a pixel value at the position.
複数のコンピュートユニットを有したコンピュートシェーダを備え、レンダリング処理を行う画像処理プロセッサにおける画像データ処理方法であって、
各コンピュートユニットは、
テクスチャを分割した各分割テクスチャを担当して並列的に処理するものであって、プログラムにより並列的に動作する複数のスレッドを有し、
前記複数のスレッドを利用して、前記分割テクスチャを構成する各画素の値から、各画素により構成される各格子のうちの所定数の格子について、三角形分割手法で使用する三角形分割パターンを一括で決定し、
ポリゴンに前記テクスチャがマッピングされた画像を表示部に表示するために、拡大した画像を格納するバッファ上の画素の位置に対応する前記所定数の格子上の位置を求め、
各格子に含まれる前記位置に係る前記表示部上の画素の値を、各格子に対応する各スレッドを利用して、各格子に対して決定された前記三角形分割パターンに基づき当該分割テクスチャにおける周辺の画素の値を補間して求めることを特徴とする画像データ処理方法。
A method of processing image data in an image processing processor, comprising a compute shader having a plurality of compute units, which performs rendering processing,
Each compute unit is
It takes charge of each divided texture which divided the texture and processes it in parallel, and has a plurality of threads operated in parallel by the program,
From the value of each pixel making up the divided texture using the plurality of threads, for a predetermined number of lattices in each lattice made up of each pixel, a triangular division pattern used in the triangular division method is collectively Decide
In order to display on the display unit an image in which the texture is mapped to a polygon, positions on the predetermined number of grids corresponding to positions of pixels on a buffer storing the enlarged image are obtained.
The value of the pixel on the display unit according to the position included in each grid is used in each of the threads corresponding to each grid, based on the triangle division pattern determined for each grid, in the periphery of the divided texture. An image data processing method characterized by interpolating the pixel values of
前記複数のスレッドは、前記三角形分割パターンを一括で決定する際に、処理の過程で得られた値を、前記複数のスレッドに共通のメモリに格納しつつ処理を行うことを特徴とする請求項5に記載の画像データ処理方法。   The plurality of threads perform processing while storing values obtained in the course of processing in a memory common to the plurality of threads when collectively determining the triangle division pattern. 5. The image data processing method according to 5. 前記各コンピュートユニットは、前記複数のスレッドを利用して前記三角形分割パターンを一括で決定する際に、各格子を構成する画素及びその周辺の画素の各値について、低域濾過フィルタを施しつつ勾配値を求め、
当該フィルタ処理により、利用する前記分割テクスチャの画素数に対して、得られる前記三角形分割パターンの数が減じてしまう分、前記各コンピュートユニットに、前記各分割テクスチャの境界部分が重複して割り当てられることを特徴とする請求項5に記載の画像データ処理方法。
When each of the compute units collectively determines the triangle division pattern using the plurality of threads, gradients are applied while low-pass filtering is performed on the values of pixels constituting each grid and pixels in the periphery thereof. Find the value,
Since the number of obtained triangle division patterns is reduced with respect to the number of pixels of the divided textures to be used by the filtering process, the boundaries of the divided textures are redundantly allocated to the respective compute units. The image data processing method according to claim 5, characterized in that:
前記各コンピュートユニットは、前記複数のスレッドを利用して前記三角形分割パターンを一括で決定する際に、各スレッドに対応する格子に係る前記三角形分割パターンと、当該格子の上下左右の格子に係る前記三角形分割パターンとを仮決定し、仮決定された、当該スレッドに対応する格子に係る前記三角形分割パターンと、当該格子の上下左右の格子に係る前記三角形分割パターンとが不整合の場合には、整合させることにより、当該スレッドに対応する格子に係る前記三角形分割パターンを最終決定することを特徴とする請求項5に記載の画像データ処理方法。   When each of the compute units collectively determines the triangle division pattern using the plurality of threads, the triangle division pattern according to a grid corresponding to each thread and the grid according to upper, lower, left, and right grids of the grid If the triangle division pattern of the lattice corresponding to the thread, which is temporarily determined with the triangle division pattern, and the triangle division pattern of the upper, lower, left, and right lattices of the lattice mismatch, The image data processing method according to claim 5, wherein the triangle division pattern of the lattice corresponding to the thread is finally determined by matching. 各々が複数の並列動作可能なスレッドを有する、複数の並列動作可能なコンピュートユニットを備えた画像処理プロセッサに、ポリゴンで構成される三次元モデルの情報と貼られるべきテクスチャの情報に基づきレンダリング処理を行わせる画像データ処理プログラムであって、
前記テクスチャを複数に分割した分割テクスチャの各々を前記各コンピュートユニットに割り当てる処理と、
前記複数のスレッドに、前記分割テクスチャを構成する各画素の値から、各画素により構成される各格子のうちの所定数の格子について、三角形分割手法で使用する三角形分割パターンを一括で決定させる処理と、
前記ポリゴンに前記テクスチャがマッピングされた画像を表示部に表示するために、拡大した画像を格納するバッファ上の画素の位置に対応する前記所定数の格子上の位置を求める処理と、
各格子に対応する各スレッドに、各格子に含まれる前記位置に係る前記表示部上の画素の値を、各格子に対して決定された前記三角形分割パターンに基づき当該分割テクスチャにおける周辺の画素の値を補間して求めさせる処理を有することを特徴とする画像データ処理プログラム。
An image processing processor comprising a plurality of parallel operable compute units each having a plurality of parallel operable threads, rendering processing based on information of a three-dimensional model composed of polygons and information of a texture to be attached An image data processing program to be executed,
Assigning each of the divided textures obtained by dividing the texture into a plurality to each of the compute units;
Process of causing the plurality of threads to collectively determine a triangle division pattern to be used in a triangle division method from a value of each pixel constituting the divided texture, for a predetermined number of lattices among the lattices constituted by each pixel When,
A process of determining positions on the predetermined number of grids corresponding to positions of pixels on a buffer storing an enlarged image, in order to display an image in which the texture is mapped to the polygon on a display unit;
In each thread corresponding to each grid, the value of the pixel on the display unit according to the position included in each grid is calculated based on the triangle division pattern determined for each grid, of surrounding pixels of the divided texture. An image data processing program comprising processing for interpolating and obtaining values.
JP2016165442A 2016-08-26 2016-08-26 Image data processing method in image processing processor and program thereof Active JP6424329B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016165442A JP6424329B2 (en) 2016-08-26 2016-08-26 Image data processing method in image processing processor and program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016165442A JP6424329B2 (en) 2016-08-26 2016-08-26 Image data processing method in image processing processor and program thereof

Publications (2)

Publication Number Publication Date
JP2018032301A JP2018032301A (en) 2018-03-01
JP6424329B2 true JP6424329B2 (en) 2018-11-21

Family

ID=61303530

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016165442A Active JP6424329B2 (en) 2016-08-26 2016-08-26 Image data processing method in image processing processor and program thereof

Country Status (1)

Country Link
JP (1) JP6424329B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7154706B2 (en) 2018-12-18 2022-10-18 アール・ビー・コントロールズ株式会社 Electronics

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163790A (en) * 2018-06-11 2019-08-23 腾讯科技(深圳)有限公司 Image processing method, device, system, storage medium and computer equipment
CN114782611B (en) * 2022-06-24 2022-09-20 北京飞渡科技有限公司 Image processing method, image processing apparatus, storage medium, and electronic device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002342780A (en) * 2001-05-15 2002-11-29 Namco Ltd Image generating system and image generating method and information storage medium
JP5712387B2 (en) * 2012-05-31 2015-05-07 株式会社アクセル Image display processing method and image display processing apparatus
JP5712386B2 (en) * 2012-05-31 2015-05-07 株式会社アクセル Image display processing method and image display processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7154706B2 (en) 2018-12-18 2022-10-18 アール・ビー・コントロールズ株式会社 Electronics

Also Published As

Publication number Publication date
JP2018032301A (en) 2018-03-01

Similar Documents

Publication Publication Date Title
JP6903183B2 (en) Changes in effective resolution based on screen position in graphics processing by approximating the projection of vertices on a curved viewport
EP3559914B1 (en) Foveated rendering in tiled architectures
KR102101626B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
KR102046616B1 (en) Graphics processing enhancement by tracking object and/or primitive identifiers
KR101687520B1 (en) Target independent stenciling in graphics processing
JP4327105B2 (en) Drawing method, image generation apparatus, and electronic information device
KR101145260B1 (en) Apparatus and method for mapping textures to object model
JP2010102713A (en) Method of and apparatus for processing computer graphics
US7843463B1 (en) System and method for bump mapping setup
JP2017517056A (en) Effective construction method of high resolution display buffer
KR102278147B1 (en) Clipping of graphics primitives
KR20200035467A (en) Variable rate shading
JP6424329B2 (en) Image data processing method in image processing processor and program thereof
TW201706962A (en) Graphics processing
TW201234314A (en) Micropolygon splatting
KR20170031479A (en) Method and apparatus for performing a path stroke
US20230298212A1 (en) Locking mechanism for image classification
US10339704B2 (en) Image data processing method in image processor and computer readable medium storing program therefor for rendering a texture based on a triangulation pattern
JP5587132B2 (en) Image processing apparatus and image processing method
KR101227155B1 (en) Graphic image processing apparatus and method for realtime transforming low resolution image into high resolution image
JP4691494B2 (en) Image drawing apparatus, vertex selection method, vertex selection program, and integrated circuit
JP2011028641A (en) Image processing device and image processing method
US20230298133A1 (en) Super resolution upscaling
JP4766576B2 (en) Drawing method, image generation apparatus, and electronic information device
JP5712385B2 (en) Image display processing apparatus and image display processing method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180823

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180921

R150 Certificate of patent or registration of utility model

Ref document number: 6424329

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