JP2009116550A - Plotting processor, plotting processing method and plotting processing program - Google Patents

Plotting processor, plotting processing method and plotting processing program Download PDF

Info

Publication number
JP2009116550A
JP2009116550A JP2007287908A JP2007287908A JP2009116550A JP 2009116550 A JP2009116550 A JP 2009116550A JP 2007287908 A JP2007287908 A JP 2007287908A JP 2007287908 A JP2007287908 A JP 2007287908A JP 2009116550 A JP2009116550 A JP 2009116550A
Authority
JP
Japan
Prior art keywords
value
unit
texture
change
amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007287908A
Other languages
Japanese (ja)
Other versions
JP5050786B2 (en
Inventor
Masayuki Nakamura
雅之 中村
Makoto Adachi
誠 安達
Takane Yonemoto
たかね 米本
Koji Nishikawa
幸治 西河
Motonobu Mamiya
元信 間宮
Kae Yamashita
香恵 山下
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.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor Ltd
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 Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2007287908A priority Critical patent/JP5050786B2/en
Publication of JP2009116550A publication Critical patent/JP2009116550A/en
Application granted granted Critical
Publication of JP5050786B2 publication Critical patent/JP5050786B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To obtain an image with little distortion, and to simplify an arithmetic operation. <P>SOLUTION: This plotting processor 1 is provided with a first selection part 2; a second selection part 3; and an arithmetic part 4. The first selection part 2 compares variation (du/dx) with variation (dv/dy), and selects the larger value. The second selection part 3 compares variation (du/dy) with variation (dv/dx), and selects the larger value. The arithmetic part 4 considers the value selected by the first selection part 2 and the value selected by the second selection part 3 as perpendicularly crossing two sides of a right triangle, and substantially calculates the value of the oblique side of the right triangle. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は描画処理装置、描画処理方法および描画処理プログラムに関し、特に、ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する描画処理装置、描画処理方法および描画処理プログラムに関する。   The present invention relates to a drawing processing device, a drawing processing method, and a drawing processing program, and more particularly to a drawing processing device, a drawing processing method, and a drawing processing program for acquiring a texture of an optimal size from a texture storage unit that stores a mipmap.

コンピュータグラフィックの3次元描画において写実的な描画を行うために、絵や写真の2次元画像(テクスチャ)を3次元図形の表面に貼り付けることで、質感等の表現力を向上させる手法であるテクスチャマッピング方法が知られている(例えば、特許文献1〜3、非特許文献1参照)。   Texture, which is a technique for improving the expressive power of texture and the like by pasting a two-dimensional image (texture) of a picture or photograph on the surface of a three-dimensional figure to perform realistic drawing in three-dimensional drawing of computer graphics Mapping methods are known (see, for example, Patent Documents 1 to 3 and Non-Patent Document 1).

3次元描画では、描画図形が遠くにあることを表現するために小さく描画したり傾いていることを表現したりするために、図形を変形させて描画する場合がある(例えば、特許文献1参照)。この場合、描画図形と貼り付けるテクスチャのサイズとが一致しないためエイリアシング(aliasing)が発生する。エイリアシングを防ぐために、もとのテクスチャのサイズを縦、横ともに1/2に縮小したテクスチャを繰り返し作成したミップマップ(Mip(Multum In Parvo) Map)を予めテクスチャ記憶部に格納して、最適なサイズのテクスチャを取得するためのLoD(Level of Detail:縮小率)演算を行う(例えば、非特許文献1参照)。   In three-dimensional drawing, there is a case where a figure is deformed and drawn in order to draw a small figure to express that the drawn figure is far away or to express that the figure is inclined (see, for example, Patent Document 1). ). In this case, aliasing occurs because the drawing figure and the size of the texture to be pasted do not match. In order to prevent aliasing, the mipmap (Mipum In Parvo) Map (Mipum In Parvo Map) created by repeatedly reducing the original texture size to 1/2 in both length and width is stored in the texture storage unit in advance, and the optimum A LoD (Level of Detail: reduction ratio) calculation for obtaining a texture of a size is performed (for example, see Non-Patent Document 1).

このテクスチャのLoDは、元の画像がテクスチャマッピングされるときにどの程度縮小しているかを示すものであり、元画像が1/1、1/2、1/4、・・・と縮小しているときLoDとの関係は、次式(1)のようになる(例えば、特許文献1参照)。   The LoD of the texture indicates how much the original image has been reduced when texture mapping is performed. The original image is reduced to 1/1, 1/2, 1/4,. The relationship with LoD is as shown in the following equation (1) (see, for example, Patent Document 1).

1/1:LoD=0
1/2:LoD=1
1/4:LoD=2
1/8:LoD=3

1/ρ:LoD=log2(ρ)・・・(1)
また、ρは、次式(2)で表される。
1/1: LoD = 0
1/2: LoD = 1
1/4: LoD = 2
1/8: LoD = 3
:
1 / ρ: LoD = log 2 (ρ) (1)
Moreover, ρ is expressed by the following equation (2).

Figure 2009116550
Figure 2009116550

ここで、「max[]」は、「括弧([])内のカンマで区切られた数式のうちの大きいほうを選択する」という意味であり、括弧内の(du/dx)、(dv/dx)、(du/dy)、(dv/dy)は、それぞれXY座標における画素(X,Y)に対するテクスチャ座標(U,V)の変化量(変位量)を示しており、例えば変化量(du/dx)は、画素(X,Y)の画素のX軸方向の辺素dxが、テクスチャ座標(U,V)では、U軸方向にuだけ変化していることを示している。従って、XY座標でのdxの変化量は、上記式(2)の括弧内のカンマで区切られた左側の数式となる。dyの変化量は、上記式(2)の括弧内のカンマで区切られた右側の数式となる。
特開2000−155850号公報 特開2001−195602号公報 特表2002−504251号公報 Mark Segal., Kurt Akeley., "The OpenGL Graphics System: A Specification". Version2.1- December1, 2006. P173, Scale Factor and Level of Detail. [retrieved on 2007/11/5] Retrieved from the Internet: <URL: http://www.opengl.org/registry/doc/glspec21.20061201.pdf>
Here, “max []” means “select the larger one of the mathematical expressions delimited by commas in parentheses ([])”, and (du / dx), (dv / dx), (du / dy), and (dv / dy) indicate the amount of change (displacement amount) of the texture coordinates (U, V) with respect to the pixel (X, Y) in the XY coordinates. du / dx) indicates that the edge element dx in the X-axis direction of the pixel of the pixel (X, Y) is changed by u in the U-axis direction in the texture coordinates (U, V). Therefore, the amount of change in dx on the XY coordinates is the left-side mathematical formula delimited by the commas in parentheses in the above formula (2). The amount of change in dy is a mathematical expression on the right side separated by commas in parentheses in the above formula (2).
JP 2000-155850 A JP 2001-195602 A Japanese translation of PCT publication No. 2002-504251 Mark Segal., Kurt Akeley., "The OpenGL Graphics System: A Specification". Version2.1- December1, 2006. P173, Scale Factor and Level of Detail. [Retrieved on 2007/11/5] Retrieved from the Internet: < URL: http://www.opengl.org/registry/doc/glspec21.20061201.pdf>

しかしながら、式(2)では、括弧内の値がどちらかに切り替わる付近では正常なLoDが得られずに、描画した画像に歪みが生じるという問題があった。
画像に歪みが生じる例を示す。
However, in the formula (2), there is a problem that a normal LoD cannot be obtained near the value in the parenthesis is switched to either, and the drawn image is distorted.
An example in which distortion occurs in an image is shown.

図9は、従来の描画方法による図形を示す図である。
図9では、トンネル画像91の中心に視点がある図形を示している。トンネル画像91の中心に視点があるので中心からトンネル画像91の側面は等距離である。トンネル画像91の奥側(画像の中心)になるほど遠近法にて小さくなるためLoDが大きくなる。すなわち、トンネル画像91を構成するテクスチャ92の外側は、LoD=0のテクスチャであり、テクスチャ92は、LoD=1のテクスチャであり、テクスチャ93は、LoD=2のテクスチャであり、テクスチャ94は、LoD=3のテクスチャであり、テクスチャ95は、LoD=4のテクスチャである。
FIG. 9 is a diagram showing a figure by a conventional drawing method.
FIG. 9 shows a figure having a viewpoint at the center of the tunnel image 91. Since the viewpoint is at the center of the tunnel image 91, the side surface of the tunnel image 91 is equidistant from the center. Since it becomes smaller in the perspective as it is closer to the inner side (the center of the image) of the tunnel image 91, LoD becomes larger. That is, the outside of the texture 92 constituting the tunnel image 91 is a texture with LoD = 0, the texture 92 is a texture with LoD = 1, the texture 93 is a texture with LoD = 2, and the texture 94 is The texture is LoD = 3, and the texture 95 is a texture with LoD = 4.

