JPH08305890A - Method and device for phon shading - Google Patents

Method and device for phon shading

Info

Publication number
JPH08305890A
JPH08305890A JP11280295A JP11280295A JPH08305890A JP H08305890 A JPH08305890 A JP H08305890A JP 11280295 A JP11280295 A JP 11280295A JP 11280295 A JP11280295 A JP 11280295A JP H08305890 A JPH08305890 A JP H08305890A
Authority
JP
Japan
Prior art keywords
angle information
specular reflection
light intensity
angle
intensity
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
JP11280295A
Other languages
Japanese (ja)
Inventor
Naoko Nakamura
村 直 子 中
Tamio Nishiomote
面 民 男 西
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.)
Toshiba Corp
Toshiba Electronic Device Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Microelectronics 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 Toshiba Corp, Toshiba Microelectronics Corp filed Critical Toshiba Corp
Priority to JP11280295A priority Critical patent/JPH08305890A/en
Publication of JPH08305890A publication Critical patent/JPH08305890A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE: To make a drawing system easily turnable into hardware. CONSTITUTION: Angles θ1 and α1 determining the directivity of a light beam of every pixel are interpolated with the angles θa (∼θc) and αa (∼αc) of vertexes (DDAs 1 and 2), and reflected light vector quantities cosθ and cos<n> α are found by referring to function tables in a ROM 3 and a RAM 4 according to the obtained angles, and those are multiplied by diffusion and mirror surface reflection effective incident light intensity values Id and Is to find reflected light intensity values Id.cosθ and Is.cos<n> α(multipliers 5 and 6 and storage parts 10 and 11) and an ambient light intensity value Ia is added to them (adders 7 and 8) to calculate the total reflected light intensity I. Consequently, phon shading is actualized by a simple calculation. Consequently, the device can be easily turned into hardware and the arithmetic processing is speeded up.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、3次元コンピュータグ
ラフィックスのフォンシェーディング方法及び同装置に
係り、反射光(拡散、鏡面反射)効果を用いた高品位な
描画を目標とし、特に描画プロセッサに使用されるもの
である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a phon shading method and apparatus for three-dimensional computer graphics, which aims at high-quality drawing using a reflected light (diffuse, specular reflection) effect, and particularly to a drawing processor. Is what is used.

【0002】[0002]

【従来の技術】年々、グラフィックスLSIの高性能化
に伴い、スムーズシェーディングによる美しい描画のレ
ベルアップが求められている。その方法の一環として物
体面を表現するにあたっては反射光による個々のハイラ
イト(艶のある物体の光って見える部分)が大きな影響
を与える。
2. Description of the Related Art As the performance of graphics LSIs increases year by year, it is required to improve beautiful drawing by smooth shading. When expressing the surface of an object as part of that method, individual highlights due to reflected light (the shiningly visible portion of a glossy object) have a great influence.

【0003】従来技術では、このハイライトを表すには
グーローシェーディングとフォンシェーディングとによ
る2つの描画方法があげられる。
In the prior art, there are two drawing methods using Gouraud shading and phon shading to represent this highlight.

【0004】グーローシェーディングによる描画方法を
図5で説明する。同図は描画エリア内の任意位置に三角
形を描画したもので、この三角形の各頂点をa、b、c
とし、それぞれに対して三原色で表した輝度値を設定し
ている。例えば、頂点aは赤が最も強い輝度値を有し、
頂点bは青が最も強い輝度値を有するものとした時、頂
点a→bの三角形内各ピクセルの輝度値は視覚的には赤
→紫→青の滑らかな補間が行われる。これは各ピクセル
の「輝度値」を双一次関数を用いた輝度計算により補間
することでグーローシェーディングによる三角形描画が
なされているものである。
A drawing method by Gouraud shading will be described with reference to FIG. In the figure, a triangle is drawn at an arbitrary position in the drawing area, and each vertex of this triangle is represented by a, b, c.
And the brightness values represented by the three primary colors are set for each. For example, at vertex a, red has the strongest luminance value,
When blue has the strongest luminance value at the vertex b, the luminance value of each pixel in the triangle of the vertexes a → b is visually smoothly interpolated from red → purple → blue. This is a triangle drawing by Gouraud shading by interpolating the "brightness value" of each pixel by brightness calculation using a bilinear function.

【0005】[0005]

【発明が解決しようとする課題】しかし、グーローシェ
ーディングは曲面物体の描画時に滑らかな輝度値の補間
は出来ても、周りの輝度値に関わりなく部分的に光らせ
るような補間は出来ず、高品位なハイライトを表す描画
を行うのに問題がある。
However, with Gouraud shading, even if smooth luminance values can be interpolated when a curved surface object is drawn, interpolation that partially illuminates is not possible regardless of surrounding luminance values. I'm having trouble drawing with high-definition highlights.

【0006】これに対し、フォンシェーディングはその
ような高品位ハイライトを提供するもので、以下に、こ
のフォンシェーディングによる描画方法を図6、図7で
説明する。フォンシェーディングは、ある物体に対して
ピクセルごとに補間によって法線ベクトルを求め、反射
光の強度を求める。この反射光は光源の構成、向き、形
状と物体表面の向き、特性(材質等)により影響を受
け、それによって生じた、どの方向にも均等に放射する
拡散反射や物体の表面上で反射する鏡面反射で特徴づけ
られる。図6は曲面物体上の任意の点Aで反射した時の
もので、拡散反射及び鏡面反射と、これらの反射光強度
を求める際に必要な角度を説明するものである。ここで
のθ1は点Aから光源へと向かうベクトルと物体表面の
法線ベクトルとがなす角度で拡散反射に関係する。θ2
は反射光と法線ベクトルとがなす角度、αは反射光と点
Aから視線に向かうベクトルとがなす角度で常に観察者
の視点に影響される鏡面反射に関係する。
On the other hand, the phon shading provides such a high-quality highlight, and the drawing method by the phon shading will be described below with reference to FIGS. 6 and 7. In Phong shading, a normal vector is obtained by interpolating a certain object for each pixel, and the intensity of reflected light is obtained. This reflected light is affected by the configuration, orientation, shape and orientation of the object surface and the characteristics (material, etc.) of the light source, and is caused by the diffuse reflection that is uniformly radiated in any direction and is reflected on the surface of the object. Characterized by specular reflection. FIG. 6 shows a case where light is reflected at an arbitrary point A on a curved surface object, and illustrates diffuse reflection and specular reflection, and angles necessary for obtaining the reflected light intensities thereof. Here, θ1 is an angle formed by a vector from the point A toward the light source and a normal vector of the object surface, and is related to diffuse reflection. θ2
Is the angle formed by the reflected light and the normal vector, and α is the angle formed by the reflected light and the vector from the point A toward the line of sight, and is related to the specular reflection that is always affected by the observer's viewpoint.

【0007】フォンシェーディングの反射光の光源計算
は、その物体の環境(デフォルト値)の周囲光、拡散反
射、鏡面反射をそれぞれ求めたものを用いる。この反射
光の強度(I)の算出方法は以下に示す式で求める。
The light source calculation of the reflected light of the phon shading uses the ambient light, diffuse reflection, and specular reflection of the environment (default value) of the object. The method of calculating the intensity (I) of the reflected light is obtained by the formula shown below.

【0008】 I=La・Ka+L1・Kd・cosθ+L1・Ks・cosn α ここでのLaは周囲光強度、Kaは周囲光の拡散反射係
数、L1は光源からの入射光の強度、Kdは光源からの
入射光の拡散反射係数、Ksは反射率係数、n乗は鏡面
反射光の分散を近似する指数である。
I = La · Ka + L1 · Kd · cos θ + L1 · Ks · cos n α where La is ambient light intensity, Ka is ambient light diffuse reflection coefficient, L1 is intensity of incident light from the light source, and Kd is from the light source. Is the diffuse reflection coefficient of the incident light, Ks is the reflectance coefficient, and the n-th power is an index that approximates the dispersion of the specularly reflected light.

【0009】また、cosθ、cosαは次の式で求め
る。ここでの↑n(「↑」はベクトルを意味し、ここで
はベクトルnを示している)、↑L、↑R、↑Sは図6
の各ベクトルに対応しており、3次元で表す場合はn=
(Xn ,Yn ,Zn ),L=(X1 ,Y1 ,Z1 ),R
=(Xr ,Yr ,Zr ),S=(Xs ,Ys ,Zs )と
仮定する。
Further, cos θ and cos α are obtained by the following equations. Here, ↑ n (“↑” means a vector, and here, the vector n is shown), ↑ L, ↑ R, and ↑ S are shown in FIG.
Corresponding to each vector of
(Xn, Yn, Zn), L = (X1, Y1, Z1), R
= (Xr, Yr, Zr), S = (Xs, Ys, Zs).

