JP2004102900A - Image generating method and device therefor - Google Patents

Image generating method and device therefor Download PDF

Info

Publication number
JP2004102900A
JP2004102900A JP2002266890A JP2002266890A JP2004102900A JP 2004102900 A JP2004102900 A JP 2004102900A JP 2002266890 A JP2002266890 A JP 2002266890A JP 2002266890 A JP2002266890 A JP 2002266890A JP 2004102900 A JP2004102900 A JP 2004102900A
Authority
JP
Japan
Prior art keywords
image
texture
light
vector
normal
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
JP2002266890A
Other languages
Japanese (ja)
Other versions
JP4078926B2 (en
Inventor
Takahiro Hiraoka
平岡 隆宏
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.)
Toppan Inc
Original Assignee
Toppan Printing Co 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 Toppan Printing Co Ltd filed Critical Toppan Printing Co Ltd
Priority to JP2002266890A priority Critical patent/JP4078926B2/en
Publication of JP2004102900A publication Critical patent/JP2004102900A/en
Application granted granted Critical
Publication of JP4078926B2 publication Critical patent/JP4078926B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To generate a high quality image with partially different quality with less number of processing steps. <P>SOLUTION: The lengths of normal vectors on a normal map are differentiated according to the difference of the quality of a corresponding texture image. A write vector is multiplied by the texture image to generate a rendering image by diffuse light, the inner product of a half angle vector by the normal vector on the normal map corresponding to the texture image is calculated, and the inner product value is multiplied by a specified specular color to generate the rendering image by specular light. Then, the rendering image by the diffuse light and the rendering image by the specular light are added to each other to generate an output image. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、立体空間に立体モデルと光源と視点を設定して、視点から立体モデルを見たときの画像を生成する画像生成方法及びその装置に関し、特に、法線マップを用いたバンプマッピング技術を応用して部分的に質感が異なる画像を生成する方法及びその装置に関する。
【0002】
【従来の技術】
例えばバーチャルリアリティ(VR)システムは、コンピュータの中に互いに直交する3つの座標軸(X軸,Y軸,Z軸)によって仮想的に表現された三次元座標系の立体空間に、種々の立体モデルと光源を設定するとともに、入力装置からの入力信号によって上記立体空間内を自由に移動できる視点を設定し、この視点から見た立体空間の画像を生成し、スクリーンやディスプレイ等の画面に表示させることによって、鑑賞者自身があたかも仮想空間内に入り込み、立体モデルを見ているような感覚が得られるというものである。
【0003】
ところで、立体モデルの表面は様々な模様を持つ。これらの模様は、テクスチャと称される画像データとしてコンピュータ内の記憶装置に予め記憶されている。そして画像生成時に、テクスチャ画像は該当する立体モデルの表面に貼り付けられ、視点や光源の位置等によりシェーディング(陰影付け)されて、画面に表示される。
【0004】
また、模様のなかには凸凹感を持たせることによって、よりリアルな画像が得られる場合がある。凸凹のないテクスチャ画像を凸凹があるかのように見せるのも、シェーディングによって可能である。このようなシェーディングを、バンプマッピングと称している。バンプマッピングとしては、法線マップを用いた技術が一般的である。
【0005】
図13に法線マップ1の一例を示す。この法線マップ1は、図14に示すテクスチャ2の画像に対応して作成されたものである。法線マップ1は、図15に示すように、X軸,Y軸及びZ軸からなる三次元座標系に対する画素pの向きを、画素p毎に法線ベクトルS(X,Y,Zの各ベクトル値からなる)の傾きで表現したもので、X,Y,Zの各々のベクトル値がそれぞれR(Red),G(Green),B(Blue)値に変換されて画素p毎に設定されている。ここで、法線ベクトルSの長さは、全て“1”に正規化されている。したがって、法線ベクトルSの傾きの大きさは−1.0〜1.0の範囲となるが、色の強さは0〜255なので、例えば法線ベクトルS(X,Y,Z)が(0.0,0.0,1.0)となる平らの部分は、(R,G,B)=(127,127,255)となり、青色で表現される。
【0006】
図16は、この種の画像を生成する画像生成装置が実行する従来のバンプマップ処理の手順を示す流れ図である。すなわち画像生成装置は、立体モデルの表面に貼り付けられる画像のテクスチャ2と、このテクスチャ2の画像に対応して作成された法線マップ1を記憶部から取得する(ST1,ST2)。
【0007】
次に、画像生成装置は、当該テクスチャ2の画像が貼り付けられる立体モデルの面の向きと光源の位置とから、当該面の光源方向への向きを示すライトベクトルを画素p毎に計算する(ST3)。次に、画像生成装置は、このライトベクトルと、当該テクスチャ2の画像に対応する法線マップ1の法線ベクトルSとの内積を画素p毎に計算して、ディフューズ(Diffuse:拡散反射)光に対する各画素pの輝度値を求める(ST4)。しかる後、この内積演算結果(内積値)である各画素pの輝度値を当該テクスチャ2の画像に乗算して、ディフューズ光によるレンダリング画像を生成する(ST5)。
【0008】
また、画像生成装置は、当該テクスチャ2の画像が貼り付けられる立体モデルの面の向きと光源及び視点の各位置とから、当該面の光源からの光方向と視点からの視線方向との和の向きを示すハーフアングルベクトルを画素p毎に計算する(ST6)。次に、画像生成装置は、このハーフアングルベクトルと前記法線マップ1の法線ベクトルSとの内積を画素p毎に計算して、スペキュラ(Specular:鏡面反射)光に対する各画素pの輝度値を求める(ST7)。しかる後、この内積演算結果である各画素pの輝度値を、所定のスペキュラカラーに乗算して、スペキュラ光によるレンダリング画像を生成する(ST8)。なお、スペキュラカラーは、当該テクスチャ2の画像が貼り付けられる面を照射する光源の種類によって決まる。
【0009】
こうして、ディフューズ光によるレンダリング画像とスペキュラ光によるレンダリング画像とを生成したならば、画像生成装置は、両レンダリング画像を加算して最終出力画像を得る(ST9)。そして画像生成装置は、この最終出力画像を表示装置に出力して(ST10)、スクリーンやディスプレイの画面に表示させていた。
【0010】
なお、ST3〜ST5のディフューズ光によるレンダリング画像生成処理と、ST6〜ST8のスペキュラ光によるレンダリング画像生成処理とは、どちらを先に処理してもよく、また、並行して処理してもよいものである。
【0011】
さて、従来のバンプマップ処理によってシェーディングが施された画像の一例を図17に示す。この画像は、画面中央の襖を示す立体モデルの表面に、図14に示したテクスチャ2の画像を貼り付けたもので、テクスチャ2の画像は、松以外の部分に金箔が貼られていることを表現しているので、バンプマップ処理を施して金箔の光沢感を高めている。しかしながら、従来のバンプマップ処理では、襖絵全体で光沢感が均一となるため、襖絵全体に光沢があるように表現されてしまっており、金箔の部分が目立たなくなっていた。
【0012】
そこで、図18に示すように、襖絵の光沢感がない松の部分を黒くしたマスク用画像のテクスチャ3を用意する。そして画像生成装置は、図16の破線で示すように、スペキュラ光によるレンダリング画像に上記マスク用画像を乗算して、マスク部分の輝度値を低くした後(ST11)、ディフューズ光によるレンダリング画像を加算して(ST9)、最終出力画像を得るようにする(ST10)。こうすることにより、金箔が貼られていない松の部分は光沢が抑えられるので、金箔の光沢感が高められる。
【0013】
因みに、図17に示した画像を生成する場合において、マスク用画像のテクスチャ3を適用する前のスペキュラ光によるレンダリング画像を図19に示し、マスク用画像のテクスチャ3を適用した後のスペキュラ光によるレンダリング画像を図20に示す。
【0014】
【発明が解決しようとする課題】
しかしながら、テクスチャ画像の光沢感が部分的に異なるためにマスク用画像のテクスチャ3を適用する場合には、テクスチャ2の画像からマスク用画像のテクスチャ3を予め作成しておかなければならない煩雑さがある上、テクスチャ2や法線マップ1以外に、マスク用画像のテクスチャ3を記憶保持するための記憶領域も必要で、記憶容量が大容量になるという問題があった。また、スペキュラ光によるレンダリング画像に上記マスク用画像を乗算する処理ステップが追加されるため処理に時間がかかり、バーチャルリアリティシステムのように画像をごく短時間に次々と生成しなければならないものに対しては不向きであった。
【0015】
本発明はこのような事情に基づいてなされたもので、その目的とするところは、部分的に質感が異なる画像を少ない処理ステップで高品質に生成できる上、記憶容量も節約できる画像生成方法及びその装置を提供しようとするものである。
【0016】
【課題を解決するための手段】
本発明はかかる課題を解決するものであり、請求項1に対応する発明は、立体空間に、部分的に質感が異なる画像のテクスチャを貼り付けた立体モデルと光源と視点をそれぞれ設定して、視点から立体モデルを見たときの画像を生成する画像生成方法であって、立体モデルのテクスチャ画像が貼り付けられる面の光源方向への向きを示すライトベクトルをテクスチャ画像に乗算してディフューズ光によるレンダリング画像を生成するステップと、立体モデルのテクスチャ画像が貼り付けられる面の光源からの光方向と視点からの視線方向との和の向きを示すハーフアングルベクトルとテクスチャ画像に対応した法線マップの法線ベクトルとの内積を計算し、この内積値を所定のスペキュラカラーに乗算してスペキュラ光によるレンダリング画像を生成するステップと、ディフューズ光によるレンダリング画像とスペキュラ光によるレンダリング画像とを加算して出力画像を生成するステップとからなり、法線マップの法線ベクトルの長さを、対応するテクスチャ画像の質感の違いにより異ならせたしたものである。
【0017】
この請求項1に対応する発明の画像生成方法においては、法線マップの画素毎に設定された各法線ベクトルの長さが、対応するテクスチャ画像の質感の違いにより異なっている。したがって、スペキュラ光によるレンダリング画像は、ハーフアングルベクトルと上記法線マップの法線ベクトルとの内積を計算し、この内積値を所定のスペキュラカラーに乗算することによって生成しているので、法線ベクトルに応じてスペキュラ光の輝度値が異なり、質感の違いが高品質に表現される。なお、法線ベクトルの長さが不揃いだと、ディフューズ光の計算時にテクスチャの画像情報が損なわれて黒ずんでしまう。そこで、本発明では、ディフューズ光の計算に法線ベクトルを考慮しないように、ライトベクトルの高さ方向の成分をテクスチャの画像データに乗算するだけでディフューズ光によるレンダリング画像を生成している。
【0018】
本発明の請求項2に対応する発明は、上記請求項1に対応する発明において、部分的に光沢感が異なる画像のテクスチャに対応する法線マップは、画素毎に設定された各法線ベクトルのうち、対応するテクスチャ画像の中で光沢感を抑える画像に対応する画素の法線ベクトルを他の画素の法線ベクトルより短くしたものである。
【0019】
この請求項2に対応する発明の画像生成方法においては、法線マップの法線ベクトルは、対応するテクスチャ画像の中で光沢感を抑える画像に対応する画素の法線ベクトルが他の画素の法線ベクトルより短くなっている。したがって、スペキュラ光によるレンダリング画像は、法線ベクトルが短い部分はスペキュラ光の輝度がその分小さくなるので、この部分に対応した画像の光沢感が抑えられる。
【0020】
本発明の請求項3に対応する発明は、立体空間に立体モデルと光源と視点をそれぞれ設定して、視点から立体モデルを見たときの画像を生成する画像生成装置において、立体モデルに貼り付けるテクスチャ画像及びこのテクスチャ画像に対応した法線マップを記憶する記憶手段と、テクスチャ画像が光沢感に斑のある画像であるとき、立体モデルのテクスチャ画像が貼り付けられる面の光源方向への向きを示すライトベクトルを当該テクスチャ画像に乗算してディフューズ光によるレンダリング画像を生成するディフューズ光レンダリング手段と、テクスチャの画像が光沢感に斑のある画像であるとき、立体モデルのテクスチャ画像が貼り付けられる面の光源からの光方向と視点からの視線方向との和の向きを示すハーフアングルベクトルとテクスチャ画像に対応した法線マップの法線ベクトルとの内積を計算し、この内積値を所定のスペキュラカラーに乗算してスペキュラ光によるレンダリング画像を生成するスペキュラ光レンダリング手段と、ディフューズ光レンダリング手段により生成されたディフューズ光によるレンダリング画像とスペキュラ光レンダリング手段により生成されたスペキュラ光によるレンダリング画像とを加算して出力画像を生成する出力画像生成手段とを備え、法線マップは、法線ベクトルの長さを、対応するテクスチャ画像の質感の違いにより異ならせたものである。
【0021】
この請求項3に対応する発明の画像生成装置においては、記憶手段により、立体モデルに貼り付けるテクスチャ画像と、このテクスチャ画像に対応した法線マップとが記憶手段により記憶されている。ここで、法線マップは、法線ベクトルの長さが、対応するテクスチャ画像の質感の違いにより異なっている。
【0022】
ディフューズ光によるレンダリング画像は、ライトベクトルの高さ方向の成分が当該テクスチャ画像に乗算されて生成される。一方、スペキュラ光によるレンダリング画像は、ハーフアングルベクトルと当該テクスチャ画像に対応する法線マップの法線ベクトルとの内積が計算され、この内積値がスペキュラカラーに乗算されて生成される。しかして、ディフューズ光によるレンダリング画像とスペキュラ光によるレンダリング画像とが加算されて、法線ベクトルの長さにより部分的に質感が異なった出力画像が生成される。
【0023】
【発明の実施の形態】
以下、本発明の一実施の形態を図面を用いて説明する。
なお、この実施の形態は、バーチャルリアリティシステムで表示される立体空間画像を生成する場合について説明する。
【0024】
図1は本実施の形態における画像生成装置10の要部構成を示すブロック図であり、この画像生成装置10は、例えばパーソナルコンピュータやワークステーション等のコンピュータによって構成されている。
【0025】
画像生成装置10は、入力装置20から入力される各種の信号を、それぞれ対応する内容の入力指令に変換し、この入力指令を画像生成演算部13に与える入力信号変換部11と、モデルファイル121,光源ファイル122,テクスチャファイル123,法線マップファイル124などの種々のデータファイルを記憶保存する記憶手段としてのデータ記憶部12と、前記入力信号変換部11から与えられた入力指令に従い前記データ記憶部12のデータを使用して立体空間画像を生成する画像生成演算部13と、この画像生成演算部13により生成された立体空間画像のデータを記憶するフレームメモリ14と、このフレームメモリ14に記憶された画像データを読出し、アナログの映像信号に変換して表示装置30に出力するD/A(ディジタル/アナログ)変換部15とから構成されている。
【0026】
なお、入力装置20は、立体空間に設定される視点の位置や視線方向を移動させるためのものである。表示装置30は、スクリーンやディスプレイ等の画面に立体空間画像を投影して表示するものである。
【0027】
モデルファイル121には、立体空間に設定される各種立体モデルの形状や位置等に関するデータが記憶保存されている。図2に、モデルファイル121に記憶保存されるデータレコード41の一例を示す。図2において、項目「モデルID」は、各種立体モデルを一意に識別するためにモデル毎に設定された固有のコードである。例えば、一意に定めたモデル毎のファイル名であってもよい。項目「形状データ」は、対応するモデルIDが設定された立体モデルの三次元形状の各頂点座標等を示すデータである。項目「位置座標」は、互いに直交する3つの座標軸(X軸,Y軸,Z軸)によって仮想的に表現された三次元座標系の立体空間において、対応するモデルIDの立体モデルが設置された位置座標を示すデータである。項目「テクスチャNo」は、対応するモデルIDが設定された立体モデルの表面に貼り付けられるテクスチャ画像を特定する識別記号である。この識別記号は、例えばテクスチャ画像のファイル名であってもよい。
【0028】
光源ファイル122には、立体空間に設定される各種光源に関するデータが記憶保存されている。図3に、光源ファイル122に記憶保存されるデータレコード42の一例を示す。図3において、項目「光源ID」は、各種光源を識別するために光源毎に一意に設定された固有のコードである。項目「種別」は、対応する光源IDが設定された光源の種類(無限遠光源,点光源,線光源,環境光等)を示すデータである。項目「位置座標」は、前記三次元座標系の立体空間において、対応する光源IDの光源が設置された位置座標を示すデータである。
【0029】
テクスチャファイル123には、各種立体モデルの面に貼り付けられる模様や材質等を示すテクスチャデータが記憶保存されている。図4に、テクスチャファイル123に記憶保存されるデータレコードの一例を示す。図4において、項目「テクスチャNo」は、各テクスチャデータを識別するためにテクスチャ毎に設定された固有の識別記号である。例えばテクスチャNoは、テクスチャデータのファイル名であってもよい。項目「画像データ」は、対応するテクスチャNoが設定されたテクスチャの画像データである。項目「法線マップNo」は、対応するテクスチャNoのテクスチャ画像から作成された法線マップを特定する識別記号である。例えば法線マップNoは、法線マップデータのファイル名であってもよい。項目「光沢フラグ」は、対応するテクスチャNoのテクスチャ画像が光沢感に斑のある画像か否かを識別するデータである。
【0030】
また、このテクスチャファイル123のファイルには、「レンダリング指示」と呼ばれる項目が備えられていてもよい。このレンダリング指示とは、モデルの表面をレンダリングする際の指示が記載されたものである。例えば、このレンダリング指示は、モデルAに対して通常のバンプマッピング、モデルBに対しては法線マップAと法線マップB、モデルCに対しては法線マップB、モデルDに対しては本発明を実施するに必要な法線マップE等のように、立体モデルと手法との対応付けが行なわれているものである。このようなレンダリング指示をファイルに記載しておくことによって、異なった立体モデルに対して同一の法線マップなどの手法を対応付けることができる。これにより、重複した法線マップを記録する必要がなくなる。
【0031】
法線マップファイル124には、各種テクスチャ画像から生成された法線マップに関するデータが記憶保存されている。図5に、法線マップファイル124に記憶保存されるデータレコードの一例を示す。図5において、項目「法線マップNo」は、各法線マップを識別するために法線マップ毎に設定された固有の識別記号である。各「法線マップデータ」は、対応する法線マップNoが設定された法線マップの各画素の法線ベクトルである。
【0032】
また、図2から図5までの各種ファイルの各レコードを集約して一つのファイル、1つのレコードとしてもよい。この場合には、重複する項目は省略される。
【0033】
ここで、本実施の形態では、従来の手法で行なわれている各法線ベクトルの長さを1に正規化するという制約を外し、法線マップの画素毎に設定された各法線ベクトルの大きさを、対応するテクスチャ画像の質感の違いによって異ならせている。このような法線ベクトルは、例えば下記(1)式によって算出される。
【0034】
(R,G,B)=[(r,g,b)−(127,127,127)]×α+(127,127,127)  …(1)
ただし、r,g,bは法線ベクトルを1に正規化したときのX,Y,Zのベクトルにそれぞれ対応したRGB値。αは0≦α≦1の範囲内で任意。
【0035】
さて、かかる構成の画像生成装置において、画像生成演算部13は、三次元座標系の立体空間に、モデルファイル121に設定された各種立体モデルと、光源ファイル122に設定された各種光源を設定し、入力装置20からの入力信号によって視点の位置と視線方向とが定まると、その視点から見た立体空間の画像を生成する。このとき、画像生成演算部13は、所定の立体モデルに対してバンプマップ処理を実行して、その立体モデルの面に凹凸感のあるテクスチャ画像を貼り付ける。
【0036】
図6は、画像生成演算部13が実行するバンプマップ処理の手順を示す流れ図である。先ず、画像生成演算部13は、モデルファイル21から取得した立体モデルに関するデータレコード41から当該モデルに貼り付けるテクスチャの画像データのテクスチャNoを取得すると、ST21としてテクスチャファイル123から当該テクスチャNoのデータレコード43を読込む。
【0037】
次に、画像生成演算部13は、ST22としてテクスチャデータレコード43から法線マップNoを検出し、法線マップファイル124から当該法線マップNoのデータレコード44を読込む。
【0038】
次に、画像生成演算部13は、テクスチャデータレコードの光沢フラグを調べる。そして、光沢フラグが光沢感に斑のある画像であることを示すときには、ST24,25で示すディフューズ光によるレンダリング画像生成処理と、ST26〜ST28で示すスペキュラ光によるレンダリング画像生成処理を実行する。なお、この処理はどちらを先に処理してもよいし、両方を並行して処理してもよい。
【0039】
すなわち、画像生成演算部13は、ST24としてテクスチャの画像が貼り付けられる立体モデルの面の向きと光源の位置とから、当該面の光源方向への向きを示すライトベクトルを画素p毎に計算する。そして画像生成演算部13は、ST25としてこのライトベクトルの高さ方向の成分(通常はライトベクトルのZ軸成分)を、テクスチャファイル123から読込んだテクスチャデータレコード43の画像データ(テクスチャの画像データ)に乗算して、ディフューズ光によるレンダリング画像を生成する(ディフューズ光レンダリング手段)。
【0040】
また、画像生成演算部13は、ST26としてテクスチャの画像データが貼り付けられる立体モデルの面の向きと光源及び視点の各位置とから、当該面の光源からの光方向と視点からの視線方向との和の向きを示すハーフアングルベクトルを画素毎に計算する。次いで、画像生成演算部13は、このハーフアングルベクトルと、法線マップファイル124から読込んだ法線マップデータレコード44の法線マップデータ(法線ベクトルS)との内積を画素毎に計算して、スペキュラ光に対する各画素の内積値つまり輝度値を求める。そして、この内積演算結果である各画素の輝度値を、所定のスペキュラカラーに乗算して、スペキュラ光によるレンダリング画像を生成する。なお、スペキュラカラーは、当該テクスチャの画像が貼り付けられる面を照射する光源の種類によって決まる。
【0041】
こうして、ディフューズ光によるレンダリング画像とスペキュラ光によるレンダリング画像とを生成したならば、画像生成演算部13は、ST29として両レンダリング画像を加算して最終出力画像を得る。そこで、画像生成演算部13は、ST30としてこの最終出力画像をフレームメモリ14に描画出力する。
【0042】
フレームメモリ14に描画された最終出力画像の画像データは、D/A変換部15によりアナログの映像信号に変換されて、表示装置32によりスクリーンやディスプレイ等の画面に表示されるものとなっている。
【0043】
このように構成された本実施の形態においては、例えば図12に示す立体空間画像を生成する場合、予め画面中央の襖を形成する立体モデルの面に貼り付けられる襖絵のテクスチャとして、図14に示す画像のテクスチャ2をテクスチャファイル123に記憶するとともに、このテクスチャ2の画像に対応した法線マップとして、図7に示すように、テクスチャ画像の光沢感がない松の部分に対応する画素の法線ベクトルを、光沢感がある金箔の部分に対応する画素の法線ベクトルよりも短くした法線マップ1′を、法線マップファイル124に記憶しておく。
【0044】
そして、画像生成演算部13において、当該立体モデルに対するバンプマップ処理が実行されると、図8に示すようなライトベクトルが計算され、このライトベクトルの高さ方向の成分がテクスチャ2の画像データに乗算されて、図10に示すようなディフューズ光によるレンダリング画像が生成される。また、図9に示すようなハーフアングルベクトルが算出され、このハーフアングルベクトルと法線マップ1′の法線ベクトルとの内積が計算された後、この内積値、つまり輝度値に所定のスペキュラカラーが乗算されて、図11に示すようなスペキュラ光によるレンダリング画像が生成される。そして、このディフューズ光によるレンダリング画像とスペキュラ光によるレンダリング画像とが加算されて、図12に示すような最終出力画像が得られる。この最終出力画像は、法線マップ1′の法線ベクトルが短い部分、つまり光沢感のない松の部分の光沢が抑えられるので、逆に、法線ベクトルが長い部分、つまり金箔が貼られている部分の光沢感が高められ、従来のマスク用画像のテクスチャ3を用いたときと同等若しくはそれに近い品質の画像が得られる。
【0045】
したがって、本実施の形態によれば、マスク用画像のテクスチャ3を不要にできるので、このマスク用画像のテクスチャ3を作成する手間をなくすことができる上、このマスク用画像のテクスチャを保存する記憶部の記憶容量も節約できる。また、スペキュラ光によるレンダリング画像にマスク用画像のテクスチャ3を乗算する処理ステップが不要となり処理ステップも少なくなるので、処理時間を短縮できる。
【0046】
しかも、法線ベクトルの長さが不揃いだと、ディフューズ光の計算時にテクスチャの画像情報が損なわれて黒ずんでしまうおそれがあるが、本実施の形態では、ディフューズ光の計算に法線ベクトルを考慮しないように、ライトベクトルの高さ方向の成分をテクスチャの画像データに乗算するだけでディフューズ光によるレンダリング画像を生成しているので、このような問題も起こり得ない。
【0047】
なお、この発明は、バーチャルリアリティシステムにおける画像生成技術に限らず、例えばCGアニメーションやTVゲームにおいて立体空間画像を生成する際にも適用できる。
【0048】
また、この発明は、金箔部以外の質感が異なる画像の生成にも適用して効果的である。
【0049】
また、従来の技術ではディフューズ光の輝度値をライトベクトルと法線ベクトルとの内積を求めることにより得ていたが、この発明においては、全ての画素において法線ベクトルは鉛直上向き(0,0,1)とすることにより、ライトベクトルの高さ成分だけで輝度値を得ている。したがって、この発明では、立体空間画像が全く均一に光を受ける平坦な表面であるならば、より一層の質感及び光沢感を演出することができる。
【0050】
【発明の効果】
以上詳述したように、請求項1に対応する発明によれば、部分的に質感が異なる画像を少ない処理ステップで高品質に生成できる上、記憶容量も節約できる画像生成方法を提供できる。
【0051】
また、請求項2に対応する発明によれば、部分的に光沢感が異なる画像を少ない処理ステップで高品質に生成できる上、記憶容量も節約できる画像生成方法を提供できる。
【0052】
また、請求項3に対応する発明によれば、部分的に質感が異なる画像を少ない処理ステップで高品質に生成できる上、記憶容量も節約できる画像生成装置を提供できる。
【図面の簡単な説明】
【図1】本発明の一実施の形態における画像生成装置の要部構成を示すブロック図。
【図2】同実施の形態における画像生成装置のモデルファイルに記憶されるデータレコードの一例を示す模式図。
【図3】同実施の形態における画像生成装置の光源ファイルに記憶されるデータレコードの一例を示す模式図。
【図4】同実施の形態における画像生成装置のテクスチャファイルに記憶されるデータレコードの一例を示す模式図。
【図5】同実施の形態における画像生成装置の法線マップファイルに記憶されるデータレコードの一例を示す模式図。
【図6】同実施の形態における画像生成装置の画像生成演算部が実行するバンプマップ処理の主要な手順を示す流れ図。
【図7】同実施の形態において使用する法線マップを示す画像。
【図8】同実施の形態において算出されるライトベクトルの概念図。
【図9】同実施の形態において算出されるハーフアングルベクトルの概念図。
【図10】同実施の形態において生成されるディフューズ光によるレンダリング画像。
【図11】同実施の形態において生成されるスペキュラ光によるレンダリング画像。
【図12】同実施の形態において生成される最終出力画像。
【図13】従来説明において使用する法線マップを示す画像。
【図14】同実施の形態及び従来説明において使用するテクスチャを示す画像。
【図15】法線マップの説明に用いる概念図。
【図16】従来の画像生成時に行なわれるバンプマップ処理の主要な手順を示す流れ図。
【図17】従来のバンプマップ処理で生成される出力画像。
【図18】従来において使用されるマスク用画像。
【図19】従来のバンプマップ処理で生成されるスペキュラ光によるレンダリング画像。
【図20】従来のマスク用画像を使用したバンプマップ処理で生成されるスペキュラ光によるレンダリング画像。
【符号の説明】
1,1′…法線マップ
2…テクスチャ
10…画像生成装置
11…入力信号変換部
12…データ記憶部
13…画像生成演算部
14…フレームメモリ
15…D/A変換部
20…入力装置
30…表示装置
121…モデルファイル
122…光源ファイル
123…テクスチャファイル
124…法線マップファイル
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image generation method and an apparatus for generating an image when a three-dimensional model is viewed from a viewpoint by setting a three-dimensional model, a light source, and a viewpoint in a three-dimensional space, and in particular, a bump mapping technique using a normal map. The present invention relates to a method and an apparatus for generating images having partially different textures by applying the method.
[0002]
[Prior art]
For example, a virtual reality (VR) system includes various three-dimensional models in a three-dimensional coordinate system three-dimensional space virtually represented by three coordinate axes (X, Y, and Z axes) orthogonal to each other in a computer. Setting a light source, setting a viewpoint that can freely move in the three-dimensional space by an input signal from an input device, generating an image of the three-dimensional space viewed from this viewpoint, and displaying the image on a screen such as a screen or a display. Thus, the viewer can get into the virtual space and feel as if he / she is looking at the three-dimensional model.
[0003]
By the way, the surface of the three-dimensional model has various patterns. These patterns are stored in advance in a storage device in a computer as image data called a texture. Then, at the time of image generation, the texture image is pasted on the surface of the corresponding three-dimensional model, shaded (shaded) depending on the viewpoint and the position of the light source, and displayed on the screen.
[0004]
In addition, a more realistic image may be obtained by giving a sense of unevenness to the pattern. It is also possible by shading to make a texture image having no unevenness look as if it has unevenness. Such shading is called bump mapping. As the bump mapping, a technique using a normal map is generally used.
[0005]
FIG. 13 shows an example of the normal map 1. This normal map 1 is created corresponding to the image of the texture 2 shown in FIG. As shown in FIG. 15, the normal map 1 indicates the direction of a pixel p with respect to a three-dimensional coordinate system including the X axis, the Y axis, and the Z axis by using a normal vector S (X, Y, Z (Consisting of vector values), and the vector values of X, Y, and Z are converted into R (Red), G (Green), and B (Blue) values, respectively, and set for each pixel p. ing. Here, the lengths of the normal vectors S are all normalized to “1”. Therefore, the magnitude of the gradient of the normal vector S is in the range of −1.0 to 1.0, but since the color intensity is 0 to 255, for example, the normal vector S (X, Y, Z) becomes ( A flat portion of (0.0, 0.0, 1.0) becomes (R, G, B) = (127, 127, 255) and is expressed in blue.
[0006]
FIG. 16 is a flowchart showing a procedure of a conventional bump map process executed by an image generating apparatus that generates this type of image. That is, the image generation device acquires from the storage unit the texture 2 of the image to be pasted on the surface of the three-dimensional model and the normal map 1 created corresponding to the image of the texture 2 (ST1, ST2).
[0007]
Next, the image generation device calculates, for each pixel p, a light vector indicating the direction of the surface in the light source direction from the direction of the surface of the three-dimensional model to which the image of the texture 2 is pasted and the position of the light source ( ST3). Next, the image generation device calculates, for each pixel p, an inner product of the light vector and the normal vector S of the normal map 1 corresponding to the image of the texture 2 to obtain a diffuse (diffuse). A luminance value of each pixel p with respect to light is obtained (ST4). Thereafter, the image of the texture 2 is multiplied by the luminance value of each pixel p, which is the inner product operation result (inner product value), to generate a rendered image by diffuse light (ST5).
[0008]
Further, the image generation device calculates, based on the orientation of the surface of the three-dimensional model to which the image of the texture 2 is pasted and the positions of the light source and the viewpoint, the sum of the light direction from the light source on the surface and the line-of-sight direction from the viewpoint. A half-angle vector indicating the direction is calculated for each pixel p (ST6). Next, the image generation device calculates an inner product of the half-angle vector and the normal vector S of the normal map 1 for each pixel p, and calculates a luminance value of each pixel p with respect to specular (specular) light. (ST7). Thereafter, a predetermined specular color is multiplied by the luminance value of each pixel p, which is the result of the inner product operation, to generate a rendered image using specular light (ST8). Note that the specular color is determined by the type of light source that illuminates the surface on which the image of the texture 2 is to be pasted.
[0009]
When the rendering image by the diffuse light and the rendering image by the specular light are generated in this way, the image generating apparatus adds both rendering images to obtain a final output image (ST9). Then, the image generating apparatus outputs the final output image to the display device (ST10), and displays the final output image on a screen or a display screen.
[0010]
Either the rendering image generation process using the diffuse light in ST3 to ST5 or the rendering image generation process using the specular light in ST6 to ST8 may be performed first, or may be performed in parallel. Things.
[0011]
FIG. 17 shows an example of an image which has been subjected to shading by the conventional bump map processing. This image is obtained by pasting the image of texture 2 shown in FIG. 14 on the surface of a three-dimensional model showing a sliding door at the center of the screen. The image of texture 2 has gold foil pasted on parts other than pine. The bump map processing is applied to enhance the glossiness of the gold leaf. However, in the conventional bump map processing, the glossiness of the entire sliding picture is uniform, so that the entire sliding picture is expressed as glossy, and the gold foil portion is not noticeable.
[0012]
Therefore, as shown in FIG. 18, a texture 3 of a mask image in which a pine portion having no glossiness of a sliding door picture is blackened is prepared. Then, as shown by the broken line in FIG. 16, the image generation device multiplies the rendering image by the specular light by the image for mask to lower the luminance value of the mask portion (ST11), and then renders the rendering image by the diffuse light. The addition is performed (ST9) to obtain a final output image (ST10). By doing so, the luster of the pine portion where no gold leaf is stuck is suppressed, and the glossiness of the gold leaf is enhanced.
[0013]
Incidentally, in the case where the image shown in FIG. 17 is generated, FIG. 19 shows a rendering image of the specular light before applying the texture 3 of the mask image, and FIG. 19 shows a rendering image of the specular light after applying the texture 3 of the mask image. FIG. 20 shows the rendered image.
[0014]
[Problems to be solved by the invention]
However, when the texture 3 of the mask image is applied because the glossiness of the texture image is partially different, the complexity of creating the texture 3 of the mask image from the texture 2 image in advance is reduced. In addition, in addition to the texture 2 and the normal map 1, a storage area for storing and holding the texture 3 of the mask image is also required, and there is a problem that the storage capacity becomes large. In addition, since a processing step of multiplying the masked image by the rendered image by specular light is added, the processing is time-consuming, and it is necessary to generate images one after another in a very short time like a virtual reality system. Was unsuitable.
[0015]
The present invention has been made in view of such circumstances, and an object of the present invention is to provide an image generation method and an image generation method that can generate an image having a partially different texture with high quality in a small number of processing steps and can also save storage capacity. It is intended to provide such a device.
[0016]
[Means for Solving the Problems]
The present invention solves such a problem, and the invention corresponding to claim 1 sets a light source and a viewpoint, respectively, in a three-dimensional space, a three-dimensional model in which the texture of an image having a partially different texture is pasted, An image generation method for generating an image when a three-dimensional model is viewed from a viewpoint, wherein the texture image is multiplied by a light vector indicating a direction of a surface to which a texture image of the three-dimensional model is attached in a light source direction, and diffuse light is obtained. Generating a rendered image by using a half-angle vector indicating the sum of the light direction from the light source on the surface to which the texture image of the three-dimensional model is to be pasted and the line of sight from the viewpoint, and a normal map corresponding to the texture image Calculates the inner product with the normal vector of this, multiplies this inner product value by the specified specular color, and renders the image with specular light. Generating the output image by adding the rendered image by the diffuse light and the rendered image by the specular light, and calculates the length of the normal vector of the normal map by It is made different depending on the difference in texture.
[0017]
In the image generation method according to the first aspect of the present invention, the length of each normal vector set for each pixel of the normal map differs depending on the texture of the corresponding texture image. Therefore, the rendered image by the specular light is generated by calculating the inner product of the half-angle vector and the normal vector of the normal map and multiplying the inner product value by a predetermined specular color. , The brightness value of the specular light varies, and the difference in texture is expressed with high quality. If the lengths of the normal vectors are not uniform, the image information of the texture is lost at the time of calculating the diffuse light, resulting in darkening. Therefore, in the present invention, a rendering image by diffuse light is generated by simply multiplying the image data of the texture by the component in the height direction of the light vector so that the normal vector is not considered in the calculation of diffuse light. .
[0018]
The invention corresponding to claim 2 of the present invention is the invention according to claim 1, wherein the normal map corresponding to the texture of the image having a partially different glossiness is each normal vector set for each pixel. Among them, the normal vector of the pixel corresponding to the image whose glossiness is suppressed in the corresponding texture image is shorter than the normal vectors of the other pixels.
[0019]
In the image generating method according to the second aspect of the present invention, the normal vector of the normal map is the normal vector of the pixel corresponding to the image whose glossiness is suppressed in the corresponding texture image. It is shorter than the line vector. Therefore, in the rendered image by the specular light, the luminance of the specular light is reduced correspondingly in the portion where the normal vector is short, so that the glossiness of the image corresponding to this portion is suppressed.
[0020]
According to a third aspect of the present invention, in an image generating apparatus that sets a stereo model, a light source, and a viewpoint in a stereo space and generates an image when the stereo model is viewed from the viewpoint, the image generation apparatus pastes the stereo model. A storage unit for storing a texture image and a normal map corresponding to the texture image; and, when the texture image is an image having uneven glossiness, the direction of the surface on which the texture image of the three-dimensional model is pasted in the light source direction is determined. Diffuse light rendering means for multiplying the texture image by the indicated light vector to generate a rendered image by diffuse light; and when the texture image is an image with uneven glossiness, a texture image of a three-dimensional model is pasted. A half-angle vector indicating the direction of the sum of the light direction from the light source on the surface to be viewed and the viewing direction from the viewpoint A specular light rendering means for calculating an inner product of the normal map corresponding to the texture image and a normal vector, multiplying the inner product value by a predetermined specular color to generate a rendered image by specular light, and a diffuse light rendering means Output image generating means for generating an output image by adding the rendered image by the diffuse light generated by the method and the rendered image by the specular light generated by the specular light rendering means, wherein the normal map is a normal vector Are different depending on the difference in texture of the corresponding texture images.
[0021]
In the image generating apparatus according to the third aspect of the present invention, the storage means stores the texture image to be pasted on the three-dimensional model and the normal map corresponding to the texture image by the storage means. Here, in the normal map, the length of the normal vector differs depending on the difference in the texture of the corresponding texture image.
[0022]
The rendered image by the diffuse light is generated by multiplying the component of the light vector in the height direction by the texture image. On the other hand, a rendered image by specular light is generated by calculating an inner product of a half-angle vector and a normal vector of a normal map corresponding to the texture image, and multiplying the inner product value by a specular color. Thus, the rendered image by the diffuse light and the rendered image by the specular light are added to generate an output image having a partially different texture depending on the length of the normal vector.
[0023]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
In this embodiment, a case will be described in which a stereoscopic space image displayed by a virtual reality system is generated.
[0024]
FIG. 1 is a block diagram illustrating a main configuration of an image generation device 10 according to the present embodiment. The image generation device 10 is configured by a computer such as a personal computer or a workstation.
[0025]
The image generation device 10 converts various signals input from the input device 20 into input commands having the corresponding contents, an input signal conversion unit 11 that supplies the input commands to the image generation calculation unit 13, and a model file 121. , A light source file 122, a texture file 123, a normal map file 124, etc., a data storage unit 12 as storage means for storing and storing various data files, and the data storage according to an input command given from the input signal conversion unit 11. An image generation operation unit 13 that generates a stereoscopic space image using the data of the unit 12, a frame memory 14 that stores data of the stereoscopic image generated by the image generation operation unit 13, and a storage in the frame memory 14. D / A (D / A) that reads out the converted image data, converts it into an analog video signal, and outputs it to the display device 30. And a digital / analog) converter unit 15.
[0026]
The input device 20 is for moving the position of the viewpoint and the direction of the line of sight set in the three-dimensional space. The display device 30 projects and displays a stereoscopic space image on a screen such as a screen or a display.
[0027]
The model file 121 stores data relating to the shape, position, and the like of various three-dimensional models set in the three-dimensional space. FIG. 2 shows an example of the data record 41 stored and saved in the model file 121. In FIG. 2, the item “model ID” is a unique code set for each model in order to uniquely identify various three-dimensional models. For example, the file name may be a uniquely determined file name for each model. The item “shape data” is data indicating the coordinates of each vertex of the three-dimensional shape of the three-dimensional model to which the corresponding model ID is set. In the item “position coordinates”, a three-dimensional model with a corresponding model ID is installed in a three-dimensional coordinate system three-dimensional space virtually represented by three coordinate axes (X axis, Y axis, and Z axis) orthogonal to each other. This is data indicating position coordinates. The item “texture No” is an identification symbol for specifying a texture image to be pasted on the surface of the three-dimensional model to which the corresponding model ID is set. This identification symbol may be, for example, the file name of the texture image.
[0028]
The light source file 122 stores data relating to various light sources set in the three-dimensional space. FIG. 3 shows an example of the data record 42 stored in the light source file 122. In FIG. 3, the item “light source ID” is a unique code uniquely set for each light source to identify various light sources. The item “type” is data indicating the type of light source (infinite light source, point light source, line light source, environmental light, etc.) for which the corresponding light source ID is set. The item “position coordinates” is data indicating the position coordinates where the light source of the corresponding light source ID is installed in the three-dimensional space of the three-dimensional coordinate system.
[0029]
The texture file 123 stores and stores texture data indicating a pattern, a material, and the like to be pasted on the surface of each of the three-dimensional models. FIG. 4 shows an example of a data record stored and saved in the texture file 123. In FIG. 4, the item “texture No.” is a unique identification symbol set for each texture to identify each texture data. For example, the texture No. may be a file name of the texture data. The item “image data” is image data of a texture in which a corresponding texture number is set. The item “normal map No.” is an identification symbol that specifies a normal map created from the texture image of the corresponding texture No. For example, the normal map number may be a file name of the normal map data. The item “gloss flag” is data for identifying whether or not the texture image of the corresponding texture No. is an image having uneven glossiness.
[0030]
Further, the texture file 123 may include an item called “rendering instruction”. The rendering instruction describes an instruction for rendering the surface of the model. For example, the rendering instruction is a normal bump mapping for the model A, a normal map A and a normal map B for the model B, a normal map B for the model C, and a normal map B for the model D. A three-dimensional model is associated with a method, such as a normal map E required for implementing the present invention. By describing such a rendering instruction in a file, it is possible to associate different solid models with the same technique such as a normal map. This eliminates the need to record duplicate normal maps.
[0031]
The normal map file 124 stores data relating to a normal map generated from various texture images. FIG. 5 shows an example of a data record stored in the normal map file 124. In FIG. 5, the item "normal map No." is a unique identification symbol set for each normal map to identify each normal map. Each "normal map data" is a normal vector of each pixel of the normal map to which the corresponding normal map No. is set.
[0032]
Further, the records of the various files in FIGS. 2 to 5 may be aggregated into one file and one record. In this case, duplicate items are omitted.
[0033]
Here, in the present embodiment, the constraint of normalizing the length of each normal vector performed by the conventional method to 1 is removed, and the normal vector of each normal vector set for each pixel of the normal map is removed. The size differs depending on the difference in the texture of the corresponding texture image. Such a normal vector is calculated by, for example, the following equation (1).
[0034]
(R, G, B) = [(r, g, b) − (127, 127, 127)] × α + (127, 127, 127) (1)
Here, r, g, and b are RGB values respectively corresponding to the X, Y, and Z vectors when the normal vector is normalized to 1. α is optional within the range of 0 ≦ α ≦ 1.
[0035]
Now, in the image generation device having such a configuration, the image generation calculation unit 13 sets various solid models set in the model file 121 and various light sources set in the light source file 122 in the three-dimensional space of the three-dimensional coordinate system. When the position of the viewpoint and the direction of the line of sight are determined by an input signal from the input device 20, an image of a three-dimensional space viewed from the viewpoint is generated. At this time, the image generation calculation unit 13 performs a bump map process on a predetermined three-dimensional model, and pastes a texture image having a sense of unevenness on the surface of the three-dimensional model.
[0036]
FIG. 6 is a flowchart illustrating a procedure of the bump map process executed by the image generation calculation unit 13. First, when acquiring the texture number of the image data of the texture to be attached to the model from the data record 41 relating to the three-dimensional model acquired from the model file 21, the image generation calculation unit 13 reads the data record of the texture number from the texture file 123 as ST 21. Read 43.
[0037]
Next, the image generation calculation unit 13 detects the normal map number from the texture data record 43 in ST22, and reads the data record 44 of the normal map number from the normal map file 124.
[0038]
Next, the image generation calculation unit 13 checks the gloss flag of the texture data record. When the gloss flag indicates that the image has an uneven glossiness, a rendering image generation process using diffuse light shown in ST24 and ST25 and a rendering image generation process using specular light shown in ST26 to ST28 are executed. This processing may be performed first, or both may be processed in parallel.
[0039]
That is, the image generation calculation unit 13 calculates, for each pixel p, a light vector indicating the direction of the surface in the light source direction from the orientation of the surface of the three-dimensional model to which the texture image is pasted and the position of the light source in ST24. . In step ST25, the image generation calculation unit 13 converts the height component of the light vector (normally, the Z-axis component of the light vector) into the image data (texture image data) of the texture data record 43 read from the texture file 123. ) To generate a rendered image by diffuse light (diffuse light rendering means).
[0040]
Further, the image generation calculation unit 13 determines the light direction from the light source on the surface and the line-of-sight direction from the viewpoint from the orientation of the surface of the three-dimensional model to which the texture image data is pasted and the positions of the light source and the viewpoint in ST26. Is calculated for each pixel. Next, the image generation operation unit 13 calculates an inner product of the half-angle vector and the normal map data (normal vector S) of the normal map data record 44 read from the normal map file 124 for each pixel. Then, an inner product value of each pixel with respect to the specular light, that is, a luminance value is obtained. Then, a predetermined specular color is multiplied by a luminance value of each pixel, which is a result of the inner product operation, to generate a rendering image by specular light. The specular color is determined by the type of light source that illuminates the surface on which the texture image is to be pasted.
[0041]
After the rendering image by the diffuse light and the rendering image by the specular light are generated in this way, the image generation calculation unit 13 adds both rendering images to obtain a final output image in ST29. Then, the image generation calculation unit 13 draws and outputs this final output image to the frame memory 14 in ST30.
[0042]
The image data of the final output image drawn in the frame memory 14 is converted into an analog video signal by the D / A converter 15 and displayed on the screen such as a screen or a display by the display device 32. .
[0043]
In the present embodiment configured as described above, for example, when the three-dimensional space image shown in FIG. 12 is generated, the texture of the fusuma picture to be pasted on the surface of the three-dimensional model forming the fusuma at the center of the screen is used in advance. 7 is stored in the texture file 123, and as a normal map corresponding to the texture 2 image, as shown in FIG. The normal map 1 ′ in which the normal vector is shorter than the normal vector of the pixel corresponding to the glossy gold foil portion is stored in the normal map file 124.
[0044]
Then, when the image generation operation unit 13 executes the bump map process on the three-dimensional model, a light vector as shown in FIG. 8 is calculated, and the height component of the light vector is added to the image data of the texture 2. The multiplication is performed to generate a rendering image by the diffuse light as shown in FIG. Also, a half angle vector as shown in FIG. 9 is calculated, and an inner product of the half angle vector and the normal vector of the normal map 1 'is calculated. Is multiplied to generate a rendering image by specular light as shown in FIG. Then, the rendering image by the diffuse light and the rendering image by the specular light are added to obtain a final output image as shown in FIG. In this final output image, the glossiness of the portion where the normal vector of the normal map 1 'is short, that is, the pine portion having no glossiness is suppressed, and conversely, the portion where the normal vector is long, that is, the gold foil is attached. The glossiness of the part where it is located is enhanced, and an image with a quality equal to or close to that obtained when texture 3 of the conventional mask image is used is obtained.
[0045]
Therefore, according to the present embodiment, since the texture 3 of the mask image can be made unnecessary, it is possible to eliminate the trouble of creating the texture 3 of the mask image and to store the texture of the mask image. The storage capacity of the unit can also be saved. Further, the processing step of multiplying the rendering image by the specular light by the texture 3 of the mask image becomes unnecessary, and the number of processing steps is reduced, so that the processing time can be reduced.
[0046]
In addition, if the lengths of the normal vectors are not uniform, there is a possibility that the image information of the texture may be damaged and darkened during the calculation of the diffuse light. Since the rendering image by the diffuse light is generated only by multiplying the image component of the texture by the component in the height direction of the light vector so as not to consider the above, such a problem cannot occur.
[0047]
The present invention is not limited to the image generation technology in the virtual reality system, and can be applied to, for example, generating a three-dimensional space image in a CG animation or a TV game.
[0048]
The present invention is also effectively applied to generation of an image having a different texture other than the gold foil portion.
[0049]
Further, in the prior art, the luminance value of the diffuse light is obtained by calculating the inner product of the light vector and the normal vector, but in the present invention, the normal vector is vertically upward (0, 0) in all pixels. , 1), the luminance value is obtained only from the height component of the light vector. Therefore, according to the present invention, if the three-dimensional space image is a flat surface that receives light uniformly, it is possible to produce even more texture and glossiness.
[0050]
【The invention's effect】
As described in detail above, according to the invention corresponding to the first aspect, it is possible to provide an image generation method that can generate an image having a partially different texture with high quality in a small number of processing steps and can also save storage capacity.
[0051]
According to the second aspect of the present invention, it is possible to provide an image generating method capable of generating an image having a partially different glossiness with high quality in a small number of processing steps and saving storage capacity.
[0052]
According to the third aspect of the present invention, it is possible to provide an image generating apparatus that can generate an image having a partially different texture with high quality in a small number of processing steps and can save storage capacity.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of an image generating apparatus according to an embodiment of the present invention.
FIG. 2 is a schematic diagram showing an example of a data record stored in a model file of the image generation device according to the embodiment.
FIG. 3 is a schematic diagram showing an example of a data record stored in a light source file of the image generation device according to the embodiment.
FIG. 4 is a schematic diagram showing an example of a data record stored in a texture file of the image generation device according to the embodiment.
FIG. 5 is a schematic diagram showing an example of a data record stored in a normal map file of the image generating apparatus according to the embodiment.
FIG. 6 is a flowchart showing a main procedure of a bump map process executed by an image generation calculation unit of the image generation device according to the embodiment.
FIG. 7 is an image showing a normal map used in the embodiment.
FIG. 8 is a conceptual diagram of a light vector calculated in the embodiment.
FIG. 9 is a conceptual diagram of a half-angle vector calculated in the embodiment.
FIG. 10 is a rendering image using diffuse light generated in the embodiment.
FIG. 11 is a rendering image by specular light generated in the embodiment.
FIG. 12 is a final output image generated in the embodiment.
FIG. 13 is an image showing a normal map used in the conventional description.
FIG. 14 is an image showing a texture used in the embodiment and the conventional description.
FIG. 15 is a conceptual diagram used for describing a normal map.
FIG. 16 is a flowchart showing main steps of a conventional bump map process performed at the time of image generation.
FIG. 17 is an output image generated by a conventional bump map process.
FIG. 18 is an image for mask used conventionally.
FIG. 19 is a rendering image by specular light generated by a conventional bump map process.
FIG. 20 is a rendering image using specular light generated by a bump map process using a conventional mask image.
[Explanation of symbols]
1, 1 '... normal map
2. Texture
10 ... Image generation device
11 Input signal conversion unit
12 Data storage unit
13 ... Image generation operation unit
14. Frame memory
15 D / A converter
20 input device
30 Display device
121 ... Model file
122: Light source file
123 ... texture file
124 ... Normal map file

Claims (3)

立体空間に、部分的に質感が異なる画像のテクスチャを貼り付けた立体モデルと光源と視点をそれぞれ設定して、前記視点から前記立体モデルを見たときの画像を生成する画像生成方法であって、
前記立体モデルの前記テクスチャ画像が貼り付けられる面の前記光源方向への向きを示すライトベクトルを前記テクスチャ画像に乗算してディフューズ光によるレンダリング画像を生成するステップと、
前記立体モデルの前記テクスチャ画像が貼り付けられる面の前記光源からの光方向と前記視点からの視線方向との和の向きを示すハーフアングルベクトルと前記テクスチャ画像に対応した法線マップの法線ベクトルとの内積を計算し、この内積値を所定のスペキュラカラーに乗算してスペキュラ光によるレンダリング画像を生成するステップと、
前記ディフューズ光によるレンダリング画像と前記スペキュラ光によるレンダリング画像とを加算して出力画像を生成するステップとからなり、
前記法線マップの法線ベクトルの長さを、対応するテクスチャ画像の質感の違いにより異ならせたことを特徴とする画像生成方法。
An image generation method for setting a three-dimensional model in which texture of an image having a partially different texture is pasted in a three-dimensional space, a light source, and a viewpoint, and generating an image when the three-dimensional model is viewed from the viewpoint. ,
Generating a rendering image by diffuse light by multiplying the texture image by a light vector indicating the direction of the light source direction of the surface on which the texture image of the three-dimensional model is pasted;
A half-angle vector indicating the direction of the sum of the light direction from the light source and the line-of-sight direction from the viewpoint on the surface of the three-dimensional model to which the texture image is pasted, and a normal vector of a normal map corresponding to the texture image Calculating a dot product of the specular color and multiplying the dot product value by a predetermined specular color to generate a rendered image by specular light;
Generating an output image by adding the rendered image by the diffuse light and the rendered image by the specular light,
An image generation method, wherein the length of a normal vector of the normal map is varied depending on a difference in texture of a corresponding texture image.
請求項1記載の画像生成方法において、
部分的に光沢感が異なる画像のテクスチャに対応する法線マップは、画素毎に設定された各法線ベクトルのうち、対応するテクスチャ画像の中で光沢感を抑える画像に対応する画素の法線ベクトルを他の画素の法線ベクトルより短くしたものであることを特徴とする画像生成方法。
The image generation method according to claim 1,
The normal map corresponding to the texture of an image having a partially different glossiness is a normal vector of a pixel corresponding to an image in which the glossiness is suppressed in the corresponding texture image among the normal vectors set for each pixel. An image generation method, wherein a vector is shorter than a normal vector of another pixel.
立体空間に立体モデルと光源と視点をそれぞれ設定して、前記視点から前記立体モデルを見たときの画像を生成する画像生成装置において、
前記立体モデルに貼り付けるテクスチャ画像及びこのテクスチャ画像に対応した法線マップを記憶する記憶手段と、
前記テクスチャ画像が光沢感に斑のある画像であるとき、前記立体モデルの前記テクスチャ画像が貼り付けられる面の前記光源方向への向きを示すライトベクトルを当該テクスチャ画像に乗算してディフューズ光によるレンダリング画像を生成するディフューズ光レンダリング手段と、
前記テクスチャの画像が光沢感に斑のある画像であるとき、前記立体モデルの前記テクスチャ画像が貼り付けられる面の前記光源からの光方向と前記視点からの視線方向との和の向きを示すハーフアングルベクトルと前記テクスチャ画像に対応した法線マップの法線ベクトルとの内積を計算し、この内積値を所定のスペキュラカラーに乗算してスペキュラ光によるレンダリング画像を生成するスペキュラ光レンダリング手段と、
前記ディフューズ光レンダリング手段により生成されたディフューズ光によるレンダリング画像と前記スペキュラ光レンダリング手段により生成されたスペキュラ光によるレンダリング画像とを加算して出力画像を生成する出力画像生成手段とを具備し、
前記法線マップは、法線ベクトルの長さを、対応するテクスチャ画像の質感の違いにより異ならせたものであることを特徴とする画像生成装置。
In an image generating apparatus that sets a stereo model, a light source, and a viewpoint in a stereo space, and generates an image when the stereo model is viewed from the viewpoint,
Storage means for storing a texture image to be pasted on the three-dimensional model and a normal map corresponding to the texture image;
When the texture image is an image with uneven glossiness, the texture image is multiplied by a light vector indicating the direction of the surface of the three-dimensional model to which the texture image is pasted, in the direction of the light source, and diffuse light is used. Diffuse light rendering means for generating a rendered image;
When the texture image is an image having unevenness in glossiness, a half indicating the sum of the light direction from the light source and the line of sight from the viewpoint on the surface of the three-dimensional model to which the texture image is pasted Specular light rendering means for calculating an inner product of an angle vector and a normal vector of a normal map corresponding to the texture image, and multiplying the inner product value by a predetermined specular color to generate a rendered image by specular light,
Output image generating means for generating an output image by adding a rendered image by diffuse light generated by the diffuse light rendering means and a rendered image by specular light generated by the specular light rendering means,
The image generating apparatus according to claim 1, wherein the normal map is obtained by changing the length of a normal vector according to a difference in texture of a corresponding texture image.
JP2002266890A 2002-09-12 2002-09-12 Image generation method and apparatus Expired - Fee Related JP4078926B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002266890A JP4078926B2 (en) 2002-09-12 2002-09-12 Image generation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002266890A JP4078926B2 (en) 2002-09-12 2002-09-12 Image generation method and apparatus

