Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4714919B2 - Rendering device, recording medium, and program - Google Patents
[go: Go Back, main page]

JP4714919B2 - Rendering device, recording medium, and program - Google Patents

Rendering device, recording medium, and program Download PDF

Info

Publication number
JP4714919B2
JP4714919B2 JP2002527455A JP2002527455A JP4714919B2 JP 4714919 B2 JP4714919 B2 JP 4714919B2 JP 2002527455 A JP2002527455 A JP 2002527455A JP 2002527455 A JP2002527455 A JP 2002527455A JP 4714919 B2 JP4714919 B2 JP 4714919B2
Authority
JP
Japan
Prior art keywords
texture
polygon
vertices
curved surface
image
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
JP2002527455A
Other languages
Japanese (ja)
Other versions
JPWO2002023484A1 (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.)
Todai TLO Ltd
Original Assignee
Todai TLO 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 Todai TLO Ltd filed Critical Todai TLO Ltd
Priority to JP2002527455A priority Critical patent/JP4714919B2/en
Publication of JPWO2002023484A1 publication Critical patent/JPWO2002023484A1/en
Application granted granted Critical
Publication of JP4714919B2 publication Critical patent/JP4714919B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/00Three-dimensional [3D] image rendering
    • G06T15/04Texture mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Description

技術分野
この発明はテクスチャマッピング方法及びレンダリング装置に関し、特に、シェーディングとテクスチャマッピングの表示結果を一致させることができるテクスチャマッピング方法及びレンダリング装置に関する。
背景技術
近年のコンピュータ演算能力の急速な発展にともない、人間の操作に応答できるだけの十分な描画速度が必要とされる実時間CG(Computer Graphics)の分野においても非常に高度な表現が可能になってきた。実時間CGでは、リアリティのある高度な表現と、それを算出するための計算量のトレードオフが常に問題となる。特にバーチャルリアリティなどの応用技術分野ではこの両方に対する要求が厳しく、解決されるべきいくつかの問題点が残っている。
はじめに、現在広く普及している実時間3DCGの画像生成(レンダリング)工程について概要をまとめる。
・3次元空間情報にもとづく計算処理(Transform&Lighting)
3DCGにおけるオブジェクトは、多数の頂点によって貼られる多角形平面(Polygon)の集合によって表されるのが一般的である。レンダリングは、立体モデルの各頂点の位置・結線情報、材質に関するデータなどをもとにして行う。
このデータに対して、視界範囲内の要素のみを抽出し(カリング)、各頂点が2次元画像上のどの位置に描画されるかを計算する(座標変換)。ここで立体モデルとそれを照らす光源との位置関係から、各頂点ごとの明るさを計算する(照光処理)。ここまでが3次元空間情報にもとづく計算処理(Transform&Lighting)である。
・2次元画像上の各画素(ピクセル)ごとの計算処理(ラスタライズ)
続いて、2次元画像上の各画素(ピクセル)ごとの計算処理(ラスタライズ)を行う。各描画ピクセルの視点位置からの距離に応じて前後関係を判定し(陰面処理)、各頂点ごとの色や明るさを補間してその頂点で貼られるPolygonの色を滑らかに陰影付けする(シェーディング)。こうして得られた3次元オブジェクトの表面に2次元画像などを貼り付けることで擬似的に細部を表現する方法をテクスチャマッピングという。
現在広く普及している実時間3D−CGの代表的な計算・表現技術について簡単に説明する。
(1)シェーディング
多角形(Polygon)で構成された3次元オブジェクトの表面を、光源とオブジェクトの形状に基づいて陰影付けする方法をシェーディングという。物理的に正確なシェーディング計算を行うのは非常に困難であり計算畳も膨大なものになるため、これを軽減すべく様々な計算方法が考案されてきた。一般的に高品質な画質の得られるシェーディングほど計算量が多くなる。
シェーディングの種類として、Flatシェーディング、Gouraudシェーディング、Phongシェーディングがある。
Flatシェーディングは、表面を構成する多角形の各面ごとに法線をたて、これと光源ベクトルの内積から面の色を決定する手法である。シェーディングの単位が面ごとであるため滑らかな曲面は表現できないが、計算量は少なく高速に表示できる。
Gouraudシェーディングは、表面を構成する多角形の各頂点ごとに法線をたて、これと光源ベクトルの内積から各頂点での色を決定する手法である。頂点間はそれぞれの頂点の色を線形補間して色付けする。比較的高速で滑らかな曲面も擬似的に表現できるが、曲率の高い曲面やハイライトの表現が不自然になる。
Phongシェーディングは、表面を構成する多角形の各頂点ごとに法線をたて、次に頂点間の描画される結果画像のビクセルごとに各頂点での法線ベクトルから線形補間した法線をたて、これをもとに光源と法線の内積からピクセルごとに色を決定する手法である。高品質な結果が得られるがピクセルごとの計算量が多いため、現在の実時間3D−CGで使用されることは稀である。
(2)テクスチャマッピング
テクスチャマッピングとは、3次元オブジェクトの表面に画像を張り付けることで質感を向上させる手法である。貼り付けるテクスチャ画像にu,v座標系をとり、このu,v座標値を各頂点に割り当てることで張りかた(マッピング方法)を決定する。
現在の実時間3D−CGでは一般的に、Gouraudシェーディングとテクスチャマッピングを併用することで画像を生成している。
上記実時間3D−CGの表現技術を用いることにより、定義されたオブジェクトの頂点位置はすべて正確に3次元空間内で計算され表示される。例えば平面のみで構成されるオブジェクトを正確にモデリングした場合には、任意の視点から見た完全に正しい形状を得ることができる。
これに照光による陰影表現、すなわちシェーディングを適用する。得られる画像品質と演算処理能力とのトレードオフから、Gouraudシェーディングが現在もっとも広く利用されている。これによって、正確な位置の頂点で張られる平面上に擬似的な陰影をつけることになる。
このようにして得られたオブジェクトにテクスチャマッピングを適用する。テクスチャ座標はオブジェクトの頂点ごとに定義され、その間を線形補間することで引き延ばされて張り付けられる。オブジェクトの平面に適用されたテクスチャは、任意の視点から見て完全に正しく表現されることになる。
平面のみで構成されるオブジェクトであれば、以上の方法でおよそ問題のない結果を得られるが、同様にして曲面を表現しようとした場合にはいくつかの問題が生じる。
曲面は細かい多角形の平面の集合に分割することで擬似的に表現されるが、この際に多くの頂点や平面が必要となり、計算量が著しく増加する。ここでは画像品質と計算量のトレードオフによって曲面の分割数が決定されるが、任意の視点からの画像を得られるという実時間3D−CGの利点から考えると、細部を表示する場合にどうしても曲面が荒くなってしまうのは問題である。
シェーディングに関しては、Gouraudシェーディングによっておよそ滑らかな陰影をもつ擬似曲面表現が得られる。しかし頂点位置でのみ色を計算し陰影の変化を線形補間で近似しているため、マッハバンドなどの不自然な陰影が生じてしまう。
テクスチャマッピングを適用した場合、問題はさらに顕著になる。頂点間のテクスチャ座標が線形補間されることにより、テクスチャ画像中の直線部分は、曲面上でも曲がることなく平面的に張り付けられる。これはGouraudシェーディングがグラデーションによって曲面上の陰影を視覚的にごまかしているのに対し、テクスチャ画像中には形状を知覚する手がかりが多く、視覚的にこのようなごまかしができないためである。
これらを原因として、とくに以下のような場合に疑似曲面表現が破綻する。これらはバーチャルリアリティなどの応用的な実装を考える際に深刻な問題になってくる。
(1)動くオブジェクトの表現
動きのあるオブジェクトを表示すると、曲面を擬似的に表現していることに起因する問題点は明確にあらわれる。オブジェクトが回転する際の不自然な外形の変化やテクスチャ画像の平面的な回転は、曲面の擬似的な表現を損なってしまう。
(2)立体視での融像
立体視を行う際、人間は左右の目から得られた画像中から適当な対応点を抽出し、これをもとに自己と対応点の距離を推測している。シェーディングのみによる疑似曲面を提示した場合には、グラデーションの濃淡によって曲面上の対応点はあいまいになるので、あまり違和感は生じない。しかしこれにテクスチャマッピングを適用した場合には、テクスチャ画像中のパターンはすべて明確な対応点となり、結果として曲面として表現したいものが平面的に融像してしまう。これに影響されてシェーディングによる疑似曲面表現も損なわれてしまう。
前述のように、実時間3D−CGではオブジェクトを2次元画像上に投影し、照光による陰影付け(Shading)、オブジェクト表面への画像パターンの貼り付け(テクスチャマッピング)などの過程を経て、近似的に結果画像を生成する。
しかし、同様の手法によりオブジェクトの曲面部分を描画しようとする場合に、シェーディングとテクスチャマッピングの近似表示結果が食い違ってくるという問題がある。この問題は従来議論されていなかったものであり、本発明者により初めて見出されたものである。
曲面において従来のテクスチャマッピングがシェーディングによる疑似曲面表現を損なっている、という点以外に、「両眼立体視を行なった場合に従来のシェーディング・テクスチャ処理では曲面表現が明瞭に破綻する。これを現状のハードウェア技術上の処理で効果的に解決できる」という点も同様かそれ以上に重要である。テクスチャがシェーディング表現を損ねる問題はこれまで「やむをえない」として許容もされてきたが、今後当然普及していくであろう両眼立体視環境ではこの問題がはるかに顕著に表れる。そのため、この解決手段を提示することは非常に意義があることである。
発明の開示
本発明は、係る新規な問題、すなわち、疑似曲面へのテクスチャマッピングの際に生じるシェーディングとテクスチャマッピングの表示結果の食い違いという問題を解決するためになされたものであり、両者を一致させることができるテクスチャマッピング方法及びレンダリング装置を提供することを目的とする。
この発明に係るテクスチャマッピング方法は、三次元座標においてひとつ又は複数のポリゴンにより構成される対象を用意するステップと、
前記ポリゴンの複数の頂点に対応づけられたテクスチャを用意するステップと、
前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行うステップと、
前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画するステップと、
前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を、前記複数の頂点の間で線形補間することにより求めるステップと、
三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θを求めるステップと、
三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを求めるステップと、
前記角度θおよび前記平面上の各点における浮き上がり量dに基づき、前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるステップと、
前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するステップと、
補正されたテクスチャ座標および前記テクスチャに基づきテクスチャマッピングを行うステップとを備えるものである。
この発明に係るレンダリング装置は、三次元座標においてひとつ又は複数のポリゴンにより構成される対象を記憶する三次元モデル記憶部と、前記ポリゴンの複数の頂点に対応づけられたテクスチャを記憶するテクスチャ記憶部と、前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行う透視変換部と、前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画する描画部と、前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を前記複数の頂点の間で線形補間することにより求める線形補間部と、三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θ及び三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを受け、これらに基づき前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるテクスチャ座標シフト量計算部と、前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するテクスチャ座標補正部とを備え、補正されたテクスチャ座標に基づき前記テクスチャ記憶部のテクスチャデータが読み出され、このデータに基づき描画されることを特徴とするレンダリング装置。
発明を実施するための最良の形態
前述の問題に対して、この発明の実施の形態において、テクスチャマッピング処理時にこの問題のための補正を行う「テクスチャ内シフト」手法を提案する。すなわち空間中に曲面形状を生成するのではなく、最終的にレンダリングされる画像中での想定する曲面形状を逆算して、歪めたテクスチャ画像を動的に生成して貼り付けることで、同等の効果を得るという手法である。
テクスチャ画像を動的に生成する方法はImage−based Renderingの分野で研究されてきている(Oliveira,Manuel M.Relief Texture Mapping.Ph.D.Dissertation,University of North Carolina,2000)が、今回のような目的で実時間内の計算量に抑えるにはさらに様々な工夫が必要になってくる。このテクスチャ画像生成処理を、実際にテクスチャ画像を歪めるのではなく、テクスチャマッピング処理時に各描画ピクセルのテクスチャ画像参照位置をずらしてやることで実現する。
これは従来のPolygon細分化に対し、前述のテクスチャマッピング処理のうち後半のものの計算量増加だけですむという利点がある。またラスタライズ時の処理であるため、主な計算は最終的に描画されるピクセルのみについて選択的に行われ、視界の外や他のオブジェクトに隠された部分については計算が省かれる。さらに、この処理は常に描画ピクセル単位で行われるため、Polygon細分化では粗さが見える程度まで拡大された場合にも有効である。
この発明の実施の形態に係る装置/方法について図を用いて具体的に説明する。
この装置/方法は、コンピュータにより実現される。周知のように、コンピュータは、中央処理装置(CPU、メモリを含む)、外部記憶装置(ハードディスク、CD−ROMドライブ、フロッピーディスクドライブを含む)、入力装置(キーボード、ポインティングデバイスを含む)、出力装置(CRTディスプレイ、液晶ディスプレイを含む)、通信装置(モデム、ターミナルアダプタを含む)を備える。
図1は、この発明の実施の形態に係る装置の要部を示すブロック図である。この図は、例えば、この装置/方法に係るプログラムがインストールされたコンピュータにおける主要部を示す機能ブロック図である。説明の便宜上、必要な部分のみを示しており、この装置/方法は、必要に応じて図示されない他の部分を含んでもよい。
図1において、符号1は三次元座標においてひとつ又は複数のポリゴンにより構成される対象を記憶する三次元モデル記憶部、符号2は前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行う透視変換部、符号3は前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、テクスチャに基づき描画する描画部、符号4は前記ポリゴンの複数の頂点に対応づけられたテクスチャを記憶するテクスチャ記憶部、符号5は前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を、前記複数の頂点の間で線形補間することにより求める線形補間部、符号6は三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θ及び三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを受け、これらに基づき前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるテクスチャ座標シフト量計算部、符号7は前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するテクスチャ座標補正部である。
図2はこの発明の実施の形態にかかる処理のフローチャートである。
次に動作について説明する。
実時間3D−CG技術において、頂点単位での座標変換計算を終えた後、結果画像として各ピクセルを描画する過程をラスタライズと呼ぶ。Gouraudシェーディングでは、この段階で頂点を結果画像上に投影した位置や色、テクスチャ座標を元に、その間を線形補間して描画する。この際、補間計算されたテクスチャ座標をもとにテクスチャ画像中から対応する色を取得し、描画する各ピクセルの色を決定するのである。疑似曲面へのテクスチャの適用が問題となるのは、テクスチャ座標が頂点単位で定義されており、頂点間すなわち面上の点はすべて線形補間により計算されているためである。そこで、この発明の実施の形態の装置は、テクスチャ座標シフト量計算部6及びテクスチャ座標補正部7を備え、擬似曲面に合わせてテクスチャ座標をシフトする。これによりスムーズで自然なテクスチャ表現が可能になる。
テクスチャ座標シフト量計算部6及びテクスチャ座標補正部7は、ラスタライズ時にテクスチャ座標の参照位置を計算する。ラスタライズではピクセルごとの描画計算が行われるため、ピクセル単位での曲面計算が行えれば、常に非常に詳細な曲面表示が行える。これはシェーディングにおけるGouraudシェーディングとPhongシェーディングの違いに相当する。当然この分の計算量が増加するが、同一平面上のテクスチャ参照座標を求める計算は比較的簡単である。以下、この方法をテクスチャ座標シフトによる疑似曲面表現と呼ぶ。この処理を行う際に留意すべき点は
・実時間で実行可能な計算量に抑える
・可能な限りデータ量を増やさない
・可能な限り既存の技術上で実装する
ことである。
まず、動作原理について説明する。単位ベクトルu,vで張られるuv座標系で、図3のようなテクスチャ座標を頂点に持つ長方形の面を考える。この面の法線ベクトルをn、面を見る視線方向ベクトルをeとする。この平面は疑似曲面の一部をなし、平面上の各点で法線方向にd(u,v)だけ平面から浮き上がっているとする。これをu,n平面に投影したものが図4である。
はこの平面上に視線方向ベクトルeを射影したものである。ここで、この平面が曲面であればAに存在するべき点が平面上の点Bになってしまうため、e方向から見た場合に平面と曲面の違いが生じる。これを補正するには、平面内のピクセルごとのテクスチャ座標をシフトし、Cの位置にBのテクスチャ座標を割り当てる。すなわちCを描画するためにテクスチャ座標値uを計算する際、線形補間により求められたu値からnとeのなす角をθとしてdtanθuだけずれた値を用いればよい。これをテクスチャ座標値Vの計算においても同様に行うことで、ラスタライズで各ピクセルを描画する際に、曲面を想定したテクスチャマッピンク結果を得ることができる。
ここで、ラスタライズでCを描画する際にBのテクスチャ座標値が必要であり、そのためにはdtanθu、すなわちBでの平面上の各点における浮き上がり量dが必要である。このdを求めるにはやはりBのテクスチャ座標値が必要である。そこで、想定する曲面が十分に滑らかであり、平面の法線と視線ベクトルのなす角βが十分に小さい(tanθが小さい)ことを仮定し、d(B)≒d(C)であると近似する。
ここで必要となるnとeのなす角θは、ピクセルごとではなく平面1枚につきひとつ求めてやればよい。また視線方向ベクトルと法線ベクトルとのなす角はシェーディングの際の照光計算でも求める必要があり、この種の計算はグラフィックチップ上で高速に行うことができる。
次に、平面から想定する曲面までの浮き上がり量d(u,v)を求める。これは各頂点の位置や法線ベクトルなどから近似的に求める方法も可能であるが、ラスタライズ時に各ピクセルごとにこの計算を行うと計算量が非常に多くなってしまう。ここではこれを省くための方法を考える。
まず、求めるべき浮き上がり量はテクスチャ画像上の各点において異なるが、描画のたびに変化しない静的な値であることに注目する。これらの値はあらかじめ計算し、各面ごとに保持しておけばよい。ここでは浮き上がり量d(u,v)を濃淡としたテクスチャ画像を用意し、ラスタライズ時にテクスチャ画像の各ピクセルの値を参照するのと同様にこれを参照することにする。
例えば、通常の色情報を含んだ画像の他に、もう一枚濃淡で浮き上がり量を表した画像を用意する。3DCGの描画時に、1枚のテクスチャだけでなく2枚のテクスチャの色を混合したりしながら張りつける技術は、「マルチテクスチャ技術」として一般的である。たとえば、DirectXなどのAPIにいて利用可能な機能になっている。ここでは2枚目の画像テクスチャを浮き上がり量テーブルとして用い、混合の代わりに「テクスチャ座標をシフト」させる処理を行なうことで、「マルチテクスチャ技術」「EMBM技術」などの現状のハードウェア技術上でもリアルタイム処理可能な実装方法を提供できる。
浮き上がり量をテクスチャ画像として用意するには、いくつかの方法が考えられる。
まずひとつは、テクスチャ画像中にRGB値の色とともにα値(通常透明度を表す)を持たせ、浮き上がり量をα値とする方法である。一般的にテクスチャ画像に色情報RGBとα値の計4チャンネルを持たせることで、色と透明度を表現する。
この方法ではそれぞれのテクスチャ画像に合った浮き上がり量を設定でき、任意の曲面形状を表現できる。しかし多数の平面にわたって1枚のテクスチャ画像を適用するため、浮き上がり量のu,v方向の解像度が荒くなってしまうことが難点である。また、すべてのテクスチャにそれぞれの浮き上がり量データを持たせることは不必要なデータ量の増加につながる。
もう一つの方法は、一般的な浮き上がり量のテクスチャ画像を別に用意し、ラスタライズ時には2枚のテクスチャ画像を元に計算を行う方法(Multi−texture)である。図5に示すように、頂点ごとに適切なテクスチャ座標を設定してやることで、一枚の浮き上がり量テクスチャ画像を様々な曲面に適用できる。この方法では、各面ごとに浮き上がり量をスケーリングするパラメータを用意すると、一枚の浮き上がり量テクスチャ画像で任意の曲率を表現できるようになる。
ここで、透明度が不要な場合にはαチャンネル内に浮き上がり量テーブルを持たせることができ、また透明度が必要な場合には別途浮き上がり量テクスチャ画像を用意すれば良い。また、浮き上がり量テーブルはもっと広義に高さを表す高度テーブルとしても利用できる。これにより多種多様な応用、例えば、滑らかな曲面の表現だけでなく、地形や人の顔など任意の形状をわずかなポリゴンで表現するような場合などにも適用できる。
計算されたテクスチャ座標シフト量をもとに、ラスタライズの段階でテクスチャ画像の参照位置を補正する。
補正されたテクスチャ座標に基づきテクスチャマッピングを行う。実際の処理には公知の手法を用いることができる。たとえば、Microsoft社によって提唱されたMultimedia API、DirectX中の実時間3D−CG描画用APIであるDirect3D(商標)を用いることができる。Direct3D(商標)の1998年のVersion6の仕様において、Environment−Mapped Bump−Mapping(EMBM)と呼ばれる機能がサポートされた。これは本来、環境マッピングを併用したバンプブマッピングという特殊効果のために提案された機能であるが、これを利用することで濃淡テクスチャ画像をシフト量としたピクセル単位でのテクスチャ画像設定が可能である。またこの機能は一部のグラフィックカード上でハードウェア的に実装されており、実時間内での処理が可能である。
この発明の実施の形態による装置/方法に係る、テクスチャ座標シフトによる疑似曲面の処理結果の例を図6に示す。図6(c)は処理対象である対象を示す。この対象は上半分が32角柱、下半分が8角柱である。図6(b)は通常のテクスチャマッピングを適用したもの、図6(a)はテクスチャ座標シフトによる疑似曲面処理を行ったものである。図から分かるように、正面に近い部分ではテクスチャの曲率を持った歪みがおよそ正しく表現されている。またこの効果は、立体視においても実現されていることが確認できた。これらの表示はEMBM等の機能を持つ既存のグラフィックカード上にて実時間で処理できる。
一方、面の法線と視線方向とのなす角が大きくなる側面付近では、円柱との表示結果に相違が見られる。また、テクスチャ座標シフトによって補正できない形状のシルエットは円柱の場合と異なる。
本発明の実施の形態に係るテクスチャ座標シフトによる疑似曲面表現手法では、1枚の平面内にほぼ任意の凹凸形状を表現できるので、バンプマッピンクと併用することでオブジェクト表面に様々なデイテールを付加することができる。
本発明の実施の形態によれば、実時間3D−CGにおける疑似曲面表現でシェーディングとテクスチャマッピンクの近似表示が食い違うという問題(発明者が発見した新規な課題)を解決することができる。本発明の実施の形態によれば実時間での処理が十分可能である。
本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
また、本明細書において、手段とは必ずしも物理的手段を意味するものではなく、各手段の機能が、ソフトウェアによって実現される場合も包含する。さらに、一つの手段の機能が、二つ以上の物理的手段により実現されても、若しくは、二つ以上の手段の機能が、一つの物理的手段により実現されてもよい。
【図面の簡単な説明】
図1は、この発明の実施の形態に係る装置のブロック図である。
図2は、この発明の実施の形態に係る処理のフローチャートである。
図3は、この発明の実施の形態の動作説明図である。
図4は、この発明の実施の形態の動作説明図である。
図5は、この発明の実施の形態の動作説明図である。
図6は、この発明の実施の形態の処理結果の例である。
TECHNICAL FIELD The present invention relates to a texture mapping method and rendering apparatus, and more particularly to a texture mapping method and rendering apparatus that can match display results of shading and texture mapping.
BACKGROUND ART With the rapid development of computer computing capabilities in recent years, extremely high-level expressions are possible even in the field of real-time CG (Computer Graphics), which requires a sufficient drawing speed to respond to human operations. I came. In real-time CG, the trade-off between reality and advanced expressions and the amount of calculation for calculating them is always a problem. Especially in the field of applied technology such as virtual reality, the requirements for both are severe, and some problems to be solved remain.
First, an overview of the real-time 3DCG image generation (rendering) process that is currently in widespread use will be summarized.
・ Calculation processing based on 3D spatial information (Transform & Lighting)
An object in 3DCG is generally represented by a set of polygonal planes (Polygons) pasted by a large number of vertices. Rendering is performed based on the position / connection information of each vertex of the stereo model, data on the material, and the like.
For this data, only the elements within the field of view are extracted (culling), and the position where each vertex is drawn on the two-dimensional image is calculated (coordinate conversion). Here, the brightness for each vertex is calculated from the positional relationship between the three-dimensional model and the light source that illuminates it (lighting process). This is the calculation processing (Transform & Lighting) based on the three-dimensional space information.
・ Calculation processing (rasterization) for each pixel on the 2D image
Subsequently, calculation processing (rasterization) is performed for each pixel on the two-dimensional image. The front-rear relationship is determined according to the distance from the viewpoint position of each rendering pixel (hidden surface processing), and the color and brightness of each vertex are interpolated to smoothly shade the polygon color pasted at that vertex (shading) ). A method of expressing details in a pseudo manner by pasting a two-dimensional image or the like on the surface of the three-dimensional object thus obtained is called texture mapping.
A typical calculation / representation technique of real-time 3D-CG that is currently widely used will be briefly described.
(1) Shading A method of shading the surface of a three-dimensional object composed of polygons based on the light source and the shape of the object is called shading. Since it is very difficult to perform physically accurate shading calculations and the calculation tatami is enormous, various calculation methods have been devised to reduce this. In general, the amount of calculation increases as shading with which high quality image quality is obtained.
As shading types, there are Flat shading, Gouraud shading, and Phong shading.
Flat shading is a method in which a normal is set for each surface of a polygon constituting the surface, and the color of the surface is determined from the inner product of this and the light source vector. Since the unit of shading is for each surface, a smooth curved surface cannot be expressed, but the amount of calculation is small and it can be displayed at high speed.
Gouraud shading is a method of determining a color at each vertex from the inner product of this and a light source vector for each vertex of a polygon constituting the surface. The vertices are colored by linearly interpolating the colors of the vertices. A relatively fast and smooth curved surface can also be simulated, but the curved surface with high curvature and highlighting become unnatural.
In the Phong shading, a normal is set for each vertex of a polygon constituting the surface, and a normal is obtained by linear interpolation from the normal vector at each vertex for each voxel of the resultant image drawn between the vertices. Based on this, the color is determined for each pixel from the inner product of the light source and the normal. High quality results are obtained, but due to the large amount of computation per pixel, it is rarely used in current real-time 3D-CG.
(2) Texture mapping Texture mapping is a technique for improving the texture by pasting an image on the surface of a three-dimensional object. The texture image to be pasted is taken with the u and v coordinate systems, and the u and v coordinate values are assigned to the respective vertices to determine how to apply (mapping method).
In the current real-time 3D-CG, an image is generally generated by using both Gouraud shading and texture mapping.
By using the real-time 3D-CG representation technique, the vertex positions of the defined objects are all accurately calculated and displayed in the three-dimensional space. For example, when an object composed only of a plane is accurately modeled, a completely correct shape viewed from an arbitrary viewpoint can be obtained.
A shadow expression by illumination, that is, shading is applied to this. Gouraud shading is currently most widely used because of the trade-off between the obtained image quality and arithmetic processing capability. As a result, a pseudo shadow is created on the plane stretched at the vertex of the correct position.
Texture mapping is applied to the object thus obtained. Texture coordinates are defined for each vertex of the object, and are stretched and pasted by linear interpolation between them. The texture applied to the plane of the object will be represented perfectly correctly from any viewpoint.
If the object is composed of only a plane, the above method can be used to obtain a problem-free result, but there are some problems when trying to represent a curved surface in the same way.
A curved surface is expressed in a pseudo manner by dividing it into a set of fine polygonal planes. At this time, a large number of vertices and planes are required, and the amount of calculation increases remarkably. Here, the number of curved surface divisions is determined by a trade-off between image quality and calculation amount. However, considering the advantage of real-time 3D-CG that an image from an arbitrary viewpoint can be obtained, the curved surface is inevitably displayed when displaying details. It is a problem that becomes rough.
With respect to shading, pseudo-curved surface representation having approximately smooth shading can be obtained by Gouraud shading. However, since the color is calculated only at the vertex position and the change in the shadow is approximated by linear interpolation, an unnatural shadow such as a Mach band is generated.
The problem becomes even more pronounced when texture mapping is applied. By linearly interpolating the texture coordinates between the vertices, the straight line portion in the texture image is pasted in a plane without bending even on the curved surface. This is because the Gouraud shading visually deceives the shadow on the curved surface by gradation, but there are many clues to perceive the shape in the texture image, and such deception is not possible visually.
Due to these reasons, the pseudo-curved surface expression breaks down particularly in the following cases. These become serious problems when considering application implementations such as virtual reality.
(1) Representation of moving objects When an object with movement is displayed, problems caused by representing a curved surface in a pseudo manner clearly appear. Unnatural changes in the outer shape of the object and the planar rotation of the texture image impair the pseudo-expression of the curved surface.
(2) Fusion When performing stereoscopic viewing, humans extract appropriate corresponding points from the images obtained from the left and right eyes, and based on this, estimate the distance between themselves and the corresponding points. Yes. When a pseudo curved surface only by shading is presented, the corresponding points on the curved surface become ambiguous due to gradation of gradation, so that there is not much discomfort. However, when texture mapping is applied to this, all the patterns in the texture image become clear corresponding points, and as a result, what is desired to be expressed as a curved surface is fused in a plane. This affects the pseudo curved surface expression by shading.
As described above, in real-time 3D-CG, an object is projected onto a two-dimensional image, subjected to approximate processes through processes such as shading by illumination and pasting of an image pattern on the object surface (texture mapping). A result image is generated.
However, there is a problem that the approximate display results of shading and texture mapping differ when drawing the curved surface portion of an object using the same method. This problem has not been discussed in the past, and was first discovered by the present inventors.
In addition to the fact that the conventional texture mapping on the curved surface impairs the pseudo-curved surface expression by shading, “When binocular stereoscopic viewing is performed, the curved surface expression clearly breaks down in the conventional shading and texture processing. It is equally important or more important that it can be effectively resolved with the processing of hardware technology. The problem that the texture impairs the shading expression has been accepted as “unavoidable” until now, but this problem appears much more prominently in a binocular stereoscopic environment that will naturally become popular in the future. Therefore, it is very meaningful to present this solution.
DISCLOSURE OF THE INVENTION The present invention has been made to solve such a new problem, that is, the problem of discrepancy between the display result of shading and texture mapping that occurs during texture mapping to a pseudo-curved surface. An object of the present invention is to provide a texture mapping method and a rendering apparatus that can perform the above-described process.
The texture mapping method according to the present invention comprises a step of preparing an object constituted by one or a plurality of polygons in three-dimensional coordinates;
Preparing a texture associated with a plurality of vertices of the polygon;
Performing perspective transformation of the object by projecting a plurality of vertices of the polygon onto screen coordinates respectively;
Rendering pixels on the screen coordinates corresponding to a plurality of vertices of the polygon based on the texture;
Obtaining texture coordinates corresponding to pixels between a plurality of vertices of the polygon on the screen coordinates by linear interpolation between the plurality of vertices;
Obtaining an angle θ formed by a viewing direction in a three-dimensional space and a surface normal of the polygon;
Obtaining a lifting amount d at each point on a plane from a plane constituting the polygon in a three-dimensional space to a predetermined curved surface;
Obtaining a texture coordinate shift amount, which is an error amount generated between the surface of the polygon and the curved surface when viewed from the line-of-sight direction, based on the angle θ and the lift amount d at each point on the plane;
Correcting the texture coordinates based on the texture coordinate shift amount;
Performing texture mapping based on the corrected texture coordinates and the texture.
A rendering device according to the present invention includes a three-dimensional model storage unit that stores an object composed of one or a plurality of polygons in three-dimensional coordinates, and a texture storage unit that stores textures associated with a plurality of vertices of the polygons A perspective transformation unit that performs perspective transformation of the object by projecting a plurality of vertices of the polygon onto screen coordinates, and pixels on the screen coordinates corresponding to the plurality of vertices of the polygon in the texture. A drawing unit for drawing based on the image, a linear interpolation unit for obtaining a texture coordinate corresponding to pixels between the plurality of vertices of the polygon on the screen coordinates by linear interpolation between the plurality of vertices, and a three-dimensional space The angle θ formed between the line-of-sight direction and the surface normal of the polygon, and the polygon in a three-dimensional space Texture that is an error amount generated between the surface of the polygon and the curved surface when viewed from the line-of-sight direction based on the lift amount d at each point on the plane from the constituting surface to a predetermined curved surface A texture coordinate shift amount calculation unit for obtaining a coordinate shift amount; and a texture coordinate correction unit that corrects the texture coordinates based on the texture coordinate shift amount. The texture data in the texture storage unit is read based on the corrected texture coordinates. A rendering device characterized in that it is rendered and rendered based on this data.
BEST MODE FOR CARRYING OUT THE INVENTION To solve the above-described problem, an embodiment of the present invention proposes a “shift in texture” technique for performing correction for this problem during texture mapping processing. In other words, instead of generating a curved surface shape in the space, the calculated curved surface shape is dynamically calculated and pasted by back-calculating the assumed curved surface shape in the final rendered image. It is a technique of obtaining an effect.
A method for dynamically generating texture images has been studied in the field of Image-based Rendering (Oliveira, Manuel M. Relief Texture Mapping. Ph. D. Dissertation, University of North Carolina, 2000). In order to reduce the amount of calculation in real time for a simple purpose, various ideas are required. This texture image generation process is realized by shifting the texture image reference position of each drawing pixel during the texture mapping process instead of actually distorting the texture image.
This has an advantage that the calculation amount of the latter half of the above-described texture mapping process is only increased compared to the conventional Polygon subdivision. In addition, since it is a process at the time of rasterization, the main calculation is selectively performed only for the pixel to be finally drawn, and the calculation is omitted for a portion outside the field of view or hidden by another object. Furthermore, since this process is always performed in units of drawing pixels, it is effective even when the polygon subdivision is enlarged to such an extent that the roughness can be seen.
An apparatus / method according to an embodiment of the present invention will be specifically described with reference to the drawings.
This apparatus / method is realized by a computer. As is well known, a computer has a central processing unit (including a CPU and a memory), an external storage device (including a hard disk, a CD-ROM drive, and a floppy disk drive), an input device (including a keyboard and a pointing device), and an output device. (Including a CRT display and a liquid crystal display) and a communication device (including a modem and a terminal adapter).
FIG. 1 is a block diagram showing a main part of an apparatus according to an embodiment of the present invention. This figure is, for example, a functional block diagram showing a main part in a computer in which a program according to this apparatus / method is installed. For convenience of explanation, only the necessary parts are shown, and this apparatus / method may include other parts not shown as needed.
In FIG. 1, reference numeral 1 denotes a three-dimensional model storage unit that stores an object composed of one or a plurality of polygons in three-dimensional coordinates, and reference numeral 2 denotes the above-mentioned by projecting a plurality of vertices of the polygons on screen coordinates. A perspective transformation unit that performs perspective transformation of an object, reference numeral 3 is a drawing unit that renders pixels on the screen coordinates corresponding to the plurality of vertices of the polygon based on texture, and reference numeral 4 is associated with the plurality of vertices of the polygon. A texture storage unit for storing the texture obtained by performing linear interpolation between the plurality of vertices for texture coordinates corresponding to pixels between the plurality of vertices of the polygon on the screen coordinates , Reference numeral 6 denotes an angle θ formed by the line-of-sight direction in the three-dimensional space and the surface normal of the polygon, and the three-dimensional space. The amount of lift d at each point on the plane from the surface constituting the polygon to a predetermined curved surface is received, and based on these, an error generated between the surface of the polygon and the curved surface when viewed from the line of sight A texture coordinate shift amount calculation unit for obtaining a texture coordinate shift amount, which is a quantity, and a texture coordinate correction unit 7 for correcting the texture coordinates based on the texture coordinate shift amount.
FIG. 2 is a flowchart of processing according to the embodiment of the present invention.
Next, the operation will be described.
In the real-time 3D-CG technology, the process of drawing each pixel as a result image after completing the coordinate conversion calculation for each vertex is called rasterization. In Gouraud shading, drawing is performed by linear interpolation between the positions, colors, and texture coordinates at which vertices are projected on the result image at this stage. At this time, the corresponding color is acquired from the texture image based on the texture coordinates calculated by interpolation, and the color of each pixel to be drawn is determined. The reason why the texture is applied to the pseudo curved surface is that the texture coordinates are defined in units of vertices, and the points between the vertices, that is, the points on the surface are all calculated by linear interpolation. Therefore, the apparatus according to the embodiment of the present invention includes a texture coordinate shift amount calculation unit 6 and a texture coordinate correction unit 7, and shifts texture coordinates according to the pseudo curved surface. This enables smooth and natural texture expression.
The texture coordinate shift amount calculation unit 6 and the texture coordinate correction unit 7 calculate the reference position of the texture coordinates at the time of rasterization. In rasterization, drawing calculation is performed for each pixel. Therefore, if a curved surface calculation can be performed in units of pixels, a very detailed curved surface display can always be performed. This corresponds to the difference between Gouraud shading and Phong shading in shading. Of course, this amount of calculation increases, but the calculation for obtaining the texture reference coordinates on the same plane is relatively simple. Hereinafter, this method is referred to as pseudo curved surface expression by texture coordinate shift. Points to keep in mind when performing this processing are: • Limit the amount of computation to be executable in real time • Do not increase the amount of data as much as possible • Implement on existing technology as much as possible.
First, the operation principle will be described. Consider a rectangular plane having texture coordinates as vertices as shown in FIG. 3 in the uv coordinate system spanned by unit vectors u and v. The normal vector of this surface is n, and the line-of-sight direction vector viewing the surface is e. It is assumed that this plane is a part of a pseudo curved surface and is lifted from the plane by d (u, v) in the normal direction at each point on the plane. FIG. 4 shows a projection of this onto the u, n plane.
eu is a projection of the line-of-sight direction vector e on this plane. Here, if this plane is a curved surface, a point that should be present on A is a point B on the plane, so that a difference between the plane and the curved surface occurs when viewed from the e direction. To correct this, the texture coordinate for each pixel in the plane is shifted, and the texture coordinate of B is assigned to the position of C. That when calculating the texture coordinates u to draw the C, and the angle between n and e n from u value obtained by linear interpolation may be used a value shifted by dtanθu as theta. By performing this similarly in the calculation of the texture coordinate value V, a texture map result assuming a curved surface can be obtained when each pixel is drawn by rasterization.
Here, when rendering C by rasterization, the texture coordinate value of B is required, and for this purpose, dtan θu, that is, the lift amount d at each point on the plane at B is required. In order to obtain this d, the texture coordinate value of B is still necessary. Therefore, assuming that the assumed curved surface is sufficiently smooth and the angle β between the normal line of the plane and the line-of-sight vector is sufficiently small (tan θ is small), it is approximated that d (B) ≈d (C). To do.
Here, the required angle θ between n and e may be obtained for each plane, not for each pixel. In addition, the angle formed by the line-of-sight direction vector and the normal vector needs to be obtained by illumination calculation at the time of shading, and this type of calculation can be performed at high speed on the graphic chip.
Next, a lifting amount d (u, v) from the plane to the assumed curved surface is obtained. This can be calculated approximately from the position of each vertex and the normal vector, but if this calculation is performed for each pixel during rasterization, the amount of calculation becomes very large. Here, a method for omitting this is considered.
First, it should be noted that the amount of lift to be obtained is a static value that differs at each point on the texture image but does not change with each drawing. These values may be calculated in advance and stored for each surface. Here, a texture image is prepared in which the floating amount d (u, v) is shaded, and this is referred to in the same manner as referring to the value of each pixel of the texture image at the time of rasterization.
For example, in addition to an image including normal color information, another image representing the amount of floating is prepared. A technique of pasting while mixing not only one texture but also two texture colors at the time of 3DCG drawing is general as “multi-texture technique”. For example, it is a function that can be used in an API such as DirectX. Here, the second image texture is used as the lift amount table, and instead of mixing, the process of “shifting the texture coordinates” is performed, so that even in the current hardware technology such as “multi-texture technology” and “EMBM technology”. An implementation method capable of real-time processing can be provided.
Several methods are conceivable for preparing the floating amount as a texture image.
The first is a method in which an α value (usually representing transparency) is given to the texture image together with the color of the RGB value, and the floating amount is set to the α value. In general, a texture image has a total of four channels of color information RGB and an α value to express color and transparency.
In this method, the amount of lifting suitable for each texture image can be set, and an arbitrary curved surface shape can be expressed. However, since one texture image is applied over a large number of planes, it is difficult to raise the resolution in the u and v directions of the floating amount. Also, having all textures have their respective lift amount data leads to an unnecessary increase in data amount.
The other method is a method (Multi-texture) in which a texture image having a general floating amount is prepared separately, and calculation is performed based on two texture images at the time of rasterization. As shown in FIG. 5, by setting appropriate texture coordinates for each vertex, a single floating amount texture image can be applied to various curved surfaces. In this method, if a parameter for scaling the lifting amount is prepared for each surface, an arbitrary curvature can be expressed by one lifting amount texture image.
Here, when the transparency is not required, a float amount table can be provided in the α channel, and when the transparency is required, a separate lift amount texture image may be prepared. The lift amount table can also be used as an altitude table that expresses the height in a broader sense. As a result, the present invention can be applied to a wide variety of applications, for example, not only to express a smooth curved surface but also to express an arbitrary shape such as terrain or a human face with a small number of polygons.
Based on the calculated texture coordinate shift amount, the reference position of the texture image is corrected at the stage of rasterization.
Texture mapping is performed based on the corrected texture coordinates. A known method can be used for the actual processing. For example, the Multimedia API proposed by Microsoft, Direct3D (trademark), which is a real-time 3D-CG rendering API in DirectX, can be used. The Direct3D ™ version 1998 specification supported a feature called Environment-Mapped Bump-Mapping (EMBM). This is a function originally proposed for the special effect of bump mapping in combination with environment mapping. By using this function, texture images can be set in pixel units with a grayscale texture image as the shift amount. is there. This function is implemented in hardware on some graphic cards and can be processed in real time.
An example of the processing result of the pseudo curved surface by the texture coordinate shift according to the apparatus / method according to the embodiment of the present invention is shown in FIG. FIG. 6C shows an object to be processed. In this object, the upper half is a 32 prism and the lower half is an octagon. FIG. 6B shows a case where a normal texture mapping is applied, and FIG. 6A shows a case where a pseudo curved surface process is performed by a texture coordinate shift. As can be seen from the figure, the distortion with the curvature of the texture is roughly expressed in the part near the front. Moreover, it has confirmed that this effect was implement | achieved also in the stereoscopic vision. These displays can be processed in real time on an existing graphic card having a function such as EMBM.
On the other hand, in the vicinity of the side surface where the angle formed by the normal of the surface and the line-of-sight direction is large, there is a difference in the display result with the cylinder. Also, the silhouette of the shape that cannot be corrected by the texture coordinate shift is different from that of the cylinder.
The pseudo-curved surface expression method by texture coordinate shift according to the embodiment of the present invention can express almost any uneven shape in one plane, so various details are added to the object surface by using it together with bump maple. can do.
According to the embodiment of the present invention, it is possible to solve a problem (a new problem discovered by the inventor) that the approximate display of shading and texture map pink is different in pseudo-curved surface expression in real-time 3D-CG. According to the embodiment of the present invention, processing in real time is sufficiently possible.
The present invention is not limited to the above embodiments, and various modifications can be made within the scope of the invention described in the claims, and these are also included in the scope of the present invention. Needless to say.
In the present specification, means does not necessarily mean physical means, but includes cases where the functions of each means are realized by software. Furthermore, the function of one means may be realized by two or more physical means, or the functions of two or more means may be realized by one physical means.
[Brief description of the drawings]
FIG. 1 is a block diagram of an apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart of processing according to the embodiment of the present invention.
FIG. 3 is a diagram for explaining the operation of the embodiment of the present invention.
FIG. 4 is an explanatory diagram of the operation of the embodiment of the present invention.
FIG. 5 is an explanatory diagram of the operation of the embodiment of the present invention.
FIG. 6 is an example of the processing result of the embodiment of the present invention.

Claims (10)

空間中に曲面形状を生成することに代えて、テクスチャマッピング処理時にレンダリングされる画像中での想定する曲面形状を逆算して、歪めたテクスチャ画像を動的に生成して貼り付けるテクスチャ内シフト手法によるテクスチャマッピング方法を実行するレンダリング装置であって、
三次元座標においてひとつ又は複数のポリゴンにより構成される対象を用意するステップと、
前記ポリゴンの複数の頂点に対応づけられたテクスチャを用意するステップと、
前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行うステップと、
前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画するステップと、
前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を、前記複数の頂点の間で線形補間することにより求めるステップと、
三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θを求めるステップと、
三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを求めるステップと、
前記角度θおよび前記平面上の各点における浮き上がり量dに基づき、前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるステップと、
前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するステップと、
補正されたテクスチャ座標および前記テクスチャに基づきテクスチャマッピングを行うステップとを備え、
前記テクスチャ座標シフト量を用いることにより、テクスチャ画像生成処理を、実際にテクスチャ画像を歪めることに代えて、テクスチャマッピング処理時に各描画ピクセルのテクスチャ画像参照位置をずらしてやることで実現したことを特徴とするテクスチャマッピング方法を実行するレンダリング装置
Instead of generating a curved surface shape in space, an in-texture shift method that dynamically calculates and pastes a distorted texture image by back-calculating the assumed curved surface shape in the image rendered during texture mapping processing A rendering device that executes a texture mapping method according to
Preparing an object composed of one or more polygons in three-dimensional coordinates;
Preparing a texture associated with a plurality of vertices of the polygon;
Performing perspective transformation of the object by projecting a plurality of vertices of the polygon onto screen coordinates respectively;
Rendering pixels on the screen coordinates corresponding to a plurality of vertices of the polygon based on the texture;
Obtaining texture coordinates corresponding to pixels between a plurality of vertices of the polygon on the screen coordinates by linear interpolation between the plurality of vertices;
Obtaining an angle θ formed by a viewing direction in a three-dimensional space and a surface normal of the polygon;
Obtaining a lifting amount d at each point on a plane from a plane constituting the polygon in a three-dimensional space to a predetermined curved surface;
Obtaining a texture coordinate shift amount, which is an error amount generated between the surface of the polygon and the curved surface when viewed from the line-of-sight direction, based on the angle θ and the lift amount d at each point on the plane;
Correcting the texture coordinates based on the texture coordinate shift amount;
Performing texture mapping based on the corrected texture coordinates and the texture,
By using the texture coordinate shift amount, the texture image generation processing is realized by shifting the texture image reference position of each drawing pixel during texture mapping processing instead of actually distorting the texture image. A rendering device for executing a texture mapping method.
前記テクスチャマッピング方法において、前記テクスチャ座標シフト量は、式:d・tanθにより与えられることを特徴とする請求項1記載のレンダリング装置 2. The rendering apparatus according to claim 1 , wherein in the texture mapping method, the texture coordinate shift amount is given by an expression: d · tan θ. 前記テクスチャマッピング方法において、前記テクスチャ座標シフト量は、浮き上がり量の倍率をkとしたとき、式:k・d・tanθにより与えられることを特徴とする請求項1記載のレンダリング装置 2. The rendering apparatus according to claim 1 , wherein, in the texture mapping method, the texture coordinate shift amount is given by an equation: k.d.tan.theta. 前記テクスチャマッピング方法において、三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの浮き上がり量を前記ポリゴンそれぞれについて予め記憶する浮き上がり量テーブルを用意するステップを備えることを特徴とする請求項1記載のレンダリング装置 The texture mapping method further comprises a step of preparing a lift amount table for storing in advance a lift amount from a surface constituting the polygon in a three-dimensional space to a predetermined curved surface for each of the polygons. The rendering apparatus according to 1. 前記テクスチャマッピング方法において、三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの浮き上がり量を前記ポリゴンそれぞれについて予め記憶する浮き上がり量テーブルを用意するステップを備え、
前記浮き上がり量テーブルは、浮き上がり量を濃淡とするテクスチャ画像であり、前記テクスチャ画像は、色情報とともにパラメータ値αを含み、前記パラメータ値αは前記テクスチャ画像ごとに異なる値に設定されることを特徴とする請求項1記載のレンダリング装置
In the texture mapping method, the method includes a step of preparing a lift amount table that stores in advance a lift amount from a surface constituting the polygon in a three-dimensional space to a predetermined curved surface for each of the polygons,
The lift amount table is a texture image in which the lift amount is shaded, and the texture image includes a parameter value α together with color information, and the parameter value α is set to a different value for each texture image. The rendering apparatus according to claim 1.
前記テクスチャマッピング方法において、三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの浮き上がり量を前記ポリゴンそれぞれについて予め記憶する浮き上がり量テーブルを用意するステップを備え、
前記浮き上がり量テーブルは、浮き上がり量を濃淡とするテクスチャ画像であり、
前記テクスチャおよび前記浮き上がり量テーブルに基づきテクスチャマッピングを行うことを特徴とする請求項1記載のレンダリング装置
In the texture mapping method, the method includes a step of preparing a lift amount table that stores in advance a lift amount from a surface constituting the polygon in a three-dimensional space to a predetermined curved surface for each of the polygons,
The lift amount table is a texture image in which the lift amount is shaded,
The rendering apparatus according to claim 1, wherein texture mapping is performed based on the texture and the lift amount table.
前記テクスチャマッピング方法において、面ごとに前記浮き上がり量をスケーリングするパラメータを用意することにより任意の曲率を表現することを特徴とする請求項5記載のレンダリング装置 6. The rendering apparatus according to claim 5 , wherein in the texture mapping method, an arbitrary curvature is expressed by preparing a parameter for scaling the lifting amount for each surface. 空間中に曲面形状を生成することに代えて、テクスチャマッピング処理時にレンダリングされる画像中での想定する曲面形状を逆算して、歪めたテクスチャ画像を動的に生成して貼り付けるテクスチャ内シフト手法によるレンダリング装置であって、
三次元座標においてひとつ又は複数のポリゴンにより構成される対象を記憶する三次元モデル記憶部と、前記ポリゴンの複数の頂点に対応づけられたテクスチャを記憶するテクスチャ記憶部と、前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行う透視変換部と、前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画する描画部と、前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を前記複数の頂点の間で線形補間することにより求める線形補間部と、三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θ及び三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを受け、これらに基づき前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるテクスチャ座標シフト量計算部と、前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するテクスチャ座標補正部とを備え、
前記テクスチャ座標シフト量を用いることにより、テクスチャ画像生成処理を、実際にテクスチャ画像を歪めることに代えて、テクスチャマッピング処理時に各描画ピクセルのテクスチャ画像参照位置をずらしてやることで実現したことを特徴とするレンダリング装置。
Instead of generating a curved surface shape in space, an in-texture shift method that dynamically calculates and pastes a distorted texture image by back-calculating the assumed curved surface shape in the image rendered during texture mapping processing A rendering device according to
A three-dimensional model storage unit that stores an object composed of one or a plurality of polygons in three-dimensional coordinates, a texture storage unit that stores textures associated with a plurality of vertices of the polygon, and a plurality of vertices of the polygon A perspective transformation unit that performs perspective transformation of the object by projecting each on screen coordinates, a drawing unit that renders pixels on the screen coordinates corresponding to a plurality of vertices of the polygon based on the texture, and A linear interpolation unit that obtains texture coordinates corresponding to pixels between a plurality of vertices of the polygon on screen coordinates by linear interpolation between the plurality of vertices; a line-of-sight direction in a three-dimensional space; and a surface method of the polygon Curved surface determined in advance from the angle θ formed with the line and the surface constituting the polygon in the three-dimensional space Texture coordinate shift amount for obtaining a texture coordinate shift amount, which is an error amount generated between the surface of the polygon and the curved surface when viewed from the line of sight based on the lift amount d at each point on the plane A calculation unit, and a texture coordinate correction unit that corrects the texture coordinates based on the texture coordinate shift amount,
By using the texture coordinate shift amount, the texture image generation processing is realized by shifting the texture image reference position of each drawing pixel during texture mapping processing instead of actually distorting the texture image. Rendering device.
コンピュータに、
空間中に曲面形状を生成することに代えて、テクスチャマッピング処理時にレンダリングされる画像中での想定する曲面形状を逆算して、歪めたテクスチャ画像を動的に生成して貼り付けるテクスチャ内シフト手法によるテクスチャマッピング方法であって、
三次元座標においてひとつ又は複数のポリゴンにより構成される対象を用意するステップと、
前記ポリゴンの複数の頂点に対応づけられたテクスチャを用意するステップと、
前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行うステップと、
前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画するステップと、
前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を、前記複数の頂点の間で線形補間することにより求めるステップと、
三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θを求めるステップと、
三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを求めるステップと、
前記角度θおよび前記平面上の各点における浮き上がり量dに基づき、前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるステップと、
前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するステップと、
補正されたテクスチャ座標および前記テクスチャに基づきテクスチャマッピングを行うステップとを備え、
前記テクスチャ座標シフト量を用いることにより、テクスチャ画像生成処理を、実際にテクスチャ画像を歪めることに代えて、テクスチャマッピング処理時に各描画ピクセルのテクスチャ画像参照位置をずらしてやることで実現したことを特徴とするテクスチャマッピング方法を実行させるためのプログラムを記憶した記録媒体。
On the computer,
Instead of generating a curved surface shape in space, an in-texture shift method that dynamically calculates and pastes a distorted texture image by back-calculating the assumed curved surface shape in the image rendered during texture mapping processing A texture mapping method according to
Preparing an object composed of one or more polygons in three-dimensional coordinates;
Preparing a texture associated with a plurality of vertices of the polygon;
Performing perspective transformation of the object by projecting a plurality of vertices of the polygon onto screen coordinates respectively;
Rendering pixels on the screen coordinates corresponding to a plurality of vertices of the polygon based on the texture;
Obtaining texture coordinates corresponding to pixels between a plurality of vertices of the polygon on the screen coordinates by linear interpolation between the plurality of vertices;
Obtaining an angle θ formed by a viewing direction in a three-dimensional space and a surface normal of the polygon;
Obtaining a lifting amount d at each point on a plane from a plane constituting the polygon in a three-dimensional space to a predetermined curved surface;
Obtaining a texture coordinate shift amount, which is an error amount generated between the surface of the polygon and the curved surface when viewed from the line-of-sight direction, based on the angle θ and the lift amount d at each point on the plane;
Correcting the texture coordinates based on the texture coordinate shift amount;
Performing texture mapping based on the corrected texture coordinates and the texture,
By using the texture coordinate shift amount, the texture image generation processing is realized by shifting the texture image reference position of each drawing pixel during texture mapping processing instead of actually distorting the texture image. A recording medium storing a program for executing a texture mapping method.
コンピュータに、
空間中に曲面形状を生成することに代えて、テクスチャマッピング処理時にレンダリングされる画像中での想定する曲面形状を逆算して、歪めたテクスチャ画像を動的に生成して貼り付けるテクスチャ内シフト手法によるテクスチャマッピング方法であって、
三次元座標においてひとつ又は複数のポリゴンにより構成される対象を用意するステップと、
前記ポリゴンの複数の頂点に対応づけられたテクスチャを用意するステップと、
前記ポリゴンの複数の頂点をそれぞれスクリーン座標上に投影することにより前記対象の透視変換を行うステップと、
前記ポリゴンの複数の頂点に対応する前記スクリーン座標上の画素を、前記テクスチャに基づき描画するステップと、
前記スクリーン座標上における前記ポリゴンの複数の頂点の間の画素に対応するテクスチャ座標を、前記複数の頂点の間で線形補間することにより求めるステップと、
三次元空間における視線方向と前記ポリゴンの面法線とのなす角度θを求めるステップと、
三次元空間における前記ポリゴンを構成する面から予め定められた曲面までの平面上の各点における浮き上がり量dを求めるステップと、
前記角度θおよび前記平面上の各点における浮き上がり量dに基づき、前記視線方向から見たときの前記ポリゴンの面と前記曲面の間に生じる誤差量であるテクスチャ座標シフト量を求めるステップと、
前記テクスチャ座標を前記テクスチャ座標シフト量に基づき補正するステップと、
補正されたテクスチャ座標および前記テクスチャに基づきテクスチャマッピングを行うステップとを備え、
前記テクスチャ座標シフト量を用いることにより、テクスチャ画像生成処理を、実際にテクスチャ画像を歪めることに代えて、テクスチャマッピング処理時に各描画ピクセルのテクスチャ画像参照位置をずらしてやることで実現したことを特徴とするテクスチャマッピング方法を実行させるためのプログラム。
On the computer,
Instead of generating a curved surface shape in space, an in-texture shift method that dynamically calculates and pastes a distorted texture image by back-calculating the assumed curved surface shape in the image rendered during texture mapping processing A texture mapping method according to
Preparing an object composed of one or more polygons in three-dimensional coordinates;
Preparing a texture associated with a plurality of vertices of the polygon;
Performing perspective transformation of the object by projecting a plurality of vertices of the polygon onto screen coordinates respectively;
Rendering pixels on the screen coordinates corresponding to a plurality of vertices of the polygon based on the texture;
Obtaining texture coordinates corresponding to pixels between a plurality of vertices of the polygon on the screen coordinates by linear interpolation between the plurality of vertices;
Obtaining an angle θ formed by a viewing direction in a three-dimensional space and a surface normal of the polygon;
Obtaining a lifting amount d at each point on a plane from a plane constituting the polygon in a three-dimensional space to a predetermined curved surface;
Obtaining a texture coordinate shift amount, which is an error amount generated between the surface of the polygon and the curved surface when viewed from the line-of-sight direction, based on the angle θ and the lift amount d at each point on the plane;
Correcting the texture coordinates based on the texture coordinate shift amount;
Performing texture mapping based on the corrected texture coordinates and the texture,
By using the texture coordinate shift amount, the texture image generation processing is realized by shifting the texture image reference position of each drawing pixel during texture mapping processing instead of actually distorting the texture image. A program for executing the texture mapping method.
JP2002527455A 2000-09-13 2001-09-13 Rendering device, recording medium, and program Expired - Fee Related JP4714919B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002527455A JP4714919B2 (en) 2000-09-13 2001-09-13 Rendering device, recording medium, and program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2000278045 2000-09-13
JP2000278045 2000-09-13
PCT/JP2001/007936 WO2002023484A1 (en) 2000-09-13 2001-09-13 Texture mapping method and rendering device
JP2002527455A JP4714919B2 (en) 2000-09-13 2001-09-13 Rendering device, recording medium, and program

Publications (2)

Publication Number Publication Date
JPWO2002023484A1 JPWO2002023484A1 (en) 2004-04-08
JP4714919B2 true JP4714919B2 (en) 2011-07-06

Family

ID=18763269

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002527455A Expired - Fee Related JP4714919B2 (en) 2000-09-13 2001-09-13 Rendering device, recording medium, and program

Country Status (3)

Country Link
JP (1) JP4714919B2 (en)
AU (1) AU2001286216A1 (en)
WO (1) WO2002023484A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019049457A1 (en) * 2017-09-07 2019-03-14 株式会社ソニー・インタラクティブエンタテインメント Image generation device and image generation method

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4641831B2 (en) * 2005-03-14 2011-03-02 株式会社バンダイナムコゲームス Program, information storage medium, and image generation system
JP4662260B2 (en) * 2005-09-21 2011-03-30 株式会社バンダイナムコゲームス Program, information storage medium, and image generation system
JP7712895B2 (en) 2022-06-16 2025-07-24 任天堂株式会社 IMAGE PROCESSING PROGRAM, IMAGE PROCESSING APPARATUS, IMAGE PROCESSING SYSTEM, AND IMAGE PROCESSING METHOD

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10302079A (en) * 1997-04-23 1998-11-13 Sharp Corp Three-dimensional texture mapping processing device and three-dimensional image generation device using the same
JPH11203498A (en) * 1998-01-16 1999-07-30 Nec Corp Method and device for generating texture coordinate by using normal vector
JP2000504453A (en) * 1996-11-21 2000-04-11 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method and apparatus for generating computer graphics images
JP2002074389A (en) * 2000-08-23 2002-03-15 Nintendo Co Ltd Graphics processing system and method for performing embossed bump mapping

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000504453A (en) * 1996-11-21 2000-04-11 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method and apparatus for generating computer graphics images
JPH10302079A (en) * 1997-04-23 1998-11-13 Sharp Corp Three-dimensional texture mapping processing device and three-dimensional image generation device using the same
JPH11203498A (en) * 1998-01-16 1999-07-30 Nec Corp Method and device for generating texture coordinate by using normal vector
JP2002074389A (en) * 2000-08-23 2002-03-15 Nintendo Co Ltd Graphics processing system and method for performing embossed bump mapping

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019049457A1 (en) * 2017-09-07 2019-03-14 株式会社ソニー・インタラクティブエンタテインメント Image generation device and image generation method
US11120614B2 (en) 2017-09-07 2021-09-14 Sony Interactive Entertainment Inc. Image generation apparatus and image generation method

Also Published As

Publication number Publication date
JPWO2002023484A1 (en) 2004-04-08
AU2001286216A1 (en) 2002-03-26
WO2002023484A1 (en) 2002-03-21

Similar Documents

Publication Publication Date Title
EP3748584B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
JP3294149B2 (en) Three-dimensional texture mapping processing device and three-dimensional image generation device using the same
Welsh Parallax mapping with offset limiting: A per-pixel approximation of uneven surfaces
US7280121B2 (en) Image processing apparatus and method of same
CN102708585B (en) Method for rendering contour edges of models
US8059119B2 (en) Method for detecting border tiles or border pixels of a primitive for tile-based rendering
KR102701851B1 (en) Apparatus and method for determining LOD(level Of detail) for texturing cube map
US7889208B1 (en) Z-texture mapping system, method and computer program product
US7884825B2 (en) Drawing method, image generating device, and electronic information apparatus
CN100399358C (en) Image processing device and method thereof
US11989807B2 (en) Rendering scalable raster content
US7158133B2 (en) System and method for shadow rendering
WO2019049457A1 (en) Image generation device and image generation method
US6297833B1 (en) Bump mapping in a computer graphics pipeline
KR101118597B1 (en) Method and System for Rendering Mobile Computer Graphic
US8179399B2 (en) Rasterizing method
Malan Edge Antialiasing by Post-Processing
JP4714919B2 (en) Rendering device, recording medium, and program
US11776179B2 (en) Rendering scalable multicolored vector content
KR100559127B1 (en) Image processing device
US7088368B1 (en) Methods and systems for rendering computer graphics
KR20240140624A (en) Smart CG rendering methodfor high-quality VFX implementation
CN119540432A (en) Texture rendering method, device and computer equipment based on UV space
JP3745152B2 (en) Image display device
Fields et al. Parallax Occlusion Mapping Using

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080818

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080818

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101124

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110114

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110222

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110309

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

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees