JPH0935085A - Method and device for real-time video generation - Google Patents
Method and device for real-time video generationInfo
- Publication number
- JPH0935085A JPH0935085A JP20186795A JP20186795A JPH0935085A JP H0935085 A JPH0935085 A JP H0935085A JP 20186795 A JP20186795 A JP 20186795A JP 20186795 A JP20186795 A JP 20186795A JP H0935085 A JPH0935085 A JP H0935085A
- Authority
- JP
- Japan
- Prior art keywords
- polygon
- viewpoint
- light source
- screen
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 11
- 238000013507 mapping Methods 0.000 claims abstract description 40
- 238000006243 chemical reaction Methods 0.000 claims abstract description 7
- 238000004364 calculation method Methods 0.000 claims description 117
- 238000009877 rendering Methods 0.000 claims description 17
- 230000000007 visual effect Effects 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 238000007796 conventional method Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- GJJFMKBJSRMPLA-HIFRSBDPSA-N (1R,2S)-2-(aminomethyl)-N,N-diethyl-1-phenyl-1-cyclopropanecarboxamide Chemical compound C=1C=CC=CC=1[C@@]1(C(=O)N(CC)CC)C[C@@H]1CN GJJFMKBJSRMPLA-HIFRSBDPSA-N 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000004615 ingredient Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Landscapes
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】この発明は、実時間映像発生(あ
るいはビジュアル・システム又はリアルタイムコンピュ
ータグラフィックス)における、実景に近い影映像の実
時間生成に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to real-time generation of a shadow image close to a real scene in real-time image generation (or visual system or real-time computer graphics).
【0002】[0002]
【従来の技術】図3に、従来のリアリティの高い実時間
コンピュータグラフィックスのハードウェア構成を示
す。構成は2つに分かれ、幾何計算を行う幾何計算部
(Geometric Processor (GP))31、およびピクセ
ルの色計算を行うレンダリングプロセッサ(Rendering
Processor (RP))32の2つの部分からなる。幾何
計算部31はフレーム毎の計算を行い、レンダリングプ
ロセッサ32はピクセル毎の計算を行う。2. Description of the Related Art FIG. 3 shows a hardware structure of conventional real-time computer graphics with high reality. The configuration is divided into two parts, a geometric calculation unit (Geometric Processor (GP)) 31 for performing geometric calculation, and a rendering processor (Rendering) for performing color calculation of pixels.
Processor (RP) 32. The geometric calculation unit 31 performs calculation for each frame, and the rendering processor 32 performs calculation for each pixel.
【0003】幾何計算部31は、3次元のモデルを2次
元のポリゴン情報に変換しレンダリングプロセッサ32
に送る。レンダリングプロセッサ32のラスタライザ
(Rasterlizer )321は、ポリゴンをスキャンライン
方向のセグメントに分解する。次に、セグメントはスパ
ン計算部(Span Calc.)322においてスパン(例えば
4画素等の複数画素)に分解される。以後、この複数画
素が並列処理の対象となり、各画素の色がテクスチャ生
成回路(Texture Calc. )323において同時に計算さ
れる。さらに、エッジをなめらかに見せるためにアンチ
エリアリング(Anti-aliasing )処理がピクセル計算部
(Pixel Calc. )324で行われ、画素データがフレー
ムメモリに書き込まれる。最後に、輝度変調部(Video
Output)325に内蔵されるフレームメモリ3251の
内容がDA変換され、CRT33に映像として表示され
る。図3に示すように、リアリティの高い映像生成装置
は、テクスチャ生成回路323を標準として持つ。The geometric calculation unit 31 converts a three-dimensional model into two-dimensional polygon information and renders the rendering processor 32.
Send to A rasterizer (Rasterlizer) 321 of the rendering processor 32 decomposes the polygon into segments in the scan line direction. Next, the segment is decomposed into a span (for example, a plurality of pixels such as 4 pixels) in a span calculation unit (Span Calc.) 322. After that, the plurality of pixels are subjected to parallel processing, and the color of each pixel is simultaneously calculated in the texture generation circuit (Texture Calc.) 323. Furthermore, in order to make the edges look smooth, anti-aliasing (Anti-aliasing) processing is performed by the pixel calculation unit (Pixel Calc.) 324, and the pixel data is written in the frame memory. Finally, the brightness modulator (Video
The contents of the frame memory 3251 incorporated in the Output) 325 are DA converted and displayed on the CRT 33 as an image. As shown in FIG. 3, the highly realistic image generation apparatus has the texture generation circuit 323 as a standard.
【0004】テクスチャマッピング計算の原理を図4に
示す。テクスチャマッピングでは、スクリーン上の各画
素の色の決定にThe principle of texture mapping calculation is shown in FIG. Texture mapping is used to determine the color of each pixel on the screen.
【0005】(1)図4に示すテクスチャマッピング計
算によりテクスチャパターンのアドレス(1) The address of the texture pattern is calculated by the texture mapping calculation shown in FIG.
【外1】 を決める。すなわち、[Outside 1] Decide. That is,
【外2】 を延長し、ポリゴンとの交点Oを求め、さらに、Oより
平面Qに垂線を下ろし、交点Mを求める。[Outside 2] Is extended to obtain an intersection point O with the polygon, and a perpendicular line is drawn from O to the plane Q to obtain an intersection point M.
【0006】(2)テクスチャ生成回路323内の図示
しないテクスチャメモリに予め格納されているテクスチ
ャパターン(写真等よりデジタル化して作った模様)の
内容をこのアドレスを用いてひく。(2) The contents of a texture pattern (a pattern made by digitizing a photograph or the like) stored in advance in a texture memory (not shown) in the texture generation circuit 323 is subtracted using this address.
【0007】(3)この色をスクリーンの画素の色とす
るものである。(3) This color is used as the color of the screen pixel.
【0008】計算の大きな部分はテクスチャマッピング
計算である。このマッピングによるメモリアドレスA large part of the calculation is the texture mapping calculation. Memory address by this mapping
【外3】 の計算は、次の式(1)である。[Outside 3] Is calculated by the following equation (1).
【0009】[0009]
【数1】 [Equation 1]
【0010】ただし、However,
【0011】T:テクスチャをポリゴンに貼る姿勢を示
す2行3列のマトリクスである。T: A matrix of 2 rows and 3 columns showing the posture of attaching the texture to the polygon.
【0012】[0012]
【外4】 :テクスチャをポリゴンに貼るときの原点からの平行移
動を示すベクトル。[Outside 4] : A vector that indicates the translation from the origin when the texture is pasted on the polygon.
【0013】[0013]
【外5】 :テクスチャマッピングの対象画素(p,q,1)の位
置ベクトルである。[Outside 5] : A position vector of the target pixel (p, q, 1) of texture mapping.
【0014】[0014]
【外6】 :ベクトル[Outside 6] :vector
【外7】 を延長したときポリゴンと交わる点のz値。[Outside 7] Z value of the point that intersects the polygon when is extended.
【0015】従来の実時間映像発生装置は、前述のよう
に構成されるが、影映像の発生が実用化されていない。
一部、実験システムで行われているものも、影映像発生
の精度が悪く、ゲーミングエリアが広く映像の精度を要
求されるフライトシミュレータ等の用途には適用ができ
ない。Although the conventional real-time image generator is constructed as described above, the generation of a shadow image has not been put to practical use.
Some of them, which are performed in an experimental system, cannot be applied to applications such as flight simulators in which the shadow image generation accuracy is poor and the gaming area is wide and image accuracy is required.
【0016】これらの主な原因は、The main causes of these are
【0017】(1)影判定に用いるZの精度がポリゴン
毎に異なる。(1) The accuracy of Z used for shadow determination differs for each polygon.
【0018】(2)影計算のためのハードウェア規模が
大きくなり、経済性との兼合いにより実用化が困難であ
る。(2) The scale of hardware for shadow calculation becomes large, and it is difficult to put it into practical use in consideration of economical efficiency.
【0019】による。According to
【0020】[従来のZ値を用いる影生成のアルゴリズ
ム][Conventional Shadow Generation Algorithm Using Z Value]
【0021】図5は、光源と視点との関係を示した図で
ある。同(a)は光源からみたすなわち光源を視点とし
たときにzバッファ(z-buffer)に格納されるz値を示
し、同(b)は正規の視点を用いたときに格納されるz
値を示す。このとき、各スクリーンの画素位置(p,
q)とzバッファのメモリアドレスは、1対1に対応し
ている。図5(c)は全体の概観図であり、模擬視界対
象物を仮定する視点と光源とから見るスクリーン座標系
の関係を示している。FIG. 5 is a diagram showing the relationship between the light source and the viewpoint. The same (a) shows the z value stored in the z buffer (z-buffer) when viewed from the light source, that is, when the light source is the viewpoint, and the same (b) shows the z value stored when the normal viewpoint is used.
Indicates a value. At this time, the pixel position (p,
q) and the memory address of the z buffer have a one-to-one correspondence. FIG. 5C is a general view of the whole, and shows the relationship between the viewpoint assuming the simulated field of view object and the screen coordinate system viewed from the light source.
【0022】立体を表現するための隠顕処理にzバッフ
ァ(またはデプスバッファ(depth-buffer))法を用い
る映像生成においては、光源を仮想の視点として、図5
に示す点Oを見たとき、隠れなければ、その点までの奥
行情報(通常z軸を奥行方向にとるためz値である)が
zバッファに格納される。In the image generation using the z-buffer (or depth-buffer) method for the invisible processing for expressing a solid, the light source is regarded as a virtual viewpoint, and FIG.
When the point O shown in is viewed, if it is not hidden, the depth information up to that point (normally the z value because the z axis is in the depth direction) is stored in the z buffer.
【0023】従って、視点側スクリーン座標系における
点Oの座標値を、光源側スクリーン座標系に変換した変
換後のz値zlightCと、光源から該当点を見たときにす
でにzバッファに格納されているz値zlightMとの大小
を比較することにより影の判定がおこなえる。zlightM
<zlightCのとき光源と点Oの間にさえぎる物体がある
ことを意味し、点Oは影となる。Therefore, the z value z lightC after the conversion of the coordinate value of the point O in the viewpoint side screen coordinate system to the light source side screen coordinate system and the z value already stored in the z buffer when the corresponding point is seen from the light source. The shadow can be determined by comparing the magnitude with the z value z lightM . z lightM
When <z light C , it means that there is an object between the light source and the point O, and the point O becomes a shadow.
【0024】以上の計算をzの逆数z-1および誤差εを
用いた実用的な式で記述すれば次のようになる。zの逆
数を用いる理由は後に述べる。The above calculation can be described by a practical equation using the inverse z −1 of z and the error ε. The reason for using the reciprocal of z will be described later.
【0025】[0025]
【数2】 [Equation 2]
【0026】ただし、However,
【0027】shodow(pe,qe):(pe,qe)におい
て影が発生したことを示す論理変数。[0027] shodow (p e, q e) :( p e, the logical variable indicating that shadow occurs in q e).
【0028】R:視点側のスクリーン座標系における画
素の定義域。R: A domain of pixels in the screen coordinate system on the viewpoint side.
【0029】pe,qe:視点側のスクリーン座標系にお
ける画素位置(pe,qe)。P e , q e : pixel positions (p e , q e ) in the screen coordinate system on the viewpoint side.
【0030】[0030]
【外8】 [Outside 8]
【0031】ε:比較誤差Ε: comparison error
【0032】Zlight :光源を視点と仮定して、光源側
スクリーン座標系の全ピクセルにおけるz値(逆数)を
格納するメモリ。Z light : A memory for storing z values (inverse numbers) of all pixels in the screen coordinate system on the light source side, assuming that the light source is the viewpoint.
【0033】f1(pe,qe) :視点のスクリーン座標
系より、光源のスクリーン座標系へのマッピング関数で
あり、pl 方向に対応する。F 1 (p e , q e ): a mapping function from the screen coordinate system of the viewpoint to the screen coordinate system of the light source, which corresponds to the p l direction.
【0034】f2(pe,qe) :視点のスクリーン座標
系より、光源のスクリーン座標系へのマッピング関数で
あり、ql 方向に対応する。F 2 (p e , q e ): A mapping function from the screen coordinate system of the viewpoint to the screen coordinate system of the light source, which corresponds to the q l direction.
【0035】f3(pe,qe) :視点のスクリーン座標
系より、光源のスクリーン座標系へのマッピング関数で
あり、zl 方向に対応する。F 3 (p e , q e ): A mapping function from the screen coordinate system of the viewpoint to the screen coordinate system of the light source, which corresponds to the z l direction.
【0036】(pl,ql):視点側スクリーン座標系の
点(pe,qe)に対応する、光源側スクリーン座標系に
おける画素位置。(P l , q l ): The pixel position in the light source side screen coordinate system corresponding to the point (p e , q e ) in the viewpoint side screen coordinate system.
【0037】[従来のzバッファを用いる影映像の不具
合][Defective shadow image using conventional z-buffer]
【0038】サンプリングに起因する不具合がある。視
点側スクリーン座標系でのディスクリートな画素位置
(pe,qe)を、対応する光源側スクリーン座標系の画
素位置(pl,ql)に変換したとき、図6に示すように
画素の中心が一致しない、すなわち、変換した画素位置
(pl,ql)が光源座標系では4画素There is a problem due to sampling. Discrete pixel positions in perspective side screen coordinate system (p e, q e) the corresponding pixel position of the light source side screen coordinate system (p l, q l) when converted into, the pixel as shown in FIG. 6 The centers do not match, that is, the converted pixel position (p l , q l ) is 4 pixels in the light source coordinate system.
【数3】 で囲まれた領域内に位置する。(Equation 3) Located in the area surrounded by.
【0039】そのままでは、As it is,
【数4】 の示すメモリアドレスに格納されているz値が用いられ
るので、このための誤差Errz-1 が生じる。従って、
4画素のz値を読みだし、線形補間等によってz値を補
正しなければならない。(Equation 4) Since the z value stored in the memory address indicated by is used, an error Err z −1 for this is generated. Therefore,
It is necessary to read the z value of 4 pixels and correct the z value by linear interpolation or the like.
【0040】ところが、4点がすべて同じポリゴン上の
zとならず、この線形補間を行なえない場合が多々あ
り、真のzを推定することが困難である。However, in many cases, the four points are not z on the same polygon and this linear interpolation cannot be performed, and it is difficult to estimate the true z.
【0041】誤差Errz-1の評価を説明する。The evaluation of the error Err z -1 will be described.
【0042】実時間映像の発生においては、計算の高速
化およびデータ量の削減を図るため、形状の表現にポリ
ゴンを用いたモデルを使う。When generating a real-time image, a model using polygons is used to represent the shape in order to speed up the calculation and reduce the amount of data.
【0043】したがって、スクリーン上の各画素(p,
q)に対応するポリゴン上の点のz値zpqは、ポリゴン
の傾きをもとにして線形補間により求める。Therefore, each pixel (p,
The z value z pq of the point on the polygon corresponding to q) is obtained by linear interpolation based on the inclination of the polygon.
【0044】具体的には、ポリゴンに固有の情報である
zr-1 ,∂z-1/∂p,∂z-1/∂qを用いて次に示す
式(3)の補間計算により行なう。図7に補間計算に用
いるパラメータとスクリーンとの関係を示す。Concretely, the interpolation calculation of the following equation (3) is carried out using z r -1 , ∂z -1 / ∂p, ∂z -1 / ∂q, which are information peculiar to the polygon. . FIG. 7 shows the relationship between the parameters used for the interpolation calculation and the screen.
【0045】[0045]
【数5】 (Equation 5)
【0046】補間計算において、zの逆数z-1を用いる
理由は、zでなく逆数z-1がスクリーン座標p,qに関
して線形性を持つからである。[0046] In the interpolation calculation, the reason for using the inverse z -1 and z is the inverse z -1 not z is because having linearity with respect to the screen coordinates p, q.
【0047】ここで、Here,
【0048】(1)(p,q)はスクリーン上の画素位
置であり、qはスキャンライン位置、pはスキャンライ
ン内の画素位置を示す。(1) (p, q) is a pixel position on the screen, q is a scan line position, and p is a pixel position within the scan line.
【0049】(2)zpq -1は、画素位置(p,q)に表
示されるポリゴン上の点のz値の逆数である。(2) z pq -1 is the reciprocal of the z value of the point on the polygon displayed at the pixel position (p, q).
【0050】(3)∂z-1/∂pおよび∂z-1/∂q
は、それぞれ横方向に1画素変化したとき、および縦方
向に1スキャンライン変化したときのz-1の変化率を示
す。(3) ∂z -1 / ∂p and ∂z -1 / ∂q
Indicates the rate of change of z −1 when one pixel changes in the horizontal direction and one scan line changes in the vertical direction.
【0051】(4)zr -1 は、補間計算の基準となるス
クリーン上の点(pr,qr)に表示される該当ポリゴン
上の点のz値の逆数である。(4) z r -1 is the reciprocal of the z value of the point on the corresponding polygon displayed at the point (p r , q r ) on the screen which is the basis of the interpolation calculation.
【0052】従って、誤差Errz-1の最大値|Err
max| は、次の式(4)になる。Therefore, the maximum value of the error Err z −1 | Err
max | is given by the following expression (4).
【0053】[0053]
【数6】 (Equation 6)
【0054】光源における光線の投影方向と、対象とす
る面のなす角度が小さい場合(平行に近い)|∂z-1/
∂p|または|∂z-1/∂q|が大きくなり、誤差|E
rrmax| は無視できなくなる。これは、影の判定When the angle between the projection direction of the light beam from the light source and the target surface is small (close to parallel) | ∂z -1 /
∂p | or | ∂z -1 / ∂q | becomes large, and the error | E
rr max | cannot be ignored. This is the judgment of the shadow
【数7】 の誤差εがポリゴン毎に異なることを意味する。(Equation 7) It means that the error ε of is different for each polygon.
【0055】このようなことから、z値を用いて影の生
成をおこなう方法は、地平線の表示を行う必要のあるフ
ライトシュミュレータなどの用途には適用が困難であ
る。For this reason, the method of generating a shadow using the z value is difficult to apply to a flight simulator or the like that needs to display the horizon.
【0056】図8にzバッファを用いた映像発生におけ
る、誤差Errmax による不具合例を図示する。図に示
すように模擬地表において模擬建造物8aの本来の影8
bの他に偽の影映像8cが表示されている。偽の影8c
が局所的でなく広い範囲に渡っていることが分かる。FIG. 8 illustrates a defect example due to the error Err max in the image generation using the z buffer. As shown in the figure, the original shadow 8 of the simulated building 8a on the simulated surface
In addition to b, a false shadow image 8c is displayed. Fake shadow 8c
It can be seen that is not local and covers a wide range.
【0057】[0057]
【発明が解決しようとする課題】本発明は、上記不都合
を解決するためになされたものであり、影の判定をz値
を用いずに行い、精度の高い影映像を得ることを目的と
する。SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned inconvenience, and an object of the present invention is to determine a shadow without using the z value and obtain a shadow image with high accuracy. .
【0058】また、小さなハードウェア構成で実時間影
映像の発生を行うことができる方法およびその装置を提
供することを目的とする。It is another object of the present invention to provide a method and apparatus capable of generating a real-time shadow image with a small hardware configuration.
【0059】さらに、赤外映像の発生に好都合な方法、
装置を提供することを目的とする。Furthermore, a convenient method for generating an infrared image,
It is intended to provide a device.
【0060】[0060]
【課題を解決するための手段】上記課題を解決するため
本発明は以下のように構成する。In order to solve the above problems, the present invention is configured as follows.
【0061】本発明に係る実時間映像発生方法は、仮定
する視点から見た模擬視界対象物を視点側スクリーンに
映像表示を行うものであって、映像表示の全エリア内に
存在する全ポリゴン毎に予めポリゴン番号を付与してお
き、光源から仮想的に見える視界の映像表示を行う光源
側スクリーンを仮想し、前記光源側スクリーンに仮想表
示している対象物を構成するポリゴンのポリゴン番号を
前記光源側スクリーンの各画素に対応してポリゴンメモ
リに格納し、視点側スクリーンにおける画素位置(p
e ,qe )を前記光源側スクリーンの画素位置(pl ,
ql )に変換し、前記変換により得られた光源側スクリ
ーン(座標)の画素位置(pl ,ql )をアドレスとし
て前記ポリゴンメモリに格納されるポリゴン番号Idl
を読出し、前記視点側スクリーンにおける画素位置(p
e ,qe )が表示するポリゴンの持つポリゴン番号Id
e と、前記ポリゴン番号Idl とを比較し、両者が等し
いときはポリゴン番号Ide を有する画素部分は影でな
いとし、両者が等しくないときにポリゴン番号Ide を
有する画素部分は影であるとして影映像を発生するもの
である。The real-time image generating method according to the present invention is for displaying an image of a simulated field of view object from a hypothesized viewpoint on the viewpoint side screen, and for each polygon existing in all areas of the image display. In advance, a polygon number is given to the light source side, and the light source side screen that virtually displays the field of view from the light source is virtualized, and the polygon number of the polygon forming the object virtually displayed on the light source side screen is It is stored in the polygon memory corresponding to each pixel on the light source side screen, and the pixel position (p
e , q e ) is the pixel position (p l ,
converted to q l), the pixel position (p l of the light source side screen obtained by the conversion (coordinate), a polygon number is stored q l) in the polygon memory as an address Id l
Is read out, and the pixel position (p
Polygon number Id of the polygon displayed by e , q e )
and e, comparing the polygon number Id l, pixel portions having a polygon number Id e when they are equal to the non-shadow, a pixel portion having a polygon number Id e when they are not equal is shadow It produces a shadow image.
【0062】本発明に係る実時間映像発生装置は、模擬
視界対象物の3次元情報を2次元のポリゴン情報に変換
するとともに幾何計算をする幾何計算部と、前記幾何計
算部からのポリゴンについて各画素の色計算をするレン
ダリングプロセッサとを備え、仮定する視点から見た模
擬視界対象物を視点側スクリーンに映像表示を行うもの
において、前記幾何計算部は予めポリゴン毎にポリゴン
番号を付与し、前記レンダリングプロセッサは、前記視
点から見える視界の映像表示をする視点側スクリーン上
の点を、光源から仮想的に見える視界の映像表示を行う
仮想した光源側スクリーン上のスクリーン位置に対応さ
せるテクスチャ生成回路と、前記光源側スクリーンに仮
想的に映像表示している対象物を構成するポリゴンのポ
リゴン番号Idl を前記光源側スクリーンの各画素に対
応して格納し、前記テクスチャ生成回路で対応させた光
源側スクリーン上のスクリーン位置をアドレスとしてポ
リゴン番号Idl を読出すポリゴンメモリと、前記ポリ
ゴンメモリから読出した光源側のポリゴン番号Idl
と、前記読出したポリゴンメモリのアドレスに対応する
視点側スクリーン上の点における視点側のポリゴン番号
Ide とを比較し、両者が等しいときはポリゴン番号I
de を有する画素部分は影でないとし、両者が等しくな
いときはポリゴン番号Ide を有する画素部分は影であ
ると判定するポリゴン番号判定部と、前記ポリゴン番号
判定部で影であると判定された視点側のポリゴン番号I
de を有する画素部分に影を付ける輝度変調部とからな
るものである。The real-time image generation apparatus according to the present invention converts the three-dimensional information of the simulated field of view object into the two-dimensional polygon information and performs the geometric calculation, and each of the polygons from the geometric calculation section. A rendering processor for calculating the color of pixels is provided, and in the image display of a simulated field of view object viewed from a hypothesized viewpoint on the screen on the viewpoint side, the geometric calculation unit assigns a polygon number to each polygon in advance, and The rendering processor is a texture generation circuit that associates a point on the viewpoint-side screen that displays an image of the field of view viewed from the viewpoint with a screen position on a virtual light-source-side screen that displays an image of the field of view that is virtually viewed from the light source; polygon number of polygons constituting the virtually objects displaying images on the light source side screen Id l And stored corresponding to each pixel of the light source side screen, and reading the polygon memory polygon number Id l screen position on the light source side screen that associates an address in the texture generating circuit, read from the polygon memory source Side polygon number Id l
If, compared with the polygon number Id e perspective side at a point on the viewpoint side screen corresponding to the address of the read out polygon memory, the polygon numbers when they are equal I
The pixel portion having d e is not a shadow, and when they are not equal, the pixel portion having a polygon number Id e is determined to be a shadow, and the polygon number determination unit determines that it is a shadow. Polygon number I on the viewpoint side
and a luminance modulation unit that casts a shadow on a pixel portion having d e .
【0063】また、上記テクスチャ生成回路は、視点か
ら見える視界の映像表示のためのテクスチャマッピング
計算と、前記視点から見える視界の映像表示をする視点
側スクリーン上の点を、光源から仮想的に見える視界の
映像表示を行う仮想した光源側スクリーン上のスクリー
ン位置に対応させるマッピング計算とを行うように構成
して、テクスチャマッピング計算と影計算のためのマッ
ピング計算とを共用させることができる。Further, the texture generation circuit makes a texture mapping calculation for displaying an image of the field of view seen from the viewpoint and a point on the viewpoint side screen for displaying the image of the field of view seen from the viewpoint virtually seen from the light source. The mapping calculation corresponding to the screen position on the virtual light source side screen that displays the image of the field of view is configured to be performed, and the texture mapping calculation and the mapping calculation for the shadow calculation can be shared.
【0064】[0064]
【作用】実時間映像発生方法においては次のように作用
する。映像表示の全エリア内に存在する全ポリゴン毎に
予めポリゴン番号を付与しておく。光源から仮想的に見
える視界の映像表示を行う光源側スクリーンを仮想し、
前記光源側スクリーンに仮想表示している対象物を構成
するポリゴンのポリゴン番号を前記光源側スクリーンの
各画素に対応してポリゴンメモリに格納する。視点側ス
クリーンにおける画素位置(pe ,qe )を前記光源側
スクリーンの画素位置(pl ,ql )に変換する。前記
変換により得られた光源側スクリーン(座標)の画素位
置(pl ,ql )をアドレスとして前記ポリゴンメモリ
に格納されるポリゴン番号Idl を読出す。前記視点側
スクリーンにおける画素位置(pe ,qe )が表示する
ポリゴンの持つポリゴン番号Ide と、前記読出したポ
リゴン番号Idl とを比較し、両者が等しいときはポリ
ゴン番号Ide を有する画素部分は影でないとし、両者
が等しくないときにポリゴン番号Ide を有する画素部
分は影であるとする。この判定に基づいて、影映像を発
生する。The operation of the real-time image generation method is as follows. A polygon number is given in advance to every polygon existing in all areas of the image display. Virtualize the screen on the light source side that displays the image of the field of vision virtually seen from the light source,
A polygon number of a polygon forming an object virtually displayed on the light source side screen is stored in a polygon memory corresponding to each pixel of the light source side screen. Pixel position in perspective side screen (p e, q e) pixel positions of the light source side screen (p l, q l) into a. The polygon number Id l stored in the polygon memory is read using the pixel position (p l , q l ) of the light source side screen (coordinates) obtained by the conversion as an address. The pixel position in the view point side screen (p e, q e) pixel having a polygon number Id e with the polygons are displayed, the comparison between the read polygon number Id l, polygon numbers Id e when they are equal moiety is not a shadow, a pixel portion having a polygon number Id e when they are not equal is shadow. A shadow image is generated based on this determination.
【0065】本発明に係る実時間映像発生装置は、次の
ように作用する。幾何計算部は模擬視界対象物の3次元
情報を2次元のポリゴン情報に変換するとともに幾何計
算をする。このとき、各ポリゴンには予めポリゴン番号
を付与しておく。レンダリングプロセッサは、前記幾何
計算部からのポリゴンについて各画素の色計算をする。
さらに、レンダリングプロセッサのテクスチャ生成回路
は光源から仮想的に見える視界の映像表示のためのテク
スチャマッピング計算を行う。その時ポリゴン番号を、
テクスチャパターンメモリの一部であるポリゴンメモリ
に書き込む。ついで、視点から見える視界の映像表示の
ためのテクスチャマッピング計算を行う。この時、視点
から見える視界の映像表示をする視点側スクリーン上の
点を、光源から仮想的に見える視界の映像表示を行う仮
想した光源側スクリーン上のスクリーン位置に対応させ
るマッピング計算を行う。ポリゴンメモリでは、このマ
ッピング計算で得られた光源側スクリーン上位置をアド
レスとして、その位置に対応するポリゴン番号Idl が
読出される。ポリゴン番号判定部は、前記ポリゴンメモ
リから読出した光源側のポリゴン番号Idl と、前記読
出したポリゴンメモリのアドレスに対応する視点側スク
リーン上の点における視点側のポリゴン番号Ide とを
比較する。両者が等しくないときは、視点側のポリゴン
番号Ide を有する画素部分は、光源側から見えるポリ
ゴンすなわち光源に照らされるものとは異なっているか
ら、影であるとする。両者が等しいときは、視点側のポ
リゴン番号Ide を有する画素部分は、光源から見える
ポリゴンすなわち光源に照らされるものと同一であるか
ら、影でないと判定する。輝度変調部は、テクスチャ生
成回路で得られた視点側映像について、ポリゴン番号判
定部の判定に基づいて、前記ポリゴン番号判定部で影で
あると判定された視点側のポリゴン番号有する画素部分
に影を付ける。The real-time image generator according to the present invention operates as follows. The geometric calculation unit converts the three-dimensional information of the simulated field of view object into two-dimensional polygon information and performs geometric calculation. At this time, each polygon is given a polygon number in advance. The rendering processor calculates the color of each pixel of the polygon from the geometric calculation unit.
Further, the texture generation circuit of the rendering processor performs a texture mapping calculation for displaying an image of a field of view virtually viewed from the light source. At that time, the polygon number,
Write to polygon memory which is a part of texture pattern memory. Then, texture mapping calculation is performed for displaying the visual field of view from the viewpoint. At this time, mapping calculation is performed so that a point on the viewpoint side screen that displays the image of the field of view viewed from the viewpoint corresponds to a screen position on the virtual light source side screen that displays the image of the field of view virtually viewed from the light source. In the polygon memory, the position on the light source side screen obtained by this mapping calculation is used as an address, and the polygon number Id 1 corresponding to the position is read. Polygon number determination unit compares the polygon number Id l of the read light source side from the polygon memory and a polygon number Id e perspective side at a point on the viewpoint side screen corresponding to the address of the read out polygon memory. If they are not equal, the pixel portion having a polygon number Id e viewpoint side, because different from that illuminated the polygon i.e. light visible from the light source side, and a shadow. When they are equal, the pixel portion having a polygon number Id e viewpoint side are the same as the those illuminated polygon i.e. light visible from the light source is determined not to be shadow. The brightness modulation unit shadows the viewpoint side image obtained by the texture generation circuit on the pixel portion having the viewpoint side polygon number determined to be a shadow by the polygon number determination unit based on the determination by the polygon number determination unit. Attach.
【0066】[0066]
【実施例】本発明は、従来z-1を用いていた代わりとし
て、ゲーミンク゛エリアに対してユニークな識別子であ
るポリゴン番号(ゲーミンク゛エリアを構成する全ポリ
ゴンにユニークに付けられた番号)をモデルに付与し、
この番号を比較の対象とすることにより、精度による問
題を解決することができる。修正した影計算のアルゴリ
ズムを以下に示す。EXAMPLE The present invention uses a polygon number (a number uniquely assigned to all polygons forming a gaming area), which is a unique identifier for the gaming area, as a model instead of using z -1 in the past. Grant,
By using this number as a comparison target, the problem due to accuracy can be solved. The modified shadow calculation algorithm is shown below.
【0067】[0067]
【数8】 (Equation 8)
【0068】ただし、However,
【0069】Idl :光源を視点として映像表示したと
き、スクリーンに対応するメモリ(ポリゴン格納用に設
けたポリゴンメモリPolygonM)に格納される画
素毎のポリゴン番号。Id l : The polygon number for each pixel stored in the memory (polygon memory PolygonM provided for storing polygons) corresponding to the screen when an image is displayed with the light source as the viewpoint.
【0070】Ide :視点側で影付の対象となるピクセ
ル位置画素位置(pe ,qe )が持つポリゴン番号。[0070] Id e: subject to pixel position pixel positions with shadow perspective side (p e, q e) polygon numbers with the.
【0071】以下本発明の実施例を図により説明する。
図1は、影映像生成の方法を説明するため処理の流れを
示すフロー図である。影映像の計算は、(a)光源を視
点としてポリゴン番号を生成、(b)正規の視点を用い
て映像計算、に大別される。さらに(b)は次の計算に
細分される。Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a flowchart showing the flow of processing for explaining the method of generating a shadow image. The calculation of the shadow image is roughly divided into (a) generating a polygon number from the viewpoint of the light source and (b) calculating the image using the normal viewpoint. Further, (b) is subdivided into the following calculations.
【0072】(1)視点におけるスクリーン座標系の点
Oe (pe o,qe o,1)を該当する光源のスクリーン位
置Ol (pl o,ql o,1)に対応させるマッピング計
算、(図1の(1)および、上述のアルゴリズムで説明
した式中の(5−1)から(5−3)に相当する)(1) Mapping for mapping the point O e (p e o , q e o , 1) on the screen coordinate system at the viewpoint to the screen position O l (p l o , q l o , 1) of the corresponding light source. Calculation, (corresponding to (5-1) in FIG. 1 and (5-1) to (5-3) in the formula described in the above algorithm)
【0073】および(2)そのスクリーン位置(pl o,
ql o,1)のpl o,ql oをポリゴン番号格納のメモリア
ドレスとしてポリゴン番号Idl の検索、(図1の
(2)および、上述のアルゴリズムで説明した式中の
(5−4)に相当する)And (2) its screen position (p l o ,
q l o, 1) p l o, Find polygon numbers Id l a q l o as the memory address of the polygon number storage, ((2 in Figure 1) and, in the formula described in the above-described algorithm (5- 4))
【0074】さらに(3)このポリゴン番号Idl とO
e におけるポリゴン番号Ide との比較による影の判
定、(図1の(3)および、上述のアルゴリズムで説明
した式中の(5−5),(5−6)に相当する)(3) The polygon numbers Id l and O
determination of the shadow by comparison with the polygon number Id e in e, (the (3) and FIG. 1, in the formula described in the above-described algorithm (5-5), corresponding to (5-6))
【0075】最後に、(4)影を付けるための画素(p
e ,qe )における画素値の輝度変調に分れる(図1の
(4)に相当する)。Finally, (4) the pixel (p
e , q e ) can be divided into luminance modulation of pixel values (corresponding to (4) in FIG. 1).
【0076】処理の大きな部分は、視点における点Oe
を、対応する光源における点Ol に変換するマッピング
計算である。The major part of the processing is the point O e in the viewpoint.
Is a mapping calculation that transforms to a point O l at the corresponding light source.
【0077】この影計算のためのマッピング計算(f
1 ,f2 ,f3 )のハードウェア化に向いた式を求める
と式(6)および(7)となる。式(7)のMapping calculation (f
Equations (6) and (7) are obtained by obtaining equations suitable for hardware implementation of ( 1 , f 2 , f 3 ). Of equation (7)
【外9】 の成分(pl ,ql )が、視点側スクリーン上の画素位
置(pe ,qe )に対応するポリゴンメモリのメモリア
ドレスを与える。[Outside 9] Component (p l , q l ) gives the memory address of the polygon memory corresponding to the pixel position (p e , q e ) on the viewpoint side screen.
【0078】[0078]
【数9】 [Equation 9]
【0079】[0079]
【数10】 (Equation 10)
【0080】ただし、However,
【0081】[0081]
【外10】 [Outside 10]
【0082】Teye :ワールド座標系における視点の3
行3列の姿勢マトリクス。変換方向は、ワールド座標系
から視点座標系。T eye : 3 of viewpoints in the world coordinate system
Posture matrix with 3 rows. The conversion direction is from the world coordinate system to the viewpoint coordinate system.
【0083】[0083]
【外11】 [Outside 11]
【0084】Tlight :ワールド座標系における点光源
の3行3列の姿勢マトリクス。変換方向は、ワールド座
標系から光源座標系。T light : 3 × 3 posture matrix of the point light source in the world coordinate system. The conversion direction is from the world coordinate system to the light source coordinate system.
【0085】[0085]
【外12】 [Outside 12]
【0086】[0086]
【外13】 [Outside 13]
【0087】[0087]
【外14】 [Outside 14]
【0088】[0088]
【外15】 [Outside 15]
【0089】[0089]
【外16】 [Outside 16]
【0090】ここでいう、ハードウェア化に向いた計算
とは、(1)計算量が少なく、(2)パイプライン化が
容易(すなわち、計算に規則性がある)であることを意
味している。また、式(6),(7)中で、per p
ixelとは画素毎の計算を示し、per frame
はフレーム毎計算を示す。Here, the calculation suitable for hardware means that (1) the calculation amount is small, and (2) the pipeline is easy (that is, the calculation has regularity). There is. Also, in equations (6) and (7), per p
"ixel" indicates the calculation for each pixel, and the per frame
Indicates calculation for each frame.
【0091】実時間で影の生成をおこなうための、1画
素当りの計算時間の程度は、1024×1024がその
分解能を持つスクリーンにおいて、オーバライト比を4
(半透明の表示を4重)としたとき、1/30×1/4×1/102
4×1/1024 ≒8nsである。これは、SRAMのアクセ
ス時間15nsよりも短い時間である。従って、処理は
並列化又はパイプライン化しなければならず、回路規模
の増大を伴う。The degree of calculation time per pixel for generating a shadow in real time is 1024 × 1024, and the overwrite ratio is 4 in a screen having the resolution.
1/30 × 1/4 × 1/102 when (translucent display is quadruple)
4 × 1/1024 ≈8 ns. This is a time shorter than the SRAM access time of 15 ns. Therefore, the processing must be parallelized or pipelined, and the circuit scale increases.
【0092】ここでは、影計算とテクスチャマッピング
計算の類似性を用いることにより、ハードウェアの大き
な増加を伴わずに影計算を行う手段を示す。Here, by using the similarity between the shadow calculation and the texture mapping calculation, means for performing the shadow calculation without a large increase in hardware will be described.
【0093】先に計算量を回路の規模で比較する。テク
スチャマッピングの計算(式(1))をパイプライン化
して行う回路は汎用のLSIを用いて構成するとスカラ
ーの計算First, the calculation amounts will be compared according to the circuit scale. A pipeline calculation circuit (formula (1)) for texture mapping is a scalar calculation if it is configured using a general-purpose LSI.
【0094】[0094]
【数11】式(8) AX+BY+CZ+D[Equation 11] Equation (8) AX + BY + CZ + D
【0095】にVME12Uサイズの基板(約40cm×30
cm)で約0.5枚を占める規模である。テクスチャマッ
ピング計算には2回のスカラー計算が必要であり、並列
に計算するためには、上に述べた基板サイズで約1枚が
必要となる計算量である。また、影計算には、3回のス
カラー計算が必要であり、同様の条件で約1.5枚が必
要となる。独立に計算を行えば、回路規模の増大を伴い
好ましいものではない。影映像の実時間生成が一般的に
ならない理由である。Substrate of VME12U size (approximately 40 cm x 30
cm) occupies about 0.5 sheets. The texture mapping calculation requires two scalar calculations, and in order to perform parallel calculation, the above-mentioned substrate size requires about one sheet, which is a calculation amount. Also, the shadow calculation requires three scalar calculations, and about 1.5 sheets are required under the same conditions. Independent calculation is not preferable because the circuit scale increases. That is why real-time generation of shadow images is not common.
【0096】次に示す対応をとれば、テクスチャマッピ
ングの計算(式(1))と影計算で用いる計算(式
(9))の間には類似性がある。If the following correspondence is taken, there is similarity between the calculation of texture mapping (formula (1)) and the calculation used in shadow calculation (formula (9)).
【0097】[0097]
【数12】 (Equation 12)
【0098】[0098]
【外17】 と[Outside 17] When
【数13】 、Tと(Equation 13) , T and
【数14】 を対応させて2つのパラメータとみなす。このパラメー
タは幾何計算部(GP)においてフレーム毎に計算し、
処理ポリゴンに固有のパラメータとして、レンダリング
プロセッサ(RP)に与える。このことにより、テクス
チャ生成回路をテクスチャマッピング計算と影計算のた
めのマッピングとで共用することができる。[Equation 14] Are regarded as two parameters in correspondence with each other. This parameter is calculated for each frame in the geometric calculation unit (GP),
It is given to the rendering processor (RP) as a parameter unique to the processing polygon. As a result, the texture generation circuit can be shared by the texture mapping calculation and the mapping for shadow calculation.
【0099】図2は、本発明に用いるテクスチャ生成回
路の機能ブロック図であり、このテクスチャ生成回路は
従来技術として説明した図3のテクスチャ生成回路32
3に相当するものであり、これに接続する前段後段の回
路も図3と同様のものである。テクスチャ生成回路は、
図3において説明したレンダリングプロセッサ32の一
部を構成し、レンダリングプロセッサ32は幾何計算部
32およびCRT33に接続する。図2において、21
はインプットレジスタ、22はレジスタファイル、23
はアドレス計算部、231はx成分計算部、232はy
成分計算部、233はz成分計算部、234はアドレス
出力部、24はポリゴンメモリ付きテクスチャメモリ、
241はポリゴンメモリ、25はポリゴン番号判定部と
して機能する比較器、26は遅延器である。FIG. 2 is a functional block diagram of a texture generation circuit used in the present invention. This texture generation circuit is the texture generation circuit 32 shown in FIG.
3 and the circuit of the former stage and the latter stage connected thereto is the same as that of FIG. The texture generation circuit
It constitutes a part of the rendering processor 32 described in FIG. 3, and the rendering processor 32 is connected to the geometric calculation unit 32 and the CRT 33. In FIG. 2, 21
Is an input register, 22 is a register file, 23
Is an address calculator, 231 is an x component calculator, 232 is y
A component calculation unit, 233 is a z component calculation unit, 234 is an address output unit, 24 is a texture memory with a polygon memory,
Reference numeral 241 is a polygon memory, 25 is a comparator functioning as a polygon number determination unit, and 26 is a delay device.
【0100】テクスチャ生成回路は、光源を視点とする
映像を得るためテクスチャマッピング計算を従来のテク
スチャマッピング計算と同様に行う。すなわち、図示し
ない幾何計算部(従来の技術として説明した図3の幾何
計算部31と同様のものが用いられる。)からパラメー
タとしてt11,t12,…t32,t33,tx ,ty ,t
z ,画素情報X,Y,Z-1をインプットレジスタ21と
レジスタファイル22に格納する。タグ情報(Tag)
がテクスチャマッピング計算であることから、このパラ
メータは、模擬視界対象物の3次元情報が2次元のポリ
ゴン情報に変換されテクスチャをポリゴンに貼る姿勢お
よび画素情報X,Y,Z-1としてテキスチャ計算の対象
画素(pl,ql,1)の位置ベクトルを示す。アドレス
計算部23においてこれらのパラメータによりテクスチ
ャメモリ24のアドレスを計算する。このアドレス計算
は、光源を視点として、前記した式(1)を適用して行
う。このとき、パラメータt11,t12,…t32,t33は
式(1)のTに対応し、パラメータtx ,ty ,tz はThe texture generation circuit performs the texture mapping calculation in the same manner as the conventional texture mapping calculation in order to obtain the image with the light source as the viewpoint. That is, from a geometric calculation unit (not shown) (the same as the geometric calculation unit 31 of FIG. 3 described as a conventional technique is used) as parameters t 11 , t 12 , ... T 32 , t 33 , t x , t. y , t
z , pixel information X, Y, Z −1 are stored in the input register 21 and the register file 22. Tag information (Tag)
Is the texture mapping calculation, this parameter is used for the texture calculation as the posture and the pixel information X, Y, Z −1 in which the three-dimensional information of the simulated visual field object is converted into the two-dimensional polygon information and the texture is attached to the polygon. The position vector of the target pixel (p 1 , q l , 1) is shown. The address calculator 23 calculates the address of the texture memory 24 using these parameters. This address calculation is performed by applying the above equation (1) from the viewpoint of the light source. At this time, the parameters t 11 , t 12 , ... T 32 , t 33 correspond to T in the equation (1), and the parameters t x , t y , t z are
【外18】 に対応する。これらのパラメータを用いて、x成分計算
部233は、[Outside 18] Corresponding to. Using these parameters, the x component calculation unit 233
【0101】[0101]
【数15】 によりテクスチャメモリ24のx成分を計算する。y成
分計算部234は、(Equation 15) The x component of the texture memory 24 is calculated by The y component calculation unit 234
【0102】[0102]
【数16】 によりy成分を計算する。また、z成分計算部235
は、(Equation 16) The y component is calculated by Also, the z component calculation unit 235
Is
【数17】 [Equation 17]
【0103】を計算する。アドレス出力部234は、前
段の計算結果を、Calculate The address output unit 234 uses the calculation result of the previous stage as
【数18】 (Equation 18)
【0104】に代入して、テクスチャメモリ24および
ポリゴンメモリ241のアドレスのx,y成分としてm
x ,my を得る。このポリゴンメモリ241のアドレス
に対して図示しない幾何計算部から対象画素(pl,
ql,1)についてのポリゴン番号Idl を書き込む。By substituting into m as the x and y components of the addresses of the texture memory 24 and the polygon memory 241.
Get x and m y . For the address of this polygon memory 241, the target pixel (p l ,
Write the polygon number Id l for q l , 1).
【0105】次に、テクスチャ生成回路は、正規の視点
を用いて映像を得るためテクスチャマッピング計算を従
来のテクスチャマッピング計算と同様に行う。すなわ
ち、図示しない幾何計算部からパラメータとしてt11,
t12,…t32,t33,tx ,ty ,tz ,画素情報X,
Y,Z-1をインプットレジスタ21とレジスタファイル
22に格納する。タグ情報(Tag)がテクスチャマッ
ピング計算であることから、このパラメータは、模擬視
界対象物の3次元情報が2次元のポリゴン情報に変換さ
れテクスチャをポリゴンに貼る姿勢および画素情報X,
Y,Z-1としてテキスチャ計算の対象画素(pe,qe,
1)の位置ベクトルを示す。さらに、当該対象画素の位
置(pe,qe)のポリゴンを識別するポリゴン番号Id
e を図示しない幾何計算部から入力し、レジスタファイ
ル22に格納する。アドレス計算部23においてこれら
のパラメータによりテクスチャメモリ24のアドレスを
計算する。このアドレス計算は、視点を正規の視点位置
にして、前記した式(1)を適用して行う。このとき、
パラメータt11,t12,…t32,t33は式(1)のTに
対応し、パラメータtx ,ty ,tz はNext, the texture generation circuit performs the texture mapping calculation in the same manner as the conventional texture mapping calculation in order to obtain the image using the regular viewpoint. That is, a geometric calculation unit (not shown) sets t 11 ,
t 12 , ... t 32 , t 33 , t x , t y , t z , pixel information X,
The Y and Z −1 are stored in the input register 21 and the register file 22. Since the tag information (Tag) is the texture mapping calculation, this parameter is the posture and the pixel information X where the three-dimensional information of the simulated field of view object is converted into the two-dimensional polygon information and the texture is attached to the polygon.
Target pixels (p e , q e ,) of texture calculation as Y and Z −1
The position vector of 1) is shown. Furthermore, the position of the target pixel (p e, q e) the polygon number Id identifies the polygon
e is input from a geometric calculation unit (not shown) and stored in the register file 22. The address calculator 23 calculates the address of the texture memory 24 using these parameters. This address calculation is performed by applying the above-mentioned equation (1) with the viewpoint set to the normal viewpoint position. At this time,
The parameters t 11 , t 12 , ... t 32 , t 33 correspond to T in the equation (1), and the parameters t x , t y , t z are
【外19】 に対応する。これらのパラメータを用いて、x成分計算
部233は、式(10)によりテクスチャメモリ24の
x成分を計算する。y成分計算部234は、式(11)
によりy成分を計算する。また、z成分計算部235
は、式(12)によりz成分を計算する。アドレス出力
部234は、前段の計算結果を、式(13)に代入し
て、テクスチャメモリ24のアドレスのx,y成分とし
てmx ,my を得る。このアドレスからテクスチャパタ
ーンの内容を読出して、この色を対象画素(pe,qe)
の色としてこの画素位置(pe,qe)をアドレスとして
図示しない輝度変調部(従来の技術として説明した図3
の輝度変調部325と同様のものが用いられる。)のフ
レームメモリに書き込む。[Outside 19] Corresponding to. Using these parameters, the x-component calculator 233 calculates the x-component of the texture memory 24 by the equation (10). The y component calculation unit 234 uses the equation (11).
The y component is calculated by Also, the z component calculation unit 235
Calculates the z component according to equation (12). The address output unit 234 substitutes the calculation result of the previous stage into Expression (13) to obtain m x and m y as the x and y components of the address of the texture memory 24. This address reads the contents of the texture pattern, the target pixel this color (p e, q e)
The pixel position of the color (p e, q e) 3 for explaining the luminance modulation portion (not shown) as an address (as the prior art
The same one as the luminance modulator 325 of is used. ) Write to the frame memory.
【0106】さらに、続いてタグ情報(Tag)が影計
算となり、これを受けてテクスチャ生成回路は、正規の
視点から見た画素位置(pe,qe)を光源から見た画素
位置(pl,ql)に変換する。このためのアルゴリズム
は、前述した式(5−1),(5−2),(5−3)に
より与えられる。そして、前述したように、テクスチャ
マッピング計算と影計算とで、テクスチャ生成回路を共
用することができる。すなわち、図示しない幾何計算部
からパラメータとしてt11,t12,…t32,t33,t
x ,ty ,tz ,画素情報X,Y,Z-1をインプットレ
ジスタ21とレジスタファイル22に格納する。タグ情
報(Tag)が影計算であることから、このパラメータ
は、視点のスクリーン座標から光源のスクリーン座標へ
のマッピングのためのもの、および画素情報X,Y,Z
-1として対象画素(pe,qe,1)の位置ベクトルを示
す。さらに、当該対象画素の位置(pe,qe)のポリゴ
ンを識別するポリゴン番号Ide を図示しない幾何計算
部から入力し、レジスタファイル22に格納する。アド
レス計算部23においてこれらのパラメータにより対応
する光源のスクリーン座標の位置(pl,ql)を計算す
る。この位置(pl ,ql )はポリゴンメモリ241の
アドレスとなる。このアドレス計算は、視点を正規の視
点位置にして、前記した式(1)を適用して行う。この
とき、パラメータt11,t12,…t32,t33は式(1)
のTに対応し、パラメータtx ,ty ,tz はFurther, subsequently, the tag information (Tag) becomes shadow calculation, and in response to this, the texture generating circuit receives the pixel position (p e , q e ) viewed from the normal viewpoint as the pixel position (p e viewed from the light source). l , q l ). The algorithm for this is given by the above-mentioned equations (5-1), (5-2), (5-3). Then, as described above, the texture generation circuit can be shared by the texture mapping calculation and the shadow calculation. That is, a geometric calculation unit (not shown) uses parameters t 11 , t 12 , ... T 32 , t 33 , t as parameters.
The x , t y , t z and pixel information X, Y, Z −1 are stored in the input register 21 and the register file 22. Since the tag information (Tag) is a shadow calculation, this parameter is for mapping from the screen coordinates of the viewpoint to the screen coordinates of the light source, and the pixel information X, Y, Z.
Target pixels as -1 (p e, q e, 1) indicating the position vector. Further, input from the position of the target pixel (p e, q e) the geometric calculation section (not shown) polygon number Id e identifying the polygons, are stored in the register file 22. The address calculator 23 calculates the position (p l , q l ) of the screen coordinate of the corresponding light source using these parameters. This position (p l , q l ) becomes the address of the polygon memory 241. This address calculation is performed by applying the above-mentioned equation (1) with the viewpoint set to the normal viewpoint position. At this time, the parameters t 11 , t 12 , ... T 32 , t 33 are expressed by the formula (1).
Corresponding to T, and the parameters t x , t y , and t z are
【外20】 に対応する。これらのパラメータを用いて、x成分計算
部233は、式(10)によりx成分を計算する。y成
分計算部234は、式(11)によりy成分を計算す
る。また、z成分計算部235は、式(12)によりz
成分を計算する。アドレス出力部234は、前段の計算
結果を、式(13)に代入して、ポリゴンメモリ241
のアドレスのx,y成分としてmx ,my を得る。この
アドレスから視点のスクリーン座標に対応する光源のス
クリーン座標のポリゴン番号Idl を読出す。[Outside 20] Corresponding to. Using these parameters, the x component calculation unit 233 calculates the x component according to the equation (10). The y-component calculator 234 calculates the y-component according to equation (11). In addition, the z component calculation unit 235 calculates z by the equation (12).
Calculate the ingredients. The address output unit 234 substitutes the calculation result of the previous stage into the equation (13) to generate the polygon memory 241.
M x and m y are obtained as the x and y components of the address. It reads the polygon number Id l of screen coordinates of light sources corresponding to the screen coordinates of the viewpoint from this address.
【0107】比較器25は読出されたポリゴン番号Id
l と、レジスタファイル22から得た当該画素位置
(p,q)の前記ポリゴン番号Ide と比較する。比較
の結果、両者が等しくないときは、視点側のポリゴン番
号Ide を有する画素部分は、光源側から見えるポリゴ
ンすなわち光源に照らされるものとは異なっているか
ら、影であるとする。両者が等しいときは、視点側のポ
リゴン番号Ide を有する画素部分は、光源から見える
ポリゴンすなわち光源に照らされるものと同一であるか
ら、影でないと判定する。The comparator 25 outputs the read polygon number Id.
and l, compared with the polygon number Id e of the pixel position obtained from the register file 22 (p, q). As a result of the comparison, when both are not equal, the pixel portion having a polygon number Id e viewpoint side, because different from that illuminated the polygon i.e. light visible from the light source side, and a shadow. When they are equal, the pixel portion having a polygon number Id e viewpoint side are the same as the those illuminated polygon i.e. light visible from the light source is determined not to be shadow.
【0108】図示しない輝度変調部は、テクスチャ生成
回路で得られ書き込んでおいた視点側映像を読出し、ポ
リゴン番号判定部としての比較器25の判定に基づい
て、前記ポリゴン番号判定部で影であると判定された視
点側のポリゴン番号有する画素部分に影を付けるように
信号処理し、さらにDA変換して出力する。図示しない
CRTではこの信号を映像として表示する。図9に本発
明の実施により表示される映像例を図示する。The brightness modulation section (not shown) reads the viewpoint side image obtained and written by the texture generation circuit, and shadows the polygon number judging section based on the judgment of the comparator 25 as the polygon number judging section. Signal processing is performed so that a pixel portion having the polygon number on the viewpoint side determined to be shaded is shaded, and further DA converted and output. A CRT (not shown) displays this signal as an image. FIG. 9 shows an example of an image displayed by implementing the present invention.
【0109】以上の説明では、可視光線による影を付け
ることにより、影を灰色を加えることを前提としていた
が、以上のように影を正確に模擬することができるか
ら、可視光線に限らず、例えば赤外線による映像加工を
することができ、赤外映像の発生が可能となる。In the above description, it was premised that a shade of visible light was added to add a gray shade to the shade. However, since the shade can be accurately simulated as described above, it is not limited to visible rays. For example, an infrared image can be processed, and an infrared image can be generated.
【0110】[0110]
【発明の効果】以上のように、この発明によれば、影の
判定をZ値を用いずに行っているので、Z値による誤差
による影になったりならなかったりする問題が発生せ
ず、ポリゴン番号を比較するだけで影であるかないかを
判断するので、精度の高い影映像を得ることができる。As described above, according to the present invention, since the shadow is determined without using the Z value, there is no problem that the shadow is caused by an error due to the Z value. Since it is determined whether or not it is a shadow only by comparing polygon numbers, it is possible to obtain a highly accurate shadow image.
【0111】また、実時間の影計算をテクスチャマッピ
ング計算と共用することを可能としているため、小さな
ハードウェア構成で、実時間影映像の発生が行うことが
できる。Since the real-time shadow calculation can be shared with the texture mapping calculation, the real-time shadow image can be generated with a small hardware configuration.
【0112】さらに、影を正しく模擬可能であるから、
赤外映像の発生が可能である。Furthermore, since the shadow can be correctly simulated,
Infrared images can be generated.
【図1】本発明の一実施例の方法の流れを示すフロー図
である。FIG. 1 is a flow chart showing a flow of a method according to an embodiment of the present invention.
【図2】本発明に用いるテクスチャ生成回路の機能ブロ
ック図の一例である。FIG. 2 is an example of a functional block diagram of a texture generation circuit used in the present invention.
【図3】従来の実時間コンピュータグラフィックスのハ
ードウェア構成を示す。FIG. 3 shows a hardware configuration of conventional real-time computer graphics.
【図4】テクスチャマッピング計算の原理を示す図であ
る。FIG. 4 is a diagram showing the principle of texture mapping calculation.
【図5】光源と視点との関係を示した図である。FIG. 5 is a diagram showing a relationship between a light source and a viewpoint.
【図6】視点側の画素中心と対応する光源側画素中心の
ずれを説明する図である。FIG. 6 is a diagram for explaining a deviation of a light source side pixel center corresponding to a viewpoint side pixel center.
【図7】補間計算に用いるパラメータとスクリーンとの
関係を示す図である。FIG. 7 is a diagram showing a relationship between parameters used for interpolation calculation and a screen.
【図8】従来の方法による映像の不具合例を示す図であ
る。FIG. 8 is a diagram showing an example of a defect of an image by a conventional method.
【図9】本発明の実施により表示される映像例を示す図
である。FIG. 9 is a diagram showing an example of an image displayed by implementing the present invention.
【符号の説明】 21…インプットレジスタ、22…レジスタファイル、
23…アドレス計算部、231…x成分計算部、232
…y成分計算部、233…z成分計算部、234…アド
レス出力部、24…ポリゴンメモリ付きテクスチャメモ
リ、241…ポリゴンメモリ、25…比較器(ポリゴン
番号判定部)、26…遅延器、31…幾何計算部、32
…レンダリングプロセッサ、321…ラスタライザ、3
22…スパン計算部、323…テクスチャ生成回路、3
24…ピクセル計算部、325…輝度変調部、3251
…フレームメモリ、33…CRT。[Explanation of Codes] 21 ... Input Register, 22 ... Register File,
23 ... Address calculator, 231, ... x component calculator, 232
... y component calculation unit, 233 ... z component calculation unit, 234 ... address output unit, 24 ... texture memory with polygon memory, 241 ... polygon memory, 25 ... comparator (polygon number determination unit), 26 ... delay device, 31 ... Geometric calculator, 32
... Rendering processor, 321 ... Rasterizer, 3
22 ... Span calculator, 323 ... Texture generation circuit, 3
24 ... Pixel calculator, 325 ... Luminance modulator, 3251
… Frame memory, 33… CRT.
Claims (3)
視点側スクリーンに映像表示を行う実時間映像発生方法
において、 映像表示の全エリア内に存在する全ポリゴン毎に予めポ
リゴン番号を付与しておき、 光源から仮想的に見える視界の映像表示を行う光源側ス
クリーンを仮想し、 前記光源側スクリーンに仮想表示している対象物を構成
するポリゴンのポリゴン番号を前記光源側スクリーンの
各画素に対応してポリゴンメモリに格納し、視点側スク
リーンにおける画素位置(pe ,qe )を前記光源側ス
クリーンの画素位置(pl ,ql )に変換し、 前記変換により得られた光源側スクリーン(座標)の画
素位置(pl ,ql )をアドレスとして前記ポリゴンメ
モリに格納されるポリゴン番号Idl を読出し、前記視
点側スクリーンにおける画素位置(pe ,qe )が表示
するポリゴンの持つポリゴン番号Ide と、前記ポリゴ
ン番号Idl とを比較し、両者が等しいときはポリゴン
番号Ide を有する画素部分は影でないとし、両者が等
しくないときにポリゴン番号Ide を有する画素部分は
影であるとして影映像を発生する実時間映像発生の方
法。1. A real-time image generation method for displaying an image of a simulated field of view from a hypothesized viewpoint on a screen on the viewpoint side, in which polygon numbers are assigned in advance to all polygons existing in all areas of the image display. The light source side screen that virtually displays the visual field from the light source is virtualized, and the polygon number of the polygon that constitutes the object virtually displayed on the light source side screen is assigned to each pixel of the light source side screen. stored in the polygon memory corresponding pixel position in the view point side screen (p e, q e) is converted the pixel position of the light source side screen (p l, q l), the light source side screen obtained by the conversion The polygon number Id l stored in the polygon memory is read by using the pixel position (p l , q l ) of (coordinates) as an address, and the polygon number Id l is read on the viewpoint side screen. A polygon number Id e to the pixel position (p e, q e) has a polygon to be displayed that, comparing the polygon number Id l, pixel portions having a polygon number Id e when they are equal to the non-shadow, the method of real-time image generation pixel portion having a polygon number Id e when they are not equal, for generating a shadow image as a shadow.
ポリゴン情報に変換するとともに幾何計算をする幾何計
算部と、前記幾何計算部からのポリゴンについて各画素
の色計算をするレンダリングプロセッサとを備え、仮定
する視点から見た模擬視界対象物を視点側スクリーンに
映像表示を行う実時間映像発生装置において、 前記幾何計算部は予めポリゴン毎にポリゴン番号を付与
し、 前記レンダリングプロセッサは、 前記視点から見える視界の映像表示をする視点側スクリ
ーン上の点を、光源から仮想的に見える視界の映像表示
を行う仮想した光源側スクリーン上のスクリーン位置に
対応させるテクスチャ生成回路と、 前記光源側スクリーンに仮想的に映像表示している対象
物を構成するポリゴンのポリゴン番号Idl を前記光源
側スクリーンの各画素に対応して格納し、前記テクスチ
ャ生成回路で対応させた光源側スクリーン上のスクリー
ン位置をアドレスとしてポリゴン番号Idl を読出すポ
リゴンメモリと、 前記ポリゴンメモリから読出した光源側のポリゴン番号
Idl と、前記読出したポリゴンメモリのアドレスに対
応する視点側スクリーン上の点における視点側のポリゴ
ン番号Ide とを比較し、両者が等しいときは視点側の
ポリゴン番号Ide を有する画素部分は影でないとし、
両者が等しくないときは視点側のポリゴン番号Ide を
有する画素部分は影であると判定するポリゴン番号判定
部と、 前記ポリゴン番号判定部で影であると判定された視点側
のポリゴン番号Ideを有する画素部分に影を付ける輝
度変調部とからなることを特徴する実時間映像発生装
置。2. A geometric calculation section for converting three-dimensional information of a simulated field of view object into two-dimensional polygon information and geometric calculation, and a rendering processor for performing color calculation of each pixel of the polygon from the geometric calculation section. In the real-time image generation device for displaying a simulated field of view object viewed from a hypothesized viewpoint on the viewpoint side screen, the geometric calculation unit assigns a polygon number to each polygon in advance, and the rendering processor includes: A texture generation circuit that associates a point on the viewpoint-side screen that displays the image of the field of view seen from the viewpoint with a screen position on the virtual light-source-side screen that displays the image of the field of view that is virtually viewed from the light source; The polygon number Id l of the polygon forming the object virtually displayed on the screen is displayed on the light source side screen. A polygon memory for storing the polygon number Id l corresponding to each pixel of the screen and reading the polygon number Id 1 with the screen position on the light source side screen corresponding to the texture generation circuit as an address; pixel having a polygon number Id l, wherein comparing the polygon number Id e perspective side at a point on the viewpoint side screen corresponding to the read out polygon memory addresses, polygon numbers Id e when they are equal the perspective side The part is not a shadow,
And determining the polygon number checker and pixel portion is a shadow having a polygon number Id e perspective side when they are not equal, the polygon number of the polygon number checker is determined to be shadow viewpoint side Id e A real-time image generation device, comprising:
ポリゴン情報に変換するとともに幾何計算をする幾何計
算部と、前記幾何計算部からのポリゴンについて各画素
の色計算をするレンダリングプロセッサとを備え、仮定
する視点から見た模擬視界対象物を視点側スクリーンに
映像表示を行う実時間映像発生装置において、 前記幾何計算部は予めポリゴン毎にポリゴン番号を付与
し、 前記レンダリングプロセッサは、 視点から見える視界の映像表示のためのテクスチャマッ
ピング計算と、 前記視点から見える視界の映像表示をする視点側スクリ
ーン上の点を、光源から仮想的に見える視界の映像表示
を行う仮想した光源側スクリーン上のスクリーン位置に
対応させるマッピング計算とを行うテクスチャ生成回路
と、 前記光源側スクリーンに仮想的に映像表示している対象
物を構成するポリゴンのポリゴン番号Idl を前記光源
側スクリーンの各画素に対応して格納し、前記テクスチ
ャ生成回路で対応させた光源側スクリーン上のスクリー
ン位置をアドレスとしてポリゴン番号Idl を読出すポ
リゴンメモリと、 前記ポリゴンメモリから読出した光源側のポリゴン番号
Idl と、前記読出したポリゴンメモリのアドレスに対
応する視点側スクリーン上の点における視点側のポリゴ
ン番号Ide とを比較し、両者が等しいときは視点側の
ポリゴン番号Ide を有する画素部分は影でないとし、
両者が等しくないときは視点側のポリゴン番号Ide を
有する画素部分は影であると判定するポリゴン番号判定
部と、 前記ポリゴン番号判定部で影であると判定された視点側
のポリゴン番号Ideを有する画素部分に影を付ける輝
度変調部とからなることを特徴する実時間映像発生装
置。3. A geometric calculation unit for converting three-dimensional information of a simulated field of view object into two-dimensional polygon information and performing geometric calculation, and a rendering processor for performing color calculation of each pixel of the polygon from the geometric calculation unit. In the real-time image generator that displays the simulated field of view object from the hypothesized viewpoint on the viewpoint side screen, the geometric calculation unit assigns a polygon number to each polygon in advance, and the rendering processor A texture mapping calculation for displaying the image of the field of view viewed from the point, and a point on the viewpoint side screen that displays the image of the field of view viewed from the viewpoint, on the virtual light source side screen that displays the image of the field of view virtually viewed from the light source. Texture generation circuit for performing mapping calculation corresponding to the screen position of the Polygon number Id l of polygons constituting the objects are virtually displayed picture is stored corresponding to each pixel of the light source side screen, the screen position on the light source side screen to correspond with the texture generating circuit and reading polygon memory polygon number Id l as an address, a polygon number Id l of the read light source side from the polygon memory, a polygon number perspective side at a point on the viewpoint side screen corresponding to the address of the read-out polygon memory Id e is compared, and when they are equal to each other, the pixel portion having the polygon number Id e on the viewpoint side is not a shadow,
And determining the polygon number checker and pixel portion is a shadow having a polygon number Id e perspective side when they are not equal, the polygon number of the polygon number checker is determined to be shadow viewpoint side Id e A real-time image generation device, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP20186795A JPH0935085A (en) | 1995-07-17 | 1995-07-17 | Method and device for real-time video generation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP20186795A JPH0935085A (en) | 1995-07-17 | 1995-07-17 | Method and device for real-time video generation |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0935085A true JPH0935085A (en) | 1997-02-07 |
Family
ID=16448210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP20186795A Pending JPH0935085A (en) | 1995-07-17 | 1995-07-17 | Method and device for real-time video generation |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0935085A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002074390A (en) * | 2000-08-23 | 2002-03-15 | Nintendo Co Ltd | Shadow mapping in inexpensive graphics system |
JP2002190032A (en) * | 2000-12-20 | 2002-07-05 | Namco Ltd | Game system, program and information storage medium |
-
1995
- 1995-07-17 JP JP20186795A patent/JPH0935085A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002074390A (en) * | 2000-08-23 | 2002-03-15 | Nintendo Co Ltd | Shadow mapping in inexpensive graphics system |
JP2002190032A (en) * | 2000-12-20 | 2002-07-05 | Namco Ltd | Game system, program and information storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111508052B (en) | Rendering method and device of three-dimensional grid body | |
US5742749A (en) | Method and apparatus for shadow generation through depth mapping | |
JP3608801B2 (en) | Image generator | |
JP3759971B2 (en) | How to shade a 3D image | |
US6078333A (en) | Images and apparatus for carrying out the method | |
JPH0757117A (en) | Method and computer controlled display system for generating an index to a texture map | |
EP0321095A2 (en) | Polygon priority resolving system with antialiasing | |
CA2301607C (en) | An improved method and apparatus for per pixel mip mapping and trilinear filtering | |
JPH04502368A (en) | image generator | |
JPH09231404A (en) | Picture processing method for displaying object, and device therefor | |
US6774897B2 (en) | Apparatus and method for drawing three dimensional graphics by converting two dimensional polygon data to three dimensional polygon data | |
JP3629243B2 (en) | Image processing apparatus and method for rendering shading process using distance component in modeling | |
JP3035571B2 (en) | Image processing device | |
CN1201268C (en) | Image process for realizing moving fuzzification | |
JPH11339064A (en) | Plotting method, device and recording medium | |
JPH0935085A (en) | Method and device for real-time video generation | |
JP2001283254A (en) | Three-dimensional graphic plotting device and its method | |
JPS63237172A (en) | Method and device for color change of color picture | |
JP2952585B1 (en) | Image generation method | |
JPH09114994A (en) | Device and method for forming image | |
JP3344675B2 (en) | Stereoscopic image processing device | |
US6130669A (en) | Image processing method for stimulating structure in relief, and device for carrying out the method | |
JPH0234069B2 (en) | ||
JPH03268186A (en) | graphics processing unit | |
CN119559317A (en) | A hybrid screen-space global illumination method based on resampling and probes |