トンネルの側面は中心から等距離なのでLoDで選択されたミップマップの色は同心円を描くはずだが、式(2)に示す「max[]」での値がどちらかに切り替わる付近(図9中、太線で囲んだ部分)では歪みが生じてしまう。   Since the side of the tunnel is equidistant from the center, the color of the mipmap selected by LoD should draw a concentric circle, but in the vicinity where the value at “max []” shown in Equation (2) switches to either (in FIG. 9, Distortion occurs in the portion surrounded by the thick line.

また、式(1)、(2)では、平方根の演算があるため、ハードウェアでの処理が膨大になるという問題があった。
本発明はこのような点に鑑みてなされたものであり、歪みの少ない画像を得ることができる描画処理装置、描画処理方法および描画処理プログラムを提供することを目的とする。
In addition, in the formulas (1) and (2), there is a problem that processing by hardware becomes enormous because there is a square root calculation.
SUMMARY An advantage of some aspects of the invention is that it provides a drawing processing apparatus, a drawing processing method, and a drawing processing program capable of obtaining an image with less distortion.

また、他の目的として演算を容易にすることができる描画処理装置、描画処理方法および描画処理プログラムを提供することを目的とする。   It is another object of the present invention to provide a drawing processing apparatus, a drawing processing method, and a drawing processing program capable of facilitating calculations as other purposes.

本発明では上記問題を解決するために、下記の描画処理装置が提供される。
本発明に係る描画処理装置は、ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する装置である。
In the present invention, in order to solve the above problem, the following drawing processing apparatus is provided.
The drawing processing apparatus according to the present invention is an apparatus that acquires a texture having an optimum size from a texture storage unit that stores a mipmap.

第1の選択部は、画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)と、変化量(dv/dy)とを比較し、大きい方の値を選択する。
第2の選択部は、前述した画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dy)と、変化量(dv/dx)とを比較し、大きい方の値を選択する。
The first selection unit compares the change amount (du / dx) of the texture coordinates (U, V) with respect to the pixel (X, Y) and the change amount (dv / dy), and selects the larger value. .
The second selection unit compares the change amount (du / dy) of the texture coordinate (U, V) with respect to the pixel (X, Y) described above and the change amount (dv / dx), and determines the larger value. select.

演算部は、第1の選択部によって選択された値と第2の選択部によって選択された値とをそれぞれ直角三角形の直角に交わる2辺とみなし、この直角三角形の斜辺の値を実質的に演算する。   The calculation unit regards the value selected by the first selection unit and the value selected by the second selection unit as two sides that intersect the right angle of the right triangle, and substantially determines the value of the hypotenuse of the right triangle. Calculate.

このような描画処理装置によれば、第1の選択部により、変化量(du/dx)、変化量(dv/dy)の大きい方の値が選択される。また、第2の選択部により、変化量(du/dy)、変化量(dv/dx)の大きい方の値が選択される。そして、演算部により、第1の選択部によって選択された値と第2の選択部によって選択された値とがそれぞれ直角三角形の直角に交わる2辺とみなされ、この直角三角形の斜辺の値が実質的に演算される。   According to such a drawing processing device, the first selection unit selects the larger value of the change amount (du / dx) and the change amount (dv / dy). In addition, the second selection unit selects the larger value of the change amount (du / dy) and the change amount (dv / dx). Then, the value selected by the first selection unit and the value selected by the second selection unit are regarded as two sides intersecting at right angles of the right triangle, and the value of the hypotenuse of the right triangle is calculated by the calculation unit. It is virtually calculated.

また、上記課題を解決するために、ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する描画処理方法において、画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)、変化量(dv/dx),変化量(du/dy)、変化量(dv/dy)における、{(du/dx)2+(du/dy)21/2と{(dv/dx)2+(dv/dy)21/2とのうちの大きい方の値を選択する第1のステップと、{(du/dx)2+(dv/dx)21/2と{(du/dy)2+(dv/dy)21/2とのうちの大きい方の値を選択する第2のステップと、第1のステップによって選択された値と第2のステップによって選択された値とのうち大きい方の値を、テクスチャの画素サイズと描画画像の画素サイズとの比率とする第3のステップと、を実質的に含むことを特徴とする描画処理方法が提供される。 Further, in order to solve the above-described problem, in a drawing processing method for obtaining a texture of an optimal size from a texture storage unit storing a mipmap, a change amount of texture coordinates (U, V) with respect to a pixel (X, Y) ( du (dx), change amount (dv / dx), change amount (du / dy), change amount (dv / dy), {(du / dx) 2 + (du / dy) 2 } 1/2 and { A first step of selecting the larger value of (dv / dx) 2 + (dv / dy) 2 } 1/2 and {(du / dx) 2 + (dv / dx) 2 } 1 / 2 and {(du / dy) 2 + (dv / dy) 2 } 1/2 , the second step of selecting the larger value, the value selected by the first step and the second The larger one of the values selected in step, the texture pixel size and the rendered image And a third step of setting the ratio to the pixel size of the drawing.

このような描画処理方法によれば、演算を容易にすることができる。   According to such a drawing processing method, calculation can be facilitated.

本発明によれば、歪みの少ない図形を描画することができる。また、演算を容易にすることができる。   According to the present invention, it is possible to draw a figure with less distortion. Further, the calculation can be facilitated.

以下、本発明の実施の形態を、図面を参照して詳細に説明する。
まず、本発明の概要について説明し、その後、実施の形態を説明する。
図1は、本発明の概要を示す図である。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
First, an outline of the present invention will be described, and then an embodiment will be described.
FIG. 1 is a diagram showing an outline of the present invention.

描画処理装置1は、第1の選択部2と、第2の選択部3と、演算部4とを有している。
以下、テクスチャを貼り付ける図形が写像される座標をXY座標とする単位画素(X,Y)のX軸方向の辺素dxの、図形に貼り付けるテクスチャのUV座標系を構成するU軸方向の変化量を変化量(du/dx)、V軸方向の変化量を変化量(dv/dx)とし、単位画素(X,Y)のY軸方向の辺素dyの、U軸方向の変化量を変化量(du/dy)、V軸方向の変化量を変化量(dv/dy)とする。
The drawing processing apparatus 1 includes a first selection unit 2, a second selection unit 3, and a calculation unit 4.
Hereinafter, the U-axis direction constituting the UV coordinate system of the texture to be pasted to the graphic of the side element dx in the X-axis direction of the unit pixel (X, Y) having the coordinate to which the graphic to be textured is mapped as the XY coordinate The amount of change is the amount of change (du / dx), the amount of change in the V-axis direction is the amount of change (dv / dx), and the amount of change in the Y-axis direction dy of the unit pixel (X, Y) in the U-axis direction Is the amount of change (du / dy), and the amount of change in the V-axis direction is the amount of change (dv / dy).

第1の選択部2は、変化量(du/dx)と変化量(dv/dy)とを比較し、大きい方の値を選択する。
第2の選択部3は、変化量(du/dy)と変化量(dv/dx)とを比較し、大きい方の値を選択する。
The first selection unit 2 compares the change amount (du / dx) and the change amount (dv / dy), and selects the larger value.
The second selection unit 3 compares the change amount (du / dy) with the change amount (dv / dx), and selects the larger value.

演算部4は、第1の選択部2によって選択された値と第2の選択部3によって選択された値とをそれぞれ直角三角形の直角に交わる2辺とみなし、この直角三角形の斜辺の値を実質的に演算する。斜辺の値は、平方根の演算を行って求めてもよいが、近似式を用いて求めるのが好ましい。これにより容易に演算することができる。   The calculation unit 4 regards the value selected by the first selection unit 2 and the value selected by the second selection unit 3 as two sides that intersect each right angle of the right triangle, and determines the value of the hypotenuse of the right triangle. Operate virtually. The value of the hypotenuse may be obtained by calculating the square root, but is preferably obtained using an approximate expression. This makes it easy to calculate.

このような描画処理装置1によれば、第1の選択部2により、変化量(du/dx)および変化量(dv/dy)の大きい方の値が選択される。また、第2の選択部3により、変化量(du/dy)および変化量(dv/dx)の大きい方の値が選択される。そして、演算部4により、第1の選択部2によって選択された値と第2の選択部3によって選択された値とがそれぞれ直角三角形の直角に交わる2辺とみなされ、この直角三角形の斜辺の値が実質的に演算される。   According to such a drawing processing apparatus 1, the first selection unit 2 selects the larger value of the change amount (du / dx) and the change amount (dv / dy). Further, the second selection unit 3 selects the larger value of the change amount (du / dy) and the change amount (dv / dx). Then, the calculation unit 4 regards the value selected by the first selection unit 2 and the value selected by the second selection unit 3 as two sides intersecting at right angles of the right triangle, and the hypotenuse of the right triangle Is substantially calculated.

このような演算手段によって、演算された斜辺の値を用いてLoDを演算することによって、最適なサイズのテクスチャを容易に取得することができる。
以下、本発明の実施の形態を説明する。
By calculating the LoD using the calculated hypotenuse value by such a calculation means, it is possible to easily obtain the texture of the optimum size.
Embodiments of the present invention will be described below.

図2は、描画装置の構成を示すブロック図である。
描画処理装置10は、CPU(Central Processing Unit)20と、GPU(Graphics Processing Unit)30と、外部メモリ40と、モニタ(スクリーン)50とを有している。
FIG. 2 is a block diagram illustrating a configuration of the drawing apparatus.
The drawing processing apparatus 10 includes a CPU (Central Processing Unit) 20, a GPU (Graphics Processing Unit) 30, an external memory 40, and a monitor (screen) 50.

CPU20は、描画したい3次元の物体データの頂点座標(3次元座標)と対応するパラメータとをGPU30に送信する。
GPU30は、ジオメトリ31と、ラスタ化部32と、LoD演算部33と、テクスチャ取得用アドレス生成部34と、ピクセルブレンダ35とを有している。
The CPU 20 transmits the vertex coordinates (three-dimensional coordinates) of the three-dimensional object data to be drawn and the corresponding parameters to the GPU 30.
The GPU 30 includes a geometry 31, a rasterization unit 32, a LoD calculation unit 33, a texture acquisition address generation unit 34, and a pixel blender 35.

ジオメトリ31は、CPU20からの頂点座標と対応するパラメータとを受信する。
ジオメトリ31では、視点の角度にて物体がモニタ50に投影される画像の頂点座標と対応するパラメータとを算出し、ラスタ化部32へ送信する。
The geometry 31 receives the vertex coordinates from the CPU 20 and the corresponding parameters.
In the geometry 31, the vertex coordinates of the image on which the object is projected onto the monitor 50 at the viewpoint angle are calculated and the corresponding parameters are transmitted to the rasterizing unit 32.

ラスタ化部32は、受信した頂点座標に基づいてラスタライズ(rasterize)して各座標(XY座標およびUV座標)を求め、求めた座標のうち、XY座標およびUV座標をLoD演算部33に送信し、UV座標をテクスチャ取得用アドレス生成部34に送信し、XY座標をピクセルブレンダ35に送信する。   The rasterizing unit 32 rasterizes the received vertex coordinates to obtain each coordinate (XY coordinate and UV coordinate), and transmits the XY coordinate and the UV coordinate to the LoD calculation unit 33 among the obtained coordinates. The UV coordinates are transmitted to the texture acquisition address generator 34, and the XY coordinates are transmitted to the pixel blender 35.

LoD演算部33は、XY座標およびUV座標からLoDを求め、テクスチャ取得用アドレス生成部34に送信する。
テクスチャ取得用アドレス生成部34は、UV座標とLoDとに基づいて、テクスチャを取得するためのアドレスを生成し、外部メモリ40に送信する。
The LoD calculation unit 33 obtains LoD from the XY coordinates and the UV coordinates, and transmits the LoD to the texture acquisition address generation unit 34.
The texture acquisition address generation unit 34 generates an address for acquiring a texture based on the UV coordinates and the LoD, and transmits the generated address to the external memory 40.

外部メモリ40は、フレームバッファ41とテクスチャ記憶部42とを有している。
テクスチャ記憶部42は、アドレスを受信するとテクスチャを構成するテクセルを生成し、ピクセルブレンダ35に送信する。
The external memory 40 includes a frame buffer 41 and a texture storage unit 42.
When the texture storage unit 42 receives the address, the texture storage unit 42 generates a texel constituting the texture and transmits the texel to the pixel blender 35.

ピクセルブレンダ35は、テクセルをさまざまな設定にて加工(色を変化させたり、他の色とブレンドしたり)することができ、加工したテクセルをXY座標に対応するフレームバッファ41に書き込む。   The pixel blender 35 can process (change colors or blend with other colors) texels with various settings, and writes the processed texels to the frame buffer 41 corresponding to the XY coordinates.

モニタ50はフレームバッファ41に記憶されている内容を画素表示する。これにより、画像が得られる。
以上のような構成によって、本実施の形態の処理機能を実現することができる。
The monitor 50 displays the contents stored in the frame buffer 41 as pixels. Thereby, an image is obtained.
With the configuration as described above, the processing function of the present embodiment can be realized.

次に、LoD演算部33の構成について詳しく説明する。
LoD演算部33は、従来の(正常なLoD演算が行われていない)式(2)の「max[]」の切り替わりを補うために、「max[]」内の2つの値の大きい方を選択するのではなく、2つの値を直交する2辺とする直角三角形の斜辺の値ρ1を求め、log2(ρ1)を本実施の形態のLoDとする演算を行う。すなわち、直交する2辺を次式(3)、(4)、
Next, the configuration of the LoD calculation unit 33 will be described in detail.
The LoD calculation unit 33 calculates the larger of the two values in “max []” in order to compensate for the switching of “max []” in the conventional equation (2) where normal LoD calculation is not performed. Instead of selecting, the value ρ1 of the hypotenuse of a right triangle having two values orthogonal to each other is obtained, and an operation of setting log 2 (ρ1) to LoD of this embodiment is performed. That is, two orthogonal sides are expressed by the following equations (3), (4),

Figure 2009116550
Figure 2009116550

Figure 2009116550
Figure 2009116550

と定義すると、直角三角形の斜辺の値ρ1は次式(5)で表される。   The value ρ1 of the hypotenuse of a right triangle is expressed by the following equation (5).

Figure 2009116550
Figure 2009116550

また、式(5)に、式(3)、(4)を代入すると次式(6)が得られる。   Further, when Expressions (3) and (4) are substituted into Expression (5), the following Expression (6) is obtained.

Figure 2009116550
Figure 2009116550

このとき、図9に示したように、トンネル画像91の図形のように奥まっていくほど(紙面中央部に向かうほど)変化量が大きくなっていく。これに対して、筒状の外周面に沿う方向は変化量があまり大きくない。そこで、u,vのうち変化量の小さい方を無視することで式(6)から次式(7)、(8)が得られる。   At this time, as illustrated in FIG. 9, the amount of change increases as the depth increases as the figure of the tunnel image 91 increases. On the other hand, the amount of change in the direction along the cylindrical outer peripheral surface is not so large. Therefore, the following equations (7) and (8) are obtained from the equation (6) by ignoring the smaller change amount of u and v.

Figure 2009116550
Figure 2009116550

Figure 2009116550
Figure 2009116550

式(7)と式(8)との大きい方の値を選択する。
ρuv=max[ρu,ρv]・・・(9)
式(2)を式(3)と式(4)とを使用して次式(10)とする。
The larger value of Equation (7) and Equation (8) is selected.
ρuv = max [ρu, ρv] (9)
Formula (2) is changed into Formula (10) below using Formula (3) and Formula (4).

ρxy=max[ρx,ρy]・・・(10)
従来の歪みはLoDが小さいことで生じている。次式(11)に示すように、式(9)と式(10)とにおいて、それぞれ大きい方の値を選択することで、歪みのない画像では式(10)が使用され、歪みがある画像では式(9)が使用されることで、歪みを補正することができる。
ρxy = max [ρx, ρy] (10)
Conventional distortion is caused by low LoD. As shown in the following expression (11), by selecting the larger value in each of the expressions (9) and (10), the expression (10) is used for an image without distortion, and an image with distortion is obtained. Then, distortion can be corrected by using equation (9).

ρ1=max[ρxy,ρuv]・・・(11)
但し、ρxyとρuvとを求めて直接比較しなくても、変化量(du/dx)と変化量(dv/dy)との大小と、変化量(du/dy)と変化量(dv/dx)との大小を比較することで、式(3)、(4)、(7)、(8)のうち最も大きい値を判断することができるため、斜辺の値ρ1を容易に演算することができる。
ρ1 = max [ρxy, ρuv] (11)
However, the magnitude of the change amount (du / dx) and the change amount (dv / dy), the change amount (du / dy), and the change amount (dv / dx) can be obtained without obtaining and directly comparing ρxy and ρuv. )), The largest value among the formulas (3), (4), (7), and (8) can be determined. Therefore, the hypotenuse value ρ1 can be easily calculated. it can.

図3は、LoD演算部の演算アルゴリズムを示すフローチャートである。
まず、変化量(du/dy)が変化量(dv/dx)より大きいか否かを判断する(ステップS1)。
FIG. 3 is a flowchart showing a calculation algorithm of the LoD calculation unit.
First, it is determined whether or not the change amount (du / dy) is larger than the change amount (dv / dx) (step S1).

変化量(du/dy)が変化量(dv/dx)より大きい場合(ステップS1のYes)、変化量(du/dx)が変化量(dv/dy)より大きいか否かを判断する(ステップS2)。   When the amount of change (du / dy) is larger than the amount of change (dv / dx) (Yes in step S1), it is determined whether the amount of change (du / dx) is larger than the amount of change (dv / dy) (step). S2).

変化量(du/dx)が変化量(dv/dy)より大きい場合(ステップS2のYes)、ρ1=ρuとする(ステップS3)。
また、変化量(du/dx)が変化量(dv/dy)以下の場合(ステップS2のNo)、ρ1=ρyとする(ステップS4)。
When the amount of change (du / dx) is larger than the amount of change (dv / dy) (Yes in step S2), ρ1 = ρu is set (step S3).
If the amount of change (du / dx) is equal to or less than the amount of change (dv / dy) (No in step S2), ρ1 = ρy is set (step S4).

一方、ステップS1にて変化量(du/dy)が変化量(dv/dx)以下の場合(ステップS1のNo)、変化量(du/dx)が変化量(dv/dy)より大きいか否かを判断する(ステップS5)。   On the other hand, if the change amount (du / dy) is equal to or less than the change amount (dv / dx) in step S1 (No in step S1), whether or not the change amount (du / dx) is greater than the change amount (dv / dy). Is determined (step S5).

変化量(du/dx)が変化量(dv/dy)より大きい場合(ステップS5のYes)、ρ1=ρxとする(ステップS6)。
また、変化量(du/dx)が変化量(dv/dy)以下の場合(ステップS5のNo)、ρ1=ρvとする(ステップS7)。
When the amount of change (du / dx) is larger than the amount of change (dv / dy) (Yes in step S5), ρ1 = ρx is set (step S6).
If the amount of change (du / dx) is equal to or less than the amount of change (dv / dy) (No in step S5), ρ1 = ρv is set (step S7).

次に、このような演算アルゴリズムを実現するLoD演算部33の構成を説明する。
図4は、LoD演算部の構成を示すブロック図である。
LoD演算部33は、変化量測定部331と、比較部332、333と、大小比較部334と、演算部335と、対数演算部336とを有している。
Next, the configuration of the LoD calculation unit 33 that realizes such a calculation algorithm will be described.
FIG. 4 is a block diagram illustrating a configuration of the LoD calculation unit.
The LoD calculation unit 33 includes a change amount measurement unit 331, comparison units 332 and 333, a magnitude comparison unit 334, a calculation unit 335, and a logarithmic calculation unit 336.

変化量測定部331は、画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)、変化量(dv/dx)、変化量(du/dy)、変化量(dv/dy)を求める。   The change amount measuring unit 331 includes a change amount (du / dx), a change amount (dv / dx), a change amount (du / dy), and a change amount (dv) of the texture coordinates (U, V) with respect to the pixel (X, Y). / Dy).

