JP2006127368A - Graphics rendering device with gamma correction function based on depth value - Google Patents
Graphics rendering device with gamma correction function based on depth value Download PDFInfo
- Publication number
- JP2006127368A JP2006127368A JP2004317854A JP2004317854A JP2006127368A JP 2006127368 A JP2006127368 A JP 2006127368A JP 2004317854 A JP2004317854 A JP 2004317854A JP 2004317854 A JP2004317854 A JP 2004317854A JP 2006127368 A JP2006127368 A JP 2006127368A
- Authority
- JP
- Japan
- Prior art keywords
- value
- gamma correction
- color
- pixel
- brightness
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Image Generation (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
【課題】より簡単に3次元的な明るさの調節を行うことのできるグラフィックス描画装置を安価に提供すること。従来の照度計算では演算コストが高く、高速に処理するためにはハードウェアリソースが増大してしまうという課題があった。また、光源の位置やマテリアルなどのパラメータの設定が煩雑で、ユーザーが手軽に明るさをプログラムするということが容易ではなく、明るさのプログラマブル性が低いという課題があった。
【解決手段】複数のガンマ補正曲線を設定するためのルックアップテーブルを備え、各画素の奥行き値(Z値)に応じて、前記ルックアップテーブルによりガンマ補正が適用された複数のカラー値のうちの1つを選択することにより、Z値に応じた明るさの調節を行う。
【選択図】図1To provide a graphics drawing apparatus capable of adjusting three-dimensional brightness more easily at low cost. The conventional illuminance calculation has a problem that the calculation cost is high, and hardware resources are increased for high-speed processing. Further, setting parameters such as the position of the light source and the material is complicated, and it is not easy for the user to easily program the brightness, and there is a problem that the brightness is not programmable.
A lookup table for setting a plurality of gamma correction curves is provided, and a plurality of color values to which gamma correction is applied by the lookup table according to the depth value (Z value) of each pixel. By selecting one of these, the brightness is adjusted according to the Z value.
[Selection] Figure 1
Description
本発明は、コンピュータグラフィックス技術に関し、特に3次元グラフィックス描画において、従来よりも簡単な方法で、奥行き感のあるリアルな画像を生成するための技術に関する。 The present invention relates to a computer graphics technique, and more particularly to a technique for generating a real image with a sense of depth in a three-dimensional graphics drawing by a simpler method than before.
一般的な3次元グラフィックス描画では、仮想的な3次元空間内に配置された複数の多角形(ポリゴン)からなる複数のオブジェクトを、観測者の視線に垂直な2次元平面(スクリーン)上に投影することによって行われる。このとき、観測者から見てポリゴンの前後関係が正しくなるようにするために、ポリゴンの陰面消去が一般的に行われる。ポリゴンの陰面処理の方法としては、Zバッファ法が広く用いられている。Zバッファ法では、ディスプレイの画素数分のカラー値を格納するカラーバッファの他に、ディスプレイの画素数分の奥行き値(Z値)を格納するZバッファを用いる。Zバッファには、すでに描画済みの、視点から最も近い位置にあるオブジェクトのZ値を格納しておき、画素単位でこのZバッファのZ値と、これから描画しようとするポリゴンのZ値とを比較することによって、Z値が小さいポリゴンの画素だけを描画することにより陰面消去を行う。 In general three-dimensional graphics drawing, a plurality of objects composed of a plurality of polygons (polygons) arranged in a virtual three-dimensional space are placed on a two-dimensional plane (screen) perpendicular to the observer's line of sight. This is done by projecting. At this time, the hidden surface removal of the polygon is generally performed so that the context of the polygon is correct as viewed from the observer. The Z buffer method is widely used as a polygon hidden surface processing method. In the Z buffer method, a Z buffer that stores depth values (Z values) corresponding to the number of pixels of the display is used in addition to color buffers that store color values corresponding to the number of pixels of the display. The Z buffer stores the Z value of the object that has already been drawn and is closest to the viewpoint, and compares the Z value of this Z buffer with the Z value of the polygon to be drawn in pixel units. By doing so, the hidden surface removal is performed by drawing only the pixels of the polygon having a small Z value.
Zバッファを用いて3次元オブジェクトの陰面消去が行われる様子を、図2および図3を用いて説明する。図2(A)は3次元空間内に配置された2個のポリゴン201および202が、スクリーン200上に投影される様子を示している。ポリゴン203は、ポリゴン201がスクリーン200上に投影された図形を示しており、ポリゴン204は、ポリゴン202がスクリーン200上に投影された図形を示している。図2(B)は、Zバッファによる描画を示す図であって、図2(A)のスクリーン200上に表示された2個のポリゴン203および204が、ZバッファのZ値とポリゴンのZ値の比較によって、画素ごとに陰面消去しながら描画された結果を示している。図3は、Zバッファを用いて、より多くのポリゴンからなるオブジェクトの陰面消去を行った例である。図3(A)は、奥行きのある部屋オブジェクト301の中で、多数の細かいポリゴンからなる球状のオブジェクト302および303が宙に浮かんでいるシーンを描画する様子を示している。図3(B)は、スクリーン300上に投影された描画結果を示している。以上のように、Zバッファを用いることで、より複雑な3次元画像を生成することが可能である。
The manner in which hidden surface removal of a three-dimensional object is performed using a Z buffer will be described with reference to FIGS. FIG. 2A shows how two
しかしながら、単にZバッファを用いてポリゴンを陰面消去するだけでは、実写のようなリアル感を得ることは難しい。なぜなら、3次元空間内に配置されているオブジェクトの明るさの3次元的な広がりが考慮されていないからである。すなわち、ポリゴンの頂点や画素についているカラー値が見た目に不自然であるため、実写に比べてリアリティに欠けてしまうからである。そこで、よりリアリティの高いグラフィックス画像が求められる用途では、3次元的な明るさの広がりを持たせる手段として、3次元空間内に仮想的な光源を配置して、ポリゴンの頂点あるいは画素ごとに照度値を計算することが一般的に行われている。例えば図4は、オブジェクトの配置が図3と同じ状況において、仮想的な点光源400を配置することにより、オブジェクトに明るさの強弱をつけ、3次元的な視覚効果を高める様子を示している。
However, it is difficult to obtain a real feeling like a live-action by simply removing the hidden surface of the polygon using the Z buffer. This is because the three-dimensional spread of the brightness of the objects arranged in the three-dimensional space is not considered. That is, the color values attached to the vertices and pixels of the polygon are unnatural to the eye, and thus lack the reality compared to the actual image. Therefore, in applications where a more realistic graphics image is required, a virtual light source is arranged in a three-dimensional space as a means of giving a three-dimensional brightness spread, and is applied to each vertex or pixel of a polygon. It is common practice to calculate the illuminance value. For example, FIG. 4 shows how the virtual
文献(OpenGL Specification 1.3)によれば、照度値の計算式は次式で表される。 According to the literature (OpenGL Specification 1.3), the formula for calculating the illuminance value is represented by the following formula.
上式の照度計算はRGBカラーごとに行われる。上式において、ME、MA、MD、MSはポリゴンの材質(マテリアル)に関するパラメータであって、それぞれエミッションカラー、アンビエントカラー、ディフューズカラー、スペキュラーカラーを示す。CAは全体環境(シーン)のアンビエントカラーである。記号Σは、複数の光源(i)について加算することを示している。LA(i)、LD(i)、LS(i)はそれぞれ光源(i)のアンビエント強度、ディフューズ強度、スペキュラー強度である。Att(i)およびSpot(i)は、光源(i)に関する減衰項およびスポットライト項であり、Dc(i)およびSc(i)は、光源(i)に関するディフューズ項およびスペキュラー項である。これらの各項は、光源(i)とポリゴンの頂点または画素の相互関係から求められる。すなわち、3次元空間における光源(i)の位置ベクトルと、ポリゴンの頂点または画素の位置ベクトルまたは法線ベクトルを用いて、ベクトルの内積計算や指数計算を行うことにより求められる値である。このように、3次元空間において、オブジェクトに相対して光源を配置し、ポリゴンの頂点あるいは画素ごとに照度値を求めることによって、3次元的な明るさの強弱をつけることができ、より実写に近いリアルな3次元グラフィックス画像を生成することができる。 The above illuminance calculation is performed for each RGB color. In the above equation, ME, MA, MD, and MS are parameters relating to the material of the polygon, and indicate the emission color, ambient color, diffuse color, and specular color, respectively. CA is the ambient color of the entire environment (scene). The symbol Σ indicates that addition is performed for a plurality of light sources (i). LA (i), LD (i), and LS (i) are the ambient intensity, diffuse intensity, and specular intensity of the light source (i), respectively. Att (i) and Spot (i) are the attenuation and spotlight terms for light source (i), and Dc (i) and Sc (i) are the diffuse and specular terms for light source (i). Each of these terms is obtained from the interrelationship between the light source (i) and the vertexes or pixels of the polygon. That is, it is a value obtained by calculating the inner product of the vector or calculating the exponent using the position vector of the light source (i) in the three-dimensional space and the position vector or normal vector of the vertex or pixel of the polygon. In this way, in a three-dimensional space, by arranging a light source relative to an object and obtaining an illuminance value for each vertex or pixel of a polygon, the intensity of the three-dimensional brightness can be added, making it more realistic. A near real 3D graphics image can be generated.
上記の照度計算の他に、3次元的な視覚効果を与える手段として、フォグが知られている。上記の文献によれば、フォグの計算式は次式で表される。 In addition to the above illuminance calculation, fog is known as a means for giving a three-dimensional visual effect. According to the above literature, the fog calculation formula is expressed by the following formula.
上式のフォグ計算はRGBカラーごとに行われる。Ciは入力されるポリゴンの頂点または画素のカラー値であり、Cfはフォグカラーである。fはこれら2つのカラーを混合する際のブレンド係数であって、ポリゴンの頂点または画素の位置から視点までの距離(Z値)の関数である。一般的なフォグのブレンド係数はZ値について減少関数であって、視点から遠くなるほどフォグカラーCfの割合が多くなり、視点に近くなるほど入力カラーCiの割合が多くなる。すなわち、視点から遠い位置にあるポリゴンは、フォグ(霧)がかかったような、ぼやけた感じの色になる。このようにフォグは、遠くの位置にあるオブジェクトをぼかす手法(被写界深度)の1つであって、照度計算のような3次元的に明るさの強弱を求めるものではない。 The above fog calculation is performed for each RGB color. Ci is the color value of the vertex or pixel of the input polygon, and Cf is the fog color. f is a blending coefficient for mixing these two colors, and is a function of the distance (Z value) from the vertex or pixel position of the polygon to the viewpoint. The general fog blend coefficient is a decreasing function with respect to the Z value, and the ratio of the fog color Cf increases as the distance from the viewpoint increases, and the ratio of the input color Ci increases as the distance from the viewpoint increases. That is, the polygon far from the viewpoint has a blurry color as if fog (fog) is applied. As described above, fog is one of the methods (depth of field) for blurring an object located at a far position, and does not calculate brightness intensity three-dimensionally like illuminance calculation.
さらに別の方法として、特許文献1に、インデックスカラー・テクスチャ用のルックアップテーブル(LUT)に、あらかじめ不透明度(α値)を格納しておき、前記LUTのインデックスとしてZ値を設定してα値を引き、前記α値に応じてアルファブレンドを行う方法が公開されている。この方法についてもフォグと同様、視点から遠い位置にあるポリゴンをぼかすものであって、照度計算のような3次元的に明るさの強弱を求めるものではない。
3次元グラフィックス描画において、オブジェクトに3次元的な明るさの広がりを与えるという目的に対し、従来の方法では以下のような課題がある。すなわち、光源の配置による照度計算は、(数1)に示されるように、演算コストが非常に高く、高速に処理するためにはハードウェアリソースが増大してしまうという課題があった。また、光源の位置やマテリアルなどのパラメータの設定が煩雑で、ユーザーが手軽に明るさをプログラムするということが容易ではない、すなわち、明るさのプログラマブル性が低いという課題があった。 In the three-dimensional graphics drawing, the conventional method has the following problems for the purpose of giving the object a three-dimensional brightness spread. In other words, the illuminance calculation based on the arrangement of the light sources has a problem that the calculation cost is very high as shown in (Equation 1), and hardware resources are increased for high-speed processing. Further, the setting of parameters such as the position of the light source and the material is complicated, and it is not easy for the user to easily program the brightness, that is, there is a problem that the brightness is not programmable.
また、フォグや、Z値をインデックスとしてLUTからα値を求めてアルファブレンドを行う方法については、Z値に応じてオブジェクトをぼかすことはできるが、3次元空間内の明るさの調節を行うことはできないので、上記の課題を解決するものではない。 As for the method of performing alpha blending by obtaining the α value from the LUT using fog or the Z value as an index, the object can be blurred according to the Z value, but the brightness in the three-dimensional space is adjusted. Can not solve the above problems.
上記の課題を解決するために、本発明では以下の手段を講じた。すなわち、各画素のカラー値を変換するためのガンマ補正手段を複数備え、各画素の奥行き値に応じて前記複数のガンマ補正手段から出力された複数のカラー値のうちの1つを選択し、前記選択されたカラー値を前記画素のカラー値とすることにより、前記奥行き値に応じた明るさ調節を行う。 In order to solve the above problems, the present invention takes the following measures. That is, a plurality of gamma correction means for converting the color value of each pixel, and selecting one of the plurality of color values output from the plurality of gamma correction means according to the depth value of each pixel, Brightness adjustment according to the depth value is performed by using the selected color value as the color value of the pixel.
あるいは、各画素のカラー値を変換するためのガンマ補正手段を複数備え、各画素の奥行き値に応じて前記複数のガンマ補正手段から出力された複数のカラー値のうちの2つを選択し、前記選択された2つのカラー値を前記奥行き値を用いて線形補間し、前記線形補間されたカラー値を前記画素のカラー値とすることにより、前記奥行き値に応じた明るさ調節を行う。 Alternatively, a plurality of gamma correction means for converting the color value of each pixel, and selecting two of the plurality of color values output from the plurality of gamma correction means according to the depth value of each pixel, The selected two color values are linearly interpolated using the depth value, and the linearly interpolated color value is used as the color value of the pixel, thereby adjusting the brightness according to the depth value.
あるいは、各画素のカラー値を変換するためのガンマ補正手段を複数備え、各画素のスクリーン座標および奥行き値に応じて前記複数のガンマ補正手段から出力された複数のカラー値のうちの1つを選択し、前記選択されたカラー値を前記画素のカラー値とすることにより、前記スクリーン座標および前記奥行き値に応じた明るさ調節を行う。 Alternatively, a plurality of gamma correction means for converting the color value of each pixel are provided, and one of the plurality of color values output from the plurality of gamma correction means according to the screen coordinate and depth value of each pixel is obtained. The brightness is adjusted according to the screen coordinates and the depth value by selecting and using the selected color value as the color value of the pixel.
本発明によれば、ユーザーが奥行きに応じたガンマ補正曲線を自由に、かつ簡単に設定できるので、3次元空間内の明るさのプログラマブル性の高いという効果がある。また本発明によれば、従来の照度計算に比べて演算コストが低く、より少ないハードウェアリソースにより高速に処理することが可能であるという効果がある。 According to the present invention, since the user can freely and easily set a gamma correction curve corresponding to the depth, there is an effect that the brightness in the three-dimensional space is highly programmable. Further, according to the present invention, the calculation cost is lower than that of the conventional illuminance calculation, and it is possible to perform high-speed processing with fewer hardware resources.
また、Z値に応じたガンマ補正が画質的にもたらす効果としては、例えば、Z値が大きくなるほど入力階調に対する出力階調の比が小さくなるように複数のガンマ補正曲線を設定すれば、遠い位置の画素ほど、すべての階調について全体的に暗くなるという視覚効果を生み出すことができる。また、Z値が小さくなるほど非線形性の度合いが大きくなるようにるガンマ補正曲線を設定すれば、近い位置の画素ほど、中間調付近で明るい階調はより明るくなり、暗い階調はより暗くなり、したがってコントラストが大きくなるという視覚効果を生み出すことができる。結果として、Z値の大きい画素と小さい画素では、ガンマ補正曲線、すなわち明るさやコントラストに差が生じて奥行き感がより一層得られるので、よりリアルな3次元グラフィックス画像を得ることができるという効果がある。 In addition, as an effect of gamma correction according to the Z value in terms of image quality, for example, if a plurality of gamma correction curves are set so that the ratio of the output gradation to the input gradation becomes smaller as the Z value becomes larger, it is farther away. It is possible to produce a visual effect that the pixel at the position becomes darker overall for all gradations. In addition, if a gamma correction curve is set so that the degree of nonlinearity increases as the Z value decreases, the closer the pixel is, the brighter the gradation near the halftone and the darker the gradation becomes darker. Therefore, it is possible to produce a visual effect that the contrast is increased. As a result, a gamma correction curve, that is, a difference in brightness and contrast is generated between the pixel having a large Z value and the pixel having a small Z value, and a sense of depth is further obtained, so that a more realistic three-dimensional graphics image can be obtained. There is.
以下、本発明の実施の形態について、図面を参照しながら説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
(実施の形態1)
図1に本発明の実施の形態1における構成を示す。図1において、入力カラーCinがガンマ補正部100に入力されている。ガンマ補正部100は、4個のルックアップテーブルLUT0〜LUT3により構成され、それぞれ異なるガンマ補正曲線があらかじめ設定されている。各ルックアップテーブルには、入力カラーCinがインデックスとして入力され、それぞれインデックスに対応するカラー値、すなわちガンマ補正済みのカラー値を出力する。ここで、入力カラー値Cinを例えば8ビットとすると、ルックアップテーブルのインデックスは8ビットであって、256通りのインデックス値に応じて8ビットのガンマ補正済みカラー値を出力する。なお、本実施の形態の入力カラーCinは、RGBカラー値ではなく、輝度値であるものと仮定する。
(Embodiment 1)
FIG. 1 shows a configuration according to Embodiment 1 of the present invention. In FIG. 1, the input color Cin is input to the
これらのルックアップテーブルLUT0〜LUT3に設定するガンマ補正曲線の例を図5に示す。図5では、LUT0→LUT1→LUT2→LUT3と変化するにつれて、入力階調に対する出力階調の比が小さくなり、かつ非線形性の度合いが小さくなるようなガンマ補正曲線が設定されている。 Examples of gamma correction curves set in these lookup tables LUT0 to LUT3 are shown in FIG. In FIG. 5, a gamma correction curve is set such that the ratio of the output gradation to the input gradation becomes smaller and the degree of nonlinearity becomes smaller as LUT0 → LUT1 → LUT2 → LUT3 changes.
選択信号生成部101は、現在描画しようとしている画素のZ値から、特定の2ビットを抽出するブロックである。抽出された2ビットのZ値は、ガンマ補正曲線選択信号Zselとしてマルチプレクサ102に入力される。なお、ガンマ補正曲線選択信号Zselとしては、Z値の最上位ビットから順に2ビットを抽出するのが最も簡単な構成であるが、任意の連続した2ビットを抽出するような構成にしても良い。例えば、シーンによってはZ値が特定の範囲に偏っている場合もあるので、Z値の最上位の2ビットではなく、さらに下位の2ビットをガンマ補正曲線選択信号Zselとして採用することができる。このような場合は、選択信号生成部101が、Z値のどのビットを抽出するかをあらかじめ設定できるような構成にしておけばよい。
The selection
マルチプレクサ102は、前記ガンマ補正曲線選択信号Zselに応じて、ガンマ補正部100の出力である4つのガンマ補正済みカラーからいずれか1つを選択するブロックである。Zselが”00”の場合は、ルックアップテーブルLUT0の出力が選択され、Zselが”01”の場合は、ルックアップテーブルLUT1の出力が選択され、Zselが”10”の場合は、ルックアップテーブルLUT2の出力が選択され、Zselが”11”の場合は、ルックアップテーブルLUT3の出力が選択される。このように、マルチプレクサ102により、Z値に応じたガンマ補正済みの最終的なカラー値Coutが得られる。
The
図6に、本実施の形態における3次元空間とガンマ補正曲線の対応関係を示す。図6では、奥行きのある部屋オブジェクト601の中に、多数の細かいポリゴンからなる球状のオブジェクト602および603が宙に浮かんでいるシーンを描画することを想定している。このとき、Z値によって区分された4つの領域(A)〜(D)においてそれぞれ描画される画素に対して、図5のガンマ補正曲線(A)〜(D)が適用される。すなわち、オブジェクトを構成する画素のZ値に応じて異なるガンマ補正曲線が適用され、結果として、図7のような3次元グラフィックス画像が生成される。
FIG. 6 shows the correspondence between the three-dimensional space and the gamma correction curve in the present embodiment. In FIG. 6, it is assumed that a scene in which
以上のように、現在描画しようとしている画素のカラー値は、その画素のZ値によって任意のガンマ補正が適用される。これにより、例えば、図5のようにガンマ補正曲線を設定しておけば、Z値が大きくなるほど入力階調に対する出力階調の比が小さくなっているガンマ補正曲線が選択されるので、遠い位置の画素ほど、すべての階調について全体的に暗くなる。また、Z値が小さくなるほど非線形性の度合いが大きくなっているガンマ補正曲線が選択されるので、近い位置の画素ほど、中間調付近で明るい階調はより明るくなり、暗い階調はより暗くなり、したがってコントラストが大きくなる。結果として、Z値の大きい画素と小さい画素では、ガンマ補正曲線、すなわち明るさやコントラストに差が生じて奥行き感がより一層得られるので、よりリアルな3次元グラフィックス画像を得ることができる。 As described above, an arbitrary gamma correction is applied to the color value of the pixel that is currently drawn based on the Z value of the pixel. Accordingly, for example, if a gamma correction curve is set as shown in FIG. 5, a gamma correction curve having a smaller ratio of output gradation to input gradation as the Z value increases is selected. This pixel becomes darker for all gradations as a whole. In addition, since a gamma correction curve with a higher degree of non-linearity is selected as the Z value decreases, the closer the pixel is, the brighter the gradation near the halftone and the darker the gradation becomes darker. Therefore, the contrast is increased. As a result, a pixel having a large Z value and a pixel having a small Z value have a difference in gamma correction curves, that is, brightness and contrast, and a sense of depth is further obtained, so that a more realistic three-dimensional graphics image can be obtained.
なお、本実施の形態ではガンマ補正部100が4つのルックアップテーブルから構成されているが、ルックアップテーブルの個数については、これに限られるものではない。その場合、ルックアップテーブルの数に応じて、ガンマ補正曲線選択信号Zselのビット数が変化するので、選択信号生成部101やマルチプレクサ102を、Zselのビット数に対応させる必要がある。またガンマ補正曲線は、図5の例に限らず、ユーザーが自由に設定できる。例えば、図5とは逆に、Z値が大きいほど明るくしたり、コントラストを大きくしたりすることも可能である。また本実施の形態では、入力カラーCinが、RGBカラー値ではなく輝度値であると仮定したが、RGBカラー値であっても良い。その場合は、RGBごとにガンマ補正を行うために、ルックアップテーブルやマルチプレクサの個数が3倍必要になる。
In the present embodiment, the
(実施の形態2)
図8に本発明の実施の形態2における構成を示す。図8(A)は図1と比較して、ガンマ補正部800に関しては同じものであるが、マルチプレクサ802の出力が2種類存在し、線形補間部803に入力されている点と、選択信号生成部801がガンマ補正曲線選択信号Zselの他に線形補間部803への混ぜ率Zαを出力している点が異なっている。
(Embodiment 2)
FIG. 8 shows a configuration according to the second embodiment of the present invention. 8A is the same as that in FIG. 1 with respect to the
本実施の形態は、2つの異なるルックアップテーブルからの出力を、線形補間部803によりフィルタリングすることによって、色の境目を目立たなくすることを特徴としている。そのような必要性があるのは、図5の4つのガンマ補正曲線の中で、隣り合う2つのガンマ補正曲線の設定値に大きな差がある場合であって、図6の(A−B間)あるいは(B−C間)あるいは(C−D間)の境界付近の画素において、色の段差が出てしまう可能性があるからである。
This embodiment is characterized in that the color boundary is made inconspicuous by filtering outputs from two different look-up tables by a
マルチプレクサ802は、選択信号生成部801からのガンマ補正曲線選択信号Zselにしたがって、ルックアップテーブルLUT0〜LUT3の合計4つの出力から2つを選択する。Zselが”00”の場合は、ルックアップテーブルLUT0およびLUT1の出力が選択され、Zselが”01”の場合は、ルックアップテーブルLUT1およびLUT2の出力が選択され、Zselが”10”の場合は、ルックアップテーブルLUT2およびLUT3の出力が選択され、Zselが”11”の場合は、ルックアップテーブルLUT3の出力のみが選択される。
The
線形補間部803への混ぜ率Zαは、例えばビット幅を8ビットとして、図8(B)のように、Z値のガンマ補正曲線選択信号Zselより下の8ビットを使用することができる。この混ぜ率Zαと、マルチプレクサ802の出力Cm0およびCm1を用いて、以下のようにフィルタリングを行うことができる。
As the mixing ratio Zα to the
なお、本実施の形態ではガンマ補正部800が4つのルックアップテーブルから構成されているが、ルックアップテーブルの個数については、これに限られるものではない。その場合、ルックアップテーブルの数に応じて、ガンマ補正曲線選択信号Zselのビット数が変化するので、選択信号生成部801やマルチプレクサ802を、Zselのビット数に対応させる必要がある。また本実施の形態では、混ぜ率Zαを8ビットとしたが、これ以外であってもよい。また本実施の形態では、入力カラーCinが、RGBカラー値ではなく輝度値であると仮定したが、RGBカラー値であっても良い。その場合は、RGBごとにガンマ補正を行うために、ルックアップテーブルやマルチプレクサ、線形補間部の個数が3倍必要になる。
In the present embodiment, the
(実施の形態3)
上述した実施の形態1および2では、図6のように、Z軸の方向に3次元空間を分割して、ガンマ補正曲線を割り当てたが、本実施の形態では、図9のように、Z軸に限らずX軸およびY軸の方向にも領域を分割して、ガンマ補正曲線を割り当てるものである。あるいは、図10のように、3次元空間の定義された任意のベクトルPの方向に、領域を分割することも可能である。このような場合には、画素のX、Y、Z値からガンマ補正曲線選択信号を生成する必要がある。
(Embodiment 3)
In the first and second embodiments described above, a gamma correction curve is assigned by dividing the three-dimensional space in the Z-axis direction as shown in FIG. 6, but in this embodiment, as shown in FIG. The gamma correction curve is assigned by dividing the region not only in the axis but also in the X-axis and Y-axis directions. Alternatively, as shown in FIG. 10, it is possible to divide the region in the direction of an arbitrary vector P defined in the three-dimensional space. In such a case, it is necessary to generate a gamma correction curve selection signal from the X, Y, and Z values of the pixel.
本実施形態の構成を図11に示す。図11は図1に比べて、選択信号生成部1101への入力が画素のX、Y、Z値となっている点が異なっている。選択信号生成部1101は、2ビットのガンマ補正曲線選択信号selを出力する必要があるが、図9(A)のような領域分割では、Z値とX値からそれぞれ上位のビットを1ビットずつ取ればよく、また図9(B)のような領域分割では、Z値とY値からそれぞれ上位ビットを1ビットずつ取ればよい。
The configuration of the present embodiment is shown in FIG. FIG. 11 differs from FIG. 1 in that the input to the selection
図10のような領域分割では、ベクトルの始点Pの3次元空間座標を(Xp,Yp,Zp)として、次の領域判定関数Fを求め、上位2ビットをガンマ補正曲線選択信号selとして出力すればよい。 In the area division as shown in FIG. 10, the next area determination function F is obtained with the three-dimensional space coordinates of the vector starting point P as (Xp, Yp, Zp), and the upper 2 bits are output as the gamma correction curve selection signal sel. That's fine.
ただし、(数4)において、sqrtは平方根演算を示す。(数4)の計算は多少複雑であって、演算コストが高くなるため、ベクトルPの始点を原点に取ったり、平方根演算を省略することで、選択信号生成部の構成を簡単化することができる。なお、本実施形態では、3次元空間を4つの領域に分割して、異なるガンマ補正曲線を割り当てたが、さらにもっと多くの領域に分割しても良い。 However, in (Equation 4), sqrt represents a square root operation. Since the calculation of (Equation 4) is somewhat complicated and the calculation cost is high, the configuration of the selection signal generation unit can be simplified by taking the starting point of the vector P as the origin or omitting the square root calculation. it can. In the present embodiment, the three-dimensional space is divided into four regions and different gamma correction curves are assigned, but it may be further divided into more regions.
(実施の形態4)
図12、図13および図14に、本発明のZ値によるガンマ補正部を備えたグラフィックス描画装置に関する一実施の形態を示す。図12は、前記グラフィックス描画装置の最上位階層の構成を示し、CPU(中央演算装置)1201、グラフィックスエンジン1202、メモリコントローラ1203、表示コントローラ1204、メモリデバイス1205、表示デバイス1206で構成されている。なお、これらのブロックは別々の半導体で構成されていても良いし、いくつかのブロックをまとめて、1つのシステムLSIとして集積されていても良い。メモリコントローラ1203はメモリデバイス1206を制御し、表示コントローラは1204は表示デバイス1207を制御する。
(Embodiment 4)
FIG. 12, FIG. 13 and FIG. 14 show an embodiment relating to a graphics drawing apparatus having a gamma correction unit based on Z values according to the present invention. FIG. 12 shows the configuration of the highest hierarchy of the graphics drawing apparatus, which is composed of a CPU (Central Processing Unit) 1201, a
グラフィックスエンジン1202は、CPUバス1207を介してCPU1201に接続され、制御されている。また、グラフィックスエンジン1202はメモリバス1208を介してメモリコントローラ1203に接続され、メモリデバイス1205上のデータにアクセスできる。メモリデバイス1205上には、グラフィックスエンジン1202による3次元グラフィックス描画で用いられる、カラーバッファおよびZバッファの画素データ、ディスプレイリスト、テクスチャデータなどが格納されている。なお、メモリアクセスの高速化のために、これらのデータを格納するメモリがグラフィックスエンジン1202の内部に存在していても良い。
The
次に、グラフィックスエンジン1202の内部構成を図13に示す。ホストインターフェース1301はCPUバスに接続され、CPUとの通信を行う。グラフィックスコントローラ1302は、CPUからの命令に従い、グラフィックスパイプライン1304にポリゴン描画データを投入する。前記ポリゴン描画データは、CPUからの命令列に含まれていても良いし、前記メモリデバイス1205上にあるディスプレイリストに含まれていても良い。後者の場合、グラフィックスコントローラ1302は、メモリバスインターフェース1303を介してディスプレイリストをリードし、ポリゴン描画データを取得する。グラフィックスパイプラインは1304は、次の3つの主要なブロックに分かれている。頂点処理部1305は、ポリゴンの頂点ごとに座標変換や照度計算などの処理を行うブロックである。ラスタライザ1307は、ポリゴン内部をピクセル単位で走査し、各ピクセルに対してZ値による陰面処理やテクスチャマッピング、各種ブレンド処理などを行うブロックである。セットアップ部1306はそれら両者の間にあって、頂点処理部1305が出力する座標変換および照度計算済みの3つの頂点データから、ポリゴンの幾何形状やポリゴン内部のカラー値やテクスチャ座標などの傾斜情報などを求め、ラスタライザ1307に入力できるデータ形式に変換する処理を行う。なお、図13は本発明におけるグラフィックスエンジンの構成であるが、一般的なグラフィックスエンジンもほぼ同様の構成であって、本実施の形態を特徴づける構成はラスタライザ1307よりも下層にある。
Next, the internal configuration of the
図14にラスタライザの内部構成を示す。図14において、ピクセル座標生成部1401はポリゴン内部をピクセル単位で走査し、ポリゴン内部に含まれる画素の位置座標(X座標およびY座標)を求める。テクスチャアドレス生成部1402、カラー生成部1403、フォグ生成部1404、Z値生成部1405は、前記位置座標からそれぞれ画素のテクスチャ座標値、カラー値、フォグ値、Z値を求める。テクスチャカラー生成部1406はメモリバスインターフェースを介して外部メモリ(図12のメモリデバイス1205)上にあるテクスチャカラーをリードし、フィルタリングなどの処理を行う。テクスチャカラー生成部1406から出力されるテクスチャカラーは、カラー生成部1403から出力されるカラーとテクスチャ環境演算部1407においてブレンドされた後、フォグ生成部1404から出力されるフォグ値とフォグ演算部1408においてブレンドされ、Z値によるガンマ補正部1409に送られる。なお、テクスチャマッピングを行わない場合は、テクスチャ環境演算部1407はカラー生成部1403から入力されるカラーをそのまま出力することは言うまでもない。フォグを行わない場合もまた同様である。また、図14のラスタライザの内部構成には、フォグ生成部1404およびフォグ演算部1408が含まれるが、これらのブロックが存在しない構成であっても本実施の形態の特徴を損なうものではない。図14において、本実施の形態を特徴づけるブロックは、Z値によるガンマ補正部1409である。このブロックの内部構成は、すでに実施の形態1および2で説明した、図1および図8に示された構成と同様の構成をとる。すなわち、Z値によるガンマ補正部1409は、ガンマ補正曲線を格納できるルックアップテーブルを複数持ち、Z値によって、いずれかのルックアップテーブルの出力を選択するものである。
FIG. 14 shows the internal configuration of the rasterizer. In FIG. 14, a pixel coordinate
なお、前記ルックアップテーブルに関しては、Z値によるガンマ補正部1409とテクスチャカラー生成部1406とで共用できるような構成にしても良い。これは以下のような理由による。従来より、「インデックステクスチャ」というテクスチャのデータ形式が、外部メモリ上のテクスチャデータの容量を小さくする目的で一般的に用いられている。この形式のテクスチャでは、テクスチャカラー生成部1406の内部にルックアップテーブルが必要である。しかしながら、近年の半導体技術の進歩により、メモリバスのバンド幅が向上し、使用可能なメモリ容量が増大する傾向にある。また高画質化の要求から、必ずしもインデックステクスチャを使わなければならないという状況が少なくなってきているのも事実である。したがって、従来のインデックステクスチャと、本発明のZ値によるガンマ補正の2つの用途に対して、同じルックアップテーブルを流用できれば、回路を効率的に使用でき、回路面積の増加も抑えられるという利点がある。
The lookup table may be configured so that it can be shared by the Z-value
ピクセルテスト部1410では、アルファテスト、ステンシルテスト、Zテスト(Z値による陰面処理)などが行われる。Zテストが行われる場合、Z値生成部1405から出力されるZ値と、前記外部メモリからリードされたZ値が比較され、前者が後者よりも小さい(手前にある)と判断された画素だけがこのテストをパスする。ディスティネーションブレンド部1411では、Z値によるガンマ補正部1409からの出力されたガンマ補正済みのカラーと、前記レンダリングバッファからリードされたカラー値が必要に応じてブレンドされる。最終的に、ブレンド処理後のカラー値とZ値生成部1405が生成したZ値が、前記外部メモリにライトされる。
In the
本発明の奥行き値によるガンマ補正機能を備えたグラフィックス描画装置は、グラフィックス描画機能を搭載するさまざまな電子機器、例えば、携帯電話、PDA、デジタルテレビ、カーナビゲーションシステム、家庭用ゲーム機、パーソナルコンピュータ等において用いることができる。 A graphics drawing apparatus having a gamma correction function based on a depth value according to the present invention is a variety of electronic devices equipped with a graphics drawing function, such as a mobile phone, a PDA, a digital TV, a car navigation system, a home game machine, and a personal computer. It can be used in a computer or the like.
100,800,1100 ガンマ補正部
101,801,1101 選択信号生成部
102,802,1102 マルチプレクサ
200,300 スクリーン
201〜204 ポリゴン
301〜303,601〜603 描画オブジェクト
400 光源
803 線形補間部
1201 CPU
1202 グラフィックスエンジン
1203 メモリコントローラ
1204 表示コントローラ
1205 メモリデバイス
1206 表示デバイス
1207 CPUバス
1208 メモリバス
1301 ホストインターフェース
1302 グラフィックスコントローラ
1303 メモリバスインターフェース
1304 グラフィックスパイプライン
1305 頂点処理部
1306 セットアップ部
1307 ラスタライザ
1401 ピクセル座標生成部
1402 テクスチャアドレス生成部
1403 カラー生成部
1404 フォグ生成部
1405 Z値生成部
1406 テクスチャカラー生成部
1407 テクスチャ環境演算部
1408 フォグ演算部
1409 Z値によるガンマ補正部
1410 ピクセルテスト部
1411 ディスティネーションブレンド部
100, 800, 1100
1202
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004317854A JP2006127368A (en) | 2004-11-01 | 2004-11-01 | Graphics rendering device with gamma correction function based on depth value |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004317854A JP2006127368A (en) | 2004-11-01 | 2004-11-01 | Graphics rendering device with gamma correction function based on depth value |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006127368A true JP2006127368A (en) | 2006-05-18 |
Family
ID=36722034
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004317854A Pending JP2006127368A (en) | 2004-11-01 | 2004-11-01 | Graphics rendering device with gamma correction function based on depth value |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006127368A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008033897A (en) * | 2006-06-29 | 2008-02-14 | Matsushita Electric Ind Co Ltd | Image processing apparatus, image processing method, program, recording medium, and integrated circuit |
JP2008112391A (en) * | 2006-10-31 | 2008-05-15 | Fujitsu Ltd | Fog effect processing method, graphics apparatus, graphics semiconductor integrated circuit device, and fog effect processing program |
CN108305578A (en) * | 2017-01-12 | 2018-07-20 | 辛纳普蒂克斯日本合同会社 | For sub-pixel rendering and the system and method for display driver |
-
2004
- 2004-11-01 JP JP2004317854A patent/JP2006127368A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008033897A (en) * | 2006-06-29 | 2008-02-14 | Matsushita Electric Ind Co Ltd | Image processing apparatus, image processing method, program, recording medium, and integrated circuit |
JP2008112391A (en) * | 2006-10-31 | 2008-05-15 | Fujitsu Ltd | Fog effect processing method, graphics apparatus, graphics semiconductor integrated circuit device, and fog effect processing program |
CN108305578A (en) * | 2017-01-12 | 2018-07-20 | 辛纳普蒂克斯日本合同会社 | For sub-pixel rendering and the system and method for display driver |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11069128B2 (en) | Rendering an image from computer graphics using two rendering computing devices | |
JP4291892B2 (en) | Image processing apparatus and method | |
EP1977801B1 (en) | Game machine, game machine control method, and information storage medium | |
JP3626144B2 (en) | Method and program for generating 2D image of cartoon expression from 3D object data | |
JP2004110597A (en) | Image generation information, information storage medium, and image generation device | |
US6927778B2 (en) | System for alpha blending and method thereof | |
JP2007066064A (en) | Image generating device and image generating program | |
EP1355276A2 (en) | System and method for distance adjusted rendering | |
US6833836B2 (en) | Image rendering process for displaying three-dimensional image information on a two-dimensional screen | |
JP2006127412A (en) | Drawing device and drawing method | |
JP2002260007A (en) | Plotting method, plotting device, computer readable recording medium for recording plotting processing program to be executed by computer, program executing device for executing plotting processing program and plotting processing program to be executed by computer | |
KR100453529B1 (en) | APPARATUS AND METHOD FOR DRAWING THREE DIMENSIONAL GRAPHICS BY CONTROLLING α VALUE BASED ON Z COORDINATE VALUE | |
US6744440B1 (en) | Image processing apparatus, recording medium, and program | |
KR20080100854A (en) | A computer readable recording medium on which a rendering processing method, a rendering processing apparatus, and a rendering processing program are recorded. | |
JP2001126086A (en) | Method and device for displaying three-dimensional model in video game, game machine, and computer- readable recording medium storing three-dimensional model displaying program for video game | |
JP3035571B2 (en) | Image processing device | |
JP2006127368A (en) | Graphics rendering device with gamma correction function based on depth value | |
JP2006011539A (en) | Program, information storage medium, and image generation system | |
JP2001283254A (en) | Three-dimensional graphic plotting device and its method | |
KR100603134B1 (en) | 3D Rendering Processing Method Using Monochromatic Light and Its Apparatus | |
US12322030B2 (en) | Computer-readable non-transitory storage medium having image processing program stored therein, image processing apparatus, image processing system, and image processing method | |
JP2015045958A (en) | Display processing unit, display processing method, and program | |
JP4563070B2 (en) | GAME DEVICE AND GAME PROGRAM | |
JP4449582B2 (en) | Image generation device | |
JP2009211243A (en) | Program, information storage medium, and image generation system |