JP4617501B2 - Texture mapping method, program and apparatus - Google Patents
Texture mapping method, program and apparatus Download PDFInfo
- Publication number
- JP4617501B2 JP4617501B2 JP2007318380A JP2007318380A JP4617501B2 JP 4617501 B2 JP4617501 B2 JP 4617501B2 JP 2007318380 A JP2007318380 A JP 2007318380A JP 2007318380 A JP2007318380 A JP 2007318380A JP 4617501 B2 JP4617501 B2 JP 4617501B2
- Authority
- JP
- Japan
- Prior art keywords
- texture
- data
- value
- data area
- distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明はテクスチャデータのデータ構造に関し、特にセルシェーディングに好適なデータ構造に関する。 The present invention relates to a data structure of texture data, and more particularly to a data structure suitable for cell shading.
従来、コンピュータグラフィックス分野におけるマルチテクスチャを用いたテクスチャマッピングの手法として、セルシェーディングと呼ばれる手法が知られている。セルシェーディングはトゥーンシェーディングとも呼ばれ、テクスチャマッピングの対象となるオブジェクト(モデル)と光源との距離や、オブジェクト表面の法線ベクトルと光線ベクトルとのなす角度等からテクスチャデータのUV座標(読み出しアドレス)を求め、輝度や色等を適度にフィルタリングしてオブジェクト表面にテクスチャをマッピングし、シェーディングを行う手法である。図8は従来のセルシェーディングに用いられるテクスチャデータの説明図である。同図に示すテクスチャデータ70は、オブジェクト表面の輝度がある一定の閾値を超えたときに白色から黒色にシェーディング処理するためのものであり、正規化されたUV座標系(0.0≦U≦1.0かつ0.0≦V≦1.0)において、白色のデータを配したデータ領域71(0.0≦U≦0.5かつ0.0≦V≦1.0)と、黒色のデータを配したデータ領域72(0.5≦U≦1.0かつ0.0≦V≦1.0)とを含んで構成されている。テクスチャマッピングの際に参照されるUV座標は、下記の2式により求めることができる。
U=a*I+b …(1)
V=c*I+d …(2)
ここで、Iはオブジェクト表面の規格化された法線ベクトルと規格化された光線ベクトルの内積から求めた輝度の値であり、a,b,c,dは各々定数である。セルシェーディングの手法は公知であるため、a,b,c,dの詳細については省略する。輝度Iを求めることができれば、式(1)、式(2)からテクスチャデータ上のUV座標を求めることができる。輝度Iの値を変化させたときのUV座標の移動軌跡は直線73のようになる。同図から明らかなように、光源計算の結果、オブジェクトの各頂点のUV値を設定する際に、オブジェクト表面上の法線ベクトルと光線ベクトルとのなす角が小さく光がよく当たる部分では、小さいU値が指定され、白色にテクスチャマッピングされる一方、オブジェクト表面上の法線ベクトルと光線ベクトルとのなす角が大きく光があまり当たらない部分では、大きいU値が指定され、黒色にテクスチャマッピングされる。つまり、U値が0.5を超えた時点で、オブジェクト表面のピクセルは白色から黒色にシェーディングされる。このように、シェーディング処理を白と黒の2値処理することで、オブジェクト表面の露光面と非露光面との差をはっきりさせることができ、いわゆるアニメ調のシェーディングが可能となる。
Conventionally, a technique called cell shading is known as a texture mapping technique using multiple textures in the field of computer graphics. Cell shading is also called toon shading, and the texture data UV coordinates (reading address) are determined from the distance between the object (model) to be texture mapped and the light source, the angle between the normal vector of the object surface and the light vector, etc. This is a technique for performing shading by mapping the texture on the object surface by appropriately filtering luminance, color, and the like. FIG. 8 is an explanatory diagram of texture data used for conventional cell shading. The
U = a * I + b (1)
V = c * I + d (2)
Here, I is a luminance value obtained from the inner product of the normalized normal vector of the object surface and the normalized ray vector, and a, b, c, and d are constants. Since the cell shading technique is known, the details of a, b, c, and d are omitted. If the luminance I can be obtained, the UV coordinates on the texture data can be obtained from the equations (1) and (2). The movement locus of the UV coordinates when the value of the luminance I is changed becomes a
しかし、従来のセルシェーディングの手法では、光源の色、光源とオブジェクトとの距離、光源の光強度等の各種露光条件に応じてシェーディング用のテクスチャデータを用意する必要があったため、デザイナーの手間がかかる上にハードウエア資源を浪費するという問題があった。また、本来、テクスチャマッピングは2次元の平面に2次元の図柄や模様を貼り付けて物体のディテールを表現するものであるが、上記のようにシェーディングのためにテクスチャマッピングを用いる場合には、陰影用のテクスチャデータは1次元方向のみで足りるため、陰影用のテクスチャデータとして2次元のテクスチャデータを用いることはメモリを無駄に浪費することになる。かかる問題点を図9、図10を参照して説明する。 However, in the conventional cell shading method, it is necessary to prepare texture data for shading according to various exposure conditions such as the color of the light source, the distance between the light source and the object, the light intensity of the light source, etc. In addition, there is a problem of wasting hardware resources. Originally, texture mapping expresses the details of an object by pasting a two-dimensional pattern or pattern on a two-dimensional plane. However, when texture mapping is used for shading as described above, shadow mapping is used. Since the texture data for use is only required in the one-dimensional direction, use of the two-dimensional texture data as the texture data for shading wastes memory. Such a problem will be described with reference to FIGS.
図9は光源の色に対応して使用するテクスチャデータを切り換える場合の説明図であり、オブジェクト50を照らす光源として、赤色光源41、緑色光源42、及び青色光源43が仮想空間内に配されている。各色の光源に対応して、2値化したシェーディング処理をするためのテクスチャデータが3種類用意されている。同図に示す状態では、オブジェクト50は緑色光源42の位置にあるため、緑色のシェーディング処理をするためのテクスチャデータを利用してテクスチャマッピングをすればよい。ところが、オブジェクト50が赤色光源41と緑色光源42との中間にある境界61を超えて、赤色光源41側に移動すると、もはや緑色光源42用のテクスチャデータを用いてシェーディングをすることはできず、赤色光源41用のテクスチャデータを用いてシェーディングをしなければならない。境界線61を境に使用するテクスチャデータを突然切り換えると、オブジェクト50の表面に表示される陰影が突然切り替わるため、グラフィックス表示上極めて不自然である。緑色光源42と青色光源43の中間にある境界62を超えて、青色光源43側にオブジェクト50が移動した場合も同様である。
FIG. 9 is an explanatory diagram for switching texture data to be used corresponding to the color of the light source. A
図10はカメラ(仮想視点)とオブジェクトとの位置関係に応じて使用するテクスチャデータを切り換える場合の説明図であり、光源40、オブジェクト50、及びカメラ60が所定の位置に配されている。3次元コンピュータグラフィックスにおいては、オブジェクト50を構成する各ポリゴンをワールド座標系へモデリング変換し、カメラ60から見たカメラ視点への視野変換、三次元クリッピング処理、陰面処理、テクスチャマッピング処理、シェーディング処理、表示優先処理等を行ってビデオディスプレイに表示する。オブジェクト50に施される陰影は、カメラ60とオブジェクト50との距離に応じて見え方が異なるため、複数種類のシェーディング処理のテクスチャデータを予め用意し、オブジェクト50とカメラ60との距離がある一定の距離を超えたところで、シェーディングに使用するテクスチャを切り換えている。同図の例では、オブジェクト50が境界63を超えてカメラ60よりも遠方に移動した時点で使用するテクスチャを切り換えている。ところが、境界63を境に使用するテクスチャが突然切り替えると、オブジェクト50の表面に表示される陰影が突然切り替わるため、グラフィックス表示上極めて不自然である。
FIG. 10 is an explanatory diagram of switching texture data to be used according to the positional relationship between the camera (virtual viewpoint) and the object. The
しかも、図8に示すテクスチャデータ70のうち、実際に使用しているのは、直線73上のデータだけであり、他のデータ領域は使用されないため、テクスチャメモリの無駄が多いという問題も指摘されている。
Moreover, among the
そこで、本発明は上記の問題点を解決し、滑らかなシェーディングを可能にするとともに、メモリ資源の節約に好適なテクスチャデータのデータ構造、テクスチャマッピングをコンピュータシステムに実行させるためのプログラム、テクスチャマッピング方法及びテクスチャマッピング装置を提案することを課題とする。 Therefore, the present invention solves the above-described problems, enables smooth shading, and also provides a data structure of texture data suitable for saving memory resources, a program for causing a computer system to execute texture mapping, and a texture mapping method And a texture mapping device.
上記の課題を解決するため、本発明では、互いに直交する2方向へ濃淡勾配が形成されている色データを配したコンピュータ読取り可能なデータ領域を含むテクスチャデータにアクセスするために、テクスチャマッピングされるオブジェクト表面の輝度情報から所定の計算式を基に、前記2方向のうち何れか1方向における、前記データ領域にアクセスするための座標を算出し、前記2方向のうち他の1方向における、前記データ領域にアクセスするための座標を動的変数に代入されている任意の値を基に算出し、算出された座標を基に前記データ領域にアクセスすることにより、色データを読み出し、前記オブジェクト表面へテクスチャマッピングする。 In order to solve the above-described problem, in the present invention, texture mapping is performed in order to access texture data including a computer-readable data area in which color data in which a gray scale is formed in two orthogonal directions is arranged. Based on a predetermined calculation formula from the luminance information of the object surface, the coordinates for accessing the data area in any one of the two directions are calculated, and the other one of the two directions The coordinates for accessing the data area are calculated based on an arbitrary value assigned to the dynamic variable, and the data area is read out by accessing the data area based on the calculated coordinates. Texture mapping to
また、本発明では上記の方法をコンピュータシステムに実行させるためのプログラムをコンピュータ読取り可能な記録媒体に記録することができる。このような記録媒体として、例えば、光記録媒体(CD−RAM、CD−ROM、DVD−RAM、DVD−ROM、DVD−R、PDディスク、MDディスク、MOディスク等の光学的にデータの読み取りが可能な記録媒体)や、磁気記録媒体(フレキシブルディスク、磁気カード、磁気テープ等の磁気的にデータの読み取りが可能な記録媒体)、或いはDRAM、SRAM、MRAM、FRAM等のメモリ素子を備えたメモリカートリッジ等の可搬性記録媒体等がある。 In the present invention, a program for causing a computer system to execute the above method can be recorded on a computer-readable recording medium. Examples of such recording media include optical recording media (CD-RAM, CD-ROM, DVD-RAM, DVD-ROM, DVD-R, PD disk, MD disk, MO disk, etc.) Recording medium), a magnetic recording medium (a recording medium capable of magnetically reading data such as a flexible disk, a magnetic card, and a magnetic tape), or a memory having a memory element such as a DRAM, SRAM, MRAM, or FRAM There are portable recording media such as cartridges.
また、上記のプログラムはインターネット網やパケット通信網等のオープンネットワーク等に接続するクライアント装置(パーソナルコンピュータ、ゲーム装置、或いは、Webブラウザを実装した携帯電話、PDA、パーム型PC等の情報携帯端末等)からの要求に応答して、Webサーバ等のネットワークサーバからオンデマンド配信することもできる。 In addition, the above program is a client device (personal computer, game device, mobile phone equipped with a Web browser, PDA, palm-type personal computer, etc.) connected to an open network such as the Internet network or a packet communication network. In response to a request from a network server such as a Web server, it can be distributed on demand.
本発明によれば、互いに直交する2方向へ濃淡勾配が形成されている色データを配したコンピュータ読取り可能なデータ領域を含むテクスチャデータを用いてテクスチャマッピングを行うため、オブジェクト表面の輝度情報から所定の計算式で求めた値と、動的変数に代入された任意の値を基に算出した値から、テクスチャデータにアクセスするための座標を求めることができ、動的変数に代入する値に応じて、読み出されるべきテクスチャデータの色調、濃淡等を適宜変更することができる。このため、陰影色の異なるシェーディングを自然に移り変わるように見せることができる。また、複数のテクスチャデータを単一のテクスチャデータに集約することができ、テクスチャメモリを節約できる。 According to the present invention, since texture mapping is performed using texture data including a computer-readable data area in which color data having gradations formed in two directions orthogonal to each other are arranged, predetermined information is obtained from luminance information on the object surface. Coordinates for accessing texture data can be obtained from the value obtained from the above formula and the value calculated from any value assigned to the dynamic variable, depending on the value assigned to the dynamic variable. Thus, the color tone, shading, etc. of the texture data to be read can be changed as appropriate. For this reason, shading with different shade colors can be seen to change naturally. Also, a plurality of texture data can be aggregated into a single texture data, and texture memory can be saved.
以下、各図を参照して本実施の形態について説明する。 Hereinafter, the present embodiment will be described with reference to the drawings.
図7はシェーディング用のテクスチャデータを用いてオブジェクト上にテクスチャマッピングを施し、ビデオディスプレイにビデオ信号を出力するための機能ブロック図である。同図において、11はテクスチャデータを格納するテクスチャメモリ、12はフィルタ、13は1画面分の画像データを書き込むフレームメモリ、14はビデオディスプレイにビデオ信号を出力するためのビデオ信号生成部である。オブジェクト表面の各ピクセル又はオブジェクトを構成するポリゴンの頂点に対応する光源計算の結果、各ピクセル又はポリゴンの頂点に対応する輝度データ、色データ等がテクスチャメモリ11から読み出された後、フィルタ12において、周辺のピクセルの輝度データや色データを参照してフィルタ演算を施し、処理結果をフレームメモリ13に書き込む。ビデオ信号生成部14はフレームメモリ13に書き込まれた画像データを基にビデオ信号を生成し、図示しないビデオディスプレイに出力する。
FIG. 7 is a functional block diagram for performing texture mapping on an object using texture data for shading and outputting a video signal to a video display. In the figure, 11 is a texture memory for storing texture data, 12 is a filter, 13 is a frame memory for writing image data for one screen, and 14 is a video signal generator for outputting a video signal to a video display. As a result of light source calculation corresponding to each pixel on the object surface or the vertex of the polygon constituting the object, luminance data, color data, etc. corresponding to each pixel or the vertex of the polygon are read from the
図1は本実施形態に係わるテクスチャデータの説明図である。同図に示すテクスチャデータ20は、説明の便宜上、テクスチャが2次元平面に展開されている状態を示しているが、テクスチャメモリ11に記憶されている状態で必ずしも2次元平面上に展開されている必要はなく、テクスチャデータの任意の座標における色データ相互の関係が同図に示すような関係を満たすものであれば、テクスチャデータのデータ構造としては同一性を有するものである。つまり、本明細書における「データ構造」とは、テクスチャデータがメモリ等の記録媒体に記録された状態における個々のビットデータ相互の関係を意味しているものではなく、当該テクスチャデータの読み出しアドレスで定義される個々の座標の色データ相互の関係をいうものである。また、色データとして、有彩色の場合には輝度、色相、彩度に関する情報を含み、無彩色の場合には輝度(明暗)に関する情報を含む。さらに透明色の場合には、色データとして、透明度に関する情報を含み、色付きの半透明の場合には、透明度に加えて輝度、色相、彩度に関する情報をも含むものとする。
FIG. 1 is an explanatory diagram of texture data according to the present embodiment. The
テクスチャデータ20は、図3に示すように、赤色、緑色、及び青色の光源41、42、及び43の下でオブジェクト50が図示左右方向に移動する場合に、オブジェクト表面にシェーディング処理するために用意されたものである。テクスチャデータ20は、0.0≦U≦0.5かつ0.0≦V≦1.0となるデータ領域C10において、白色のテクスチャデータが配され、0.5≦U≦1.0かつ0.0≦V≦1.0となるデータ領域C1〜C9において、光源41、42、及び43に対するシェーディング処理用のテクスチャデータが略等間隔に配されている。より詳細には、C1は濃い赤色、C2は薄い赤色、C3は薄い赤色と薄い緑色の混色、C4は薄い緑色、C5は濃い緑色、C6は薄い緑色、C7は薄い緑色と薄い青色の混色、C8は薄い青色、C9は濃い青色のテクスチャデータである。つまり、光源41、42、及び43の位置に対応して、色調の異なる複数のシェーディング用のテクスチャデータをV座標方向に配している。同図に示す例では、説明の便宜上、9段階の濃淡勾配を設けているが、実際には数十程度のより細かい濃淡勾配を設けてもよい。また、テクスチャのU座標とV座標を逆に設定しても発明の本質を変えるものではないことは言うまでもない。用途に応じた適切な濃淡勾配を設けることによって、陰影を2値化するアニメ調のシェーディング処理から、陰影を多値化する劇画調のシェーディング処理まで、各種のシェーディング処理を実現できる。本実施形態では、テクスチャデータ20を用いてシェーディング処理する場合に、光源計算によりU値を求めるには(1)式を用い、V値を求めるには(2)式に替えて、下記の(3)式を用いる。
V=d …(3)
(3)式によれば、輝度Iにかかわらず、変数dの値によってV値を設定することが可能となる。この変数dはプログラム上、任意に変更可能な動的変数であり、例えば、光源とオブジェクトとの距離に応じてリアルタイムに変更することも可能であり、さらには光源との位置関係に関係なく、仮想空間内で展開されるゲーム状況(例えば、プレイヤが有利な状況下にいるか否か、獲得点数がアップしているか否か等)に応じて適宜変更することも可能である。dの値をどのように設定するかは、本発明をコンピュータ・グラフィックス・アート用として使用するか、或いはゲーム用として使用するか等の各種アプリケーションの用途に応じて、プログラマが適宜設定することが可能である。
As shown in FIG. 3, the
V = d (3)
According to equation (3), regardless of the luminance I, the V value can be set by the value of the variable d. This variable d is a dynamic variable that can be arbitrarily changed on the program. For example, it can be changed in real time according to the distance between the light source and the object, and further, regardless of the positional relationship with the light source, It is also possible to change appropriately according to the game situation (for example, whether the player is in an advantageous situation, whether the score is increased, etc.) developed in the virtual space. How to set the value of d should be set appropriately by the programmer according to the use of various applications such as whether the present invention is used for computer graphics, art, or for games. Is possible.
例えば、図1の例において、dの値を0.15に設定すると、薄い赤色のシェーディング処理によって、弱いコントラストを表現することができる一方、dの値を0.9に設定すると、濃い青色のシェーディング処理によって、強いコントラストを表現することができる。dの値を光源との距離に関連付けて定義すると、オブジェクトと光源との位置関係に連動してdの値をリアルタイムに変更することができる。例えば、図3の例において、図示左右方向に座標軸を設定し、光源41の位置をd=0.0、光源42の位置をd=0.5、光源43の位置をd=1.0とすれば、オブジェクト50が光源41に近づくほどd値は0.0に近づき、光源42に近づくほどd値は0.5に近づき、光源43に近づくほどd値は1.0に近づく。同図の例では、オブジェクト50は光源42の位置に対してやや左寄りであるため、上記座標軸上のd値を求めて、d=0.35が得られたとすると、オブジェクト50の表面にシェーディングされる陰影の色は薄い緑色となる。
For example, in the example of FIG. 1, when the value of d is set to 0.15, a weak contrast can be expressed by the light red shading process, while when the value of d is set to 0.9, a dark blue color A strong contrast can be expressed by the shading process. If the value of d is defined in association with the distance to the light source, the value of d can be changed in real time in conjunction with the positional relationship between the object and the light source. For example, in the example of FIG. 3, coordinate axes are set in the horizontal direction in the drawing, the position of the
このように、U値をシェーディング処理用に用い、V値を陰影の色調制御用に用いることで、3色の光源による滑らかなシェーディング処理を実現することができる。さらに、従来技術のように、光源との位置関係で予め設定された境界を境にして陰影の色調が激変することがないため、違和感のない滑らかなシェーディングを実現することができる。また、従来では、光源の数に対応して、複数のテクスチャデータを用意する必要があったが、本実施形態によれば1つで済むため、複数のテクスチャデータを作成するデザイナーの手間を省略できるとともに、テクスチャメモリの節約にもなる。 Thus, by using the U value for shading processing and the V value for shading color control, it is possible to realize smooth shading processing with three color light sources. Further, unlike the prior art, the shade color does not change drastically at the boundary set in advance with the positional relationship with the light source, so that smooth shading without a sense of incongruity can be realized. In addition, conventionally, it is necessary to prepare a plurality of texture data corresponding to the number of light sources. However, according to the present embodiment, only one is required, so the trouble of a designer who creates a plurality of texture data is omitted. As well as saving texture memory.
本実施形態のテクスチャデータを用いた他の使用例について説明する。dの値が0.0から1.0と増加するに従い、テクスチャデータは濃い黒から徐々に薄い黒へと変化するように濃淡勾配が設定されているものとすると、光源とオブジェクトとの位置関係に連動して陰影のコントラストを変えることができる。例えば、図4において、図示左右方向に座標軸を設定し、光源40の位置をd=0.0とすると、光源40から離れるに従い、d=0.0からd=1.0とd値が変化する。例えば、d=0.3では光源40とオブジェクト50との距離が相対的に短いため、比較的強いコントラストの陰影がシェーディング処理されるのに対し、d=0.8では光源40とオブジェクト50との距離が相対的に長いため、比較的弱いコントラストの陰影がシェーディング処理される。つまり、光源40から離れるに従い、距離の2乗に反比例してオブジェクト表面における受光強度が弱まり、徐々にコントラストの弱いシェーディング処理がなされ、ライティング効果と同等の効果を得ることができる。
Another usage example using the texture data of this embodiment will be described. As the value of d increases from 0.0 to 1.0, it is assumed that the gradient gradient is set so that the texture data gradually changes from dark black to light black. The contrast of the shadow can be changed in conjunction with. For example, in FIG. 4, when the coordinate axis is set in the horizontal direction in the drawing and the position of the
図5はカメラ60とオブジェクト50との距離に連動してd値を変更し、シェーディングを行う場合の説明図である。図示左右方向に座標軸を設定して、カメラ60の位置をd=0.0とすると、カメラ60から離れるに従い、d=0.0からd=1.0とd値が変化する。ここで、dの値が0.0から1.0と増加するに従い、テクスチャデータは濃い黒から徐々に薄い黒へと変化するように濃淡勾配が設定されているものとすると、カメラ60から離れるに従い、徐々にコントラストの弱いシェーディング処理がなされ、フォグのような効果を得ることができる。
FIG. 5 is an explanatory diagram when shading is performed by changing the d value in conjunction with the distance between the
尚、本発明は、光源若しくはカメラとオブジェクト間の距離に応じてd値を変更し、シェーディング処理する場合に限らず、例えば、光源の光強度をd値と関連付けてシェーディングすることもできる。例えば、光強度が極大となる光源に対してd値を0.0とし、光強度が徐々に弱くなるに従い、d値の値を徐々に増加させ、光強度が極小となる光源に対してd値を1.0とすれば、光源の光強度の強弱に対応して陰影のコントラストを微調整することができる。但し、この場合において、dの値が0.0から1.0と増加するに従い、テクスチャデータは濃い黒から徐々に薄い黒へと変化するように濃淡勾配が設定されているものとする。また、d値の設定例として、オブジェクトと海面との距離を関連付けたり、オブジェクト同士の距離に関連付けたり、その他ゲームパラメータに関連付けたりすることもできる。 Note that the present invention is not limited to the case where the d value is changed according to the distance between the light source or the camera and the object and the shading process is performed. For example, the light intensity of the light source can be shaded in association with the d value. For example, the d value is set to 0.0 for a light source having a maximum light intensity, and the d value is gradually increased as the light intensity gradually decreases, so that the d value is increased for a light source having a minimum light intensity. If the value is 1.0, the shadow contrast can be finely adjusted in accordance with the light intensity of the light source. However, in this case, it is assumed that the gradation gradient is set so that the texture data gradually changes from dark black to light black as the value of d increases from 0.0 to 1.0. Further, as an example of setting the d value, the distance between the object and the sea surface can be associated, the distance between the objects can be associated, or other game parameters can be associated.
図2にテクスチャデータの他の例を示す。同図に示すテクスチャデータ30はU座標方向及びV座標方向のそれぞれに曲線状の濃淡勾配を形成するように、白色のデータ領域C11、薄い灰色のデータ領域C12、灰色のデータ領域C13、濃い灰色のデータ領域C14、黒色のデータ領域C15が配されている。光源計算によりテクスチャデータ30のU値を求めるには(1)式を用い、V値を求めるには(3)式を用いる。テクスチャデータ30を用いることで、d値に対応して陰影の階調数を調整することができる。例えば、d値を0.2とすると、V値はC11、C13、C15の何れかのデータ領域の値をとるため、陰影を3値化することができ、d値を0.8とすると、V値はC11〜C15までの何れかのデータ領域の値をとるため、陰影を5値化することができる。図6はテクスチャデータ30を用いたシェーディングの応用例の説明図であり、プレイヤがゲーム上で獲得したポイント(点数)に連動してd値を増減することで、陰影の階調数を調整している。同図の例では、ポイントが少ない場合には、d値を0.2に設定することで階調数を3とし、ポイントが多い場合には、d値を0.8に設定することで階調数を5とする。プレイヤの獲得ポイントに連動してゲームキャラクタ等の陰影の階調数を自在に調整できるため、ゲーム展開に応じてキャラクタの雰囲気等をアニメ調から劇画調へと自在に変えることができるため、ゲームを面白くすることができる。
FIG. 2 shows another example of texture data. The
以上、説明したように、本実施形態によれば、U座標方向だけでなく、V座標方向にもテクスチャの色調を変化させたため、例えば、赤い陰影から青い陰影へと滑らかに塗り分けることができ、陰影の色調変化を違和感なく自然に変化させることが可能となる。また、シェーディング用のテクスチャを予め図柄で有しているため、従来のフォグによる連続変化に比べると複雑な描画を簡易に行うことができる。また、従来では光源数等に対応してテクスチャデータを複数用意していたが、本実施形態では複数のテクスチャデータを単一のテクスチャデータに集約することができるため、キャッシュのヒット率を高めることができ、描画速度を高めることができる。また、輝度Iにかかわらず、V値を独立に指定できるため、テクスチャデータ全体のデータ領域を有効に活用でき、テクスチャメモリの無駄が生じることもない。 As described above, according to this embodiment, since the color tone of the texture is changed not only in the U coordinate direction but also in the V coordinate direction, for example, it is possible to smoothly paint from a red shade to a blue shade. Therefore, it is possible to change the shade color change naturally without a sense of incongruity. In addition, since the texture for shading is provided in advance as a design, complicated drawing can be easily performed as compared with the conventional continuous change by fog. Conventionally, a plurality of texture data has been prepared corresponding to the number of light sources, etc., but in this embodiment, a plurality of texture data can be aggregated into a single texture data, thereby increasing the cache hit rate. The drawing speed can be increased. Further, since the V value can be specified independently regardless of the luminance I, the data area of the entire texture data can be used effectively, and the texture memory is not wasted.
尚、本実施形態によれば、陰影の色調数や段階数だけでなく、段階的に出現するハイライト、反射光量の増減、オブジェクト表面の露光面積の変化、色調や彩度の変化、透明度の変化などを自在に調整することができる。また、d値の設定を適宜変更することにより、ノイズのような表現や、焚き火の光が当たっているようなゆらゆらとした光量の変化、陰影部分と露光部分の面積比率の増減などが表現できる。また、オブジェクトの頂点毎にd値を変えることで、複雑な点光源の表現や、オブジェクト表面の特定部分だけ陰影が変化する表現、当該特定の部分だけ艶が生じる表現などが可能となる。また、本発明はポリゴンで構成されたオブジェクトへのテクスチャマッピングだけでなく、NURBS等の曲面に対するテクスチャマッピングに用いることができる。 In addition, according to the present embodiment, not only the shade tone number and the number of steps, but also highlights appearing in steps, increase / decrease in the amount of reflected light, change in exposure area of the object surface, change in color tone and saturation, change in transparency, etc. Changes can be adjusted freely. In addition, by appropriately changing the d value setting, it is possible to express expressions such as noise, fluctuations in the amount of light that fluctuates when bonfire light strikes, increase or decrease in the area ratio of the shadow part and the exposed part, etc. . Further, by changing the d value for each vertex of the object, it is possible to express a complicated point light source, an expression in which the shadow changes only on a specific part of the object surface, or an expression in which the specific part is glossy. Further, the present invention can be used not only for texture mapping to an object composed of polygons but also for texture mapping for curved surfaces such as NURBS.
11…テクスチャメモリ
12…フィルタ
13…フレームメモリ
14…ビデオ信号生成部
20,30…テクスチャデータ
40,41,42,43…光源
50…オブジェクト
60…カメラ
DESCRIPTION OF
Claims (3)
前記2方向のうち他の1方向における、前記データ領域にアクセスするための座標Vを、前記オブジェクトと光源との距離、前記オブジェクトと仮想視点との距離、前記オブジェクトと他のオブジェクトとの距離、又は、前記オブジェクト表面を有するゲームキャラクタを用いて行われるゲームにおいてプレイヤが獲得した点数、のいずれか一つに連動して決定される動的変数dの値を基に、計算式V=dにより算出し、
算出された座標U及びVを基に前記データ領域にアクセスすることにより、色データを読み出し、前記オブジェクト表面へテクスチャマッピングして、得られた画像データを表示出力する、テクスチャマッピング方法。 In order to access texture data including a computer-readable data area in which different color data is arranged in each of a plurality of areas provided in a two-dimensional plane, a normalized normal vector of an object surface to be texture-mapped, and A coordinate U for accessing the data area in any one of the two directions is calculated based on the luminance value I obtained from the inner product of the standardized ray vectors and the constants a and b. Calculated by the formula U = a * I + b,
The coordinate V for accessing the data area in the other one of the two directions is the distance between the object and the light source, the distance between the object and the virtual viewpoint, the distance between the object and another object, Alternatively, based on the value of the dynamic variable d determined in conjunction with any one of the points obtained by the player in the game performed using the game character having the object surface, the calculation formula V = d Calculate
A texture mapping method in which color data is read out by accessing the data area based on the calculated coordinates U and V, texture mapping is performed on the object surface, and the obtained image data is displayed and output.
2次元平面に設けられた複数の領域のそれぞれに異なる色データを配したコンピュータ読取り可能なデータ領域を含むテクスチャデータにアクセスするために、テクスチャマッピングされるオブジェクト表面の規格化された法線ベクトルと規格化された光線ベクトルの内積から求められる輝度の値I、並びに、定数a及びbに基づいて、前記2方向のうち何れか一方向における、前記データ領域にアクセスするための座標Uを、計算式U=a*I+bにより算出する手段、
前記2方向のうち他の一方向における、前記データ領域にアクセスするための座標Vを、前記オブジェクトと光源との距離、前記オブジェクトと仮想視点との距離、前記オブジェクトと他のオブジェクトとの距離、又は、前記オブジェクト表面を有するゲームキャラクタを用いて行われるゲームにおいてプレイヤが獲得した点数、のいずれか一つに連動して決定される動的変数dの値を基に、計算式V=dにより算出する手段、
算出された座標U及びVを基に前記データ領域にアクセスすることにより、色データを読み出し、前記オブジェクト表面へテクスチャマッピングして、得られた画像データを表示出力する手段、
として機能させるためのプログラム。 Computer
In order to access texture data including a computer-readable data area in which different color data is arranged in each of a plurality of areas provided in a two-dimensional plane, a normalized normal vector of an object surface to be texture-mapped, and the value I of intensity obtained from the inner product of the normalized light vector, and, based on the constants a and b, in the one direction of the two directions, the coordinates U for access to the data area, calculated Means for calculating by the formula U = a * I + b ;
Coordinates V for accessing the data area in the other one of the two directions are the distance between the object and the light source, the distance between the object and the virtual viewpoint, the distance between the object and another object, Alternatively, based on the value of the dynamic variable d determined in conjunction with any one of the points obtained by the player in the game performed using the game character having the object surface , the calculation formula V = d Means for calculating,
Means for reading out the color data by accessing the data area based on the calculated coordinates U and V , texture-mapping the object surface, and displaying the obtained image data ;
Program to function as.
前記2方向のうち他の一方向における、前記データ領域にアクセスするための座標Vを、前記オブジェクトと光源との距離、前記オブジェクトと仮想視点との距離、前記オブジェクトと他のオブジェクトとの距離、又は、前記オブジェクト表面を有するゲームキャラクタを用いて行われるゲームにおいてプレイヤが獲得した点数、のいずれか一つに連動して決定される動的変数dの値を基に、計算式V=dにより算出する手段と、
算出された座標U及びVを基に前記データ領域にアクセスすることにより、色データを読み出し、前記オブジェクト表面へテクスチャマッピングして、得られた画像データを表示出力する手段と、
を備えるテクスチャマッピング装置。 In order to access texture data including a computer-readable data area in which different color data is arranged in each of a plurality of areas provided in a two-dimensional plane, a normalized normal vector of an object surface to be texture-mapped, and the value I of intensity obtained from the inner product of the normalized light vector, and, based on the constants a and b, in the one direction of the two directions, the coordinates U for access to the data area, calculated Means for calculating by the formula U = a * I + b ;
Coordinates V for accessing the data area in the other one of the two directions are the distance between the object and the light source, the distance between the object and the virtual viewpoint, the distance between the object and another object, Alternatively, based on the value of the dynamic variable d determined in conjunction with any one of the points obtained by the player in the game performed using the game character having the object surface , the calculation formula V = d Means for calculating;
Means for accessing the data area based on the calculated coordinates U and V to read out the color data, texture-mapping the object surface, and displaying and outputting the obtained image data ;
A texture mapping apparatus comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007318380A JP4617501B2 (en) | 2007-12-10 | 2007-12-10 | Texture mapping method, program and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007318380A JP4617501B2 (en) | 2007-12-10 | 2007-12-10 | Texture mapping method, program and apparatus |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002042137A Division JP4075039B2 (en) | 2002-02-19 | 2002-02-19 | Texture mapping method, program and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008117412A JP2008117412A (en) | 2008-05-22 |
JP4617501B2 true JP4617501B2 (en) | 2011-01-26 |
Family
ID=39503218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007318380A Expired - Fee Related JP4617501B2 (en) | 2007-12-10 | 2007-12-10 | Texture mapping method, program and apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4617501B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015051119A (en) * | 2013-09-06 | 2015-03-19 | 株式会社カプコン | Game program and game apparatus |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10293862A (en) * | 1997-04-21 | 1998-11-04 | Power Reactor & Nuclear Fuel Dev Corp | Three-dimensional object data processing method |
JP2000135375A (en) * | 1998-10-30 | 2000-05-16 | Square Co Ltd | Game system, information recording medium and image processing method |
JP2001101441A (en) * | 1999-09-28 | 2001-04-13 | Square Co Ltd | Method and device for rendering, game system and computer readable recording medium storing program for rendering three-dimensional model |
JP2002024853A (en) * | 2000-07-03 | 2002-01-25 | Sony Computer Entertainment Inc | Image drawing system |
-
2007
- 2007-12-10 JP JP2007318380A patent/JP4617501B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10293862A (en) * | 1997-04-21 | 1998-11-04 | Power Reactor & Nuclear Fuel Dev Corp | Three-dimensional object data processing method |
JP2000135375A (en) * | 1998-10-30 | 2000-05-16 | Square Co Ltd | Game system, information recording medium and image processing method |
JP2001101441A (en) * | 1999-09-28 | 2001-04-13 | Square Co Ltd | Method and device for rendering, game system and computer readable recording medium storing program for rendering three-dimensional model |
JP2002024853A (en) * | 2000-07-03 | 2002-01-25 | Sony Computer Entertainment Inc | Image drawing system |
Also Published As
Publication number | Publication date |
---|---|
JP2008117412A (en) | 2008-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4075039B2 (en) | Texture mapping method, program and apparatus | |
US7583264B2 (en) | Apparatus and program for image generation | |
JP3626144B2 (en) | Method and program for generating 2D image of cartoon expression from 3D object data | |
US7064753B2 (en) | Image generating method, storage medium, image generating apparatus, data signal and program | |
US7327364B2 (en) | Method and apparatus for rendering three-dimensional images of objects with hand-drawn appearance in real time | |
WO2023066121A1 (en) | Rendering of three-dimensional model | |
Rudomín et al. | Fragment shaders for agent animation using finite state machines | |
Winnemöller | NPR in the Wild | |
WO2008014384A2 (en) | Real-time scenery and animation | |
US20090080803A1 (en) | Image processing program, computer-readable recording medium recording the program, image processing apparatus and image processing method | |
US7133052B1 (en) | Morph map based simulated real-time rendering | |
US11804008B2 (en) | Systems and methods of texture super sampling for low-rate shading | |
JP3502796B2 (en) | 3D model display method and apparatus in video game, game apparatus, and computer-readable recording medium storing 3D model display program for video game | |
JP4617501B2 (en) | Texture mapping method, program and apparatus | |
JP2003168130A (en) | System for previewing photorealistic rendering of synthetic scene in real-time | |
JP2008077405A (en) | Image generation system, program, and information storage medium | |
JP2006252426A (en) | Program, information storage medium, and image generation system | |
JP4201207B2 (en) | Program, information storage medium, and image generation system | |
JP2001273519A (en) | Game system, picture plotting method for this system, and computer-readable recording medium for storing program for game | |
US7724255B2 (en) | Program, information storage medium, and image generation system | |
JP2006277488A (en) | Program, information storage medium and image generation system | |
JP2010033302A (en) | Image generation system, program and information storage medium | |
Taif | Machine learning for 3D visualisation using generative models | |
JP2010033301A (en) | Image generation system, program and information storage medium | |
JP2006252425A (en) | Program, information storage medium, and image generation system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100628 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100709 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100903 |
|
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: 20100922 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20101019 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20101005 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131105 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4617501 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
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 |