JP2004054599A - Image processing device and method - Google Patents

Image processing device and method Download PDF

Info

Publication number
JP2004054599A
JP2004054599A JP2002211280A JP2002211280A JP2004054599A JP 2004054599 A JP2004054599 A JP 2004054599A JP 2002211280 A JP2002211280 A JP 2002211280A JP 2002211280 A JP2002211280 A JP 2002211280A JP 2004054599 A JP2004054599 A JP 2004054599A
Authority
JP
Japan
Prior art keywords
information
map
image processing
board
created
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.)
Pending
Application number
JP2002211280A
Other languages
Japanese (ja)
Inventor
Hitoshi Ishikawa
石川 仁
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2002211280A priority Critical patent/JP2004054599A/en
Publication of JP2004054599A publication Critical patent/JP2004054599A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing device and an image processing method, by which fur or the like can be drawn speedily with high quality without using a filter having special function. <P>SOLUTION: The image processing device is provided with a bristle preparing part 11 for preparing each of bristles as a polygonal line in configurations that nodes ND are connected in a bristle coordinate system based on the whole attributes of bristles, and for outputting model information S11 of bristles, a plate/map preparing part 12 for classifying the model information of bristles into different bundles, and for preparing the information(equation) of a plane from the classified information of bristles, and for preparing a plate and map from the classified model information and the information of the plane, a map holding part 13 for holding the map information, and a plotting part 14 for plotting the plate prepared by the plate/map preparing part 12 based on the map information held by the map holding part 13. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、近接する複数の線状物体が比較的にまとまった方向に発生している毛皮等を表現する画像処理装置およびその方法に関するものである。
【0002】
【従来の技術】
昨今のコンピュータシステムにおける演算速度の向上や描画機能の強化とも相俟って、コンピュータ資源を用いて図形や画像の作成や処理を行う「コンピュータ・グラフィックス(CG)」技術が盛んに研究・開発され、さらに実用化されている。
【0003】
たとえば、3次元グラフィックスは、3次元オブジェクトが所定の光源によって照らされたときの光学現象を数学モデルで表現して、このモデルに基づいてオブジェクト表面に陰影や濃淡を付けたり、さらには模様を貼り付けたりして、よりリアルで3次元的な2次元高精細画像を生成するものである。
このようなコンピュータ・グラフィックスは、科学、工学、製造などの開発分野でのCAD/CAM、その他の各種応用分野においてますます盛んに利用されるようになってきている。
【0004】
3次元グラフィックスは、一般には、フロントエンドとして位置づけられる「ジオメトリ・サブシステム」と、バックエンドとして位置づけられる「ラスタ・サブシステム」とにより構成される。
【0005】
ジオメトリ・サブシステムとは、ディスプレイ・スクリーン上に表示する3次元オブジェクトの位置や姿勢などの幾何学的な演算処理を行う過程のことである。
ジオメトリ・サブシステムでは、一般にオブジェクトは多数のポリゴンの集合体として扱われ、ポリゴン単位で、「座標変換」、「クリッピング」、「光源計算」などの幾何学的な演算処理が行われる。
【0006】
一方、ラスタ・サブシステムは、オブジェクトを構成する各ピクセル(pixel)を塗りつぶす過程のことである。
ラスタライズ処理は、たとえばポリゴンの頂点毎に求められた画像パラメータを基にして、ポリゴン内部に含まれるすべてのピクセルの画像パラメータを補間することによって実現される。
ここで言う画像パラメータには、いわゆるRGB形式などで表される色(描画色)データ、奥行き方向の距離を表すz値などがある。
また、最近の高精細な3次元グラフィックス処理では、遠近感を醸し出すためのf(fog:霧)や、物体表面の素材感や模様を表現してリアリティを与えるテクスチャt(texture)なども、画像パラメータの1つとして含まれている。
【0007】
ここで、ポリゴンの頂点情報からポリゴン内部のピクセルを発生する処理では、よくDDA(Digital Differential Analyzer)と呼ばれる線形補間手法を用いて実行される。
DDAプロセスでは、頂点情報からポリゴンの辺方向へのデータの傾きを求め、この傾きを用いて辺上のデータを算出した後、続いてラスタ走査方向(X方向)の傾きを算出し、この傾きから求めたパラメータの変化分を走査の開始点のパラメータ値に加えていくことで、内部のピクセルを発生していく。
【0008】
【発明が解決しようとする課題】
ところで、各ピクセルの描画色の計算、すなわち色計算には表面の材質が大きく影響を及ぼす。平坦で均質な素材の表面の色計算は比較的容易であるが、たとえば動物の毛皮などの色計算は容易ではない。何故ならば、表面形状が複雑で、毛の密度によっては皮膚の色の影響を受けたり、毛の流れによって色も変化するからである。
【0009】
動物の毛皮を描画する最も基本的な方法として、毛を1本1本描画する方法がある。
しかしながら、この方法は、毛を1本1本描画するために必要な計算量が膨大となってしまうという根本的な問題がある。
さらに、毛は半透明物質として描画するため、プリミティブ単位あるいはピクセル単位で奥行き方向にソート(zソート)する必要がある。これにも膨大な計算量を要する。
【0010】
Kajiyaは、3次元マップを用い視線方向にテクセルを走査することによって、毛皮の質感を表現できることを示した(Kajiya,J.T and Timothy L. Kay.Rendering Fur with Three Dimentional Textures,SIGGRAPH 89,pp.271−280、参照)。
しかしながら、この方法は、視線方向のテクセルの走査に描画時間が多く必要である。また、3次元マップを保持するための大容量のメモリ領域が必要となる。
【0011】
Go1dmanは、ダルメシアンのような非常に短い毛の生え方がポアソン(Poisson)分布に従うと仮定することによって、確率的な見え方を計算し、高速に毛皮の質感を描画する方法を開発した(Goldman,D.B., Fake Fur Rendering,SIGGRAPH 97,pp.127−134 、参照)  。
この方法は、視線方向のテクセルの走査が必要なく、大容量のメモリも必要がない。
しかしながら、この方法は、短い毛が1ピクセル中に十分に多く存在する場合にのみ有効であり、たとえばダルメシアンより長い毛であったり、1ピクセル中にそれほど多く毛が存在しないような場合には用いることができない。
【0012】
Lengyelは、毛皮を同心の複数の半透明層(以下、シェル(shell)という)として描画する方法を提案した(Lengyel,E.J., Real−Time Fur, Eurographics Rendering Workshop 2000, pp.243−256 、および、Lengyel,E.J., Real−Time Fur over Arbitrary Surfaces ,ACM 2001 Symposium on Interactive 3D Graphics(http://research.microsoft.com/ 〜jdl/) 参照)。
これは、シェルを内側から複数回描画し、重ね合わせて行くことで、毛皮を高速に描画できる。各シェルの色計算には、事前に毛のモデルから作成した3次元マップを用いる。
【0013】
彼らはまた、nVidiaのGeForceにおける頂点シェーダ、ピクセルシェーダへの実装を行い、この方法が実際に、有効であることを示した。
【0014】
この方法では、Praunのラップドテクスチャ(lapped texture)の手法(Praun,E., Lapped Textrures, SIGGRAPH 2000,pp.465−470、参照)を用い、同しマップを縁り返し表面に貼り付けることで、必要なマップの総量を減らしている。
しかし、この方法では、依然として擬似的な3次元マップであり、シェルの数だけのマップはやはり必要となってしまうという問題がある。
【0015】
また、シェルを用いた描画の本質的な問題として、エッジ近傍での画質の劣化がある。エッジ近傍では、毛の描画色か徐々に薄く見えるようになる。また、シェルの描画順がエッジ近傍では正しくないため、正しい色が得られない。
このエッジ近傍での画質上の問題点を、Lengyelは皮膚上のメッシュの境界線上に、皮膚面に垂直にひれ状のプリミティブ(フィン:fin)を用いることで解決している。
フィン(fin)は、メッシュの境界上のどこにでも存在し、メッシュの境界がエッジに近い場合のみフィンを描画するようにしている。フィンの描画には、前述の3次元マップとは別のマップ(フィンテクスチャ(fin  texture))を用いる。
【0016】
Lengyelは、メッシュの全ての境界線上に異なるフィンテクスチャを用意するのではなく、1種類のフィンテクスチャを使いまわすことで、必要なメモリ量を節約している。
しかしながら、Lengyelが試みているのは、毛が全体的には皮膚面に対して垂直に立っている場合のみである。
この場合であれば、フィンテクスチャは1種類で済むが、たとえば毛が皮膚面に沿っているような場合には、視線と毛の方向との関係から様々なフィンテクスチャを選択する必要が生じる。
したがって、フィンテクスチャに必要なメモリ量は増大する。
【0017】
また、フィンは半透明のプリミティブとして描画するため、正確な色計算のためには本来はzソートを行わなければならないが、これについてLengyelは特に述べていない。
【0018】
上記のような課題があるものの、シェルを用いた毛皮の描画は高速であり、単純形状の物体であれば、フィンの描画を除けば、半透明物体の重ねあわせに合うソーティングも必要ないという長所がある。
ところが、このシェルレンダリングでは毛の連続性を保てない。
【0019】
毛の連続性を保つためには、フィルタを用いることが考えられる。この手法では。効果的に毛を描画できるが、フィルタを高速に実行する特別の機能を保持する必要がある。本機能を所持しないハードウェアでは、この処理は実装が困難である。
【0020】
本発明は、かかる事情に鑑みてなされたものであり、その目的は、特別な機能を有するフィルタを用いることなく、毛皮等を高速にかつ質感高く描画することができる画像処理装置およびその方法を提供することにある。
【0021】
【課題を解決するための手段】
上記目的を達成するため、本発明の第1の観点は、近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理装置であって、方向性をもって発生している近接する複数の線状物体を束なりとし、当該束なりに対応する板を作成する作成部と、所定のパラメータを基に上記作成部により作成された板を描画する描画部とを有する。
【0022】
好適には、上記描画部は、上記作成部で作成した板に対応する束なりに属する線状物の情報を含むマップデータに基づいて上記板の描画を行う。
【0023】
好適には、上記作成部は、モデルとして与えられた線状物の情報を複数の束なりに分類し、分類した複数の束なりのうち最も良く近似する束なりに基づいて板を作成する。
【0024】
好適には、上記作成部は、モデルとして与えられた線状物の情報を複数の束なりに分類するに際し、線状物に垂直な方向になるべく長く領域を取るように分類する。
【0025】
好適には、上記作成部は、板に対応する束なりに属する線状物の情報を含むマップデータを所定の軸に対して基準として作成し、かつ、当該作成に際し、線状物の生えている方向を上記所定の軸にほぼ平行に与えて作成し、上記描画部は、上記作成部で作成したマップデータに基づいて上記板の描画を行う。
【0026】
本発明の第2の観点は、近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理装置であって、線状物のモデル情報を異なる束なりに分類し、分類した線状物の情報から、平面の情報を作成し、分類したモデル情報と平面の情報から、板およびマップを作成する板/マップ作成部と、上記板/マップ作成部で作成したマップ情報を保持するマップ保持部と、板/マップ作成部により作成した板をマップ保持部に保持されているマップ情報に基づいて描画する描画部とを有する。
【0027】
本発明の第3の観点は、近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理方法であって、方向性をもって発生している近接する複数の線状物体を束なりとし、当該束なりに対応する板を作成する第1のステップと、所定のパラメータを基に作成された板を描画する第2のステップとを有する。
【0028】
本発明の第4の観点は、近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理方法であって、線状物のモデル情報を異なる束なりに分類する第1のステップと、分類した線状物の情報から、平面の情報を作成する第2のステップと、分類したモデル情報と平面の情報から、板およびマップを作成する第3のステップと、上記第3のステップ作成したマップ情報を保持する第4のステップと、上記第3のステップで作成した板を上記第4のステップで保持した情報に基づいて描画する第5のステップとを有する。
【0029】
本発明によれば、たとえば線状物のモデル情報が板/マップ作成部に供給される。
板/マップ作成部では、線状物のモデル情報を異なる束なりに分類される。分類した線状物の情報から、平面の情報が作成される。そして、分類したモデル情報と平面の情報から、板およびマップを作成される。
板/マップ作成部で生成された板情報は、描画部に供給され、マップ情報はマップ保持部に供給され、保持される。
そして、描画部において、板/マップ作成部により作成した板がマップ保持部に保持されているマップ情報に基づいて描画される。
【0030】
【発明の実施の形態】
以下、本発明の実施形態を図面に関連付けて説明する。
【0031】
図1は、本発明に係る画像処理装置の一実施形態を示すブロック構成図である。
【0032】
まず、本実施形態に係る画像処理装置10の基本概念について説明する。
本画像処理装置10は、2次元マップを用いた近接する複数の線状物体が比較的にまとまった方向に発生している毛皮の描画が可能である。
具体的には、画像処理装置10は、毛の「束なり」を表現する板を複数枚描画することにより、毛皮を描画する。
図2に示すように、毛皮における毛は全てが独立に生えているのではなく、隣り合う毛同士は比較的まとまった方向に発生している。本実施形態においては、これを「束なり」と呼ぶことにする。
このような特徴は、毛髪などでは目立たず、毛皮に特有の現象である。
毛髪を1本1本ではなく、あるまとまった単位で描画するという手法は提案されている。しかしながら、毛髪の場合、毛がどの方向にまとまるといった特徴がないことから、十分に多くの毛をまとめた単位で描画することは困難である。
本実施形態においては、毛皮における毛が平面上に「束なり」を構成していることから、これら「束なり」を別々の板として描画することにより、毛皮の質感を損なわず、毛の情報をまとめた単位で描画することができるように構成されている。
この際、板を半透明の物体として描画するため、各板は正確に奥行き方向から順番にソーティングされる必要がある。これに対して、本実施形態においては、ピクセル単位でのソートが可能であること利用して対応している。これは既存ハードウェアでも十分に実現可能である。
【0033】
図3は、図2に示した毛の束なりをそれぞれ板として表した図である。
本実施形態においては、板PLTを作成した後、図4に示すように、この板PLTに対して毛の色計算に必要な情報を投影する。その結果、板PLTそれぞれに対応して2次元のマップが作成できる。
マップには、毛の方向ベクトル、色、透過度といった情報が格納される。
なお、マップに格納する毛の情報は、各テクセルに対して一番上側の毛のみを格納することも可能であるが、これは必ずしもそうする必要はなく、各テクセルに対して複数の毛の情報の重み付け平均値を用いることもことも可能であり、有効である。
【0034】
すなわち、本実施形態に係る画像処理装置10は、3次元マップを用いず、単一の2次元マップを用いて描画する。
本画像処理装置10では、このように、表現したい毛をなるべく分断しないようにサンプリングすることで、少ないメモリ容量で高画質な表現を可能としている。
【0035】
本実施形態に係る画像処理は、描画前処理および描画時処理から構成される。描画前処理は毛のモデル作成や板およびマップ作成処理を含み、描画前に一度だけ行う。描画時処理は描画前に作成されたマップを用いて、リアルタイムで行う処理である。
以下に、本実施形態に係る画像処理装置10の具体的な構成および処理内容について詳述する。
【0036】
本画像処理装置10は、図1に示すように、毛作成部11、板/マップ作成部12、マップ保持部13、描画部14、および描画色およびz値を保持するメモリ15を有している。
描画前処理は毛作成部11、板/マップ作成部12、およびマップ保持部13で行われ、描画後処理は、描画部14、およびメモリ15により行われる。
【0037】
毛作成部11は、毛の全体的な属性をもとに、図5に示すような、毛座標系において符号1−0,1−1,・・で示す毛の1本1本を折れ線として作成し、毛のモデル情報S11として板/マップ作成部12に供給する。
図5の例は、毛を2本だけ作成した状態を示している。各毛1−0,1−1は、丸で示した複数(図5の例では4)の節点ND00〜ND03,ND10〜ND13を結合した折れ線で表現されている。
毛の属性は、基本的に先端部と末端部、すなわち一番先端の節点ND00,ND10と、一番末端の節点ND03,ND13に対する属性として与える。そして、中間に存在する節点ND01,ND02、ND11,ND12の属性は、先端と末端の節点間を均等に補間して求める。
したがって、本実施形態においては、節点間の距離は、1本の毛においては同じとなっている。
【0038】
板/マップ作成部12は、毛作成部11によりモデルとして与えられた毛の情報から板および色計算用のマップを作成し、作成した板情報S12aを描画部14に供給し、マップ情報S12bをマップ保持部13に供給する。
【0039】
図6は、板/マップ作成部12の具体的な構成例を示すブロック図である。
【0040】
この板/マップ作成部12は、図6に示すように、束なり作成部121、平面作成部122、および投影部123を有している。
【0041】
束なり作成部121は、毛作成部11により与えられた毛のモデル情報を、異なる束なりに分類し、分類した束なり毎の毛のモデル情報を信号S121として平面作成部122および投影部123に出力する。
平面作成部122は、束なり作成部121において束なりに分類された毛の情報から、平面の情報(方程式)を作成し、信号S122として投影部123に出力する。
投影部123は、モデル情報と平面の情報から、板およびマップを作成し、板情報S12aを描画部14に供給し、マップ情報S12bをマップ保持部13に供給する。
【0042】
以下に、板/マップ作成部12の具体的な処理手順について詳述する。
【0043】
毛作成部11で作成される毛は、図5に示すように、仮想的に皮膚面を表現したxyz空間に、折れ線で定義され、x−y平面を仮想的な皮膚面とする。
この場合、折れ線の節点の座標それぞれにx,y,z座標が定義される。以下ではi番目の毛のj番目の節点NDをp〔i〕〔j〕=(x〔i〕〔j〕,y〔i〕〔j〕,z〔i〕〔j〕)と記述することとする。なお、根元の節点番号をj=0とする。根元は皮膚面に接していると考えられるので、z座標は0である。
【0044】
毛の束なりは、それぞれの毛に束なりの番号を与えることにより作成する。同一の束なりの番号を与えられた毛は、同一の束なりを構成する。すなわち、グループ化を行う。
毛の束なりは、以下の数1に示すような手順で作成する。
【0045】
【数1】

Figure 2004054599
【0046】
数1に示す処理によれば、代表点は、束なりの数だけ平面に形成する。また、ランダムなx,y座標を選択する場合には、たとえば乱数を用いる。
そして、毛を全部カウントして、最も近い代表点を持つ束なりを選択する。
【0047】
ここでdistanceは、単純なユークリッド距離であってもかまわないが、毛に垂直な方向により多く毛を集めるような距離を用いると、集めた毛の束なりが板状になり、より効果的である。
たとえば、下記の数2のように計算することができる。
図7は、この毛に垂直な方向により多く毛を集めるような距離を用いて集めた毛の束なりが板状になる様子を示す図である。
図7において、ここでpは根元の位置、Repは代表点の位置である。
また、<t>は毛の生えている方向ベクトル、<g>はpからRepへと向かうベクトルである。a,bはそれぞれ定数であり、aがbよりも大きいときに毛に垂直な方向により多くの毛が集められる。すなわち、a>>bの場合に、楕円のように横長に方向性を持たせることができる。
【0048】
【数2】
Figure 2004054599
【0049】
そして、束なりを集めた後、それぞれを最も良く近似できる板を作成する。
平面の方程式は数3で表されるものとする。
【0050】
【数3】
ax+by+z+d=0
【0051】
ここで、平面がz軸に平行な場合は、この式で表現できないが、実用上は毛は皮膚に沿っていることから問題を生じない。以下ではa,b,c,dを求める。
たとえば、好ましい平面を、毛に含まれる全ての節点とz軸に垂直な方向との距離の2乗和が最小になるものとすると、数3を得る。これは一般的な最小2乗法を、平面の方程式を求めるために用いたものである。
なお、x〔i〕,y〔i〕,z〔i〕はそれぞれ、束なりに含まれる節点のx,y,z座標を列挙したものとする。またNは束なりに含まれる全部の節点の数とする。また、tは転置を示す。
【0052】
【数4】
((Σx〔i〕  Σx〔i〕y〔j〕,Σx〔i〕)
(Σx〔i〕y〔i〕,Σy〔i〕 ,Σy〔i〕)
(Σx〔i〕, Σy〔i〕, N)) *(a,b,d)
=(−Σx〔i〕z〔i〕,−Σy〔i〕z〔i〕,−Σz〔i〕)
【0053】
数3をa,b,dについて、たとえばガウス法などを用いて解くことにより、平面の方程式を求めることができる。
この方程式をそのまま用いることは可能だが、たとえば図8のように板同士が重なる場合に、画質の劣化を伴う場合がある。
そこでa,bについて、複数の板PLTにおけるa,bの平均値(a´,b´)とすることで、各板の傾きを同じとすることが有効である。
この際、数3におけるdを、数4のように再度計算し直す。
【0054】
【数5】
d´=−(a´x〔i〕+b´y〔i〕+z〔i〕)/N
【0055】
ここで定義できた平面に対して、束なりに属する毛の情報を、ある一定の方向から図4のようにして投影することによりマップを作成する。典型的には平面の垂直方向から投影する。
毛の情報としては、色計算に必要な情報であり、毛の方向ベクトル、毛の色、毛の透過度などがある。
【0056】
図9は、平面に毛の情報を投影した様子を示す図である。
図9に示すように、情報が投影された部分を全て包含するような、平面上のある矩形領域(図中の点線で示された領域)を求め、これを最終的な板PLTとする。
なお、マップのs,t軸は任意に決定できるが、s軸あるいはt軸のいずれかが毛の方向と平行であるように選ぶことで、必要なマップの総量を減らすことができる。
【0057】
図10(A)はt軸を毛にほぼ並行に与えた場合を示し、図10(B)は斜めに与えた場合を示す図である。
図10(A)にようにt軸を毛にほぼ並行に与えた場合の方が、図10(B)のように斜めに与えた場合に比べて、毛の情報をより有効に格納できる。
【0058】
ここで、板/マップ作成部12におけるマップ作成の具体的な方法の手順について、図11に関連付けて説明する。
【0059】
たとえば各板毎にmap_height×map_widthのサイズのマップを用意する。
マップには、h(tex) (毛の高さ)、valid(毛の存在するかどうかのフラグ)、T(tex) (テクスチャ座標系における毛の方向ベクトル)、Kd,Ks(拡散(diffuse)/鏡面(specular)の反射率(reflectance))、shininess(specular  shininess)、cov(coverage)を格納する。
【0060】
マップは、図11に示すように、毛1をh軸方向から投射して作成する。同じテクセル上に複数の毛が存在する場合には、最も上の毛の情報をテクセルに格納する。
【0061】
以下、作成手順の詳細を記述する。
【0062】
最初にmapの全領域についてvalidを0とする(毛が存在しない)。また、h(tex) を0とする(一番低い)。
続いて、求めた各節点のテクスチャ座標P(tex) (=(s(tex) ,t(tex) ,h(tex) ))を用いて線分をマップ上に描画する。なお以下でi番目の節点の位置をP (=(s ,t ,h ))と記述する。
【0063】
折れ線はi=0〜(節点数−2)について、i番目の節点と(i+1)番目の節点の間の線分を描画する。まず、i番目の節点と、(i+1)番目の節点のマップ上のテクセル座標(u,v)を数5のように求める。
【0064】
【数6】
   =  map_width    *    s
  =    map_height  *    t
 + =    map_width    *    s +
 + = map_height  *  t +
【0065】
線分の端点(すなわちi番目の節点と(i+1)番目の節点)での毛の方向ベクトルTは以下のように計算する。
【0066】
【数7】
 =P + −P
 + =T
【0067】
TおよびKd,Ks,shininess,h(Pの3番目の要素)およびwidthが端点で求まっている。両端での値をもとに(u ,v ),(u + ,v + )の間を結ぶ線分上のT,Kd,Ks,shininess,h,widthを線形補間により求める。
【0068】
次にT,Kd,Ks,shininess,hの値をマップ上に描画する。線分の途中での値は、両端の値を補間して求める。ただし書き込むのは、hの値がテクセルに書き込まれているhの値以上の場合とする。値を書き込んだ場合は、該当するテクセルのvalidを1(毛が存在する)とする。
【0069】
この際、通常のラインアンチエイリアスの手法で、各テクセルのカバレッジcovを求める。更に、各テクセルでのwidth値を考慮して、以下のようにカバレッジを算出する。
【0070】
【数8】
cov=min(cov*width, 1.0)
【0071】
また、マップについて、有効なテクセルを調べ、その最大なところまでを新しマップサイズとする。これにより、マップのサイズを小さくすることができる。
【0072】
マップ保持部13は、たとえばSRAM等のメモリにより構成され、板/マップ作成部12で作成され、各種パラメータや高さ情報、透過度情報が付加された2次元マップを保持し、保持したマップ情報を描画部14に出力する。
マップ保持部13は、たとえば与えられたマップ番号、テクスチャ座標に従ってテクセルの内容を出力する。
【0073】
上記までは、通常リアルタイムで実行する必要はなく、描画前に時間をかけて行えばよい種類の描画前処理である。
【0074】
描画部14は、板/マップ作成部12による板をマップ保持部13に保持されているマップ情報に基づいて描画する。
これにより、毛皮の質感を表現することが可能となる。
【0075】
前述した通り、板は皮膚面を仮想化した空間に作成しているため、これを実際に描画する際は、板の各頂点をオブジェクトが存在する空間に変換する必要がある。
仮想的な空間の原点が、オブジェクト空間の0点に存在するとする。またこの点において皮膚の法線ベクトル<n>、s,t方向のベクトル<s>,<t>のように与えられるとすると、数8のように各頂点のオブジェクト空間での座標vは計算できる。
【0076】
【数9】
V=0+x*<s>+y+<t>+z+<n>
【0077】
以上のようにして、毛の束なりから板を作成し、これを描画することにより、毛皮の質感を良好に表現することができる。
【0078】
以下に、描画部14の描画処理についてさらに説明する。
【0079】
メモリ15は、たとえばフレームバッファと同サイズの5種類のバッファを持つ。具体的には、色バッファ(CBUF)、深さバッファ(DBUF)、色バッファ2(CBUF2)、深さバッファ2(DBUF2)、最近傍バッファ(NEAREST)である。
【0080】
描画部14は、はじめに、以下のようにバッファを全てのピクセルについて初期化する。
色バッファCBUF,CBUF2を背景色に、深さバッファDBUF、DBUF2、および最近傍バッファNEARESTを最遠方の値に初期化する。
【0081】
繰り返し回数が0回目の場合は、以下のようにして、最近傍バッファNEARESTにピクセル毎の最も視点に近い場合のz値を格納する。
【0082】
【数10】
Figure 2004054599
【0083】
いずれの繰り返し回数であっても、以下のような条件で色バッファCBUF2,深さバッファDBUF2を更新する。
【0084】
【数11】
Figure 2004054599
【0085】
シーン内の全ての板の描画が完了したならば、色バッファCBUF2,深さバッファDBUF2に内容を色バッファCBUF,深さバッファDBUFへとコピーし、深さバッファDBUF2を最遠方の値とする。
全ての描画ピクセルについて、最近傍バッファNEARESTと深さバッファが一致したならば、完了フラグをtrue(真)とする。
一致しないならば、完了フラグはfalseである。
繰り返し描画を終了したときに、最終的な描画色は色バッファCBUFに格納される。
【0086】
次に、図1の構成の画像処理装置の動作を説明する。
【0087】
まず、描画前処理として、毛作成部11において、毛の全体的な属性をもとに、毛座標系において節点NDを接続した形態で毛の1本1本が折れ線として作成され、毛のモデル情報S11として板/マップ作成部12に供給される。
【0088】
板/マップ作成部12においては、毛作成部11により与えられた毛のモデル情報が束なり作成部121に入力される。
束なり作成部12においては、毛のモデル情報が異なる束なりに分類される。分類された束なり毎の毛のモデル情報が信号S121として束なり作成部121から平面作成部122および投影部123に供給される。
平面作成部122では、束なり作成部121において束なりに分類された毛の情報から、平面の情報(方程式)が作成され、信号S122として投影部123に出力される。
投影部123は、モデル情報と平面の情報から、板およびマップを作成し、板情報S12aを描画部14に供給し、マップ情報S12bをマップ保持部13に供給する。
【0089】
このように、毛のモデル情報S11が供給された板/マップ作成部12においては、与えられた毛の情報から板およびマップが作成され、作成した板情報S12aが描画部14に供給され、マップ情報S12bがマップ保持部13に供給される。
なお、生成した2次元マップには、シェルの描画時に必要なパラメータ(Kd、Ks、Ka、Tt、cov、shininess)、高さ(h)情報等が含まれている。
【0090】
そして、描画部14において、板/マップ作成部12による板がマップ保持部13に保持されているマップ情報に基づいて描画される。
このとき、板は皮膚面を仮想化した空間に作成しているため、これを実際に描画する際は、板の各頂点がオブジェクトが存在する空間に変換される。
以上のようにして、毛の束なりから板を作成し、これを描画することにより、毛皮の質感を良好に表現することができる。
【0091】
以上説明したように、本実施形態によれば、毛の全体的な属性をもとに、毛座標系において節点NDを接続した形態で毛の1本1本が折れ線として作成し、毛のモデル情報S11を出力する毛作成部11と、毛のモデル情報を異なる束なりに分類し、分類した毛の情報から、平面の情報(方程式)を作成し、分類したモデル情報と平面の情報から、板およびマップを作成する板/マップ作成部12と、マップ情報を保持するマップ保持部13と、板/マップ作成部12による板をマップ保持部13に保持されているマップ情報に基づいて描画する描画部14とを設けたので、特別な機能を有するフィルタを用いることなく、毛皮を高速に描画することができ、毛皮の質感を良好に表現することができる利点がある。
【0092】
【発明の効果】
以上説明したように、本発明によれば、特別な機能を有するフィルタを用いることなく、毛皮を高速に描画することができる。
また、ハードウェアの増大を防止できることはもとより、毛皮の質感を高精度に表現することができる利点がある。
【図面の簡単な説明】
【図1】本発明に係る画像処理装置の一実施形態を示すブロック構成図である。
【図2】本実施形態に係る毛の「束なり」について説明するための図である。
【図3】図2に示した毛の束なりをそれぞれ板として表した図である。
【図4】2次元のマップの作成概念を説明するための図である。
【図5】本実施形態に係る毛作成部の毛のモデル作成方法を説明するための図である。
【図6】本実施形態に係る板/マップ作成部の具体的な構成例を示すブロック図である。
【図7】毛に垂直な方向により多く毛を集めるような距離を用いて集めた毛の束なりが板状になる様子を示す図である。
【図8】板同士が重なった状態を示し、画質の劣化を伴う場合があることを説明するための図である。
【図9】平面に毛の情報を投影した様子を示す図である。
【図10】(A)はt軸を毛にほぼ並行に与えた場合を示す図、(B)は斜めに与えた場合を示す図である。
【図11】本実施形態に係るマップ作成の具体的な手順を説明するための図である。
【符号の説明】
10…画像処理装置、11…毛作成部、12…板/マップ作成部、121…束なり作成部、122…平面作成部、123…投影部、13…マップ保持部、14…描画部、15…メモリ。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing apparatus and a method for expressing fur or the like in which a plurality of linear objects approaching each other in a relatively unified direction.
[0002]
[Prior art]
The computer graphics (CG) technology, which creates and processes graphics and images using computer resources, has been actively researched and developed in conjunction with the recent increase in computational speed and the enhancement of drawing functions in computer systems. It has been put to practical use.
[0003]
For example, three-dimensional graphics expresses an optical phenomenon when a three-dimensional object is illuminated by a predetermined light source by using a mathematical model, and based on this model, shades, shades, and even patterns on the object surface. By pasting, a more realistic three-dimensional two-dimensional high-definition image is generated.
Such computer graphics have been increasingly used in CAD / CAM and other various application fields in development fields such as science, engineering, and manufacturing.
[0004]
The three-dimensional graphics generally includes a “geometry subsystem” positioned as a front end and a “raster subsystem” positioned as a back end.
[0005]
The geometry subsystem is a process of performing a geometric operation such as a position and a posture of a three-dimensional object displayed on a display screen.
In the geometry subsystem, an object is generally treated as an aggregate of a large number of polygons, and geometric calculation processing such as “coordinate conversion”, “clipping”, and “light source calculation” is performed in units of polygons.
[0006]
On the other hand, the raster subsystem is a process of painting each pixel constituting an object.
The rasterizing process is realized by, for example, interpolating the image parameters of all the pixels included in the polygon based on the image parameters obtained for each vertex of the polygon.
The image parameters referred to here include color (rendering color) data expressed in a so-called RGB format and the like, z values indicating a distance in the depth direction, and the like.
In recent high-definition three-dimensional graphics processing, f (fog: fog) for creating perspective and texture t (texture) for expressing reality by expressing the texture and pattern of the surface of an object, It is included as one of the image parameters.
[0007]
Here, the process of generating pixels inside the polygon from the vertex information of the polygon is often performed using a linear interpolation method called DDA (Digital @ Differential @ Analyzer).
In the DDA process, the inclination of data in the direction of the side of the polygon is obtained from the vertex information, the data on the side is calculated using this inclination, and then the inclination in the raster scanning direction (X direction) is calculated. The internal pixel is generated by adding the parameter change obtained from the above to the parameter value of the scanning start point.
[0008]
[Problems to be solved by the invention]
Incidentally, the calculation of the drawing color of each pixel, that is, the color calculation has a great influence on the surface material. The color calculation of the surface of a flat and homogeneous material is relatively easy, but the color calculation of eg animal fur is not easy. This is because the surface shape is complicated, the skin color is affected by the hair density, and the color is also changed by the hair flow.
[0009]
As the most basic method of drawing animal fur, there is a method of drawing hair one by one.
However, this method has a fundamental problem that the amount of calculation required to draw hair one by one becomes enormous.
Further, since hair is drawn as a translucent substance, it is necessary to sort (z-sort) in the depth direction in primitive units or pixel units. This also requires a huge amount of calculation.
[0010]
Kajiya has shown that the texture of fur can be expressed by scanning a texel in the direction of the line of sight using a three-dimensional map (Kajiya, J. T. And Timothy L. Kay. Rendering Fur Full with The Three Dimensions, IG 271-280).
However, this method requires a long drawing time for scanning the texel in the line of sight. Further, a large-capacity memory area for holding the three-dimensional map is required.
[0011]
Goldman has developed a method of calculating a stochastic appearance and rapidly drawing the texture of fur by assuming that a very short hair growth like Dalmatian follows a Poisson distribution (Goldman). , DB, {Fake Fur Rendering, SIGGRAPH 97, pp. 127-134}.
This method does not require scanning of texels in the line of sight, and does not require a large-capacity memory.
However, this method is effective only when there are sufficiently many short hairs in one pixel, and is used, for example, when the hair is longer than Dalmatian or when there is not much hair in one pixel. I can't.
[0012]
Lengyel proposed a method of drawing fur as a plurality of concentric translucent layers (hereinafter, referred to as shells) (Lengyel, EJ, Real-Time Fur, Eurographics Rendering Workshop 2000, pp. 243--). 256, and Lengiel, EJ, Real-Time Fur over Arbitrary Surfaces, ACM 2001 Symposium on Interactive 3D Graphics (http://research.micros.com/).
This means that the fur can be drawn at high speed by drawing the shell several times from the inside and superimposing them. For calculating the color of each shell, a three-dimensional map created in advance from a hair model is used.
[0013]
They also implemented an implementation on the vertex shader, pixel shader in nVidia's GeForce, and showed that this method was indeed valid.
[0014]
In this method, a method of Praun's wrapped texture (wrapped texture) (see Praun, E., {Lapped Textures, $ SIGGRAPH} 2000, pp. 465-470) is used, and the same map is attached to the wrapped surface. And reduce the total amount of maps needed.
However, this method still has a problem in that the map is still a pseudo three-dimensional map, and maps as many as the number of shells are still required.
[0015]
Further, as an essential problem of drawing using a shell, there is deterioration in image quality near an edge. In the vicinity of the edge, the drawing color of the hair becomes gradually faint. Further, since the drawing order of the shell is not correct near the edge, a correct color cannot be obtained.
Lengiel solves the problem of the image quality near the edge by using a fin-shaped primitive (fin: fin) perpendicular to the skin surface on the boundary of the mesh on the skin.
Fins are present anywhere on the boundary of the mesh, and are drawn only when the boundary of the mesh is close to the edge. In drawing the fins, a map (fin texture (fin @ texture)) different from the above-described three-dimensional map is used.
[0016]
Lengiel saves the required amount of memory by reusing one type of fin texture instead of preparing different fin textures on every boundary of the mesh.
However, Lengyel attempts only when the hair is generally standing perpendicular to the skin surface.
In this case, only one type of fin texture is needed. For example, when the hair is along the skin surface, various fin textures need to be selected from the relationship between the line of sight and the direction of the hair.
Therefore, the amount of memory required for the fin texture increases.
[0017]
In addition, since fins are drawn as translucent primitives, z-sorting must be performed for accurate color calculation, but Lengyel does not particularly mention this.
[0018]
Despite the problems described above, fur drawing using a shell is fast, and for objects with simple shapes, there is no need for sorting that matches the superimposition of translucent objects, except for drawing fins. There is.
However, the continuity of the hair cannot be maintained in this shell rendering.
[0019]
In order to maintain hair continuity, it is conceivable to use a filter. In this technique. Although it can draw hair effectively, it needs to retain special features that make the filter run faster. This processing is difficult to implement on hardware that does not have this function.
[0020]
The present invention has been made in view of such circumstances, and an object of the present invention is to provide an image processing apparatus and method capable of drawing fur and the like with high speed and high quality without using a filter having a special function. To provide.
[0021]
[Means for Solving the Problems]
In order to achieve the above object, a first aspect of the present invention is an image processing apparatus for expressing an object in which a plurality of adjacent linear objects are generated in a directional manner, wherein the linear objects are generated in a directional manner. It has a creating unit that forms a plurality of adjacent linear objects into a bundle and creates a plate corresponding to the bundle, and a drawing unit that draws the plate created by the creating unit based on predetermined parameters.
[0022]
Preferably, the drawing section draws the board based on map data including information on linear objects belonging to a bundle corresponding to the board created by the creating section.
[0023]
Preferably, the creation unit classifies the information of the linear object given as the model into a plurality of bundles, and creates a board based on the best approximation among the plurality of classified bundles.
[0024]
Preferably, when the information of the linear object given as the model is classified into a plurality of bundles, the creating unit classifies the information so as to take an area as long as possible in a direction perpendicular to the linear object.
[0025]
Preferably, the creating unit creates map data including information on linear objects belonging to a bundle corresponding to the plate as a reference with respect to a predetermined axis, and, at the time of the creation, generates linear objects. The drawing unit draws the board based on the map data created by the creating unit.
[0026]
According to a second aspect of the present invention, there is provided an image processing apparatus for expressing an object in which a plurality of adjacent linear objects are generated with a direction, classifying the model information of the linear objects into different bundles, A board / map creating unit that creates plane information from the classified linear object information, and creates a board and a map from the classified model information and plane information, and the map information created by the board / map creating unit. And a drawing unit that draws the board created by the board / map creating unit based on the map information held in the map holding unit.
[0027]
According to a third aspect of the present invention, there is provided an image processing method for expressing an object in which a plurality of adjacent linear objects are generated in a directional manner, wherein the plurality of adjacent linear objects are generated in a directional manner. As a bundle, a first step of creating a board corresponding to the bundle, and a second step of drawing the board created based on predetermined parameters.
[0028]
A fourth aspect of the present invention is an image processing method for expressing an object in which a plurality of adjacent linear objects are generated with a direction, and a method for classifying linear model information into different bundles. Step 1, a second step of creating plane information from the classified linear object information, a third step of creating a board and a map from the classified model information and plane information, The method includes a fourth step of holding the map information created in the third step, and a fifth step of drawing the board created in the third step based on the information held in the fourth step.
[0029]
According to the present invention, for example, model information of a linear object is supplied to the board / map creating unit.
In the plate / map creating unit, the model information of the linear object is classified into different bundles. Plane information is created from the classified linear object information. Then, a board and a map are created from the classified model information and plane information.
The board information generated by the board / map creation unit is supplied to the drawing unit, and the map information is supplied to the map holding unit and held.
Then, the drawing unit draws the board created by the board / map creation unit based on the map information held in the map holding unit.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0031]
FIG. 1 is a block diagram showing an embodiment of the image processing apparatus according to the present invention.
[0032]
First, a basic concept of the image processing apparatus 10 according to the present embodiment will be described.
The image processing apparatus 10 is capable of drawing fur in which a plurality of adjacent linear objects are generated in a relatively unified direction using a two-dimensional map.
Specifically, the image processing apparatus 10 draws the fur by drawing a plurality of boards expressing the “bundle” of the hair.
As shown in FIG. 2, not all the hairs on the fur grow independently, but adjacent hairs are generated in a relatively cohesive direction. In the present embodiment, this is referred to as "bundle".
Such a feature is inconspicuous in hair and the like, and is a phenomenon peculiar to fur.
There has been proposed a method of drawing hair in a certain unit instead of one by one. However, in the case of hair, it is difficult to draw a sufficiently large number of hairs in a unit because there is no feature that the hairs are arranged in any direction.
In the present embodiment, since the hairs of the fur constitute a "bundle" on a plane, by drawing these "bundles" as separate plates, the texture of the fur is not impaired, Is configured to be able to be drawn in a unit in which
At this time, in order to draw the boards as translucent objects, the boards need to be sorted accurately and sequentially from the depth direction. In the present embodiment, on the other hand, the fact that sorting can be performed on a pixel basis is used to cope with the situation. This can be realized sufficiently with existing hardware.
[0033]
FIG. 3 is a diagram showing the bundle of hairs shown in FIG. 2 as plates.
In the present embodiment, after the plate PLT is created, information necessary for hair color calculation is projected on the plate PLT as shown in FIG. As a result, a two-dimensional map can be created corresponding to each plate PLT.
The map stores information such as the direction vector, color, and transparency of hair.
In addition, the hair information stored in the map may store only the top hair for each texel, but this is not necessarily necessary, and a plurality of hairs may be stored for each texel. It is also possible to use a weighted average value of information, which is effective.
[0034]
That is, the image processing apparatus 10 according to the present embodiment draws using a single two-dimensional map without using a three-dimensional map.
In this way, the image processing apparatus 10 enables high-quality image expression with a small memory capacity by sampling the hair to be expressed as little as possible.
[0035]
The image processing according to the present embodiment includes pre-drawing processing and drawing-time processing. The pre-drawing process includes hair model creation, board and map creation processing, and is performed only once before drawing. The drawing process is a process performed in real time using a map created before drawing.
Hereinafter, a specific configuration and processing contents of the image processing apparatus 10 according to the present embodiment will be described in detail.
[0036]
As shown in FIG. 1, the image processing apparatus 10 includes a hair creating unit 11, a board / map creating unit 12, a map holding unit 13, a drawing unit 14, and a memory 15 that holds drawing colors and z values. I have.
The pre-drawing process is performed by the bristle creator 11, the board / map creator 12, and the map holding unit 13, and the post-drawing process is performed by the drawing unit 14 and the memory 15.
[0037]
Based on the overall attributes of the hair, the hair creating unit 11 uses the hairs 1-0, 1-1,... In the hair coordinate system as broken lines as shown in FIG. It is created and supplied to the board / map creation unit 12 as hair model information S11.
The example of FIG. 5 shows a state in which only two hairs are created. Each hair 1-0, 1-1 is represented by a polygonal line connecting a plurality of (4 in the example of FIG. 5) nodes ND00 to ND03, ND10 to ND13 indicated by circles.
The attributes of the hairs are basically given as attributes for the distal end and the distal end, that is, the foremost nodes ND00 and ND10 and the foremost nodes ND03 and ND13. Then, the attributes of the nodes ND01, ND02, ND11, and ND12 existing in the middle are obtained by evenly interpolating between the leading and trailing nodes.
Therefore, in the present embodiment, the distance between the nodes is the same for one hair.
[0038]
The board / map creation unit 12 creates a board and a color calculation map from the hair information given as a model by the hair creation unit 11, supplies the created board information S12a to the drawing unit 14, and converts the map information S12b. It is supplied to the map holding unit 13.
[0039]
FIG. 6 is a block diagram illustrating a specific configuration example of the board / map creation unit 12.
[0040]
As shown in FIG. 6, the board / map creating unit 12 includes a bundle creating unit 121, a plane creating unit 122, and a projecting unit 123.
[0041]
The bundle creation unit 121 classifies the hair model information provided by the hair creation unit 11 into different bundles, and uses the model information of the hair for each classified bundle as a signal S121 as the plane creation unit 122 and the projection unit 123. Output to
The plane creating unit 122 creates plane information (equation) from the hair information classified in the bundle by the bundle creating unit 121 and outputs the information to the projection unit 123 as a signal S122.
The projection unit 123 creates a board and a map from the model information and the plane information, supplies the board information S12a to the drawing unit 14, and supplies the map information S12b to the map holding unit 13.
[0042]
Hereinafter, a specific processing procedure of the board / map creating unit 12 will be described in detail.
[0043]
As shown in FIG. 5, the hair created by the hair creation unit 11 is defined by a polygonal line in an xyz space that virtually represents the skin surface, and the xy plane is a virtual skin surface.
In this case, x, y, and z coordinates are defined for each of the coordinates of the nodes of the polygonal line. Hereinafter, the j-th node ND of the i-th hair is described as p [i] [j] = (x [i] [j], y [i] [j], z [i] [j]). And It is assumed that the root node number is j = 0. Since the root is considered to be in contact with the skin surface, the z coordinate is zero.
[0044]
Hair bundles are created by giving each hair a bundle number. Hairs that have been given the same bundle number constitute the same bundle. That is, grouping is performed.
The bundle of hairs is created by the procedure as shown in the following Expression 1.
[0045]
(Equation 1)
Figure 2004054599
[0046]
According to the processing shown in Expression 1, the representative points are formed on the plane by the number of bundles. When selecting random x and y coordinates, for example, random numbers are used.
Then, all the hairs are counted, and a bundle having the closest representative point is selected.
[0047]
Here, the distance may be a simple Euclidean distance. However, if a distance that collects more hair in the direction perpendicular to the hair is used, the bundle of collected hair becomes a plate shape, which is more effective. is there.
For example, it can be calculated as in Equation 2 below.
FIG. 7 is a diagram showing a state in which a bundle of hairs collected using a distance that collects more hairs in a direction perpendicular to the hairs becomes a plate shape.
In FIG. 7, p is a root position, and Rep is a position of a representative point.
<T> is a direction vector where hairs grow, and <g> is a vector from p to Rep. a and b are constants, and when a is larger than b, more hair is collected in the direction perpendicular to the hair. That is, in the case of a >> b, it is possible to give a direction to a horizontally long shape like an ellipse.
[0048]
(Equation 2)
Figure 2004054599
[0049]
After collecting the bundles, a plate that can best approximate each of them is created.
The equation of the plane is represented by Equation 3.
[0050]
(Equation 3)
ax + by + z + d = 0
[0051]
Here, when the plane is parallel to the z-axis, it cannot be expressed by this equation, but in practice, there is no problem because the hair is along the skin. Hereinafter, a, b, c, and d are obtained.
For example, assuming that the preferred plane is such that the sum of the squares of the distances between all nodes included in the hair and the direction perpendicular to the z-axis is minimized, Equation 3 is obtained. This uses a general least-squares method to obtain a plane equation.
Note that x [i], y [i], and z [i] are lists of the x, y, and z coordinates of the nodes included in the bundle. N is the number of all nodes included in the bundle. Also, t indicates transposition.
[0052]
(Equation 4)
((Σx [i]2Σx [i] y [j], Σx [i])
(Σx [i] y [i], Σy [i]2, Σy [i])
(Σx [i], Σy [i], N))t* (A, b, d)t
= (-Σx [i] z [i], -Σy [i] z [i], -Σz [i])t
[0053]
By solving Equation 3 for a, b, and d using, for example, a Gaussian method, a plane equation can be obtained.
Although this equation can be used as it is, for example, when the plates are overlapped as shown in FIG. 8, the image quality may be deteriorated.
Therefore, it is effective to make the inclination of each plate the same by setting a and b to the average value (a ′, b ′) of a and b in a plurality of plates PLT.
At this time, d in Equation 3 is calculated again as in Equation 4.
[0054]
(Equation 5)
d '=-(a'x [i] + b'y [i] + z [i]) / N
[0055]
A map is created by projecting information on hairs belonging to a bundle from a certain direction as shown in FIG. 4 onto the plane defined here. Typically, the projection is performed from the vertical direction of the plane.
Hair information is information necessary for color calculation, and includes a hair direction vector, hair color, and hair transparency.
[0056]
FIG. 9 is a diagram showing a state in which hair information is projected on a plane.
As shown in FIG. 9, a certain rectangular area on the plane (an area shown by a dotted line in the figure) that includes all the portions where the information is projected is obtained, and this is set as a final plate PLT.
Although the s and t axes of the map can be determined arbitrarily, the total amount of the necessary map can be reduced by selecting either the s axis or the t axis so as to be parallel to the direction of the hair.
[0057]
FIG. 10A shows a case where the t-axis is given to the hair substantially in parallel, and FIG. 10B shows a case where the t-axis is given diagonally.
Hair information can be stored more effectively when the t-axis is given to the hair almost in parallel as shown in FIG. 10A than when it is given diagonally as shown in FIG. 10B.
[0058]
Here, a procedure of a specific method of creating a map in the board / map creating unit 12 will be described with reference to FIG.
[0059]
For example, a map having a size of map_height × map_width is prepared for each board.
The map contains h(Tex)(Hair height), valid (hair presence flag), T(Tex)(Hair direction vector in the texture coordinate system), Kd, Ks (diffuse / specular reflectance), shiness (specular sineness), and cov (coverage) are stored.
[0060]
The map is created by projecting the hair 1 from the h-axis direction, as shown in FIG. If a plurality of hairs exist on the same texel, the information of the top hair is stored in the texel.
[0061]
The details of the creation procedure are described below.
[0062]
First, the valid is set to 0 (there is no hair) for the entire region of the map. Also, h(Tex)Is set to 0 (lowest).
Subsequently, the obtained texture coordinates P of each node are obtained.(Tex)(= (S(Tex), T(Tex), H(Tex)線) Draw a line segment on the map using In the following, the position of the i-th node is Pi(= (Si, Ti, Hi)).
[0063]
The polygonal line draws a line segment between the i-th node and the (i + 1) -th node for i = 0 to (number of nodes -2). First, texel coordinates (u, v) on the map of the i-th node and the (i + 1) -th node are obtained as shown in Expression 5.
[0064]
(Equation 6)
ui= Map_width * si
vi= Map_height * ti
ui+1= Map_width * si+1
vi+1= Map_height * ti+1
[0065]
The direction vector T of the hair at the end point of the line segment (that is, the i-th node and the (i + 1) -th node) is calculated as follows.
[0066]
(Equation 7)
Ti= Pi+1-Pi
Ti+1= Ti
[0067]
T and Kd, Ks, shininess, h (the third element of P), and width are obtained at the end points. Based on the values at both ends (ui, Vi), (Ui+1, Vi+1The values of T, Kd, Ks, sineness, h, and width on the line segment connecting) are obtained by linear interpolation.
[0068]
Next, the values of T, Kd, Ks, shininess, and h are drawn on the map. The value in the middle of the line segment is obtained by interpolating the values at both ends. However, writing is performed when the value of h is equal to or greater than the value of h written in the texel. When a value is written, the valid of the corresponding texel is set to 1 (hair is present).
[0069]
At this time, the coverage cov of each texel is obtained by a normal line anti-aliasing technique. Further, taking into consideration the width value of each texel, the coverage is calculated as follows.
[0070]
(Equation 8)
cov = min (cov * width, $ 1.0)
[0071]
In addition, valid texels are checked for the map, and up to the maximum value is set as a new map size. Thus, the size of the map can be reduced.
[0072]
The map holding unit 13 is configured by a memory such as an SRAM, for example, and holds a two-dimensional map created by the board / map creating unit 12 and added with various parameters, height information, and transparency information. Is output to the drawing unit 14.
The map holding unit 13 outputs the contents of the texel according to, for example, the given map number and texture coordinates.
[0073]
Until the above, it is usually not necessary to execute the processing in real time, and it is a kind of pre-drawing processing that can be performed over time before drawing.
[0074]
The drawing unit 14 draws the board by the board / map creation unit 12 based on the map information held in the map holding unit 13.
This makes it possible to express the texture of the fur.
[0075]
As described above, since the board is created in a space in which the skin surface is virtualized, it is necessary to convert each vertex of the board into a space where the object exists when actually drawing the board.
It is assumed that the origin of the virtual space exists at zero point in the object space. Further, at this point, if the skin normal vector <n> and the vectors in the s, t directions <s>, <t> are given, the coordinates v of each vertex in the object space are calculated as shown in Expression 8. it can.
[0076]
(Equation 9)
V = 0 + x * <s> + y + <t> + z + <n>
[0077]
As described above, by creating a board from a bundle of hairs and drawing the board, the texture of the fur can be expressed well.
[0078]
Hereinafter, the drawing process of the drawing unit 14 will be further described.
[0079]
The memory 15 has, for example, five types of buffers having the same size as the frame buffer. Specifically, there are a color buffer (CBUF), a depth buffer (DBUF), a color buffer 2 (CBUF2), a depth buffer 2 (DBUF2), and a nearest buffer (NEEAREST).
[0080]
The drawing unit 14 first initializes a buffer for all pixels as follows.
The color buffers CBUF and CBUF2 are initialized to the background color, and the depth buffers DBUF and DBUF2 and the nearest buffer NEEAREST are initialized to the farthest value.
[0081]
When the number of repetitions is 0, the z value of the pixel closest to the viewpoint is stored in the nearest buffer NEEAREST as follows.
[0082]
(Equation 10)
Figure 2004054599
[0083]
Regardless of the number of repetitions, the color buffer CBUF2 and the depth buffer DBUF2 are updated under the following conditions.
[0084]
[Equation 11]
Figure 2004054599
[0085]
When drawing of all the boards in the scene is completed, the contents are copied to the color buffer CBUF2 and the depth buffer DBUF2 to the color buffer CBUF2 and the depth buffer DBUF2, and the depth buffer DBUF2 is set to the farthest value.
If the nearest buffer NEEAREST matches the depth buffer for all the drawing pixels, the completion flag is set to true (true).
If they do not match, the completion flag is false.
When the repetitive drawing is completed, the final drawing color is stored in the color buffer CBUF.
[0086]
Next, the operation of the image processing apparatus having the configuration shown in FIG. 1 will be described.
[0087]
First, as a pre-drawing process, in the hair creation unit 11, each hair is created as a polygonal line in a form in which the nodes ND are connected in the hair coordinate system based on the overall attributes of the hair, and a hair model is created. The information is supplied to the board / map creation unit 12 as information S11.
[0088]
In the board / map creation unit 12, the hair model information given by the hair creation unit 11 is bundled and input to the creation unit 121.
In the bundle creating unit 12, the hair model information is classified into different bundles. The classified hair model information for each bundle is supplied as a signal S121 from the bundle creation unit 121 to the plane creation unit 122 and the projection unit 123.
The plane creating unit 122 creates plane information (equation) from the hair information classified into the bundle by the bundle creating unit 121 and outputs the information to the projection unit 123 as a signal S122.
The projection unit 123 creates a board and a map from the model information and the plane information, supplies the board information S12a to the drawing unit 14, and supplies the map information S12b to the map holding unit 13.
[0089]
As described above, in the board / map creating unit 12 to which the hair model information S11 is supplied, a board and a map are created from the given hair information, and the created board information S12a is supplied to the drawing unit 14, and the map is created. The information S12b is supplied to the map holding unit 13.
Note that the generated two-dimensional map includes parameters (Kd, Ks, Ka, Tt, cov, and sineness) necessary for drawing the shell, height (h) information, and the like.
[0090]
Then, the drawing unit 14 draws the board by the board / map creation unit 12 based on the map information held in the map holding unit 13.
At this time, since the board is created in a space in which the skin surface is virtualized, when this is actually drawn, each vertex of the board is converted into a space in which the object exists.
As described above, by creating a board from a bundle of hairs and drawing the board, the texture of the fur can be expressed well.
[0091]
As described above, according to the present embodiment, based on the overall attributes of the hair, each hair is created as a polygonal line in a form in which the nodes ND are connected in the hair coordinate system, and the hair model is created. The hair creation unit 11 that outputs the information S11 and the hair model information are classified into different bundles, plane information (equation) is created from the classified hair information, and the classified model information and the plane information are A board / map creation unit 12 for creating a board and a map, a map holding unit 13 for holding map information, and a board by the board / map creation unit 12 are drawn based on the map information held in the map holding unit 13. Since the drawing unit 14 is provided, there is an advantage that the fur can be drawn at high speed without using a filter having a special function, and the texture of the fur can be expressed well.
[0092]
【The invention's effect】
As described above, according to the present invention, fur can be drawn at high speed without using a filter having a special function.
Further, there is an advantage that not only an increase in hardware can be prevented, but also the texture of fur can be expressed with high accuracy.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of an image processing apparatus according to the present invention.
FIG. 2 is a diagram for describing “bundling” of hair according to the present embodiment.
FIG. 3 is a diagram showing the bundle of hairs shown in FIG. 2 as plates.
FIG. 4 is a diagram for explaining a concept of creating a two-dimensional map.
FIG. 5 is a diagram for explaining a hair model creation method of the hair creation unit according to the embodiment.
FIG. 6 is a block diagram illustrating a specific configuration example of a board / map creation unit according to the embodiment.
FIG. 7 is a diagram showing a state in which bundles of hairs collected using a distance that collects more hairs in a direction perpendicular to the hairs become plate-shaped.
FIG. 8 is a diagram illustrating a state in which the plates are overlapped with each other and explaining that the image quality may be degraded.
FIG. 9 is a diagram showing a state in which hair information is projected on a plane.
FIG. 10 (A) is a diagram showing a case where the t-axis is given to hair substantially in parallel, and FIG. 10 (B) is a diagram showing a case where the t-axis is given diagonally.
FIG. 11 is a diagram for explaining a specific procedure of map creation according to the embodiment;
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Image processing apparatus, 11 ... Hair creation part, 12 ... Board / map creation part, 121 ... Bundle creation part, 122 ... Plane creation part, 123 ... Projection part, 13 ... Map holding part, 14 ... Drawing part, 15 …memory.

Claims (18)

近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理装置であって、
方向性をもって発生している近接する複数の線状物体を束なりとし、当該束なりに対応する板を作成する作成部と、
所定のパラメータを基に上記作成部により作成された板を描画する描画部と
を有する画像処理装置。
An image processing apparatus for expressing an object in which a plurality of linear objects in proximity are generated with directionality,
A creating unit that creates a bundle of a plurality of adjacent linear objects that are generated with directionality, and creates a plate corresponding to the bundle,
An image processing apparatus comprising: a drawing unit that draws a board created by the creation unit based on predetermined parameters.
上記描画部は、上記作成部で作成した板に対応する束なりに属する線状物の情報を含むマップデータに基づいて上記板の描画を行う
請求項1記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the drawing unit draws the board based on map data including information on linear objects belonging to a bundle corresponding to the board created by the creating unit.
上記作成部は、モデルとして与えられた線状物の情報を複数の束なりに分類し、分類した複数の束なりのうち最も良く近似する束なりに基づいて板を作成する
請求項1記載の画像処理装置。
2. The method according to claim 1, wherein the creating unit classifies the information of the linear object given as the model into a plurality of bundles, and creates a plate based on the best approximation among the classified bundles. 3. Image processing device.
上記作成部は、モデルとして与えられた線状物の情報を複数の束なりに分類するに際し、線状物に垂直な方向になるべく長く領域を取るように分類する
請求項3記載の画像処理装置。
4. The image processing apparatus according to claim 3, wherein the creating unit classifies the information of the linear object given as the model into a plurality of bundles so as to take an area as long as possible in a direction perpendicular to the linear object. .
上記作成部は、板に対応する束なりに属する線状物の情報を含むマップデータを所定の軸に対して基準として作成し、かつ、当該作成に際し、線状物の生えている方向を上記所定の軸にほぼ平行に与えて作成し、
上記描画部は、上記作成部で作成したマップデータに基づいて上記板の描画を行う
請求項1記載の画像処理装置。
The creation unit creates map data including information on linear objects belonging to a bundle corresponding to a plate as a reference with respect to a predetermined axis, and, at the time of the creation, determines a direction in which the linear objects are grown. Create by giving almost parallel to the predetermined axis,
The image processing apparatus according to claim 1, wherein the drawing unit draws the board based on the map data created by the creation unit.
近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理装置であって、
線状物のモデル情報を異なる束なりに分類し、分類した線状物の情報から、平面の情報を作成し、分類したモデル情報と平面の情報から、板およびマップを作成する板/マップ作成部と、
上記板/マップ作成部で作成したマップ情報を保持するマップ保持部と、
板/マップ作成部により作成した板をマップ保持部に保持されているマップ情報に基づいて描画する描画部と
を有する画像処理装置。
An image processing apparatus for expressing an object in which a plurality of linear objects in proximity are generated with directionality,
Plate / map creation for classifying model information of linear objects into different bundles, creating plane information from the classified linear object information, and creating plates and maps from the classified model information and plane information Department and
A map holding unit that holds the map information created by the board / map creating unit;
An image processing apparatus comprising: a drawing unit configured to draw a plate created by a plate / map creation unit based on map information held in a map holding unit.
上記板/マップ作成部は、分類した複数の束なりのうち最も良く近似する束なりに基づいて板を作成する
請求項6記載の画像処理装置。
The image processing apparatus according to claim 6, wherein the board / map creating unit creates a board based on a bundle that best approximates the plurality of sorted bundles.
上記板/マップ作成部は、モデルとして与えられた線状物の情報を複数の束なりに分類するに際し、線状物に垂直な方向になるべく長く領域を取るように分類する
請求項7記載の画像処理装置。
8. The plate / map creating unit according to claim 7, wherein when classifying the information of the linear object given as the model into a plurality of bundles, the plate / map creating unit classifies the information so as to take an area as long as possible in a direction perpendicular to the linear object. Image processing device.
上記板/マップ作成部は、板に対応する束なりに属する線状物の情報を含むマップデータを所定の軸に対して基準として作成し、かつ、当該作成に際し、線状物の生えている方向を上記所定の軸にほぼ平行に与えて作成する
請求項6記載の画像処理装置。
The board / map creating unit creates map data including information on linear objects belonging to a bundle corresponding to the board based on a predetermined axis, and at the time of the creation, linear objects are formed. 7. The image processing apparatus according to claim 6, wherein the image is created by giving a direction substantially parallel to the predetermined axis.
近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理方法であって、
方向性をもって発生している近接する複数の線状物体を束なりとし、当該束なりに対応する板を作成する第1のステップと、
所定のパラメータを基に作成された板を描画する第2のステップと
を有する画像処理方法。
An image processing method for expressing an object in which a plurality of adjacent linear objects are generated with directionality,
A first step of forming a plurality of adjacent linear objects generated with directionality into a bundle and creating a plate corresponding to the bundle;
A second step of drawing a board created based on predetermined parameters.
上記第2のステップにおいては、上記第1のステップで作成した板に対応する束なりに属する線状物の情報を含むマップデータに基づいて上記板の描画を行う
請求項10記載の画像処理方法。
11. The image processing method according to claim 10, wherein, in the second step, the board is drawn based on map data including information on linear objects belonging to a bundle corresponding to the board created in the first step. .
上記第1のステップにおいては、モデルとして与えられた線状物の情報を複数の束なりに分類し、分類した複数の束なりのうち最も良く近似する束なりに基づいて板を作成する
請求項10記載の画像処理方法。
In the first step, the information of the linear object given as a model is classified into a plurality of bundles, and a plate is created based on the best approximation among the plurality of classified bundles. 10. The image processing method according to 10.
上記第1のステップにおいては、モデルとして与えられた線状物の情報を複数の束なりに分類するに際し、線状物に垂直な方向になるべく長く領域を取るように分類する
請求項12記載の画像処理方法。
13. The method according to claim 12, wherein in the first step, when classifying the information of the linear object given as the model into a plurality of bundles, the information is classified so as to take an area as long as possible in a direction perpendicular to the linear object. Image processing method.
上記第1のステップにおいては、板に対応する束なりに属する線状物の情報を含むマップデータを所定の軸に対して基準として作成し、かつ、当該作成に際し、線状物の生えている方向を上記所定の軸にほぼ平行に与えて作成し、
上記第2のステップにおいては、上記第1のステップで作成したマップデータに基づいて上記板の描画を行う
請求項10記載の画像処理方法。
In the first step, map data including information on linear objects belonging to a bundle corresponding to the plate is created with reference to a predetermined axis, and, at the time of the creation, linear objects are formed. Create by giving the direction almost parallel to the above-mentioned predetermined axis,
The image processing method according to claim 10, wherein in the second step, the board is drawn based on the map data created in the first step.
近接する複数の線状物体が方向性をもって発生している対象物を表現する画像処理方法であって、
線状物のモデル情報を異なる束なりに分類する第1のステップと、
分類した線状物の情報から、平面の情報を作成する第2のステップと、
分類したモデル情報と平面の情報から、板およびマップを作成する第3のステップと、
上記第3のステップ作成したマップ情報を保持する第4のステップと、
上記第3のステップで作成した板を上記第4のステップで保持した情報に基づいて描画する第5のステップと
を有する画像処理方法。
An image processing method for expressing an object in which a plurality of adjacent linear objects are generated with directionality,
A first step of classifying the linear model information into different bundles;
A second step of creating plane information from the classified linear object information;
A third step of creating a board and a map from the classified model information and plane information;
A fourth step of holding the map information created in the third step,
A step of drawing the board created in the third step based on the information held in the fourth step.
上記第3のステップにおいては、分類した複数の束なりのうち最も良く近似する束なりに基づいて板を作成する
請求項15記載の画像処理方法。
16. The image processing method according to claim 15, wherein, in the third step, a board is created based on a bundle that best approximates the plurality of classified bundles.
上記第1のステップにおいては、モデルとして与えられた線状物の情報を複数の束なりに分類するに際し、線状物に垂直な方向になるべく長く領域を取るように分類する
請求項16記載の画像処理方法。
17. The method according to claim 16, wherein in the first step, when classifying the information of the linear object given as the model into a plurality of bundles, the linear object is classified so as to take an area as long as possible in a direction perpendicular to the linear object. Image processing method.
上記第3のステップにおいては、板に対応する束なりに属する線状物の情報を含むマップデータを所定の軸に対して基準として作成し、かつ、当該作成に際し、線状物の生えている方向を上記所定の軸にほぼ平行に与えて作成する
請求項15記載の画像処理方法。
In the third step, map data including information on linear objects belonging to the bundle corresponding to the plate is created with reference to a predetermined axis, and, at the time of the creation, linear objects are formed. 16. The image processing method according to claim 15, wherein the image is created by giving a direction substantially parallel to the predetermined axis.
JP2002211280A 2002-07-19 2002-07-19 Image processing device and method Pending JP2004054599A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002211280A JP2004054599A (en) 2002-07-19 2002-07-19 Image processing device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002211280A JP2004054599A (en) 2002-07-19 2002-07-19 Image processing device and method

Publications (1)

Publication Number Publication Date
JP2004054599A true JP2004054599A (en) 2004-02-19

Family

ID=31934561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002211280A Pending JP2004054599A (en) 2002-07-19 2002-07-19 Image processing device and method

Country Status (1)

Country Link
JP (1) JP2004054599A (en)

Similar Documents

Publication Publication Date Title
JP6260924B2 (en) Image rendering of laser scan data
JP4643271B2 (en) Visible surface determination system and method for computer graphics using interval analysis
US6952204B2 (en) 3D computer modelling apparatus
KR100889602B1 (en) Apparatus and method of ray-triangle collision detection for ray-tracing
US8115767B2 (en) Computer graphics shadow volumes using hierarchical occlusion culling
JP2001052194A (en) Reconfiguration for curved surface
Yang et al. The cluster hair model
JP2001118082A (en) Plotting arithmetic processor
CN102044089A (en) Method for carrying out self-adaption simplification, gradual transmission and rapid charting on three-dimensional model
JP2001283251A (en) Method and device for rendering graphic object
JP2001283248A (en) Method for projecting surface point of graphic object
JP2001266172A (en) Method for filtering negative attribute of surface point of graphic object
Li et al. Chameleon: An interactive texture-based rendering framework for visualizing three-dimensional vector fields
JP2001266174A (en) Method for expressing graphic object
CN105676290B (en) Geological data 3 D displaying method based on surface subdivision
Maruya Generating a Texture Map from Object‐Surface Texture Data
Boudon et al. Survey on computer representations of trees for realistic and efficient rendering
KR20160068204A (en) Data processing method for mesh geometry and computer readable storage medium of recording the same
Baldacci et al. GPU-based approaches for shape diameter function computation and its applications focused on skeleton extraction
Marroquim et al. Efficient image reconstruction for point-based and line-based rendering
JP2004054599A (en) Image processing device and method
Buerger et al. Sample-based surface coloring
JP2004054634A (en) Picture processor and its method
Bolla High quality rendering of large point-based surfaces
Koo et al. An efficient point rendering using octree and texture lookup