【0010】 cosθ =↑n・↑L=n・L/|n||L| =(Xn ・X1 +Yn ・Y1 +Zn ・Z1 ) ÷(Xs 2 +Yn 2 +Zn 2 1/2 ・(X1 2 +Y1 2 +Z1 2 1/2 cosα =↑R・↑S=R・S/|R||S| =(Xr ・Xs +Yr ・Ys +Zr ・Zs ) ÷(Xr 2 +Yr 2 +Zr 2 1/2 ・(Xs 2 +Ys 2 +Zs 2 1/2 これらの式を用いて計算するフォンシェーディングの問
題点を図7で説明する。図7は三角形上での各ピクセル
に対して図6のような鏡面反射を行っているものであ
る。この頂点b→cの各ピクセルを例にすると、↑L,
↑Sは固定であるが、↑nはx,y,zの三成分の補間
により変化し、更にこの変化によって↑Rも変化する。
問題点は、この変化に伴って|n|,|R|も変化する
ため正規化が必要となる点にあり、変数の変化する範囲
が無限大である平方根及び除算を用いたピクセルごとに
繰り返される複雑な計算を要することにある。また、こ
の計算量の多さにより、システムをハードウエアで実現
しにくいという問題もある。
[0010] cosθ = ↑ n · ↑ L = n · L / | n || L | = (Xn · X1 + Yn · Y1 + Zn · Z1) ÷ (Xs 2 + Yn 2 + Zn 2) 1/2 · (X1 2 + Y1 2 + Z1 2 ) 1/2 cos α = ↑ R ・ ↑ S = R ・ S / | R || S | = (Xr ・ Xs + Yr ・ Ys + Zr ・ Zs) ÷ (Xr 2 + Yr 2 + Zr 2 ) 1/2・(Xs 2 + Ys 2 + Zs 2 ) 1/2 The problem of phon shading calculated using these equations will be described with reference to FIG. In FIG. 7, specular reflection as in FIG. 6 is performed on each pixel on the triangle. Taking each pixel of this vertex b → c as an example, ↑ L,
↑ S is fixed, but ↑ n changes by interpolating three components of x, y, and z, and ↑ R also changes by this change.
The problem is that normalization is required because | n | and | R | also change with this change, and the range in which the variable changes is infinite. It is repeated for each pixel using square root and division. It requires complicated calculations. Also, there is a problem that it is difficult to realize the system by hardware due to the large amount of calculation.

【0011】本発明は、上記従来技術の有する問題点に
鑑みてなされたもので、その目的とするところは、描画
システムのハードウエア化を可能とするスムーズシェー
ディング方法及び同装置を提供することにある。
The present invention has been made in view of the above problems of the prior art, and an object of the present invention is to provide a smooth shading method and a device thereof which enable hardwareization of a drawing system. is there.

【0012】[0012]

【課題を解決するための手段】本発明のフォンシェーデ
ィング方法は、多角形メッシュにより物体を3次元表示
する3次元コンピュータグラフィックスにおいて、前記
多角形メッシュの各頂点での法線と入射光線の角度とに
基づいて前記多角形メッシュにおける前記各頂点間に位
置するピクセルごとの法線と入射光線との角度を示す第
1の角度情報を算出するとともに、前記多角形の各頂点
での視線と反射光線との角度に基づいて前記多角形メッ
シュにおける前記各頂点間に位置するピクセルごとの視
線と反射光線との角度を示す第2の角度情報を算出する
段階と、前記第1の角度情報を拡散反射正規化係数に、
前記第2の角度情報を鏡面反射正規化係数に、それぞれ
変換する段階と、前記拡散反射正規化係数と前記物体へ
の入射光強度に該物体への拡散反射係数を加味した実効
入射光強度とを乗算して該物体の拡散反射強度を求める
とともに、前記鏡面反射正規化係数と前記物体への入射
光強度に該物体の鏡面反射係数を加味した実効入射光強
度とを乗算して前記物体の鏡面反射強度を求める段階
と、前記物体の周囲光強度に前記拡散反射強度と前記鏡
面反射強度とを加算して反射光強度を算出する段階とを
備えていることを特徴とする。
According to the phon shading method of the present invention, in three-dimensional computer graphics in which an object is three-dimensionally displayed by a polygonal mesh, the normal line at each vertex of the polygonal mesh and the angle of the incident light ray. And calculating the first angle information indicating the angle between the incident ray and the normal line for each pixel located between the vertices in the polygon mesh, and the line-of-sight and reflection at each vertex of the polygon. Calculating second angle information indicating an angle between a line of sight of each pixel located between the vertices in the polygonal mesh and a reflected light ray based on an angle with the light ray; and diffusing the first angle information. In the reflection normalization coefficient,
Converting the second angle information into a specular reflection normalization coefficient, and an effective incident light intensity obtained by adding the diffuse reflection normalization coefficient and the incident light intensity to the object to the diffuse reflection coefficient to the object. The diffuse reflection intensity of the object is calculated by multiplying by, and the specular reflection normalization coefficient and the effective incident light intensity in which the specular reflection coefficient of the object is added to the incident light intensity of the object are multiplied to obtain the object The method further comprises the steps of obtaining a specular reflection intensity and calculating a reflected light intensity by adding the diffuse reflection intensity and the specular reflection intensity to the ambient light intensity of the object.

【0013】角度情報の各係数への変換にあたっては、
第1の角度情報をθとしたとき、拡散正規化係数を c
osθ として求める拡散反射関数テーブルを用い、第
2の角度情報をα、物体の鏡面反射光の分散近似指数を
nとしたとき、鏡面反射強度を cosα として求
める鏡面反射関数テーブルを用いることが望ましい。
In converting the angle information into each coefficient,
When the first angle information is θ, the diffusion normalization coefficient is c
It is possible to use a diffuse reflection function table obtained as osθ, and use a specular reflection function table obtained as the specular reflection intensity cos n α, where α is the second angle information and n is the dispersion approximation index of the specular reflection light of the object. desirable.

【0014】また、本発明のフォンシェーディング装置
は、多角形メッシュにより物体を3次元表示する3次元
コンピュータグラフィックスにおいて、前記多角形メッ
シュの各頂点での法線と入射光線の角度とに基づいて前
記多角形メッシュにおける前記各頂点間に位置するピク
セルごとの法線と入射光線との角度を示す第1の角度情
報を補間計算によって算出するとともに、前記多角形メ
ッシュの各頂点での視線と反射光線との角度に基づいて
前記多角形メッシュにおける前記各頂点間に位置するピ
クセルごとの視線と反射光線との角度を示す第2の角度
情報を補間計算によって算出する角度情報補間手段と、
前記第1の角度情報を拡散反射正規化係数に、前記第2
の角度情報を鏡面反射正規化係数に、それぞれ変換する
角度情報変換手段と、前記拡散反射正規化係数と前記物
体への入射光強度に該物体への拡散反射係数を加味した
実効入射光強度とを乗算して該物体の拡散反射強度を求
める拡散反射強度算出手段と、前記鏡面反射正規化係数
と前記物体への入射光強度に該物体の鏡面反射係数を加
味した実効入射光強度とを乗算して前記物体の鏡面反射
強度を求める鏡面反射強度算出手段と、前記物体の周囲
光強度に前記拡散反射強度と前記鏡面反射強度とを加算
して前記物体からの総反射光強度を算出する総反射光強
度算出手段とを備えていることを特徴とする。
Further, the phon shading device of the present invention is a three-dimensional computer graphics for three-dimensionally displaying an object by a polygon mesh, based on the normal line at each vertex of the polygon mesh and the angle of the incident light ray. The first angle information indicating the angle between the incident ray and the normal line for each pixel located between the vertices of the polygonal mesh is calculated by interpolation calculation, and the line of sight and reflection at each vertex of the polygonal mesh are calculated. Angle information interpolating means for calculating, by interpolation calculation, second angle information indicating the angle between the line of sight of each pixel located between the vertices in the polygonal mesh and the reflected ray based on the angle with the ray;
The first angle information is used as a diffuse reflection normalization coefficient, and the second
Angle information conversion means for respectively converting the angle information of the specular reflection normalization coefficient, and the effective incident light intensity obtained by adding the diffuse reflection normalization coefficient and the incident light intensity to the object to the diffuse reflection coefficient to the object. By multiplying the diffuse reflection intensity calculation means for obtaining the diffuse reflection intensity of the object by multiplying the specular reflection normalization coefficient and the incident light intensity on the object with the specular reflection coefficient of the object. Then, the specular reflection intensity calculation means for obtaining the specular reflection intensity of the object, and the total reflection light intensity from the object by adding the diffuse reflection intensity and the specular reflection intensity to the ambient light intensity of the object A reflected light intensity calculation means is provided.

【0015】角度情報補間手段はデジタル微分解析器に
よって構成することができる。
The angle information interpolating means can be constituted by a digital differential analyzer.

【0016】この角度情報変換手段は、第1の角度情報
をθとしたとき、拡散正規化係数をcosθ として求
める拡散反射関数テーブルを備え、第2の角度情報を
α、物体の鏡面反射光の分散近似指数をnとしたとき、
鏡面反射強度をcosα として求める鏡面反射関数
テーブルを有する構成とすることが望ましい。
This angle information conversion means is provided with a diffuse reflection function table for obtaining the diffusion normalization coefficient as cos θ, where the first angle information is θ, and the second angle information is α, the specular reflection light of the object. When the variance approximation index is n,
It is desirable to have a configuration having a specular reflection function table for obtaining the specular reflection intensity as cos n α.

【0017】また、その拡散反射関数テーブルとしてR
OMテーブルを備え、鏡面反射関数テーブルとしてRA
Mテーブルを有する構成とすることができる。
R is used as the diffuse reflection function table.
RA with OM table as specular reflection function table
It can be configured to have an M table.

【0018】[0018]

【作用】本発明によれば、ピクセルごとの光線ベクトル
の方向性を決定する角度情報を頂点の角度情報により補
間し、この補間された角度情報に基づいて各ピクセルご
との反射光線ベクトル量を求め、これらを加算すること
で総反射光強度を算出する、という簡単な計算によりフ
ォンシェーディングを実現することができるので、ハー
ドウエア化が容易となる。
According to the present invention, the angle information that determines the directionality of the light ray vector for each pixel is interpolated by the angle information of the vertex, and the reflected light ray vector amount for each pixel is obtained based on this interpolated angle information. Since the phon shading can be realized by a simple calculation in which the total reflected light intensity is calculated by adding these, the hardware can be easily realized.

【0019】すなわち、従来技術のグーローシェーディ
ングによるハイライトを表した描画を美しいものとする
ためにフォンシェーディングによる描画方法が挙げられ
る。しかし、従来のフォンシェーディングによる描画時
の補間算出方法は前述の式に示す通り、法線ベクトルの
三成分(x,y,z)を補間し、光源計算を法線と入射
光、視線と反射光の内積及び正規化計算で処理する複雑
な演算を有している。この従来の方法に対して本発明
は、法線と入射光、視線と反射光の角度補間、及び光源
計算(望ましくは三角関数テーブルを用いた計算)によ
って処理するため計算の簡略化が図れる。
That is, there is a drawing method by phon shading in order to make the drawing showing the highlight by the conventional Gouraud shading beautiful. However, the conventional interpolation calculation method at the time of drawing by phon shading interpolates the three components (x, y, z) of the normal vector and calculates the light source as the normal line and the incident light and the sight line and the reflection as shown in the above formula. It has complex operations that are processed by the inner product of light and the normalization calculation. In contrast to this conventional method, the present invention performs processing by angle interpolation between normal and incident light, line of sight and reflected light, and light source calculation (preferably calculation using a trigonometric function table), so that calculation can be simplified.

【0020】本発明は以下の式で反射光の強度(I)を
求める。
In the present invention, the intensity (I) of the reflected light is calculated by the following formula.

【0021】 I=Ia +Id ・f1 (θ)+Is ・f2 (α) ここでのIa =La・Ka,Id =L1・Kd,Is =
L1・Ks,f1 (θ)=cosθ(拡散反射正規化係
数),f2 (α)=cosn α(鏡面反射正規化係数)
である。
I = Ia + Idf1 (θ) + Isf2 (α) where Ia = LaKa, Id = L1Kd, Is =
L1 · Ks, f1 (θ) = cos θ (diffuse reflection normalization coefficient), f2 (α) = cos n α (specular reflection normalization coefficient)
Is.

【0022】予め準備しておく三角関数f1 (θ),f
2 (α)を解くテーブルについては図2を用いて説明す
る。同図に示すnは鏡面反射光の分散を近似する指数
で、nの値が大きいものほど金属や艶のある面を表して
いる。この図は角度が−π/2≦α≦π/2(光源が物
体の影に入る範囲を除いた)の範囲のcosn αを示
す。n値の異なるA,B,C曲線のうち、Aは法線と入
射光の角度(θ)、BやCは視線と反射光の角度(α)
に対してのcosn αを求められる。この角度とそれに
対してのデータを各アドレスに格納するといった三角関
数テーブル化と、定数化したIa ,Id ,Is を用いた
処理で各ピクセルごとの反射光強度(I)を求める本発
明により、従来のフォンシェーディングの特徴を生かし
たハイライトを表せる高品位な描画を実現できる。
Trigonometric functions f 1 (θ), f prepared in advance
A table for solving 2 (α) will be described with reference to FIG. In the figure, n is an index that approximates the dispersion of specularly reflected light, and the larger the value of n, the more metallic or glossy the surface. This figure shows cos n α in the range of the angle −π / 2 ≦ α ≦ π / 2 (excluding the range where the light source is in the shadow of the object). Among the A, B, and C curves with different n values, A is the angle between the normal and the incident light (θ), and B and C are the angle between the line of sight and the reflected light (α).
The cos n α for According to the present invention for obtaining the reflected light intensity (I) for each pixel by forming a table of trigonometric functions such as storing this angle and data corresponding thereto at each address and processing using the constants Ia, Id, Is. It is possible to realize high-quality drawing that can display highlights that make the most of the characteristics of conventional phon shading.

【0023】[0023]

【実施例】以下に本発明の実施例ついて図面を参照しつ
つ説明する。図1は本発明の一実施例に係るフォンシェ
ーディング装置の構成を示すものである。同図におい
て、DDA(デジタル微分解析器)1は、多角形メッシ
ュの各頂点での法線na (〜nc )と入射光線Lの角度
θa (〜θc )とに基づいて多角形メッシュにおける各
頂点間に位置するピクセルごとの法線と入射光線との角
度θ1 を示す第1の角度情報を補間計算によって算出
し、この第1の角度情報を次述するROM3をアクセス
するためのアドレス情報に変換出力する。DDA2は、
多角形メッシュの各頂点での視線Sと反射光線Rとの角
度αa 〜αc に基づいて多角形メッシュにおける各頂点
間に位置するピクセルごとの視線と反射光線との角度α
1 を示す第2の角度情報を補間計算によって算出し、次
述するRAM4をアクセスするためのアドレス情報に変
換する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows the configuration of a phon shading device according to an embodiment of the present invention. In the figure, a DDA (digital differential analyzer) 1 uses a normal line na (~ nc) at each vertex of a polygonal mesh and an angle θa (~ θc) of an incident ray L to determine each vertex of the polygonal mesh. The first angle information indicating the angle θ1 between the incident ray and the normal line of each pixel located between them is calculated by interpolation calculation, and this first angle information is converted into address information for accessing the ROM 3 described below. Output. DDA2 is
Based on the angles αa to αc between the line of sight S and the reflected ray R at each vertex of the polygonal mesh, the angle α between the line of sight and the reflected ray of each pixel located between the respective vertices in the polygonal mesh
The second angle information indicating 1 is calculated by interpolation calculation and converted into address information for accessing the RAM 4 described below.

【0024】ROM3には入射光−法線角度θ1 をco
sθ1 に変換する関数テーブルが格納され、このテーブ
ルはDDA1からのアドレス情報によって読出しアクセ
スされ、第1の角度情報の変換値となるcosθ1 が読
出される。RAM4には視線ベクトルSと反射光ベクト
ルRとのなす角度αをcosαに変換する関数テーブ
ルが格納されている。このテーブルはDDA2からのア
ドレス情報によって読出しアクセスされ、第2の角度情
報の変換値となるcosαに変換する関数テーブルが
格納されている。ここで、cosαを算出するのをR
AMで構成しているのは、nが物体表面の材質によって
異なり、物体ごとに関数テーブルを変更できるようにす
るためである。
In the ROM 3, the incident light-normal angle θ 1 is
A function table for converting to sθ1 is stored. This table is read and accessed by the address information from the DDA1, and cosθ1 which is the conversion value of the first angle information is read. The RAM 4 stores a function table for converting the angle α formed by the line-of-sight vector S and the reflected light vector R into cos n α. This table stores a function table which is read out and accessed by the address information from the DDA 2 and converted into cos n α which is the conversion value of the second angle information. Here, the calculation of cos n α is performed by R
The AM is used because n varies depending on the material of the surface of the object, and the function table can be changed for each object.

【0025】これらのテーブルの一例を図3を示す。こ
の図に示すテーブルは図2のA,B曲線中の0≦α≦π
/2の各角度に対して、32アドレスにそれぞれ格納さ
れるデータ(cosn α1 )を示したものである。図3
(A)はcosαのデータ、(B)はcosn α1 /n
=5のデータをテーブル化したものである。
An example of these tables is shown in FIG. The table shown in this figure is 0 ≦ α ≦ π in the curves A and B of FIG.
It shows data (cos n α1) stored at 32 addresses for each angle of / 2. FIG.
(A) is the data of cos α, (B) is the data of cos n α1 / n
= 5 is a table.

【0026】記憶部10は実効拡散入射光強度Id (L
1×Kd)を記憶するもので、乗算器5はcosθ1 と
そのId とを掛合わせ、拡散反射光強度Id ・cosθ
1 を求める。記憶部11は実効鏡面入射光強度Is (L
1×Ks)を記憶するもので、乗算器6はcosαと
そのIs とを掛合わせて鏡面反射光強度Is ・cos
αを求める。
The storage unit 10 stores the effective diffuse incident light intensity Id (L
1 × Kd), and the multiplier 5 multiplies cos θ1 and its Id to obtain the diffuse reflected light intensity Id · cos θ
Ask for 1. The storage unit 11 stores the effective specular incident light intensity Is (L
1 × Ks), and the multiplier 6 multiplies cos n α and its Is to multiply the specular reflection light intensity Is.cos n.
Find α.

【0027】加算器7は乗算器5からの拡散反射光強度
Id ・cosθ1 と乗算器6からの鏡面反射光強度Is
・cosαとを加算する。記憶部9は周囲光強度Id
を格納しており、加算器8は、このId と加算器7から
のId ・cosθ1 +Is ・cosαとを加算し、総
拡散反射光強度Iを求めることとなる。
The adder 7 has a diffuse reflection light intensity Id .multidot.cos .theta.1 from the multiplier 5 and a specular reflection light intensity Is from the multiplier 6.
-Add cos n α. The storage unit 9 stores the ambient light intensity Id.
The adder 8 adds this Id and Id.cos .theta.1 + Is .cos n .alpha. From the adder 7 to obtain the total diffuse reflected light intensity I.

【0028】以上、説明したように本実施例によれば、
計算量の軽減を図ることができる。つまり、従来のフォ
ンシェーディングは各ピクセルごとの法線ベクトルやそ
れに伴う正規化のための算出等により膨大な計算量で反
射光強度を求めていたのに対し、本実施例では各ピクセ
ルごとの角度から関数テーブルを用いた角度情報の補間
を介して反射光強度を求めていることから、計算量の軽
減を図ることができ、実現するハードウエアも簡素な構
成のもので済むようになる。
As described above, according to this embodiment,
The amount of calculation can be reduced. That is, in the conventional Phong shading, the reflected light intensity is obtained with a huge amount of calculation by the normal vector for each pixel and the calculation for normalization accompanying it, whereas in the present embodiment, the angle for each pixel is calculated. Since the reflected light intensity is obtained through interpolation of the angle information using the function table, the amount of calculation can be reduced, and the hardware to be realized can be simple in configuration.

【0029】また、このようにハードウエアで組むこと
によって、各ピクセルごとの補間と反射光強度を求める
計算の高速化を図ることができる。
Further, by using the hardware as described above, the interpolation for each pixel and the calculation of the reflected light intensity can be speeded up.

【0030】さらに、今までの説明では光源は平行光線
としているが、本発明は、光源と物体との距離が短いほ
ど優位性が向上する。図4は平面物体上の光源に近い点
P1と光源から遠い点P2 との拡散反射を比較したもの
である。図に示す通り、任意の点P1 から光源へと向か
うベクトルと法線ベクトルでなす角度θn と、点P2か
ら光源へと向かうベクトルと法線ベクトルでなす角度θ
m は大きく異なる。この拡散反射光強度を従来のフォン
シェーディングで求めると、ピクセルごとの入射光線ベ
クトルの補間が必要となって、膨大な計算量が更に増加
するところだが、本発明ではP1 ,P2 の軽微な計算量
の増加ですむ。
Further, although the light source is a parallel light beam in the above description, the advantage of the present invention is improved as the distance between the light source and the object is shorter. FIG. 4 compares the diffuse reflection at a point P1 near the light source on the plane object and a point P2 far from the light source. As shown in the figure, the angle θn formed by the vector from the arbitrary point P1 to the light source and the normal vector and the angle θn formed by the vector from the point P2 to the light source and the normal vector
m is very different. When the diffuse reflected light intensity is obtained by the conventional phon shading, it is necessary to interpolate the incident light ray vector for each pixel, and the enormous amount of calculation is further increased. However, in the present invention, the small amount of calculation of P1 and P2 is required. Can be increased.

【0031】これにより、より現実味のある美しいハイ
ライトが得られ、しかも計算量の軽減から実用性の範囲
拡大化が見込まれ、その方法如何によっては一層の高速
化を図れることとなる。
As a result, more realistic and beautiful highlights can be obtained, the range of practicality is expected to be expanded due to the reduction of the calculation amount, and the speed can be further increased depending on the method.

【0032】[0032]

【発明の効果】以上説明したように本発明によれば、ピ
クセルごとの光線ベクトルの方向性を決定する角度情報
を頂点の角度情報により補間し、この補間された角度情
報に基づいて各ピクセルごとの反射光線ベクトル量を求
め、これらを加算することで総反射光強度を算出する、
という簡単な計算によりフォンシェーディングを実現す
ることができるので、ハードウエア化が容易となる。
As described above, according to the present invention, the angle information for determining the directionality of the light ray vector for each pixel is interpolated by the angle information of the apex and each pixel is calculated based on the interpolated angle information. The total reflected light intensity is calculated by obtaining the reflected ray vector amount of
Since the phon shading can be realized by such a simple calculation, hardware implementation becomes easy.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例に係るフォンシェーディング
装置の構造を示すブロック図。
FIG. 1 is a block diagram showing the structure of a phon shading device according to an embodiment of the present invention.

【図2】図1に示す装置のROMあるいはRAM関数テ
ーブル構成の根拠となる拡散、鏡面反射の関数を示す説
明図。
FIG. 2 is an explanatory diagram showing functions of diffusion and specular reflection which are the basis of the ROM or RAM function table configuration of the apparatus shown in FIG.

【図3】図1に示す装置のROMあるいはRAM関数テ
ーブルの構成を示す説明図。
FIG. 3 is an explanatory diagram showing the configuration of a ROM or RAM function table of the device shown in FIG.

【図4】図1に示す装置による反射光強度算出において
加味されるピクセル毎の入射光ベクトルの変化の様子を
示す説明図。
FIG. 4 is an explanatory diagram showing a state of change of an incident light vector for each pixel, which is taken into consideration in calculation of reflected light intensity by the apparatus shown in FIG.

【図5】従来のグーローシェーディングについて示す説
明図。
FIG. 5 is an explanatory diagram showing conventional Gouraud shading.

【図6】入射光線の曲面物体に対する反射現象を示す説
明図。
FIG. 6 is an explanatory diagram showing a reflection phenomenon of an incident light ray on a curved surface object.

【図7】図1に示す装置による反射光強度算出において
加味されるピクセル毎の法線ベクトルの変化の様子を示
す説明図。
FIG. 7 is an explanatory diagram showing how the normal vector of each pixel changes in the calculation of reflected light intensity by the apparatus shown in FIG.

【符号の説明】[Explanation of symbols]

1,2 DDA 3 ROM 4 RAM 5,6 乗算器 7,8 加算器 9〜11 記憶部 1, 2 DDA 3 ROM 4 RAM 5, 6 Multiplier 7, 8 Adder 9-11 Storage unit

─────────────────────────────────────────────────────
─────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成7年6月27日[Submission date] June 27, 1995

【手続補正1】[Procedure Amendment 1]

【補正対象書類名】図面[Document name to be corrected] Drawing

【補正対象項目名】図6[Name of item to be corrected] Figure 6

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【図6】 [Figure 6]

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】多角形メッシュにより物体を3次元表示す
る3次元コンピュータグラフィックスにおいて、 前記多角形メッシュの各頂点での法線と入射光線の角度
とに基づいて前記多角形メッシュにおける前記各頂点間
に位置するピクセルごとの法線と入射光線との角度を示
す第1の角度情報を算出するとともに、前記多角形の各
頂点での視線と反射光線との角度に基づいて前記多角形
メッシュにおける前記各頂点間に位置するピクセルごと
の視線と反射光線との角度を示す第2の角度情報を算出
する段階と、 前記第1の角度情報を拡散反射正規化係数に、前記第2
の角度情報を鏡面反射正規化係数に、それぞれ変換する
段階と、 前記拡散反射正規化係数と前記物体への入射光強度に該
物体への拡散反射係数を加味した実効入射光強度とを乗
算して該物体の拡散反射強度を求めるとともに、前記鏡
面反射正規化係数と前記物体への入射光強度に該物体の
鏡面反射係数を加味した実効入射光強度とを乗算して前
記物体の鏡面反射強度を求める段階と、 前記物体の周囲光強度に前記拡散反射強度と前記鏡面反
射強度とを加算して反射光強度を算出する段階とを備え
ているフォンシェーディング方法。
1. In three-dimensional computer graphics for three-dimensionally displaying an object by a polygonal mesh, each vertex of the polygonal mesh is based on a normal line at each vertex of the polygonal mesh and an angle of an incident ray. The first angle information indicating the angle between the incident ray and the normal line for each pixel located between them is calculated, and based on the angle between the line of sight and the reflected ray at each vertex of the polygon, the polygon mesh Calculating second angle information indicating an angle between a line of sight of each pixel located between the vertices and a reflected ray; and using the first angle information as a diffuse reflection normalization coefficient and the second angle information.
Angle information of the specular reflection normalization coefficient, respectively, and multiplying the diffuse reflection normalization coefficient and the effective incident light intensity that adds the diffuse reflection coefficient to the object to the incident light intensity to the object. The specular reflection intensity of the object is obtained by multiplying the specular reflection normalization coefficient and the effective incident light intensity obtained by adding the specular reflection coefficient of the object to the specular reflection normalization coefficient. And a step of adding the diffuse reflection intensity and the specular reflection intensity to the ambient light intensity of the object to calculate the reflected light intensity.
【請求項2】角度情報を各係数に変換するにあたり、第
1の角度情報をθとしたとき、拡散正規化係数をcos
θ として求める拡散反射関数テーブルを用い、 第2の角度情報をα、物体の鏡面反射光の分散近似指数
をnとしたとき、鏡面反射強度をcosα として求
める鏡面反射関数テーブルを用いることを特徴とする請
求項1記載のフォンシェーディング方法。
2. When converting the angle information into each coefficient, when the first angle information is θ, the diffusion normalization coefficient is cos.
Using the diffuse reflection function table obtained as θ, and using the second angle information as α and the dispersion approximation index of the specular reflection light of the object as n, use the specular reflection function table obtained as cos n α for the specular reflection intensity. The phone shading method according to claim 1, wherein the phone shading method is used.
【請求項3】多角形メッシュにより物体を3次元表示す
る3次元コンピュータグラフィックスにおいて、 前記多角形メッシュの各頂点での法線と入射光線の角度
とに基づいて前記多角形メッシュにおける前記各頂点間
に位置するピクセルごとの法線と入射光線との角度を示
す第1の角度情報を補間計算によって算出するととも
に、前記多角形メッシュの各頂点での視線と反射光線と
の角度に基づいて前記多角形メッシュにおける前記各頂
点間に位置するピクセルごとの視線と反射光線との角度
を示す第2の角度情報を補間計算によって算出する角度
情報補間手段と、 前記第1の角度情報を拡散反射正規化係数に、前記第2
の角度情報を鏡面反射正規化係数に、それぞれ変換する
角度情報変換手段と、 前記拡散反射正規化係数と前記物体への入射光強度に該
物体への拡散反射係数を加味した実効入射光強度とを乗
算して該物体の拡散反射強度を求める拡散反射強度算出
手段と、 前記鏡面反射正規化係数と前記物体への入射光強度に該
物体の鏡面反射係数を加味した実効入射光強度とを乗算
して前記物体の鏡面反射強度を求める鏡面反射強度算出
手段と、 前記物体の周囲光強度に前記拡散反射強度と前記鏡面反
射強度とを加算して前記物体からの総反射光強度を算出
する総反射光強度算出手段とを備えているフォンシェー
ディング装置。
3. A three-dimensional computer graphics for three-dimensionally displaying an object by a polygon mesh, wherein each vertex of the polygon mesh is based on a normal line at each vertex of the polygon mesh and an angle of an incident ray. The first angle information indicating the angle between the incident ray and the normal line for each pixel located between the pixels is calculated by interpolation calculation, and based on the angle between the line of sight and the reflected ray at each vertex of the polygonal mesh, Angle information interpolation means for calculating, by interpolation calculation, second angle information indicating the angle between the line of sight of each pixel located between the vertices in the polygonal mesh and the reflected light ray, and the first angle information is diffuse reflection normal In the conversion factor, the second
Angle information conversion means for respectively converting the angle information of the specular reflection normalization coefficient, and the effective incident light intensity that takes into account the diffuse reflection normalization coefficient and the diffuse reflection coefficient to the object in addition to the incident light intensity to the object. And a diffuse reflection intensity calculating means for obtaining the diffuse reflection intensity of the object by multiplying the specular reflection normalization coefficient and the effective incident light intensity obtained by adding the specular reflection coefficient of the object to the incident light intensity of the object. Then, a specular reflection intensity calculating means for obtaining the specular reflection intensity of the object, and a total reflection light intensity from the object by adding the diffuse reflection intensity and the specular reflection intensity to the ambient light intensity of the object. A phone shading device comprising: reflected light intensity calculation means.
【請求項4】角度情報補間手段はデジタル微分解析器に
よって構成されていることを特徴とする請求項3記載の
フォンシェーディング装置。
4. The phon shading device according to claim 3, wherein the angle information interpolating means is constituted by a digital differential analyzer.
【請求項5】角度情報変換手段は、第1の角度情報をθ
としたとき、拡散正規化係数をcosθ として求める
拡散反射関数テーブルを備え、 第2の角度情報をα、物体の鏡面反射光の分散近似指数
をnとしたとき、鏡面反射強度をcosα として求
める鏡面反射関数テーブルを有することを特徴とする請
求項3、4のうちいずれか記載のフォンシェーディング
装置。
5. The angle information conversion means outputs the first angle information as θ.
And a diffuse reflection function table for obtaining a diffusion normalization coefficient as cos θ, where α is the second angle information and n is the dispersion approximation index of the specular reflection light of the object, the specular reflection intensity is cos n α 5. The phon shading device according to claim 3, further comprising a specular reflection function table to be obtained.
【請求項6】拡散反射関数テーブルとしてROMテーブ
ルを備え、 鏡面反射関数テーブルとしてRAMテーブルを有するこ
とを特徴とする請求項5記載のフォンシェーディング装
置。
6. The phon shading device according to claim 5, wherein a ROM table is provided as the diffuse reflection function table, and a RAM table is provided as the specular reflection function table.
JP11280295A 1995-05-11 1995-05-11 Method and device for phon shading Withdrawn JPH08305890A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11280295A JPH08305890A (en) 1995-05-11 1995-05-11 Method and device for phon shading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11280295A JPH08305890A (en) 1995-05-11 1995-05-11 Method and device for phon shading

Publications (1)

Publication Number Publication Date
JPH08305890A true JPH08305890A (en) 1996-11-22

Family

ID=14595901

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11280295A Withdrawn JPH08305890A (en) 1995-05-11 1995-05-11 Method and device for phon shading

Country Status (1)

Country Link
JP (1) JPH08305890A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100523493B1 (en) * 1997-04-04 2005-12-21 소니 가부시끼 가이샤 Image converting apparatus and image converting method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100523493B1 (en) * 1997-04-04 2005-12-21 소니 가부시끼 가이샤 Image converting apparatus and image converting method

Similar Documents

Publication Publication Date Title
US5808619A (en) Real-time rendering method of selectively performing bump mapping and phong shading processes and apparatus therefor
US5659671A (en) Method and apparatus for shading graphical images in a data processing system
US5936633A (en) Rendering method and apparatus, and method and apparatus for smoothing intensity-value
US6226006B1 (en) Method and apparatus for providing shading in a graphic display system
Bishop et al. Fast phong shading
US20040061700A1 (en) Image processing apparatus and method of same
US20070139408A1 (en) Reflective image objects
JP2002537614A (en) Graphics system configured to perform parallel sample pixel calculations
US20030001859A1 (en) Interactive horizon mapping
JPH04222074A (en) Inclination computing method for texture map
US5739820A (en) Method and apparatus for specular reflection shading of computer graphic images
JPH11272880A (en) Local eye vector fast calculating method using fixed-decimal point writing unit
JP2002537615A (en) A graphics system having a supersampling sample buffer and generating output pixels using selective filtering adjustments to reduce artifacts.
US6552726B2 (en) System and method for fast phong shading
US20030076320A1 (en) Programmable per-pixel shader with lighting support
JP2002537613A (en) Graphics system having a supersampling sample buffer and generating output pixels using selective filter adjustments to achieve a display effect
US20050093857A1 (en) View dependent displacement mapping
US7616802B2 (en) Light reflection intensity calculation circuit
US20010045956A1 (en) Extension of fast phong shading technique for bump mapping
JPH08305890A (en) Method and device for phon shading
US6333742B1 (en) Spotlight characteristic forming method and image processor using the same
Kim et al. A fast and efficient bump mapping algorithm by angular perturbation
Ernst et al. Hardware-supported bump mapping
JPS6346584A (en) Method and apparatus for high-speed phong shading
CN111738902A (en) Large convolution kernel real-time approximate fitting method based on bilinear filtering image hierarchy

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