比較部332は、変化量(du/dx)と変化量(dv/dy)とを比較し、大きい方の値(以下、値αと言う)を出力する。
比較部333は、変化量(du/dy)と変化量(dv/dx)とを比較し、大きい方の値(以下、値βと言う)を出力する。
The comparison unit 332 compares the amount of change (du / dx) and the amount of change (dv / dy), and outputs the larger value (hereinafter referred to as value α).
The comparison unit 333 compares the amount of change (du / dy) and the amount of change (dv / dx), and outputs the larger value (hereinafter referred to as value β).

これにより、図3に示すステップS1、S2およびステップS5に対応する動作が実行され、斜辺の値ρ1を求めるために必要な、変化量(du/dx)、変化量(dv/dx)、変化量(du/dy)、変化量(dv/dy)のいずれか2つに該当する値αおよび値βが求まる。   As a result, the operations corresponding to steps S1, S2 and S5 shown in FIG. 3 are executed, and the amount of change (du / dx), amount of change (dv / dx), and change necessary to obtain the hypotenuse value ρ1. A value α and a value β corresponding to any two of the amount (du / dy) and the change amount (dv / dy) are obtained.

大小比較部334は、値αと値βとを比較し、大きい方の値(以下、値γと言う)と、小さい方の値(以下、値δと言う)とを区別してそれぞれ出力する。
演算部335は、大小比較部334にて定まった値γと値δとを入力として斜辺の値ρ1を求める。
The magnitude comparison unit 334 compares the value α and the value β, and outputs a larger value (hereinafter referred to as a value γ) and a smaller value (hereinafter referred to as a value δ).
The computing unit 335 obtains the hypotenuse value ρ1 with the values γ and δ determined by the magnitude comparison unit 334 as inputs.

対数演算部336は、演算部335にて求まった斜辺の値ρ1を用いてlog2(ρ1)を演算してLoDを求める。
次に、演算部335について詳しく説明する。まず、演算部335の演算方法を説明し、その後、演算部335の構成を説明する。
The logarithmic operation unit 336 calculates log 2 (ρ1) using the hypotenuse value ρ1 obtained by the operation unit 335 to obtain LoD.
Next, the calculation unit 335 will be described in detail. First, the calculation method of the calculation unit 335 will be described, and then the configuration of the calculation unit 335 will be described.

前述したように、斜辺の値ρ1の値は、ρu、ρy、ρx、ρvのいずれかの値になるが、このままでは、いずれの値を演算するにしても平方根の演算となる。そこで、演算部335は、演算を簡単にするために、値γを固定値とみなし、値δを変数とみなした一次式で構成される折れ線近似の演算を行う。具体的には、次式(12)の近似を行う。   As described above, the value of the hypotenuse ρ1 is any one of ρu, ρy, ρx, and ρv. However, if any of these values is calculated, a square root operation is performed. Therefore, in order to simplify the calculation, the calculation unit 335 performs a polygonal line approximation calculation including a linear expression in which the value γ is regarded as a fixed value and the value δ is regarded as a variable. Specifically, the following equation (12) is approximated.

Figure 2009116550
Figure 2009116550

図5は、近似式における係数の求め方を説明する図である。
本実施の形態では、値γに対する値δの割合にて異なる係数1および係数2を選択し、式(12)に代入することで、斜辺の値ρ1を求める。具体的には、値γに対する値δの割合に応じた領域を用意する。次に、値γに対する値δの割合に応じて、値δが属する領域を判断する。そして、値δが属する領域毎に、最適な近似を行うための係数1および係数2を求める。
FIG. 5 is a diagram for explaining how to obtain the coefficients in the approximate expression.
In the present embodiment, different coefficients 1 and 2 are selected at a ratio of the value δ to the value γ, and are substituted into the equation (12), thereby obtaining the hypotenuse value ρ1. Specifically, an area corresponding to the ratio of the value δ to the value γ is prepared. Next, the region to which the value δ belongs is determined according to the ratio of the value δ to the value γ. Then, coefficient 1 and coefficient 2 for optimal approximation are obtained for each region to which the value δ belongs.

図5では、一例として領域を4つ(22)に区切り、値δが値γの1/4未満であれば、領域#1に属すると判断する。値δが値γの1/4以上、かつ、2/4未満であれば、領域#2に属すると判断する。値δが値γの2/4以上、かつ、3/4未満であれば、領域#3に属すると判断する。値δが値γの3/4以上、かつ、1未満であれば、領域#4に属すると判断する。そして、各領域の係数1および係数2を演算や予め用意されたテーブルからの選択等で求める。これにより、領域毎に、最適な近似式を選択することができる。 In FIG. 5, as an example, the region is divided into four (2 2 ), and if the value δ is less than ¼ of the value γ, it is determined that the region belongs to region # 1. If the value δ is ¼ or more than the value γ and less than 2/4, it is determined that the value δ belongs to the region # 2. If the value δ is 2/4 or more of the value γ and less than 3/4, it is determined that it belongs to the region # 3. If the value δ is 3/4 or more of the value γ and less than 1, it is determined that it belongs to the region # 4. Then, coefficient 1 and coefficient 2 of each region are obtained by calculation, selection from a table prepared in advance, or the like. Thereby, an optimal approximate expression can be selected for each region.

このように、値γに対する値δの割合に応じて異なる近似式を採用することにより、精度の高い近似を行うことができる。
次に、演算部335の構成を説明する。
In this way, by adopting different approximation formulas depending on the ratio of the value δ to the value γ, high-precision approximation can be performed.
Next, the configuration of the calculation unit 335 will be described.

図6は、演算部の構成を示すブロック図である。
演算部335は、係数選択部335aと、記憶部335bと、ρ1演算部335cとを有している。
FIG. 6 is a block diagram illustrating a configuration of the calculation unit.
The calculation unit 335 includes a coefficient selection unit 335a, a storage unit 335b, and a ρ1 calculation unit 335c.

なお、図6に示す演算部335は、図5に対応する構成をなしている。
係数選択部335aは、値γに対する値δの割合にて係数を選択するアドレス(選択アドレス)を生成する。本実施の形態では、値δが値γの1/4未満であれば、領域#1を指定する選択アドレスを生成する。値δが値γの1/4以上、かつ、2/4未満であれば、領域#2を指定する選択アドレスを生成する。値δが値γの2/4以上、かつ、3/4未満であれば、領域#3を指定する選択アドレスを生成する。値δが値γの3/4以上、かつ、1未満であれば、領域#4を指定する選択アドレスを生成する。
Note that the calculation unit 335 shown in FIG. 6 has a configuration corresponding to FIG.
The coefficient selection unit 335a generates an address (selection address) for selecting a coefficient at a ratio of the value δ to the value γ. In the present embodiment, if the value δ is less than ¼ of the value γ, a selection address specifying the region # 1 is generated. If the value δ is equal to or greater than ¼ of the value γ and less than 2/4, a selection address designating the region # 2 is generated. If the value δ is 2/4 or more of the value γ and less than 3/4, a selection address for designating the region # 3 is generated. If the value δ is 3/4 or more of the value γ and less than 1, a selection address for designating the region # 4 is generated.

記憶部335bは、係数選択テーブル3351と、セレクタ3352とを有している。
係数選択テーブル3351は、領域毎に異なる値を備える係数1と係数2との組合せを一組とする係数ブロックb1〜b4を有している。すなわち、係数選択テーブル3351に記憶する係数ブロックの数は、区切られた領域の数に等しい。
The storage unit 335b includes a coefficient selection table 3351 and a selector 3352.
The coefficient selection table 3351 has coefficient blocks b1 to b4 each including a combination of coefficient 1 and coefficient 2 having different values for each region. That is, the number of coefficient blocks stored in the coefficient selection table 3351 is equal to the number of divided areas.

ここで、係数ブロックb1〜b4は、係数1としてそれぞれ異なる値の係数1−1〜係数1−4を有し、係数2としてそれぞれ異なる値の係数2−1〜係数2−4を有している。   Here, the coefficient blocks b1 to b4 have coefficients 1-1 to 1-4 having different values as the coefficient 1, and coefficients 2-1 to 2-4 having different values as the coefficient 2, respectively. Yes.

セレクタ3352は、選択アドレスに基づいて、係数ブロックb1〜b4のうち、いずれか1つを選択する。具体的には、領域#1を指定する選択アドレスであれば、係数ブロックb1を選択する。領域#2を指定する選択アドレスであれば、係数ブロックb2を選択する。領域#3を指定する選択アドレスであれば、係数ブロックb3を選択する。領域#4を指定する選択アドレスであれば、係数ブロックb4を選択する。   The selector 3352 selects any one of the coefficient blocks b1 to b4 based on the selected address. Specifically, the coefficient block b1 is selected if it is a selection address designating the region # 1. If the selected address designates the area # 2, the coefficient block b2 is selected. If the selected address designates the area # 3, the coefficient block b3 is selected. If the selected address designates the area # 4, the coefficient block b4 is selected.

そして、選択した係数ブロックが有する係数1と係数2とをρ1演算部335cに出力する。
ρ1演算部335cは、得られた係数1、係数2および値γ、値δを用いて式(12)に代入して斜辺の値ρ1を求める。
Then, the coefficient 1 and the coefficient 2 included in the selected coefficient block are output to the ρ1 calculation unit 335c.
The ρ1 calculation unit 335c obtains the hypotenuse value ρ1 by substituting into the equation (12) using the obtained coefficient 1, coefficient 2, value γ, and value δ.

次に、対数演算部336について詳しく説明する。まず、対数演算部336の演算方法を説明し、その後、対数演算部336の構成を説明する。
得られた斜辺の値ρ1は、次式(13)に置き換えることができる。
Next, the logarithmic operation unit 336 will be described in detail. First, the calculation method of the logarithmic calculation unit 336 will be described, and then the configuration of the logarithmic calculation unit 336 will be described.
The obtained hypotenuse value ρ1 can be replaced by the following equation (13).

ρ1=(1+a)×2b・・・(13)
また、前述したように、LoDは、次式(14)にて求めることができる。
LoD=log2(ρ1)・・・(14)
ここで、式(14)に式(13)を代入すると、次式(15)のように表すことができる。
ρ1 = (1 + a) × 2 b (13)
Further, as described above, LoD can be obtained by the following equation (14).
LoD = log 2 (ρ1) (14)
Here, when Expression (13) is substituted into Expression (14), it can be expressed as the following Expression (15).

LoD=log2((1+a)×2b)=log2(1+a)+b・・・(15)
式(15)の「b」は、LoDの整数部であり、「log2(1+a)」は、LoDの小数部である。
LoD = log 2 ((1 + a) × 2 b ) = log 2 (1 + a) + b (15)
In equation (15), “b” is the integer part of LoD, and “log 2 (1 + a)” is the decimal part of LoD.

対数演算部336は、式(15)のこの整数部と小数部とを求めることで、LoDを演算する。
次に、対数演算部336の構成について詳しく説明する。
The logarithmic calculation unit 336 calculates LoD by obtaining the integer part and the decimal part of the equation (15).
Next, the configuration of the logarithmic operation unit 336 will be described in detail.

図7は、対数演算部の構成を示すブロック図である。
対数演算部336は、桁上げ判定部336aと、記憶部336bと、加算部336cとを有している。
FIG. 7 is a block diagram illustrating a configuration of the logarithmic operation unit.
The logarithmic operation unit 336 includes a carry determination unit 336a, a storage unit 336b, and an addition unit 336c.

桁上げ判定部336aは、斜辺の値ρ1から式(13)に示す「a」と「b」とを求める。ここで、式(13)は2進数において、「(1+a)」を「b」で桁上げしていることを示しているので、桁上げ判定部336aは、何ビット桁上げしているかを判定する。そして、求めた「a」を記憶部336bに送り、「b」を加算部336cに送る。   The carry determination unit 336a obtains “a” and “b” shown in Expression (13) from the hypotenuse value ρ1. Here, since Expression (13) indicates that “(1 + a)” is carried by “b” in the binary number, the carry judging unit 336a judges how many bits are carried. To do. Then, the obtained “a” is sent to the storage unit 336b, and “b” is sent to the adding unit 336c.

ここで、これまでの斜辺の値ρ1の演算に固定小数点を使用している場合は、斜辺の値ρ1の、小数点から最上位の‘1’までのビット数が「b」となる。
一方、これまでの斜辺の値ρ1の演算に浮動小数点を使用している場合は、斜辺の値ρ1の指数部から容易に値が求まる。‘1’が検出されると、それ以降が「a」である。
Here, when a fixed decimal point is used for the calculation of the hypotenuse value ρ1 so far, the number of bits of the hypotenuse value ρ1 from the decimal point to the most significant “1” is “b”.
On the other hand, when a floating point is used for the calculation of the hypotenuse value ρ1 so far, the value can be easily obtained from the exponent part of the hypotenuse value ρ1. When “1” is detected, “a” is indicated thereafter.

記憶部336bは、定数記憶テーブル3361と、セレクタ3362とを有している。
定数記憶テーブル3361は、「a」の値に対応する「log2(1+a)」の値(定数)を複数記憶している。図7では、「log2(1+a)」として4つの値(「log2(1+a)#1」、「log2(1+a)#2」、「log2(1+a)#3」、「log2(1+a)#4」)を記憶している。なお、記憶する定数の数は、「a」のビット数と、実現する精度とに応じて決定することができる。例えば「a」が8ビットであれば、定数記憶テーブル3361が記憶する「log2(1+a)」の個数は、最大で28=256個になる。
The storage unit 336b includes a constant storage table 3361 and a selector 3362.
The constant storage table 3361 stores a plurality of values (constants) of “log 2 (1 + a)” corresponding to the value of “a”. In FIG. 7, as “log 2 (1 + a)”, four values (“log 2 (1 + a) # 1”, “log 2 (1 + a) # 2”, “log 2 (1 + a) # 3”, “log 2 ( 1 + a) # 4 ") is stored. Note that the number of constants to be stored can be determined according to the number of bits of “a” and the accuracy to be realized. For example, if “a” is 8 bits, the maximum number of “log 2 (1 + a)” stored in the constant storage table 3361 is 2 8 = 256.

セレクタ3362は、桁上げ判定部336aから送られてくる「a」に対応する、定数記憶テーブル3361が記憶している「log2(1+a)」を選択して加算部336cに送る。 The selector 3362 selects “log 2 (1 + a)” stored in the constant storage table 3361 corresponding to “a” sent from the carry determination unit 336 a and sends it to the adding unit 336 c.

加算部336cは、桁上げ判定部336aが出力する「b」と、記憶部336bが出力する「log2(1+a)」とを加算してLoDを求め、得られたLoDをテクスチャ取得用アドレス生成部34に出力する。 The adding unit 336c adds “b” output from the carry determining unit 336a and “log 2 (1 + a)” output from the storage unit 336b to obtain the LoD, and generates the obtained LoD as a texture acquisition address. To the unit 34.

図8は、本実施の形態の描画装置による描画図形を示す図である。
以上述べたように、本実施の形態の描画処理装置10によれば、演算部335が、2つの値γおよび値δを直交する2辺とする直角三角形の斜辺の値ρ1を実質的に求める演算を行うようにしたので、図8に示すように、描画されたトンネル画像51のテクスチャ52〜55の歪みを補正することができる。また、演算部335では平方根の演算を行うことなく斜辺の値ρ1を求め、対数演算部336では対数の演算を行うことなくLoDを求めるようにしたので、LoD演算部33の小型化を図ることができる。
FIG. 8 is a diagram showing a drawing figure by the drawing apparatus of the present embodiment.
As described above, according to the rendering processing apparatus 10 of the present embodiment, the calculation unit 335 substantially determines the value ρ1 of the hypotenuse of a right triangle having two values γ and δ as two orthogonal sides. Since the calculation is performed, the distortion of the textures 52 to 55 of the drawn tunnel image 51 can be corrected as shown in FIG. In addition, since the computing unit 335 obtains the value ρ1 of the hypotenuse without performing the square root computation, and the logarithmic computation unit 336 obtains the LoD without performing the logarithmic computation, the LoD computation unit 33 can be reduced in size. Can do.

また、比較部332、333にて変化量を比較することで、演算を容易にすることができる。
また、記憶部335bが、領域毎の係数を予めテーブル化して記憶しておくことにより、容易にρ演算部335が演算を行うことができる。
In addition, the comparison units 332 and 333 can compare the amount of change to facilitate calculation.
Further, the storage unit 335b stores the coefficient for each region in a table in advance, so that the ρ calculation unit 335 can easily perform the calculation.

また、係数ブロックの個数が少なければ、ROM(Read Only Memory)等を用いることなく、本実施の形態のように小規模なセレクタ3352で記憶部335bを構成することができる。   If the number of coefficient blocks is small, the storage unit 335b can be configured by a small selector 3352 as in this embodiment without using a ROM (Read Only Memory) or the like.

なお、図5では、領域を4つに区切った例について説明したが、本発明はこれに限らず、領域の数を増やすことで近似式の精度を高めることができる。領域の数を増やす場合、記憶部335bの構成を変更することで、容易に対応することができる。   In addition, although the example which divided | segmented the area | region into four was demonstrated in FIG. 5, this invention is not restricted to this, The precision of an approximate expression can be improved by increasing the number of areas. Increasing the number of areas can be easily handled by changing the configuration of the storage unit 335b.

また、区切る領域の数は特に限定されないが、2のべき乗であるのがより好ましい。これにより、LoD演算部33をハードウェアで構成した場合、ビットシフトで対応することができるため、装置の小型化を図ることができる。   The number of regions to be divided is not particularly limited, but is preferably a power of 2. As a result, when the LoD calculation unit 33 is configured by hardware, it can be handled by bit shift, and thus the size of the apparatus can be reduced.

以上、本発明の描画処理装置、描画処理方法および描画処理プログラムを、図示の実施の形態に基づいて説明したが、本発明はこれに限定されるものではなく、各部の構成は、同様の機能を有する任意の構成のものに置換することができる。また、本発明に、他の任意の構成物や工程が付加されていてもよい。   The drawing processing apparatus, the drawing processing method, and the drawing processing program of the present invention have been described based on the illustrated embodiment. However, the present invention is not limited to this, and the configuration of each unit has the same function. Can be replaced with any structure having Moreover, other arbitrary structures and processes may be added to the present invention.

また、本発明は、前述した実施の形態のうちの、任意の2以上の構成(特徴)を組み合わせたものであってもよい。
なお、上記の処理機能は、コンピュータによって実現することができる。その場合、描画処理装置10(特に、LoD演算部33)が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、例えば、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリ等が挙げられる。磁気記録装置としては、例えば、ハードディスク装置(HDD)、フレキシブルディスク(FD)、磁気テープ等が挙げられる。光ディスクとしては、例えば、DVD(Digital Versatile Disc)、DVD−RAM(Random Access Memory)、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(ReWritable)等が挙げられる。光磁気記録媒体としては、例えば、MO(Magneto-Optical disk)等が挙げられる。
In addition, the present invention may be a combination of any two or more configurations (features) of the above-described embodiments.
The above processing functions can be realized by a computer. In that case, a program describing the processing contents of the functions that the drawing processing apparatus 10 (in particular, the LoD calculation unit 33) should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include a hard disk device (HDD), a flexible disk (FD), and a magnetic tape. Examples of the optical disc include a DVD (Digital Versatile Disc), a DVD-RAM (Random Access Memory), a CD-ROM (Compact Disc Read Only Memory), and a CD-R (Recordable) / RW (ReWritable). Examples of the magneto-optical recording medium include MO (Magneto-Optical disk).

プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD、CD−ROM等の可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When distributing the program, for example, a portable recording medium such as a DVD or a CD-ROM in which the program is recorded is sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.

描画処理プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送される毎に、逐次、受け取ったプログラムに従った処理を実行することもできる。   A computer that executes a drawing processing program stores, for example, a program recorded on a portable recording medium or a program transferred from a server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. In addition, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

本発明の概要を示す図である。It is a figure which shows the outline | summary of this invention. 描画装置の構成を示すブロック図である。It is a block diagram which shows the structure of a drawing apparatus. LoD演算部の演算アルゴリズムを示すフローチャートである。It is a flowchart which shows the calculation algorithm of a LoD calculating part. LoD演算部の構成を示すブロック図である。It is a block diagram which shows the structure of a LoD calculating part. 近似式における係数の求め方を説明する図である。It is a figure explaining how to obtain | require the coefficient in an approximate expression. 演算部の構成を示すブロック図である。It is a block diagram which shows the structure of a calculating part. 対数演算部の構成を示すブロック図である。It is a block diagram which shows the structure of a logarithm calculating part. 本実施の形態の描画装置による描画図形を示す図である。It is a figure which shows the drawing figure by the drawing apparatus of this Embodiment. 従来の描画方法による図形を示す図である。It is a figure which shows the figure by the conventional drawing method.

符号の説明Explanation of symbols

1、10 描画処理装置
2 第1の選択部
3 第2の選択部
4、335 演算部
20 CPU
30 GPU
31 ジオメトリ
32 ラスタ化部
33 LoD演算部
34 テクスチャ取得用アドレス生成部
35 ピクセルブレンダ
40 外部メモリ
41 フレームバッファ
42 テクスチャ記憶部
50 モニタ
331 変化量測定部
332、333 比較部
334 大小比較部
335a 係数選択部
335b、336b 記憶部
335c ρ1演算部
336 対数演算部
336a 桁上げ判定部
336c 加算部
3351 係数選択テーブル
3352、3362 セレクタ
3361 定数記憶テーブル
b1〜b4 係数ブロック
DESCRIPTION OF SYMBOLS 1, 10 Drawing processing apparatus 2 1st selection part 3 2nd selection part 4, 335 calculating part 20 CPU
30 GPU
31 Geometry 32 Rasterization Unit 33 LoD Operation Unit 34 Texture Acquisition Address Generation Unit 35 Pixel Blender 40 External Memory 41 Frame Buffer 42 Texture Storage Unit 50 Monitor 331 Change Measurement Unit 332, 333 Comparison Unit 334 Size Comparison Unit 335a Coefficient Selection Unit 335b, 336b Storage unit 335c ρ1 calculation unit 336 Logarithmic calculation unit 336a Carry determination unit 336c Addition unit 3351 Coefficient selection table 3352, 3362 Selector 3361 Constant storage table b1-b4 Coefficient block

Claims (8)

ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する描画処理装置において、
画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)と、変化量(dv/dy)とを比較し、大きい方の値を選択する第1の選択部と、
前記画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dy)と、変化量(dv/dx)とを比較し、大きい方の値を選択する第2の選択部と、
前記第1の選択部によって選択された値と前記第2の選択部によって選択された値とをそれぞれ直角三角形の直角に交わる2辺とみなし、前記直角三角形の斜辺の値を実質的に演算する演算部と、
を有することを特徴とする描画処理装置。
In a drawing processing apparatus that acquires a texture of an optimal size from a texture storage unit that stores a mipmap,
A first selection unit that compares the amount of change (du / dx) of the texture coordinates (U, V) with respect to the pixel (X, Y) and the amount of change (dv / dy), and selects the larger value;
A second selection unit that compares the amount of change (du / dy) of the texture coordinates (U, V) with respect to the pixel (X, Y) and the amount of change (dv / dx), and selects the larger value; ,
The value selected by the first selection unit and the value selected by the second selection unit are regarded as two sides intersecting a right angle of the right triangle, and the value of the hypotenuse of the right triangle is substantially calculated. An arithmetic unit;
A drawing processing apparatus comprising:
前記演算部は、前記第1の選択部によって選択された値と前記第2の選択部によって選択された値との大小関係を決定する大小比較部を有することを特徴とする請求項1記載の描画処理装置。   The said calculating part has a magnitude comparison part which determines the magnitude relationship between the value selected by the said 1st selection part, and the value selected by the said 2nd selection part, The size comparison part of Claim 1 characterized by the above-mentioned. Drawing processing device. 前記演算部は、前記大小比較部によって決定された大きい方の値を固定値とみなし、小さい方の値を変数値とみなして一次式で構成される近似式を演算して前記斜辺の値を演算することを特徴とする請求項2記載の描画処理装置。   The calculation unit regards the larger value determined by the magnitude comparison unit as a fixed value, regards the smaller value as a variable value, calculates an approximate expression composed of a linear expression, and calculates the value of the hypotenuse. The drawing processing apparatus according to claim 2, wherein the drawing processing apparatus performs calculation. 前記演算部は、前記固定値に対する前記変数値の割合に応じて前記近似式の係数を別個に選択することを特徴とする請求項3記載の描画処理装置。   The drawing processing apparatus according to claim 3, wherein the calculation unit separately selects a coefficient of the approximate expression according to a ratio of the variable value to the fixed value. 前記係数を記憶する記憶部をさらに有することを特徴とする請求項4記載の描画処理装置。   The drawing processing apparatus according to claim 4, further comprising a storage unit that stores the coefficient. 小数部(log2(1+a))と整数部(b)との和で表される前記テクスチャの縮小率の演算式を求める際に、aに対応する前記小数部(log2(1+a))を予め記憶しておく記憶部と、
前記演算部により演算された前記斜辺の値を((1+a)×2b)に当てはめて前記aと前記整数部(b)とを判定する判定部と、
前記判定部によって判定された前記整数部(b)と、前記記憶部に記憶された前記小数部(log2(1+a))とを加算する加算部と、を備える対数演算部をさらに有することを特徴とする請求項1記載の描画処理装置。
When calculating the arithmetic expression for the reduction ratio of the texture expressed by the sum of the decimal part (log 2 (1 + a)) and the integer part (b), the decimal part (log 2 (1 + a)) corresponding to a is calculated. A storage unit for storing in advance;
A determination unit that applies the value of the hypotenuse calculated by the calculation unit to ((1 + a) × 2 b ) to determine the a and the integer part (b);
A logarithmic operation unit further comprising: an addition unit that adds the integer part (b) determined by the determination unit and the decimal part (log 2 (1 + a)) stored in the storage unit. The drawing processing apparatus according to claim 1, wherein:
ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する描画処理方法において、
画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)、変化量(dv/dx),変化量(du/dy)、変化量(dv/dy)における、
{(du/dx)2+(du/dy)21/2と{(dv/dx)2+(dv/dy)21/2とのうちの大きい方の値を選択する第1のステップと、
{(du/dx)2+(dv/dx)21/2と{(du/dy)2+(dv/dy)21/2とのうちの大きい方の値を選択する第2のステップと、
前記第1のステップによって選択された値と前記第2のステップによって選択された値とのうち大きい方の値を、前記テクスチャの画素サイズと描画画像の画素サイズとの比率とする第3のステップと、
を実質的に含むことを特徴とする描画処理方法。
In the drawing processing method for acquiring the texture of the optimum size from the texture storage unit storing the mipmap,
In the change amount (du / dx), change amount (dv / dx), change amount (du / dy), change amount (dv / dy) of the texture coordinates (U, V) with respect to the pixel (X, Y),
First to select the larger value of {(du / dx) 2 + (du / dy) 2 } 1/2 and {(dv / dx) 2 + (dv / dy) 2 } 1/2 And the steps
A second value for selecting the larger one of {(du / dx) 2 + (dv / dx) 2 } 1/2 and {(du / dy) 2 + (dv / dy) 2 } 1/2 And the steps
A third step in which a larger value of the value selected in the first step and the value selected in the second step is a ratio between the pixel size of the texture and the pixel size of the drawn image When,
The drawing processing method characterized by including substantially.
ミップマップを格納したテクスチャ記憶部から最適なサイズのテクスチャを取得する描画処理プログラムにおいて、
コンピュータを、
画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dx)と、変化量(dv/dy)とを比較し、大きい方の値を選択する第1の選択手段、
前記画素(X,Y)に対するテクスチャ座標(U,V)の変化量(du/dy)と、変化量(dv/dx)とを比較し、大きい方の値を選択する第2の選択手段、
前記第1の選択手段によって選択された値と前記第2の選択手段によって選択された値とをそれぞれ直角三角形の直角に交わる2辺とみなし、前記直角三角形の斜辺の値を実質的に演算する演算手段、
として機能させることを特徴とする描画処理プログラム。
In a drawing processing program that acquires a texture of an optimal size from a texture storage unit that stores a mipmap,
Computer
A first selecting means for comparing the amount of change (du / dx) of the texture coordinates (U, V) with respect to the pixel (X, Y) and the amount of change (dv / dy), and selecting the larger value;
A second selecting means for comparing the amount of change (du / dy) of the texture coordinates (U, V) with respect to the pixel (X, Y) and the amount of change (dv / dx), and selecting the larger value;
The value selected by the first selection means and the value selected by the second selection means are regarded as two sides intersecting at right angles of the right triangle, and the value of the hypotenuse of the right triangle is substantially calculated. Computing means,
A drawing processing program characterized by functioning as
JP2007287908A 2007-11-05 2007-11-05 Drawing processing apparatus, drawing processing method, and drawing processing program Expired - Fee Related JP5050786B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007287908A JP5050786B2 (en) 2007-11-05 2007-11-05 Drawing processing apparatus, drawing processing method, and drawing processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007287908A JP5050786B2 (en) 2007-11-05 2007-11-05 Drawing processing apparatus, drawing processing method, and drawing processing program

Publications (2)

Publication Number Publication Date
JP2009116550A true JP2009116550A (en) 2009-05-28
JP5050786B2 JP5050786B2 (en) 2012-10-17

Family

ID=40783644

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007287908A Expired - Fee Related JP5050786B2 (en) 2007-11-05 2007-11-05 Drawing processing apparatus, drawing processing method, and drawing processing program

Country Status (1)

Country Link
JP (1) JP5050786B2 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017517054A (en) * 2014-04-05 2017-06-22 ソニー インタラクティブ エンタテインメント アメリカ リミテッド ライアビリテイ カンパニー Tilt adjustment of texture mapping for multiple rendering targets with different resolutions depending on screen position
US9865074B2 (en) 2014-04-05 2018-01-09 Sony Interactive Entertainment America Llc Method for efficient construction of high resolution display buffers
US10068311B2 (en) 2014-04-05 2018-09-04 Sony Interacive Entertainment LLC Varying effective resolution by screen location by changing active color sample count within multiple render targets
US10134175B2 (en) 2014-04-05 2018-11-20 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping to non-orthonormal grid
US10417741B2 (en) 2014-04-05 2019-09-17 Sony Interactive Entertainment LLC Varying effective resolution by screen location by altering rasterization parameters
US10438319B2 (en) 2014-04-05 2019-10-08 Sony Interactive Entertainment LLC Varying effective resolution by screen location in graphics processing by approximating projection of vertices onto curved viewport
US10510183B2 (en) 2014-04-05 2019-12-17 Sony Interactive Entertainment LLC Graphics processing enhancement by tracking object and/or primitive identifiers
US10783696B2 (en) 2014-04-05 2020-09-22 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping to non-orthonormal grid
US11302054B2 (en) 2014-04-05 2022-04-12 Sony Interactive Entertainment Europe Limited Varying effective resolution by screen location by changing active color sample count within multiple render targets

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000155850A (en) * 1998-11-20 2000-06-06 Sony Corp Texture mapping device and rendering device equipped with the same device and information processor
JP2006293627A (en) * 2005-04-08 2006-10-26 Toshiba Corp Plotting method and plotting device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000155850A (en) * 1998-11-20 2000-06-06 Sony Corp Texture mapping device and rendering device equipped with the same device and information processor
JP2006293627A (en) * 2005-04-08 2006-10-26 Toshiba Corp Plotting method and plotting device

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017517054A (en) * 2014-04-05 2017-06-22 ソニー インタラクティブ エンタテインメント アメリカ リミテッド ライアビリテイ カンパニー Tilt adjustment of texture mapping for multiple rendering targets with different resolutions depending on screen position
US9865074B2 (en) 2014-04-05 2018-01-09 Sony Interactive Entertainment America Llc Method for efficient construction of high resolution display buffers
JP2018129051A (en) * 2014-04-05 2018-08-16 ソニー インタラクティブ エンタテインメント アメリカ リミテッド ライアビリテイ カンパニー Adjustment of inclination of texture mapping of plurality of rendering of target whose resolution varies according to location of screen
US10068311B2 (en) 2014-04-05 2018-09-04 Sony Interacive Entertainment LLC Varying effective resolution by screen location by changing active color sample count within multiple render targets
US10102663B2 (en) 2014-04-05 2018-10-16 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
US10134175B2 (en) 2014-04-05 2018-11-20 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping to non-orthonormal grid
US10417741B2 (en) 2014-04-05 2019-09-17 Sony Interactive Entertainment LLC Varying effective resolution by screen location by altering rasterization parameters
US10438319B2 (en) 2014-04-05 2019-10-08 Sony Interactive Entertainment LLC Varying effective resolution by screen location in graphics processing by approximating projection of vertices onto curved viewport
US10438396B2 (en) 2014-04-05 2019-10-08 Sony Interactive Entertainment LLC Method for efficient construction of high resolution display buffers
US10510183B2 (en) 2014-04-05 2019-12-17 Sony Interactive Entertainment LLC Graphics processing enhancement by tracking object and/or primitive identifiers
US10614549B2 (en) 2014-04-05 2020-04-07 Sony Interactive Entertainment Europe Limited Varying effective resolution by screen location by changing active color sample count within multiple render targets
US10685425B2 (en) 2014-04-05 2020-06-16 Sony Interactive Entertainment LLC Varying effective resolution by screen location by altering rasterization parameters
US10783696B2 (en) 2014-04-05 2020-09-22 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping to non-orthonormal grid
US11238639B2 (en) 2014-04-05 2022-02-01 Sony Interactive Entertainment LLC Gradient adjustment for texture mapping to non-orthonormal grid
US11302054B2 (en) 2014-04-05 2022-04-12 Sony Interactive Entertainment Europe Limited Varying effective resolution by screen location by changing active color sample count within multiple render targets
US11301956B2 (en) 2014-04-05 2022-04-12 Sony Interactive Entertainment LLC Varying effective resolution by screen location by altering rasterization parameters

Also Published As

Publication number Publication date
JP5050786B2 (en) 2012-10-17

Similar Documents

Publication Publication Date Title
JP5050786B2 (en) Drawing processing apparatus, drawing processing method, and drawing processing program
JP6563048B2 (en) Tilt adjustment of texture mapping for multiple rendering targets with different resolutions depending on screen position
US10140750B2 (en) Method, display adapter and computer program product for improved graphics performance by using a replaceable culling program
JP2012252725A (en) Method, apparatus, and computer program product for improved graphics performance
US20080094409A1 (en) Image Generation Device and Image Generation Method
EP3504685B1 (en) Method and apparatus for rendering object using mipmap including plurality of textures
KR102278147B1 (en) Clipping of graphics primitives
JP5512217B2 (en) Graphics processing system
US8743135B2 (en) Graphics processing systems
KR100745768B1 (en) Method for calculate lod value for reducing power consumption and 3 dimension rendering system using the same
WO2014087572A1 (en) Area dividing and rendering device and area dividing and rendering method
US6947054B2 (en) Anisotropic filtering
KR20160003223A (en) Tessellation of two-dimensional curves using a graphics pipeline
WO2013005366A1 (en) Anti-aliasing image generation device and anti-aliasing image generation method
KR20170025099A (en) Method and apparatus for rendering
US10460502B2 (en) Method and apparatus for rendering object using mipmap including plurality of textures
EP3319046B1 (en) Texture processing method and unit
US20200202605A1 (en) Centroid selection for variable rate shading
JP2005332195A (en) Texture unit, image drawing apparatus, and texel transfer method
KR100633029B1 (en) Method of Analyzing and Modifying a Footprint
EP1988510B1 (en) Coordinate Computations for Non-Power of 2 Texture Maps
JP5151946B2 (en) Drawing device
JP2009129275A (en) Graphics processor and graphics processing method
JP2008130091A (en) Method and device for rendering three-dimensional graphics data in consideration of fog effect
JP2008152743A (en) Circuit for calculating texture pattern size

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100723

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120213

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120221

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120419

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120709

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150803

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees