JP4078926B2 - Image generation method and apparatus - Google Patents

Image generation method and apparatus Download PDF

Info

Publication number
JP4078926B2
JP4078926B2 JP2002266890A JP2002266890A JP4078926B2 JP 4078926 B2 JP4078926 B2 JP 4078926B2 JP 2002266890 A JP2002266890 A JP 2002266890A JP 2002266890 A JP2002266890 A JP 2002266890A JP 4078926 B2 JP4078926 B2 JP 4078926B2
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.)
Expired - Fee Related
Application number
JP2002266890A
Other languages
Japanese (ja)
Other versions
JP2004102900A (en
Inventor
隆宏 平岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toppan Inc
Original Assignee
Toppan Inc
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 Inc filed Critical Toppan Inc
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

Landscapes

  • Image Generation (AREA)

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]
BACKGROUND OF THE INVENTION
The present invention relates to an image generation method and apparatus for generating an image when a stereoscopic model is viewed from the viewpoint by setting a stereoscopic model, a light source, and a viewpoint in a stereoscopic space, and in particular, a bump mapping technique using a normal map. The present invention relates to a method and an apparatus for generating an image having a partially different texture 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 axis, Y axis, Z axis) orthogonal to each other in a computer. Set a light source, set a viewpoint that can freely move in the three-dimensional space according to an input signal from the input device, generate an image of the three-dimensional space viewed from this viewpoint, and display it on a screen such as a screen or a display By this, the viewer can get a feeling as if he / she entered the virtual space and was looking at the 3D 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 the computer as image data called texture. At the time of image generation, the texture image is pasted on the surface of the corresponding three-dimensional model, shaded (shaded) according to the viewpoint, the position of the light source, etc., and displayed on the screen.
[0004]
Further, there is a case where a more realistic image can be obtained by giving an uneven feeling to the pattern. It is possible by shading to make a texture image without unevenness appear as if there is unevenness. Such shading is called bump mapping. As bump mapping, a technique using a normal map is generally used.
[0005]
FIG. 13 shows an example of the normal map 1. The 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 orientation of the pixel p with respect to the three-dimensional coordinate system composed of the X axis, the Y axis, and the Z axis for each normal vector S (X, Y, Z). The vector values of X, Y, and Z are converted into R (Red), G (Green), and B (Blue) values and set for each pixel p. ing. Here, the lengths of the normal vectors S are all normalized to “1”. Accordingly, the magnitude of the gradient of the normal vector S is in the range of −1.0 to 1.0, but the intensity of the color is 0 to 255, and thus, for example, the normal vector S (X, Y, Z) is ( The 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 the procedure of a conventional bump map process executed by an image generation apparatus that generates this type of image. That is, the image generation apparatus acquires the texture 2 of the image pasted on the surface of the three-dimensional model and the normal map 1 created corresponding to the image of the texture 2 from the storage unit (ST1, ST2).
[0007]
Next, the image generation apparatus 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 texture 2 image is pasted and the position of the light source ( ST3). Next, the image generation apparatus calculates the inner product of this light vector and the normal vector S of the normal map 1 corresponding to the image of the texture 2 for each pixel p, and diffuses (Diffuse). The luminance value of each pixel p with respect to light is obtained (ST4). Thereafter, the luminance value of each pixel p, which is the inner product calculation result (inner product value), is multiplied by the image of the texture 2 to generate a rendered image by diffuse light (ST5).
[0008]
Further, the image generation device calculates the sum of the light direction from the light source of the surface and the line-of-sight direction from the viewpoint from the orientation of the surface of the stereo model to which the image of the texture 2 is pasted and the positions of the light source and the viewpoint. A half-angle vector indicating the direction is calculated for each pixel p (ST6). Next, the image generation apparatus calculates the inner product of the half-angle vector and the normal vector S of the normal map 1 for each pixel p, and the luminance value of each pixel p with respect to specular (specular) light. Is obtained (ST7). Thereafter, the luminance value of each pixel p, which is the result of the inner product calculation, is multiplied by a predetermined specular color to generate a rendered image by specular light (ST8). The specular color is determined by the type of light source that irradiates the surface to which the image of the texture 2 is attached.
[0009]
In this way, when the rendering image by the diffuse light and the rendering image by the specular light are generated, the image generation apparatus adds the both rendering images to obtain a final output image (ST9). Then, the image generation device outputs the final output image to the display device (ST10) and displays it on the screen or display screen.
[0010]
It should be noted that either the rendering image generation process using the diffused light of ST3 to ST5 or the rendering image generation process using the specular light of ST6 to ST8 may be processed first, or may be processed in parallel. Is.
[0011]
FIG. 17 shows an example of an image shaded by the conventional bump map process. This image is obtained by pasting the texture 2 image shown in FIG. 14 on the surface of the three-dimensional model showing the wrinkle at the center of the screen, and the texture 2 image has a gold leaf pasted on portions other than the pine. Therefore, bump map processing is applied to increase the gloss of the gold leaf. However, in the conventional bump map processing, since the glossiness is uniform throughout the whole picture, the whole picture is expressed as being glossy, and the gold leaf portion is not conspicuous.
[0012]
Therefore, as shown in FIG. 18, a texture 3 of a mask image is prepared by blackening a pine portion that does not have a glossy look. Then, as shown by the broken line in FIG. 16, the image generation device multiplies the rendering image by specular light by the mask image to lower the luminance value of the mask portion (ST11), and then displays the rendering image by diffuse light. Addition is performed (ST9) to obtain a final output image (ST10). By doing so, the luster of the pine part to which the gold foil is not attached is suppressed, so that the glossiness of the gold foil is enhanced.
[0013]
Incidentally, in the case of generating the image shown in FIG. 17, a rendering image by the specular light before applying the texture 3 of the mask image is shown in FIG. 19, and by the specular light after applying the texture 3 of the mask image The rendered image is shown in FIG.
[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 having to create the texture 3 of the mask image from the image of the texture 2 in advance. In addition to the texture 2 and the normal map 1, there is also a problem that a storage area for storing and holding the mask image texture 3 is also required, resulting in a large storage capacity. In addition, since a processing step for multiplying the image for masking by the specular light rendered image is added, the processing takes time, and for images that must be generated one after another in a very short time like a virtual reality system. Was unsuitable.
[0015]
The present invention has been made based on such circumstances, and an object of the present invention is to provide an image generation method capable of generating high-quality images with partially different textures with a small number of processing steps and saving storage capacity. The device is intended to be provided.
[0016]
[Means for Solving the Problems]
The present invention solves such a problem, and the invention corresponding to claim 1 sets a solid model, a light source, and a viewpoint in which a texture of an image having a partially different texture is pasted in a three-dimensional space, An image generation method for generating an image when a stereoscopic model is viewed from a viewpoint, wherein the diffused light is obtained by multiplying the texture image by a light vector indicating a direction in a light source direction of a surface on which the texture image of the stereoscopic model is pasted. A normal map corresponding to the texture image and a half-angle vector indicating the sum direction of the light direction from the light source of the surface to which the texture image of the three-dimensional model is pasted and the line-of-sight direction from the viewpoint The inner product with the normal vector is calculated and the specified specular color is multiplied by the inner product value to render the specular light. And generating an output image by adding the rendered image by the diffuse light and the rendered image by the specular light, and the length of the normal vector of the normal map is set to the value of the corresponding texture image. It is different depending on the 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 difference of the corresponding texture image. Therefore, the rendered image by 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 differs depending on the difference, 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 and darkened when calculating the diffuse light. Therefore, in the present invention, a rendering image based on diffuse light is generated by simply multiplying the texture image data 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 corresponding to claim 1 described above, wherein the normal map corresponding to the texture of the image partially different in glossiness is the normal vector set for each pixel. Among them, the normal vector of the pixel corresponding to the image that suppresses the glossiness in the corresponding texture image is made shorter than the normal vector of the other pixels.
[0019]
In the image generation method according to the second aspect of the present invention, the normal vector of the normal map is a method in which the normal vector of the pixel corresponding to the image that suppresses the glossiness in the corresponding texture image is a method of another pixel. It is shorter than the line vector. Therefore, in the rendered image by specular light, the luminance of the specular light is reduced in the portion where the normal vector is short, so that the glossiness of the image corresponding to this portion can be suppressed.
[0020]
The invention corresponding to claim 3 of the present invention is an image generation device that sets a stereoscopic model, a light source, and a viewpoint in a stereoscopic space, and generates an image when the stereoscopic model is viewed from the viewpoint, and is pasted on the stereoscopic model. Storage means for storing a texture image and a normal map corresponding to the texture image, and when the texture image is a speckled gloss image, the direction of the surface to which the texture image of the three-dimensional model is pasted in the light source direction A diffuse light rendering means for multiplying the texture image by the light vector shown to generate a rendered image by diffuse light, and the texture image of the three-dimensional model is pasted when the texture image is a speckled image 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 Specular light rendering means for calculating an inner product with a normal vector of a normal map corresponding to the texture image, multiplying the inner product value by a predetermined specular color and generating a rendered image by specular light, and a diffuse light rendering means Output image generating means for adding the rendered image generated by the diffused light generated by the specular light and the rendered image generated by the specular light generated by the specular light rendering means to generate an output image, and the normal map is a normal vector Are made different depending on the texture of the corresponding texture image.
[0021]
In the image generation apparatus according to the third aspect of the present invention, the storage unit stores the texture image to be pasted on the three-dimensional model and the normal map corresponding to the texture image by the storage unit. 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 texture image by the height direction component of the light vector. On the other hand, the rendered image by specular light is generated by calculating the inner product of the half angle vector and the normal vector of the normal map corresponding to the texture image, and multiplying the inner product value by the 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]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
In this embodiment, a case where a three-dimensional space image displayed in the virtual reality system is generated will be described.
[0024]
FIG. 1 is a block diagram showing the main configuration of an image generation apparatus 10 according to the present embodiment. The image generation apparatus 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 corresponding contents, and inputs the input commands to the image generation calculation unit 13 and a model file 121. , The light source file 122, the texture file 123, the normal map file 124, etc., the data storage unit 12 as storage means for storing and saving, and the data storage according to the input command given from the input signal conversion unit 11 An image generation calculation 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 space image generated by the image generation calculation unit 13, and a storage in the frame memory 14 D / A (decode) that reads the 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 viewpoint position and line-of-sight direction set in the three-dimensional space. The display device 30 projects and displays a three-dimensional space image on a screen such as a screen or a display.
[0027]
The model file 121 stores and saves data relating to the shape and position of various stereo models set in the stereo space. FIG. 2 shows an example of the data record 41 stored and saved in the model file 121. In FIG. 2, an item “model ID” is a unique code set for each model in order to uniquely identify various stereo models. For example, the file name for each model uniquely determined may be used. The item “shape data” is data indicating each vertex coordinate and the like of the three-dimensional shape of the three-dimensional model in which the corresponding model ID is set. In the item “position coordinates”, a three-dimensional model having a corresponding model ID is installed in a three-dimensional space of a three-dimensional coordinate system virtually represented by three coordinate axes (X axis, Y axis, Z axis) orthogonal to each other. This is data indicating position coordinates. The item “texture No” is an identification symbol that identifies a texture image to be pasted on the surface of the three-dimensional model in which the corresponding model ID is set. This identification symbol may be, for example, a texture image file name.
[0028]
The light source file 122 stores and saves data related to various light sources set in the three-dimensional space. FIG. 3 shows an example of the data record 42 stored and saved in the light source file 122. In FIG. 3, the item “light source ID” is a unique code uniquely set for each light source in order 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, ambient 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 saves texture data indicating patterns and materials to be pasted on the surfaces of various three-dimensional models. FIG. 4 shows an example of a data record stored and saved in the texture file 123. In FIG. 4, an item “texture No” is a unique identification symbol set for each texture in order to identify each texture data. For example, the texture number may be a file name of texture data. The item “image data” is image data of a texture for which a corresponding texture No. is set. The item “normal map No.” is an identification symbol that identifies 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 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 with speckled gloss.
[0030]
Further, the file of the texture file 123 may be provided with an item called “rendering instruction”. This rendering instruction describes an instruction for rendering the surface of the model. For example, the rendering instruction is normal bump mapping for model A, normal map A and normal map B for model B, normal map B for model C, and model D for model D. As in the normal map E required for carrying out the present invention, the three-dimensional model and the method are associated with each other. By describing such a rendering instruction in a file, it is possible to associate a method such as the same normal map with different three-dimensional models. This eliminates the need to record duplicate normal maps.
[0031]
The normal map file 124 stores and saves data related to normal maps generated from various texture images. FIG. 5 shows an example of a data record stored and saved in the normal map file 124. In FIG. 5, an item “normal map No” is a unique identification symbol set for each normal map in order to identify each normal map. Each “normal map data” is a normal vector of each pixel of the normal map in which the corresponding normal map No is set.
[0032]
Further, the records of the various files shown in FIGS. 2 to 5 may be integrated into one file and one record. In this case, duplicate items are omitted.
[0033]
Here, in the present embodiment, the restriction of normalizing the length of each normal vector performed by the conventional method to 1 is removed, and each normal vector set for each pixel of the normal map is removed. The size is varied depending on the difference in texture of the corresponding texture image. Such a normal vector is calculated by the following equation (1), for example.
[0034]
(R, G, B) = [(r, g, b) − (127, 127, 127)] × α + (127, 127, 127) (1)
Here, r, g, and b are RGB values corresponding to the X, Y, and Z vectors when the normal vector is normalized to 1, respectively. α is optional within the range of 0 ≦ α ≦ 1.
[0035]
In the image generation apparatus having such a configuration, the image generation calculation unit 13 sets the various three-dimensional models set in the model file 121 and the various light sources set in the light source file 122 in the three-dimensional space of the three-dimensional coordinate system. When the viewpoint position and the line-of-sight direction are determined by the input signal from the input device 20, an image of the three-dimensional space viewed from the viewpoint is generated. At this time, the image generation calculation unit 13 performs bump map processing on a predetermined three-dimensional model, and pastes a texture image with a sense of unevenness on the surface of the three-dimensional model.
[0036]
FIG. 6 is a flowchart showing a procedure of bump map processing executed by the image generation calculation unit 13. First, when the image generation calculation unit 13 acquires the texture No. of the texture image data to be pasted on the model from the data record 41 related to the three-dimensional model acquired from the model file 21, the data record of the texture No. from the texture file 123 as ST21. 43 is read.
[0037]
Next, in ST22, the image generation calculation unit 13 detects the normal map No. from the texture data record 43, and reads the data record 44 of the normal map No. 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 a glossy appearance, 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. Note that either of these processes may be processed first, or both may be processed in parallel.
[0039]
That is, the image generation calculation unit 13 calculates, for each pixel p, the light vector indicating the direction of the surface in the light source direction from the direction of the surface of the stereo model to which the texture image is pasted and the position of the light source in ST24. . Then, in ST25, the image generation calculation unit 13 reads the image data (texture image data) of the texture data record 43 obtained by reading the height direction component of the light vector (usually the Z-axis component of the light vector) from the texture file 123. ) To generate a rendering image by diffuse light (diffuse light rendering means).
[0040]
In ST26, the image generation calculation unit 13 determines the direction of the light from the light source on the surface and the direction of the line of sight from the viewpoint based on the orientation of the surface of the stereo model to which the texture image data is pasted and the positions of the light source and the viewpoint. A half-angle vector indicating the direction of the sum of is calculated for each pixel. Next, the image generation calculation unit 13 calculates, for each pixel, an inner product of this 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. Thus, an inner product value, that is, a luminance value of each pixel with respect to specular light is obtained. Then, the luminance value of each pixel, which is the result of the inner product calculation, is multiplied by a predetermined specular color to generate a rendering image using specular light. Note that the specular color is determined by the type of light source that irradiates the surface to which the texture image is attached.
[0041]
In this way, if the rendering image by the diffuse light and the rendering image by the specular light are generated, the image generation calculation unit 13 adds both the rendering images to obtain a final output image in ST29. Therefore, the image generation calculation unit 13 draws and outputs the 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 conversion unit 15 and displayed on a 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 generating the three-dimensional space image shown in FIG. 12, the texture of the lacquer that is pasted on the surface of the three-dimensional model that forms the wrinkle at the center of the screen in advance is shown in FIG. The texture 2 of the image shown in FIG. 7 is stored in the texture file 123, and as a normal map corresponding to the image of the texture 2, as shown in FIG. A 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 calculation unit 13 executes bump map processing on the three-dimensional model, a light vector as shown in FIG. 8 is calculated, and a component in the height direction of the light vector is converted into the image data of the texture 2. Multiplication is performed to generate a rendered image with diffuse light as shown in FIG. Further, 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, and then the inner product value, that is, the luminance value is set to a predetermined specular color. Is multiplied to generate a rendering image by specular light as shown in FIG. Then, the rendered image by the diffused light and the rendered image by the specular light are added to obtain a final output image as shown in FIG. Since this final output image suppresses the gloss of the portion of the normal map 1 'where the normal vector is short, that is, the non-glossy pine portion, on the contrary, the portion where the normal vector is long, that is, the gold foil is pasted. The glossiness of the existing portion is enhanced, and an image having a quality equivalent to or close to that when the texture 3 of the conventional mask image is used is obtained.
[0045]
Therefore, according to the present embodiment, the texture 3 of the mask image can be made unnecessary, so that the trouble of creating the texture 3 of the mask image can be eliminated and the memory for storing the texture of the mask image can be saved. The storage capacity of the part can be saved. In addition, the processing step of multiplying the rendered image by 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 shortened.
[0046]
In addition, if the lengths of the normal vectors are not uniform, the texture image information may be lost when the diffuse light is calculated, and blackening may occur. However, in this embodiment, the normal vector is used for calculating the diffuse light. Therefore, such a problem cannot occur because the rendering image by the diffused light is generated only by multiplying the texture image data by the height vector component of the light vector.
[0047]
Note that the present invention is not limited to the image generation technique in the virtual reality system, and can be applied, for example, when generating a three-dimensional space image in a CG animation or a TV game.
[0048]
The present invention is also effective when applied to the generation of images having different textures other than the gold foil portion.
[0049]
In the prior art, the brightness value of the diffuse light is obtained by calculating the inner product of the light vector and the normal vector. In the present invention, the normal vector is vertically upward (0, 0) in all pixels. , 1), the luminance value is obtained only with the height component of the light vector. Therefore, in the present invention, if the three-dimensional space image is a flat surface that receives light completely uniformly, a further texture and gloss can be produced.
[0050]
【The invention's effect】
As described above in detail, according to the invention corresponding to claim 1, it is possible to provide an image generation method capable of generating images with partially different textures with high processing quality with a small number of processing steps and saving storage capacity.
[0051]
Further, according to the invention corresponding to claim 2, it is possible to provide an image generation method capable of generating images with partially different glossiness with high processing quality with few processing steps and saving storage capacity.
[0052]
According to the invention corresponding to claim 3, it is possible to provide an image generating apparatus that can generate images with partially different textures with high processing quality with a small number of processing steps and save storage capacity.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of an image generation 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 apparatus 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 apparatus according to the embodiment.
FIG. 4 is a schematic diagram illustrating an example of a data record stored in a texture file of the image generation apparatus 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 generation apparatus according to the embodiment.
FIG. 6 is a flowchart showing a main procedure of bump map processing executed by an image generation calculation unit of the image generation apparatus 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 by diffuse light generated in the embodiment.
FIG. 11 is a rendering image by specular light generated in the embodiment.
FIG. 12 shows 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 explaining a normal map.
FIG. 16 is a flowchart showing a main procedure of bump map processing performed at the time of conventional image generation;
FIG. 17 is an output image generated by conventional bump map processing.
FIG. 18 is a mask image used in the prior art.
FIG. 19 is a rendering image by specular light generated by conventional bump map processing.
FIG. 20 is a rendering image by specular light generated by bump map processing using a conventional mask image.
[Explanation of symbols]
1,1 '... Normal map
2 ... Texture
10. Image generating device
11 ... Input signal converter
12. Data storage unit
13. Image generation calculation 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 solid model, a light source, and a viewpoint each having a texture of an image having a partially different texture in a three-dimensional space, and generating an image when the stereoscopic model is viewed from the viewpoint ,
Multiplying the texture image by a light vector indicating the direction of the surface of the stereo model to which the texture image is pasted in the light source direction to generate a rendered image by diffuse light;
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 of the surface to which the texture image of the stereo model is pasted, and the normal vector of the normal map corresponding to the texture image And calculating a dot product with the specular light by multiplying the dot product value by a predetermined specular color;
Adding the rendered image by the diffused light and the rendered image by the specular light to generate an output image,
An image generation method characterized in that the length of a normal vector of the normal map is made different depending on the texture of the corresponding texture image.
請求項1記載の画像生成方法において、
部分的に光沢感が異なる画像のテクスチャに対応する法線マップは、画素毎に設定された各法線ベクトルのうち、対応するテクスチャ画像の中で光沢感を抑える画像に対応する画素の法線ベクトルを他の画素の法線ベクトルより短くしたものであることを特徴とする画像生成方法。
The image generation method according to claim 1,
The normal map corresponding to the texture of an image with partially different glossiness is the normal line of the pixel corresponding to the image whose 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 generation device that sets a stereoscopic model, a light source, and a viewpoint in a stereoscopic space, and generates an image when the stereoscopic 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 a speckled image of gloss, the texture image is multiplied by a light vector indicating the direction of the surface to which the texture image of the three-dimensional model is pasted in the light source direction, and diffused light is used. A diffuse light rendering means for generating a rendered image;
When the texture image is a speckled image, a half indicating the sum direction of the light direction from the light source and the line-of-sight direction from the viewpoint of the surface to which the texture image of the three-dimensional model is attached A specular light rendering unit that calculates an inner product of an angle vector and a normal vector of a normal map corresponding to the texture image, and multiplies the inner product value by a predetermined specular color to generate a rendered image by specular light;
An output image generation means for generating an output image by adding a rendering image by diffuse light generated by the diffuse light rendering means and a rendering 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 depending on 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 JP2004102900A (en) 2004-04-02
JP4078926B2 true 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)

Families Citing this family (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
JP4031509B1 (en) 2006-09-21 2008-01-09 株式会社コナミデジタルエンタテインメント Image processing apparatus, image processing apparatus control method, and program
JP4079378B2 (en) 2006-09-21 2008-04-23 株式会社コナミデジタルエンタテインメント Image processing apparatus, image processing apparatus control method, and program
JP2009147754A (en) 2007-12-14 2009-07-02 Canon Inc Image processing apparatus and method

Also Published As

Publication number Publication date
JP2004102900A (en) 2004-04-02

Similar Documents

Publication Publication Date Title
JP5463866B2 (en) Image processing apparatus, image processing method, and program
Alexander et al. The digital emily project: Achieving a photorealistic digital actor
CN110490896B (en) Video frame image processing method and device
US7952577B2 (en) Automatic 3D modeling system and method
US6532013B1 (en) System, method and article of manufacture for pixel shaders for programmable shading
US7471301B2 (en) Method and system enabling real time mixing of synthetic images and video images by a user
US5995110A (en) Method and system for the placement of texture on three-dimensional objects
JP2007066064A (en) Image generating device and image generating program
US6731289B1 (en) Extended range pixel display system and method
JP3626144B2 (en) Method and program for generating 2D image of cartoon expression from 3D object data
JP2011159329A (en) Automatic 3d modeling system and method
CN111161392A (en) Video generation method and device and computer system
KR102353556B1 (en) Apparatus for Generating Facial expressions and Poses Reappearance Avatar based in User Face
CN108197555B (en) Real-time face fusion method based on face tracking
US5793372A (en) Methods and apparatus for rapidly rendering photo-realistic surfaces on 3-dimensional wire frames automatically using user defined points
CN109002185B (en) Three-dimensional animation processing method, device, equipment and storage medium
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
JPH0224785A (en) Method and device for shadowing processing
US20170221504A1 (en) Photorealistic CGI Generated Character
JPH056419A (en) Image synthesizing device
JP3453410B2 (en) Image processing apparatus and method
JPH09114994A (en) Device and method for forming image

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