Publications (2)

Publication Number Publication Date
JP2004102900A true JP2004102900A (en) 2004-04-02
JP4078926B2 JP4078926B2 (en) 2008-04-23

Family

ID=32265573

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002266890A Expired - Fee Related JP4078926B2 (en) 2002-09-12 2002-09-12 Image generation method and apparatus

Country Status (1)

Country Link
JP (1) JP4078926B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006259818A (en) * 2005-03-15 2006-09-28 Toppan Printing Co Ltd Image processor and image processing method
WO2008035550A1 (en) 2006-09-21 2008-03-27 Konami Digital Entertainment Co., Ltd. Image processing device, control method for image processing device and information recording medium
WO2008035549A1 (en) 2006-09-21 2008-03-27 Konami Digital Entertainment Co., Ltd. Image processing device, control method for image processing device and information recording medium
JP2009147754A (en) * 2007-12-14 2009-07-02 Canon Inc Image processing apparatus and method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006259818A (en) * 2005-03-15 2006-09-28 Toppan Printing Co Ltd Image processor and image processing method
WO2008035550A1 (en) 2006-09-21 2008-03-27 Konami Digital Entertainment Co., Ltd. Image processing device, control method for image processing device and information recording medium
WO2008035549A1 (en) 2006-09-21 2008-03-27 Konami Digital Entertainment Co., Ltd. Image processing device, control method for image processing device and information recording medium
US8319786B2 (en) 2006-09-21 2012-11-27 Konami Digital Entertainment Co., Ltd. Image processing device, control method for image processing device and information recording medium
JP2009147754A (en) * 2007-12-14 2009-07-02 Canon Inc Image processing apparatus and method
US8275211B2 (en) 2007-12-14 2012-09-25 Canon Kabushiki Kaisha Image processing apparatus and method

