JP2007310682A - Transparent object rendering method - Google Patents

Transparent object rendering method Download PDF

Info

Publication number
JP2007310682A
JP2007310682A JP2006139592A JP2006139592A JP2007310682A JP 2007310682 A JP2007310682 A JP 2007310682A JP 2006139592 A JP2006139592 A JP 2006139592A JP 2006139592 A JP2006139592 A JP 2006139592A JP 2007310682 A JP2007310682 A JP 2007310682A
Authority
JP
Japan
Prior art keywords
inner layer
outer layer
transparent
processing
pixel
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.)
Withdrawn
Application number
JP2006139592A
Other languages
Japanese (ja)
Inventor
Tomoyuki Chikushima
智之 築島
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.)
Sega Corp
Original Assignee
Sega 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 Sega Corp filed Critical Sega Corp
Priority to JP2006139592A priority Critical patent/JP2007310682A/en
Publication of JP2007310682A publication Critical patent/JP2007310682A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a transparent object rendering method that is suited to render many transparent objects in real time on hardware limited in performance by uncomplicated processing. <P>SOLUTION: The method for rendering a transparent object in which an opaque inner layer is covered in an optically transparent or translucent outer layer in a virtual three-dimensional space comprises the steps of: calculating a Fresnel term having the inner product of a normal vector and a view vector to vertices of the inner layer surface; pixel-processing the background; pixel-processing the inner layer with the calculated Fresnel term as transparency; pixel-processing the outer layer with fixed transparency; and combining the pixel-processed background, inner layer and outer layer. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は仮想三次元空間での、透明もしくは半透明の光透過性外層を有する透過オブジェクトの描画方法に関し、より詳しくは、限られた性能のハードウェア上でリアルタイムに数多くの不均一、もしくは厚みの変化する光透過性を有する外層を有する透過オブジェクトを描画するCG(Computer Graphics)技術に関する。   The present invention relates to a method for drawing a transparent object having a transparent or translucent light-transmitting outer layer in a virtual three-dimensional space, and more particularly, a large number of non-uniformities or thicknesses in real time on hardware with limited performance. The present invention relates to a CG (Computer Graphics) technique for drawing a transparent object having an outer layer having a light transmission property that changes.

近年、ゲーム映像等のCG技術は非常に速い速度で進化している。これはハードウェアの進化、特にGPU(Graphics Processing Unit)の著しい進化が要因となっている。それに伴い、様々なシェーダ(描画メカニズム)が開発され効率化が進められているが、今もなおリアルタイムで処理をするにはあまりに非現実的な計算量を持つものが多々ある。フォトンマッピング等のレイトレーシング描画処理もそのひとつであり、非常に精細な描画が可能なものの、その計算量のためゲームに用いることは難しかった。   In recent years, CG technology such as game images has evolved at a very high speed. This is due to the evolution of hardware, especially the remarkable evolution of GPU (Graphics Processing Unit). Along with this, various shaders (drawing mechanisms) have been developed and improved in efficiency, but there are still many things that have an unrealistic amount of calculation to process in real time. Ray tracing drawing processing such as photon mapping is one of them, and although it is possible to draw very fine drawing, it is difficult to use it in a game due to the amount of calculation.

今回の発明がなされた背景として、我々はあるゲーム(ジャングル内のシューティングゲーム)に登場させる敵キャラクターの生物(ヒル)として、従来にない生々しくグロテスクな質感のオブジェクトを製作する必要があった。そのために必要とされた条件として、
(1)濡れて湿った水辺に生息しているという設定に伴う濡れた質感
(2)気持ち悪さを演出するため生きたように動く内臓
が挙げられる。そのため内臓を表す内層とそれを包む外層という二つの層、二つの異なる質感の表現を必要とした。
As the background of the invention of this time, we needed to create an object with an unprecedented fresh and grotesque texture as an enemy character creature (hill) that appeared in a game (shooting game in the jungle). As a condition required for that,
(1) Wet texture associated with the setting of living on wet and wet watersides (2) Visceral organs that move lively to produce unpleasantness. Therefore, we needed to express two different textures: the inner layer representing the internal organs and the outer layer surrounding it.

先ず、実際に存在するこの種の質感を持ったものを探すため様々な物を調べた結果、我々は和菓子の葛餅にヒントを得た。葛餅の見た目は滑らかで光沢があり、中身の餡子は透明もしくは半透明な葛に包まれている。これは求める生物の質感に非常に近かったので、同等の質感を再現する方法を試みた。   First, as a result of investigating various things in order to search for actual materials with this kind of texture, we gained a hint of Japanese confectionery conflict. The appearance of the kuzu is smooth and glossy, and the inner eggplant is wrapped in a transparent or translucent kuzu. This was very close to the desired texture of the organism, so we tried a method to reproduce the equivalent texture.

観察による葛餅の特徴は以下の通りである。
(A)葛の外層と餡子の内層という二つの異なる物質、質感を持つ。これは生物の外皮と内臓に値する。
(B)内層全体、特に輪郭は外層の厚みが視線方向により異なることから、視線方向の角度により不均一な不透明度によりぼやけて見える。この輪郭の滲みにより外層の中身である内層の体積を感じることができる。
The characteristics of conflict by observation are as follows.
(A) It has two different materials and textures, the outer layer of Kuzu and the inner layer of Isogo. This deserves the skin and internal organs of the organism.
(B) Since the thickness of the entire inner layer, particularly the outline, differs depending on the line-of-sight direction, it appears blurred due to non-uniform opacity depending on the angle of the line-of-sight direction. The volume of the inner layer, which is the contents of the outer layer, can be sensed by the bleeding of the contour.

以下、従来においてこのような透明もしくは半透明の光透過性を持つ外層を有する透過オブジェクトをリアルタイムに描画する場合の処理について説明する。   Hereinafter, processing in the case where a transparent object having an outer layer having such transparent or translucent light transmittance is drawn in real time will be described.

図1は従来における透過オブジェクトの描画のための処理を示すフローチャートである。   FIG. 1 is a flowchart showing a conventional process for drawing a transparent object.

図1において、リアルタイムで処理を行う場合、GPUの処理における例えば1パス目で背景、内層を含む不透明部分をレンダリングしてフレームバッファに保存する(ステップS1)。   In FIG. 1, when processing is performed in real time, an opaque portion including a background and an inner layer is rendered and stored in the frame buffer, for example, in the first pass in the GPU processing (step S1).

そして、2パス目でフレームバッファを外層の光透過部分の屈折成分として使用し、分散レイトレーシング(distribution ray-tracing)やフォトンマッピングによりレンダリングする(ステップS2)。   In the second pass, the frame buffer is used as a refractive component of the light transmission portion of the outer layer, and rendering is performed by distribution ray-tracing or photon mapping (step S2).

なお、標準的な屈折の処理では屈折する物の滲みを再現できないので、更に、滲ませる対象物(内層)の輪郭を抽出し、ボックス(Box)やガウシアン(Gaussian)などのフィルタでぼかして滲みを作る(ステップS3)。   In addition, since the blur of the object to be refracted cannot be reproduced by the standard refraction process, the outline of the object to be blurred (inner layer) is further extracted and blurred by a filter such as Box or Gaussian. (Step S3).

このように、従来の方法では最低2パス以上のレンダリングとぼかし処理が必要であった。   As described above, the conventional method requires at least two passes of rendering and blurring.

なお、関連する先行技術文献を以下に示す。
「構造モデルを用いたオパールの遊色現象の再現」 安部高明 2003年2月7日 奈良先端科学技術大学院大学(http://chihara.aist-nara.ac.jp/public/research/thesis/master/2003/abe0151003.pdf)
Related prior art documents are shown below.
“Reproduction of opal play-color phenomenon using a structural model” Takaaki Abe February 7, 2003 Nara Institute of Science and Technology (http://chihara.aist-nara.ac.jp/public/research/thesis/master /2003/abe0151003.pdf)

上述したように、従来の方法で透過オブジェクトを描画する場合、最低2パス以上のレンダリングとぼかし処理が必要となり、描画のための演算処理に多くの処理時間、および計算量の増加に伴うCPU、GPUへの多大な負荷がかかってリアルタイムの描画が困難であるという問題があった。従って、従来の方式にとらわれない観察に基づく独自の近似を行うことが必要である。   As described above, when a transparent object is drawn by a conventional method, rendering and blurring processing of at least two passes are required, and a large amount of processing time is required for calculation processing for drawing, and a CPU accompanying an increase in calculation amount, There is a problem that real-time drawing is difficult due to a great load on the GPU. Therefore, it is necessary to perform a unique approximation based on observations that are not confined to conventional methods.

本発明は上記の従来の問題点に鑑み提案されたものであり、その目的とするところは、処理が軽く、限られた性能のハードウェア上でリアルタイムに数多くのリアルな描画の施された透過オブジェクトを描画するのに適する透過オブジェクト描画方法を提供することにある。   The present invention has been proposed in view of the above-described conventional problems, and the object of the present invention is to provide a light transmission and transmission with many realistic drawings in real time on hardware with limited performance. An object is to provide a transparent object drawing method suitable for drawing an object.

上記の課題を解決するため、本発明にあっては、請求項1に記載されるように、仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画方法であって、上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する工程と、背景のピクセル処理を行う工程と、計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う工程と、固定的な透明度を使用して上記外層のピクセル処理を行う工程と、ピクセル処理された上記背景、上記内層および上記外層を合成する工程とを備える透過オブジェクト描画方法を要旨としている。   In order to solve the above problems, according to the present invention, as described in claim 1, in the virtual three-dimensional space, the opaque inner layer is covered with a transparent or translucent light-transmitting outer layer. A method of drawing an object, the step of calculating the Fresnel term by the inner product of the normal vector of the vertex of the inner layer surface and the line-of-sight vector, the step of performing background pixel processing, and using the calculated Fresnel term as transparency And performing the pixel processing of the inner layer, the pixel processing of the outer layer using fixed transparency, and the step of combining the background, the inner layer and the outer layer that have been pixel processed. The gist of the object drawing method.

また、請求項2に記載されるように、請求項1に記載の透過オブジェクト描画方法において、上記フレネル項の計算に使用する視線ベクトルは頂点によらず一定のものとすることができる。   Further, as described in claim 2, in the transparent object drawing method according to claim 1, the line-of-sight vector used for the calculation of the Fresnel term can be constant regardless of the vertex.

また、請求項3に記載されるように、請求項1に記載の透過オブジェクト描画方法において、上記フレネル項の計算に使用する視線ベクトルの符号を予め反転させておくことができる。   Further, as described in claim 3, in the transparent object drawing method according to claim 1, the sign of the line-of-sight vector used for calculation of the Fresnel term can be inverted in advance.

また、請求項4に記載されるように、請求項1に記載の透過オブジェクト描画方法において、上記フレネル項の計算は頂点処理において行うことができる。   Further, as described in claim 4, in the transparent object drawing method according to claim 1, the calculation of the Fresnel term can be performed in vertex processing.

また、請求項5に記載されるように、仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画装置であって、上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する手段と、背景のピクセル処理を行う手段と、計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う手段と、固定的な透明度を使用して上記外層のピクセル処理を行う手段と、ピクセル処理された上記背景、上記内層および上記外層を合成する手段とを備えるオブジェクト描画装置として構成することができる。   Further, according to the fifth aspect of the present invention, in the virtual three-dimensional space, a transparent object drawing device in which an opaque inner layer is covered with a transparent or translucent light-transmitting outer layer, the vertex of the inner layer surface Means for calculating the Fresnel term by the inner product of the normal vector and the line-of-sight vector, means for performing background pixel processing, means for performing pixel processing of the inner layer using the calculated Fresnel term as transparency, and fixed It is possible to configure as an object drawing apparatus including means for performing pixel processing of the outer layer using specific transparency, and means for combining the background subjected to pixel processing, the inner layer, and the outer layer.

また、請求項6に記載されるように、仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画プログラムであって、コンピュータを、上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する手段、背景のピクセル処理を行う手段、計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う手段、固定的な透明度を使用して上記外層のピクセル処理を行う手段、ピクセル処理された上記背景、上記内層および上記外層を合成する手段として機能させるオブジェクト描画プログラムとして構成することができる。   Further, according to a sixth aspect of the present invention, there is provided a drawing program for a transparent object in which an opaque inner layer is covered with a transparent or translucent light-transmitting outer layer in a virtual three-dimensional space, the computer comprising the inner layer Means for calculating the Fresnel term by the inner product of the normal vector and the line-of-sight vector of the surface vertex, means for performing background pixel processing, means for performing pixel processing of the inner layer using the calculated Fresnel term as transparency, fixed It can be configured as an object drawing program that functions as means for performing pixel processing of the outer layer using specific transparency, the background subjected to pixel processing, the inner layer, and the outer layer.

本発明の透過オブジェクト描画方法にあっては、処理が軽く、限られた性能のハードウェア上でリアルタイムに数多くのリアルな描画の施された透過オブジェクトを描画することができる。   In the transparent object drawing method of the present invention, it is possible to draw a large number of transparent objects on which real processing is performed in real time on hardware with limited performance and light processing.

以下、本発明の好適な実施形態につき説明する。   Hereinafter, preferred embodiments of the present invention will be described.

<概要>
本発明の透過オブジェクト描画方法は、従来の方法では非常に重い処理を必要とする光透過性の物質を光線が透過する際の屈折・拡散で起こる滲みの表現において、計算を簡素化して近似した見た目を得る手法である。ここで言う従来の方法とは、分散レイトレーシングやフォトンマッピングのことである。これらは膨大な計算を必要とするため、今回我々の求めるリアルタイム性は皆無であり、新たな近似手法を開発する必要があった。内層(内臓)を表現するのに単純に内層を不透明として扱い、外層を透明処理もしくは半透明処理して表現するのが一般的手法であるが、より表現力の高い品質を得るための新たな透過処理表現の手法を開発した。
<Overview>
The transparent object drawing method according to the present invention is approximated by simplifying the calculation in the expression of bleeding caused by refraction / diffusion when light passes through a light-transmitting substance that requires a very heavy processing in the conventional method. It is a technique to get an appearance. The conventional method referred to here is distributed ray tracing or photon mapping. Since these require enormous calculations, the real-time property that we demanded here was completely absent, and a new approximation method had to be developed. To express the inner layer (internal organs), the general method is to simply treat the inner layer as opaque and express the outer layer by transparent or semi-transparent processing. However, a new method for obtaining a more expressive quality A transparent processing expression method was developed.

ここでは特に透明もしくは半透明の外層と不透明の内層をもつオブジェクト表現で、内層(内臓)モデルを「内側から外側に向かって内容物が滲む」ようにシェーディングしその内層モデルに透明もしくは半透明の外層モデルを重ねることを、軽い処理で可能とする。これにより気泡や固形物などの不純物を含んだ体積のあるもの(例えば泥水、ゼリーなど)の中にある物質を自然に描画することができる。   Here, it is an object representation that has a transparent or translucent outer layer and an opaque inner layer, and the inner layer (internal) model is shaded so that the contents bleed from the inside to the outside, and the inner layer model is transparent or translucent. It is possible to overlap the outer layer model with light processing. Thereby, a substance in a volume (for example, muddy water, jelly, etc.) containing impurities such as bubbles and solids can be drawn naturally.

<システム構成>
図2は本発明の一実施形態にかかるオブジェクト描画装置の構成例を示す図である。
<System configuration>
FIG. 2 is a diagram illustrating a configuration example of an object drawing apparatus according to an embodiment of the present invention.

図2において、オブジェクト描画装置は、ゲームアプリケーション等の3D(3 Dimension)オブジェクトの描画命令を含む3Dアプリケーション1と、この3Dアプリケーション1から描画命令等を受け取るOpenGL、Direct3D等の3D−API(Application Program Interface)2と、描画処理を実行するGPU3とを備えている。   In FIG. 2, the object drawing apparatus includes a 3D application 1 including drawing commands for 3D (3 Dimension) objects such as game applications, and 3D-API (Application Program) such as OpenGL and Direct3D that receive drawing commands and the like from the 3D application 1. Interface) 2 and a GPU 3 that executes drawing processing.

GPU3は、3D−API2からGPUコマンドおよびデータストリームを受け付けるGPUフロントエンド部31と、このGPUフロントエンド部31から3D頂点データを受け取って2Dスクリーン空間に投影した座標変換(行列の転置)等を行うプログラマブル頂点プロセッサ(VS:Vertex Processor)32と、GPUフロントエンド部31から与えられる頂点インデックスストリームとプログラマブル頂点プロセッサ32で座標変換された頂点データとを組み立てる基本アセンブリ部33とを備えている。また、GPU3は、基本アセンブリ部33で組み立てられた多角形、線および点のデータからラスタライズおよび補間を行うラスタライズ/補間部34と、このラスタライズ/補間部34からラスタライズ済のピクセル(フラグメント)データを受け取ってテクスチャマッピング等を行うプログラマブルピクセルプロセッサ(PS:Pixel Processor)35と、ラスタライズ/補間部34から与えられるピクセル位置ストリームとプログラマブルピクセルプロセッサ35から与えられるテクスチャマッピング済のデータからラスタ演算を行うラスタ演算部36と、描画内容が書込・更新されるフレームバッファ37とを備えている。   The GPU 3 receives a GPU command and a data stream from the 3D-API 2, and performs coordinate transformation (matrix transposition) by receiving 3D vertex data from the GPU front end 31 and projecting it to the 2D screen space. A programmable vertex processor (VS) 32 and a basic assembly unit 33 that assembles a vertex index stream supplied from the GPU front-end unit 31 and vertex data coordinate-converted by the programmable vertex processor 32 are provided. Further, the GPU 3 performs rasterization / interpolation unit 34 that performs rasterization and interpolation from polygon, line, and point data assembled by the basic assembly unit 33, and rasterized pixel (fragment) data from the rasterization / interpolation unit 34. A raster processing that performs a raster operation from a programmable pixel processor (PS) 35 that receives and performs texture mapping and the like, a pixel position stream provided from the rasterization / interpolation unit 34 and a texture-mapped data provided from the programmable pixel processor 35 And a frame buffer 37 into which drawing contents are written / updated.

<動作>
図3は透過オブジェクトの描画のための処理例を示すフローチャートであり、1パスによる処理を示している。なお、GPU3の内部における実際の処理は自動的に最適化が行われるため、実際の処理順序は変更されることがある。
<Operation>
FIG. 3 is a flowchart showing an example of processing for drawing a transparent object, and shows processing by one pass. Note that the actual processing in the GPU 3 is automatically optimized, so the actual processing order may be changed.

図3において、処理を開始すると(ステップS100)、GPU3のプログラマブル頂点プロセッサ32および基本アセンブリ部33による頂点処理を行う(ステップS101)。この頂点処理においては、背景の頂点処理(ステップS102)と内層の頂点処理(ステップS103)と外層の頂点処理(ステップS105)とを並行して行う。   In FIG. 3, when processing is started (step S100), vertex processing is performed by the programmable vertex processor 32 and the basic assembly unit 33 of the GPU 3 (step S101). In this vertex processing, background vertex processing (step S102), inner layer vertex processing (step S103), and outer layer vertex processing (step S105) are performed in parallel.

また、内層の頂点処理(ステップS103)に続いて(あるいはこれと並行して)、透明もしくは半透明の外層による、内層の輪郭の滲みを表現する際の透明度に用いるフレネル項(通常のフレネル項の使い方とは異なる)の計算を行う(ステップS104)。   Further, following (or in parallel with) the vertex processing of the inner layer (step S103), the Fresnel term used for transparency when expressing the blur of the inner layer contour by the transparent or translucent outer layer (ordinary Fresnel term) Is calculated) (step S104).

内層は外層より光沢が抑えられた質感である。これは内層に光が届くまで、また内層から外に光が出てくる時、外層の濁りにより光が分散されるからである。それは透過・屈折する光もまた分散されることを意味し、結果として輪郭の滲みが生まれる。この滲んだ輪郭を再現することがもっとも重要である。滲みを正しく計算するため、一般には分散レイトレーシングなどの確率を利用したレンダリング法や、物質内で光に関与する媒体を考慮したレンダリングが必要になるが、処理は複雑になるのでリアルタイム性は全くない。   The inner layer has a texture that is less glossy than the outer layer. This is because the light is dispersed by the turbidity of the outer layer until the light reaches the inner layer and when the light comes out of the inner layer. This means that the light that is transmitted and refracted is also dispersed, resulting in contour blurring. It is most important to reproduce this blurred outline. In order to correctly calculate bleeding, it is generally necessary to use a rendering method that uses probability such as dispersion ray tracing, or rendering that considers media involved in light within the material, but the processing becomes complicated, so real-time performance is completely Absent.

滲みは光透過性を持つ外層を透過する際の光の散乱で引き起こされる現象なので、どのくらい内層から外層へ厚み(距離)があるかを得る必要がある。厚みの数値情報を得るには内層と外層のそれぞれの任意の頂点間の距離を測ることになるため、最低二回の頂点座標処理が必要となる。正確に距離を得るには仮想カメラ位置より内層側から外層へ、または外層側から内層へ視線ベクトル(レイ)を飛ばしてそれぞれとの衝突判定を行い、交点をもとに距離を得なければならない。この処理に必要な時間、及びCPU、GPUへの演算負荷はあまりに膨大である。そこで、本発明では視線ベクトルと法線ベクトルの角度を利用し、両ベクトルの内積から滲みの度合に対応する透明度を計算するようにしている。その結果、通常のフレネル項の計算(視線とジオメトリの傾きを考慮)と同様な手法を採用することができる。   Bleeding is a phenomenon caused by light scattering when passing through an outer layer having optical transparency, so it is necessary to obtain how much thickness (distance) is from the inner layer to the outer layer. In order to obtain numerical information on the thickness, the distance between arbitrary vertices of the inner layer and the outer layer is measured, so that vertex coordinate processing is required at least twice. In order to obtain the distance accurately, it is necessary to determine the collision with each other by sending a line-of-sight vector (ray) from the inner layer side to the outer layer or from the outer layer side to the inner layer from the virtual camera position, and to obtain the distance based on the intersection . The time required for this processing and the computation load on the CPU and GPU are too large. Therefore, in the present invention, the angle corresponding to the degree of bleeding is calculated from the inner product of both vectors by using the angles of the line-of-sight vector and the normal vector. As a result, it is possible to employ a method similar to the normal calculation of Fresnel terms (considering the line of sight and the inclination of the geometry).

図4は光透過性を持つ外層による内層の輪郭の滲みの度合が視線ベクトルと法線ベクトルの内積に依存する様子を示す図であり、I、Iは視点(カメラ)Eから内層IL上の頂点P、Pを向く視線ベクトル、N、Nは内層ILの頂点P、Pにおけるジオメトリ法線の方向を向く法線ベクトルである。なお、OLは外層である。 FIG. 4 is a diagram showing how the degree of blurring of the inner layer contour by the outer layer having light transmittance depends on the inner product of the line-of-sight vector and the normal vector, and I 1 and I 2 are the inner layer IL from the viewpoint (camera) E. The line-of-sight vectors N 1 and N 2 facing the upper vertices P 1 and P 2 are normal vectors facing the direction of the geometry normal at the vertices P 1 and P 2 of the inner layer IL. In addition, OL is an outer layer.

図4において、頂点Pのように視線ベクトルIと法線ベクトルNが同一直線上(角度が0度)にある場合に比べ、頂点Pのように視線ベクトルIと法線ベクトルNの角度が90度(内積で0)に近づくことで外層OLの厚み(破線部分)が増すと考えることができる。外層OLの厚みは光の拡散の度合いとなり、その分に応じて内層ILの輪郭が滲んで見えるようになる。 4, compared to the case sight vector I 2 and the normal vector N 2 as vertices P 2 is collinear (angle of 0 degrees), line-of-sight vector I 1 and the normal vector as vertices P 1 It can be considered that the thickness of the outer layer OL (broken line portion) increases as the angle of N 1 approaches 90 degrees (0 in the inner product). The thickness of the outer layer OL is the degree of light diffusion, and the contour of the inner layer IL appears to be blurred according to the thickness.

一般的なフレネル項Fresnelの計算は次のような式に基づいて行われる。   A general Fresnel term Fresnel is calculated based on the following equation.

Fresnel = max( 0, min( 1, Bias + Scale
* ( 1 + pow( dot( I, N ), Shininess ) ) ) )
ここで、max(x,y)はxとyの最大値を求める関数、min(x,y)はxとyの最小値を求める関数、pow(x,y)はxを求める関数、dot(x,y)はベクトルxとベクトルyの内積を求める関数、Bias、Scale、Shininessは各種のパラメータである。
Fresnel = max (0, min (1, Bias + Scale
* (1 + pow (dot (I, N), Shininess))))
Here, max (x, y) is a function for obtaining the maximum value of x and y, min (x, y) is a function for obtaining the minimum value of x and y, pow (x, y) is a function for obtaining xy , dot (x, y) is a function for calculating the inner product of the vector x and the vector y, and Bias, Scale, and Shininess are various parameters.

また、一般的なフレネル項Fresnelの計算では各頂点にて、
I = normalize(Position ‐ EyePosition)
の計算を行い、各頂点に対する視線ベクトルIを求める。ここで、normalize(x)はベクトルxと同じ方向を指す長さ1のベクトルを返す関数であり、Positionは頂点の座標、EyePositionは視点の座標である。
Also, in general Fresnel term Fresnel calculation, at each vertex,
I = normalize (Position-EyePosition)
And the line-of-sight vector I for each vertex is obtained. Here, normalize (x) is a function that returns a vector of length 1 pointing in the same direction as the vector x, Position is the vertex coordinates, and EyePosition is the viewpoint coordinates.

このような計算を各頂点について行うことは計算コストがかかるため、本発明では図5に示すように、頂点によらず単一の視線ベクトルIを利用するようにしている。図6は頂点毎に視線ベクトルを計算した場合(a)と単一の視線ベクトルを用いた場合(b)の描画結果の違いの例を示す図であり、頂点毎に視線ベクトルを計算した場合(a)ではレンダリングの品質も芳しくなく、見た目が破綻しているが、単一の視線ベクトルを用いた場合(b)では計算コストがかからない上にレンダリングの品質も向上して見栄えもよくなる。これは、頂点処理においてフレネル項Fresnelを計算する場合、頂点間の補間が自動に行われるために品質の悪化を招くものと考えられる。なお、ピクセル処理においてフレネル項Fresnelを計算することもできるが、頂点処理において計算する場合よりも計算コストがかかる。なお、ここでいうコストとは、演算に対する処理時間、及びCPU、GPUなどへの負荷のことである。   Since it is computationally expensive to perform such calculation for each vertex, in the present invention, as shown in FIG. 5, a single line-of-sight vector I is used regardless of the vertex. FIG. 6 is a diagram illustrating an example of a difference in drawing result between the case where a line-of-sight vector is calculated for each vertex (a) and the case where a single line-of-sight vector is used (b), where the line-of-sight vector is calculated for each vertex. In (a), the rendering quality is not good and the appearance is broken, but in the case of using a single line-of-sight vector (b), the calculation cost is not increased and the rendering quality is improved and the appearance is improved. This is considered to cause deterioration in quality because the interpolation between vertices is automatically performed when calculating the Fresnel term Fresnel in the vertex processing. Although the Fresnel term Fresnel can be calculated in the pixel processing, the calculation cost is higher than that in the vertex processing. Note that the cost here refers to the processing time for computation and the load on the CPU, GPU, and the like.

このように、より単純で見栄えの良い手法がないか考察した結果、内層表面上の全ての頂点で同一の視線ベクトルを使用することで、ごく簡単にどれだけ法線が視点へ向いているかにより、内層の中心から外側にかけて減衰する値として取得することができる。これにより通常の方法よりも格段に滑らかな減衰値を得ることができる上、見た目が破綻することもない。さらに視線ベクトルは各描画フレームもしくは視線が変化したときのみ行えばよいので計算コストも下がる。   Thus, as a result of considering whether there is a simpler and better-looking method, it is very easy to use the same gaze vector at all the vertices on the inner layer surface, and how much the normal is directed to the viewpoint. It can be obtained as a value that attenuates from the center of the inner layer to the outer side. As a result, a much smoother attenuation value can be obtained than in the normal method, and the appearance does not break down. Furthermore, since the line-of-sight vector only needs to be calculated when each drawing frame or line of sight changes, the calculation cost is reduced.

さらに計算を単純化するため、視線ベクトルの符号を反転しておく。その結果、視線ベクトルと法線ベクトルの内積に対して関数min()を実行しなくても、必要とする正しい計算結果を得ることができるようになる。   Further, in order to simplify the calculation, the sign of the line-of-sight vector is inverted. As a result, a necessary correct calculation result can be obtained without executing the function min () on the inner product of the line-of-sight vector and the normal vector.

計算式をまとめて示せば次のようになる。   The following is a summary of the calculation formula.

I = normalize( -1 * EyeVector )
Fresnel = pow( max( 0, dot( N, I ) ), a ) * Scale
ここで、aはフレネル項のShininessと同等のパラメータであり、aとScaleは減衰の効き具合を調整する。
I = normalize (-1 * EyeVector)
Fresnel = pow (max (0, dot (N, I)), a) * Scale
Here, a is a parameter equivalent to the Fresnel term Shininess, and a and Scale adjust the degree of attenuation.

図3に戻り、頂点処理(ステップS101)の後、ラスタライズ/補間部34、プログラマブルピクセルプロセッサ35およびラスタ演算部36によるピクセル処理(ステップS106)を行う。このピクセル処理においては、背景のピクセル処理(ステップS107)と内層のピクセル処理(ステップS108)と外層のピクセル処理(ステップS109)とを並行して行う。   Returning to FIG. 3, after the vertex processing (step S <b> 101), pixel processing (step S <b> 106) is performed by the rasterizing / interpolating unit 34, the programmable pixel processor 35, and the raster computing unit 36. In this pixel processing, background pixel processing (step S107), inner layer pixel processing (step S108), and outer layer pixel processing (step S109) are performed in parallel.

ここで、内層のピクセル処理(ステップS108)では頂点処理(ステップS101)のフレネル項の計算(ステップS104)で既に計算したフレネル項を透明度として使用してテクスチャマッピングを行う。   Here, in the pixel processing of the inner layer (step S108), texture mapping is performed using the Fresnel term already calculated in the calculation of the Fresnel term (step S104) in the vertex processing (step S101) as the transparency.

また、外層のピクセル処理(ステップS109)では、固定的な透明度を使用して光沢を表現したテクスチャマッピングを行う。   In the outer layer pixel processing (step S109), texture mapping that expresses gloss using a fixed transparency is performed.

すなわち、外層の表面は濡れたような質感であり、特徴としては、
(イ)光透過性を持つ
(ロ)光沢(鏡面反射、光沢反射等)を持つ
の二点である。
In other words, the surface of the outer layer is a wet texture,
(B) It has two points of light transmission (b) gloss (specular reflection, gloss reflection, etc.).

透明もしくは半透明であることで内層を表示することができ、光沢を持つことで外層の存在と質感が強調できるようになる。光沢の種類は特には問わないため、光沢を再現できるシェーディングモデル、例えばフォン(Phong)やブリン(Blinn)のような既存の反射モデルで良い。   The inner layer can be displayed by being transparent or translucent, and the presence and texture of the outer layer can be emphasized by having gloss. Since the type of gloss is not particularly limited, a shading model that can reproduce gloss, for example, an existing reflection model such as Phong or Blinn may be used.

光沢を残す必要があるため、透明度Transparencyの計算は、
Transparency = Alpha + Specular + Reflection + Diffuse
としている。Alphaはテクスチャのアルファと頂点カラーアルファを示し、Specularは屈折、Reflectionは反射、Diffuseは拡散を示す。
Since it is necessary to leave gloss, the calculation of transparency Transparency is
Transparency = Alpha + Specular + Reflection + Diffuse
It is said. Alpha indicates the texture alpha and vertex color alpha, Specular indicates refraction, Reflection indicates reflection, and Diffuse indicates diffusion.

実際には
Transparency = saturate( Speccular * Scale1
+ Reflection * Scale2 + Diffuse * Scale3 )* Alpha
を使用している。なお、saturate(x)はmin(x,max(x,1),0)に相当する関数であり、Scale1〜Scale3はパラメータ( Scale1 = 1.2, Scale2 = 0.2, Scale3 = 1.0 )である。
actually
Transparency = saturate (Speccular * Scale1
+ Reflection * Scale2 + Diffuse * Scale3) * Alpha
Is used. Saturate (x) is a function corresponding to min (x, max (x, 1), 0), and Scale1 to Scale3 are parameters (Scale1 = 1.2, Scale2 = 0.2, Scale3 = 1.0).

次いで、図3において、各ピクセル処理(ステップS107〜S109)の結果をフレームバッファ37に書き込んで合成し(ステップS110)、処理を終了する(ステップS111)。   Next, in FIG. 3, the result of each pixel process (steps S107 to S109) is written into the frame buffer 37 and synthesized (step S110), and the process ends (step S111).

図7および図8は描画例を示す図であり、図7(a)は内層の描画結果(輪郭に滲みを表現)、図7(b)は外層の描画結果(表面に光沢を表現)、図8(a)は内層と外層の合成結果、図8(b)は内層と外層と背景の合成結果である。このように、光沢のある外層に含まれる内層につき、高品質な輪郭の滲みを再現することができる。なお、内層と外層を別々に配置しても中身の詰まった感じにはならない。必ず二つをひとつのものとしてレンダリングする必要がある。   FIG. 7 and FIG. 8 are diagrams showing a drawing example, FIG. 7A is a drawing result of the inner layer (representing bleeding on the outline), FIG. 7B is a drawing result of the outer layer (representing gloss on the surface), FIG. 8A shows the synthesis result of the inner layer and the outer layer, and FIG. 8B shows the synthesis result of the inner layer, the outer layer, and the background. In this manner, high-quality contour bleeding can be reproduced for the inner layer included in the glossy outer layer. Even if the inner layer and the outer layer are arranged separately, it does not feel that the contents are clogged. You must always render the two as one.

図9は透過オブジェクトの他の例を示す図であり、ジャングル等を想定した背景の上に、内臓が透明もしくは半透明の外皮で覆われたヒルの透過オブジェクトを描画した例である。   FIG. 9 is a diagram showing another example of a transparent object, which is an example in which a transparent object of a hill whose internal organs are covered with a transparent or semi-transparent skin on a background assuming a jungle or the like.

図10は透過オブジェクトの別なパターン例を示す図であり、(a)はこれまでに説明してきた一つの外層OL内に一つの内層ILが含まれるパターン、(b)は一つの外層OL内に複数(図示の例では二つ)の内層IL、ILが含まれるパターン、(c)は一つの外層OL内に一つの内層ILが含まれ、更に内層IL内に内層ILが含まれるパターンを示している。 FIG. 10 is a diagram showing another pattern example of the transparent object. FIG. 10A is a pattern in which one inner layer IL is included in one outer layer OL described so far, and FIG. 10B is a diagram in one outer layer OL. plural pattern that includes an inner layer IL 1, IL 2 of (two in the illustrated example), (c) is included one inner layer IL 1 in one of the outer layer OL, the inner layer IL 2 further inner layer IL 1 The pattern which contains is shown.

図11は外層の中に二つの内層が並んで存在する場合(図10のパターン(b))の描画例を示す図であり、(a)(b)は視点を変えたものである。   FIG. 11 is a diagram showing a drawing example in the case where two inner layers are arranged side by side in the outer layer (pattern (b) in FIG. 10), and (a) and (b) show different viewpoints.

<総括>
以上説明した手法により、我々が当初求めていた従来にない柔らかな透過処理が、十分なリアルタイム性を持って可能になる。なお、この実施例では、滲み部分は外周が透明になるため、エイリアシングが起こることもなく、アンチエイリアシングの必要もない。
<Summary>
With the method described above, an unprecedented soft permeation process that we originally requested can be realized with sufficient real-time characteristics. In this embodiment, since the outer periphery of the bleeding portion is transparent, aliasing does not occur and anti-aliasing is not necessary.

以上、本発明の好適な実施の形態により本発明を説明した。ここでは特定の具体例を示して本発明を説明したが、特許請求の範囲に定義された本発明の広範な趣旨および範囲から逸脱することなく、これら具体例に様々な修正および変更を加えることができることは明らかである。すなわち、具体例の詳細および添付の図面により本発明が限定されるものと解釈してはならない。   The present invention has been described above by the preferred embodiments of the present invention. While the invention has been described with reference to specific embodiments, various modifications and changes may be made to the embodiments without departing from the broad spirit and scope of the invention as defined in the claims. Obviously you can. In other words, the present invention should not be construed as being limited by the details of the specific examples and the accompanying drawings.

従来における透過オブジェクトの描画のための処理を示すフローチャートである。It is a flowchart which shows the process for drawing of the transparent object in the past. 本発明の一実施形態にかかるオブジェクト描画装置の構成例を示す図である。It is a figure which shows the structural example of the object drawing apparatus concerning one Embodiment of this invention. 透過オブジェクトの描画のための処理例を示すフローチャートである。It is a flowchart which shows the process example for drawing of a transparent object. 光透過性を持つ外層による内層の輪郭の滲みの度合が視線ベクトルと法線ベクトルの内積に依存する様子を示す図である。It is a figure which shows a mode that the degree of the bleeding of the outline of the inner layer by the outer layer which has a light transmittance is dependent on the inner product of a gaze vector and a normal vector. 単一の視線ベクトルを用いた図である。It is a figure using a single gaze vector. 頂点毎に視線ベクトルを計算した場合と単一の視線ベクトルを用いた場合の描画結果の違いの例を示す図である。It is a figure which shows the example of the difference in the drawing result at the time of using the gaze vector for every vertex, and using a single gaze vector. 描画例を示す図(その1)である。FIG. 6 is a diagram (part 1) illustrating a drawing example. 描画例を示す図(その2)である。It is a figure (the 2) which shows a drawing example. 透過オブジェクトの他の例を示す図である。It is a figure which shows the other example of a transparent object. 透過オブジェクトの別なパターン例を示す図である。It is a figure which shows another example of a pattern of a transparent object. 外層の中に二つの内層が並んで存在する場合の描画例を示す図である。It is a figure which shows the example of a drawing in case two inner layers exist side by side in an outer layer.

符号の説明Explanation of symbols

1 3Dアプリケーション
2 3D−API
3 GPU
31 GPUフロントエンド部
32 プログラマブル頂点プロセッサ
33 基本アセンブリ部
34 ラスタライズ/補間部
35 プログラマブルピクセルプロセッサ
36 ラスタ演算部
37 フレームバッファ
1 3D application 2 3D-API
3 GPU
31 GPU front-end unit 32 Programmable vertex processor 33 Basic assembly unit 34 Rasterization / interpolation unit 35 Programmable pixel processor 36 Raster operation unit 37 Frame buffer

Claims (6)

仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画方法であって、
上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する工程と、
背景のピクセル処理を行う工程と、
計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う工程と、
固定的な透明度を使用して上記外層のピクセル処理を行う工程と、
ピクセル処理された上記背景、上記内層および上記外層を合成する工程とを備えたことを特徴とする透過オブジェクト描画方法。
In a virtual three-dimensional space, a transparent object drawing method in which an opaque inner layer is covered with a transparent or semi-transparent outer layer,
Calculating a Fresnel term by the inner product of the normal vector and the line-of-sight vector of the vertex of the inner layer surface;
Performing background pixel processing;
Performing the pixel processing of the inner layer using the calculated Fresnel term as transparency;
Performing pixel processing of the outer layer using a fixed transparency;
A transparent object drawing method comprising: combining the pixel-processed background, the inner layer, and the outer layer.
請求項1に記載の透過オブジェクト描画方法において、
上記フレネル項の計算に使用する視線ベクトルは頂点によらず一定のものとすることを特徴とする透過オブジェクト描画方法。
The transparent object drawing method according to claim 1,
A transparent object drawing method, wherein a line-of-sight vector used for calculating the Fresnel term is constant regardless of a vertex.
請求項1に記載の透過オブジェクト描画方法において、
上記フレネル項の計算に使用する視線ベクトルの符号を予め反転させておくことを特徴とする透過オブジェクト描画方法。
The transparent object drawing method according to claim 1,
A transparent object drawing method, wherein a sign of a line-of-sight vector used for calculating the Fresnel term is inverted in advance.
請求項1に記載の透過オブジェクト描画方法において、
上記フレネル項の計算は頂点処理において行うことを特徴とする透過オブジェクト描画方法。
The transparent object drawing method according to claim 1,
A transparent object drawing method, wherein the calculation of the Fresnel term is performed in vertex processing.
仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画装置であって、
上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する手段と、
背景のピクセル処理を行う手段と、
計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う手段と、
固定的な透明度を使用して上記外層のピクセル処理を行う手段と、
ピクセル処理された上記背景、上記内層および上記外層を合成する手段とを備えたことを特徴とするオブジェクト描画装置。
In a virtual three-dimensional space, a transparent object drawing device in which an opaque inner layer is covered with a transparent or semi-transparent outer layer,
Means for calculating the Fresnel term by the inner product of the normal vector and the line-of-sight vector of the vertex of the inner layer surface;
Means for performing background pixel processing;
Means for pixel processing of the inner layer using the calculated Fresnel term as transparency;
Means for pixel processing of the outer layer using fixed transparency;
An object drawing apparatus, comprising: the pixel-processed background, the inner layer, and the outer layer.
仮想三次元空間内における、不透明の内層を透明もしくは半透明の光透過性を持つ外層が覆う透過オブジェクトの描画プログラムであって、
コンピュータを、
上記内層表面の頂点の法線ベクトルと視線ベクトルとの内積によりフレネル項を計算する手段、
背景のピクセル処理を行う手段、
計算されたフレネル項を透明度として使用して上記内層のピクセル処理を行う手段、
固定的な透明度を使用して上記外層のピクセル処理を行う手段、
ピクセル処理された上記背景、上記内層および上記外層を合成する手段として機能させることを特徴とするオブジェクト描画プログラム。
In a virtual three-dimensional space, a transparent object drawing program in which an opaque inner layer is covered by a transparent or translucent light-transmitting outer layer,
Computer
Means for calculating the Fresnel term by the inner product of the normal vector and the line-of-sight vector of the vertex of the inner layer surface;
Means for pixel processing of the background,
Means for performing pixel processing of the inner layer using the calculated Fresnel term as transparency,
Means for pixel processing of the outer layer using a fixed transparency;
An object drawing program that functions as means for synthesizing the pixel-processed background, the inner layer, and the outer layer.
JP2006139592A 2006-05-18 2006-05-18 Transparent object rendering method Withdrawn JP2007310682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006139592A JP2007310682A (en) 2006-05-18 2006-05-18 Transparent object rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006139592A JP2007310682A (en) 2006-05-18 2006-05-18 Transparent object rendering method

Publications (1)

Publication Number Publication Date
JP2007310682A true JP2007310682A (en) 2007-11-29

Family

ID=38843469

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006139592A Withdrawn JP2007310682A (en) 2006-05-18 2006-05-18 Transparent object rendering method

Country Status (1)

Country Link
JP (1) JP2007310682A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010033253A (en) * 2008-07-28 2010-02-12 Namco Bandai Games Inc Program, information storage medium, and image generation system
JP2010033252A (en) * 2008-07-28 2010-02-12 Namco Bandai Games Inc Program, information storage medium, and image generation system
CN110084873A (en) * 2018-01-24 2019-08-02 北京京东尚科信息技术有限公司 Method and apparatus for renders three-dimensional model
CN116421970A (en) * 2023-06-12 2023-07-14 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for externally-installed rendering of virtual object

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010033253A (en) * 2008-07-28 2010-02-12 Namco Bandai Games Inc Program, information storage medium, and image generation system
JP2010033252A (en) * 2008-07-28 2010-02-12 Namco Bandai Games Inc Program, information storage medium, and image generation system
CN110084873A (en) * 2018-01-24 2019-08-02 北京京东尚科信息技术有限公司 Method and apparatus for renders three-dimensional model
CN110084873B (en) * 2018-01-24 2023-09-01 北京京东尚科信息技术有限公司 Method and apparatus for rendering three-dimensional model
CN116421970A (en) * 2023-06-12 2023-07-14 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for externally-installed rendering of virtual object
CN116421970B (en) * 2023-06-12 2023-12-05 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for externally-installed rendering of virtual object

Similar Documents

Publication Publication Date Title
US7755626B2 (en) Cone-culled soft shadows
KR101145260B1 (en) Apparatus and method for mapping textures to object model
KR102465969B1 (en) Apparatus and method for performing graphics pipeline
US8294713B1 (en) Method and apparatus for illuminating objects in 3-D computer graphics
EP2797054B1 (en) Rendering of an indirect illumination data buffer
US10825238B2 (en) Visual edge rendering using geometry shader clipping
US10403023B2 (en) Three-dimensional character rendering system using general purpose graphic processing unit, and processing method thereof
Sabino et al. A hybrid GPU rasterized and ray traced rendering pipeline for real time rendering of per pixel effects
CN107784622A (en) Graphic system and graphics processor
JP4584956B2 (en) Graphics processor and drawing processing method
JP2007310682A (en) Transparent object rendering method
JP2014505954A (en) Estimation method of concealment in virtual environment
Policarpo et al. Deferred shading tutorial
US20180005432A1 (en) Shading Using Multiple Texture Maps
JP4754384B2 (en) Program, information recording medium, and image generation system
JP4201207B2 (en) Program, information storage medium, and image generation system
JP5253118B2 (en) Image generation system, program, and information storage medium
JP4754385B2 (en) Program, information recording medium, and image generation system
Kubo et al. Curvature-dependent reflectance function for interactive rendering of subsurface scattering
JP2007141077A (en) Program, information storage medium, and image generation system
WO2022201970A1 (en) Information processing device, information processing method, and information processing program
KR102085701B1 (en) Method for rendering image
Best et al. New rendering approach for composable volumetric lenses
Peddie The Major GPU Eras
Sung Efficient Shadow Generation of Massive Crowds Based on the Area of Screen Space

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090804