Also Published As

Publication number Publication date
JP4078926B2 (en) 2008-04-23

Similar Documents

Publication Publication Date Title
CN110650368B (en) Video processing method and device and electronic equipment
US7471301B2 (en) Method and system enabling real time mixing of synthetic images and video images by a user
US6532013B1 (en) System, method and article of manufacture for pixel shaders for programmable shading
US5995110A (en) Method and system for the placement of texture on three-dimensional objects
US20130271486A1 (en) Automatic 3D Modeling
US6731289B1 (en) Extended range pixel display system and method
CN109478344A (en) Method and apparatus for composograph
WO2021169396A1 (en) Media content placement method and related device
JP2011159329A (en) Automatic 3d modeling system and method
JP2003256865A (en) Method and program for generating two-dimensional image with cartoon-like expression from stereoscopic object data
CA2298081C (en) Image processing apparatus and method of same
CN108197555B (en) Real-time face fusion method based on face tracking
CN106447756A (en) Method and system for generating a user-customized computer-generated animation
US5793372A (en) Methods and apparatus for rapidly rendering photo-realistic surfaces on 3-dimensional wire frames automatically using user defined points
US20020175923A1 (en) Method and apparatus for displaying overlapped graphical objects using depth parameters
JP4078926B2 (en) Image generation method and apparatus
JP2010231347A (en) Method and apparatus for image generation
JP2003168130A (en) System for previewing photorealistic rendering of synthetic scene in real-time
JP3261832B2 (en) Image generation device
JP2006259818A (en) Image processor and image processing method
JPH0224785A (en) Method and device for shadowing processing
JP3890788B2 (en) Video creation device
JPH09114994A (en) Device and method for forming image
JP3453410B2 (en) Image processing apparatus and method
JP2899168B2 (en) Image data operation method and image data operation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080110

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080128

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

Free format text: PAYMENT UNTIL: 20110215

Year of fee payment: 3

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130215

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140215

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees