JPH11144079A - Processor and method for image processing and recording medium where image processing program thereof is recorded - Google Patents

Processor and method for image processing and recording medium where image processing program thereof is recorded

Info

Publication number
JPH11144079A
JPH11144079A JP30550197A JP30550197A JPH11144079A JP H11144079 A JPH11144079 A JP H11144079A JP 30550197 A JP30550197 A JP 30550197A JP 30550197 A JP30550197 A JP 30550197A JP H11144079 A JPH11144079 A JP H11144079A
Authority
JP
Japan
Prior art keywords
polygon
pixel
writing
value
lighting
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
JP30550197A
Other languages
Japanese (ja)
Inventor
Shuji Hori
修司 堀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sega Corp
Original Assignee
Sega Enterprises Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sega Enterprises Ltd filed Critical Sega Enterprises Ltd
Priority to JP30550197A priority Critical patent/JPH11144079A/en
Publication of JPH11144079A publication Critical patent/JPH11144079A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a processor and method for image processing which performs a processing for lighting from a light source through a simplified arithmetic processing for some area of a polygon. SOLUTION: A Z value of a polygon positioned on the inner side of a viewpoint about a pixel in a lighting polygon and a Z value of a position on the front side are stored in a couple of lighting memories 30 and 32. When a drawing polygon is processed, it is determined whether or not each pixel is positioned in a lighting object by using the Z values in the lighting memories 30 and 32. When the pixel of the drawing polygon is positioned in the lighting object, its luminance value is increased and image data such as color data is stored in a pixel memory 26. The pixel memory 26 is stored with image data of pixels of one frame and an image is displayed on a display screen.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータを利
用した画像処理装置にかかり、光源からポリゴンへの光
の照射(ライティング)等をより現実的に表現すること
ができる画像処理装置、その画像処理方法及びその画像
処理プログラムを記録した記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus using a computer, and more specifically to an image processing apparatus capable of more realistically expressing light irradiation (writing) from a light source to a polygon, and an image processing apparatus for the same. The present invention relates to a method and a recording medium on which the image processing program is recorded.

【0002】[0002]

【従来の技術】画像処理において、ポリゴンへの光源か
らの光の照射(ライティング)の効果は、1つのポリゴ
ンに対して一様に輝度を上げるフラットシェーディング
法、またはポリゴンの各頂点に輝度を設定しポリゴン内
の輝度をその頂点の輝度から補間して求めるグーロー
(Gouraud )シェーディング法等が知られている。前者
の場合は、1つのポリゴン内のピクセル全ての輝度が上
げられる処理であり、後者の場合は、1つのポリゴンに
おいて頂点間で輝度が一定の傾斜で変化する処理であ
る。従って、これらの処理方法では、ポリゴン内の任意
の領域において例えばスポットライトが照射された様な
ライティング効果を出すことはできない。
2. Description of the Related Art In image processing, the effect of irradiating (lighting) light from a light source onto a polygon can be achieved by a flat shading method for uniformly increasing the luminance of one polygon or by setting the luminance at each vertex of the polygon. A Gouraud shading method or the like for obtaining the luminance in a polygon by interpolating from the luminance of the vertex is known. The former case is a process in which the brightness of all the pixels in one polygon is increased, and the latter case is a process in which the brightness changes between vertices in one polygon at a constant slope. Therefore, with these processing methods, it is not possible to produce a lighting effect as if, for example, a spotlight was illuminated in an arbitrary area within the polygon.

【0003】従来、静止画像に対してライティングの効
果を表現する方法として、ポリゴン内の各ピクセル毎の
法線ベクトルと、そのピクセルから光源までの光源ベク
トルとの内積を計算し、その内積値に従って各ピクセル
の輝度の補正を行う方法がある。この方法によれば、ピ
クセル毎に独立して輝度を設定することができる。
Conventionally, as a method of expressing a lighting effect on a still image, an inner product of a normal vector for each pixel in a polygon and a light source vector from the pixel to a light source is calculated, and the inner product is calculated according to the inner product value. There is a method of correcting the luminance of each pixel. According to this method, the luminance can be set independently for each pixel.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、かかる
方法によれば、各ピクセル毎に内積値を求める必要があ
り、コンピュータを利用した演算量が大規模になり、動
画に対してリアルタイムで処理することは極めて困難で
ある。特に、内積値の演算の為には、乗算や除算が含ま
れるので現在普及している汎用コンピュータを利用した
場合、その演算に要する時間はかなり長くなる。
However, according to such a method, it is necessary to obtain an inner product value for each pixel, the amount of calculation using a computer becomes large, and it is necessary to process a moving image in real time. Is extremely difficult. In particular, since the calculation of the inner product value involves multiplication and division, the time required for the calculation is considerably long when a general-purpose computer that is currently widely used is used.

【0005】ゲーム装置やシミュレーション装置の場合
は、遊技者や操作者が入力する入力信号に応答してリア
ルタイムに画像処理を行う必要がある。従って、かかる
分野においては、上記の静止画像に対して行われるライ
ティングの手法を適用することは困難である。
In the case of a game device or a simulation device, it is necessary to perform image processing in real time in response to an input signal input by a player or an operator. Therefore, in such a field, it is difficult to apply the above-described lighting method performed on still images.

【0006】そこで、本発明の目的は、画像に対して光
の照射(ライティング)の効果を与える処理を容易に行
うことができる画像処理装置、画像処理方法及びその処
理プログラムを記録した記録媒体を提供することにあ
る。
It is an object of the present invention to provide an image processing apparatus, an image processing method, and a recording medium on which an image processing program is recorded, which can easily perform a process of giving an effect of light irradiation (writing) to an image. To provide.

【0007】更に、本発明の目的は、動画等に対して移
動する光源からの光の照射(ライティング)の効果を与
える処理をリアルタイムで行うことができる画像処理装
置、画像処理方法及びその処理プログラムを記録した記
録媒体を提供することにある。
Further, an object of the present invention is to provide an image processing apparatus, an image processing method, and a processing program capable of performing, in real time, a process of giving an effect of lighting (writing) from a moving light source to a moving image or the like. To provide a recording medium on which is recorded.

【0008】更に、本発明の目的は、画像に対して任意
の領域の輝度を下げるシェーディング効果や、任意の領
域のポリゴンの表示を禁止するクリッピング効果等の特
殊処理を容易に行うことができる画像処理装置等を提供
することにある。
Further, an object of the present invention is to provide an image which can easily perform special processing such as a shading effect for lowering the brightness of an arbitrary region on an image and a clipping effect for inhibiting the display of polygons in an arbitrary region. It is to provide a processing device and the like.

【0009】[0009]

【課題を解決するための手段】本発明は、光が照射され
る領域からなるライティングオブジェクトを追加し、そ
のライティングオブジェクトを構成するライティングポ
リゴンを通常の描画ポリゴンと共に発生する。そして、
ライティングポリゴン内のピクセルに対して視点から奥
側に位置するポリゴンのZ値と手前側に位置するポリゴ
ンのZ値とをそれぞれ一対のライティングメモリに格納
する。その後、描画ポリゴンの描画処理時において、各
ピクセルがライディングオブジェクト内に位置するか否
かの判定を、一対のライティングメモリ内のZ値をもと
に判定する。具体的にはライティングメモリのZ値の間
に位置するか否かの判定である。そして、描画ポリゴン
のピクセルがライティングオブジェクトの中に位置する
場合は、例えばその輝度値を上げるライティング処理を
行い、その処理された色データ等の画像データをピクセ
ルメモリに格納する。ピクセルメモリには1フレーム分
のピクセルの画像データが格納され、そのピクセルメモ
リの画像データに従って表示画面に画像が表示される。
According to the present invention, a lighting object consisting of an area to be irradiated with light is added, and a lighting polygon constituting the lighting object is generated together with a normal drawing polygon. And
The Z value of the polygon located on the far side from the viewpoint and the Z value of the polygon located on the near side with respect to the pixels in the lighting polygon are respectively stored in a pair of lighting memories. Thereafter, at the time of drawing processing of the drawing polygon, it is determined whether or not each pixel is located in the riding object based on the Z values in the pair of writing memories. Specifically, it is determined whether or not it is located between the Z values of the writing memory. When the pixels of the drawing polygon are located in the lighting object, for example, a lighting process for increasing the luminance value is performed, and the processed image data such as color data is stored in the pixel memory. The pixel memory stores image data of pixels for one frame, and an image is displayed on a display screen according to the image data of the pixel memory.

【0010】上記の方法によれば、光源に対応するライ
ティングオブジェクトが追加されそれを構成するライテ
ィングポリゴンのZ値の処理が必要であるが、ピクセル
毎に輝度値を上げるか否かの判断は、単にZ値の比較だ
けであり、演算量としては従来の内積値を求める場合に
比較して大幅に少なくなる。従って、かかる方法により
画像処理をする画像処理装置は、動画等に対して移動す
る光源からの光の照射の効果をリアルタイムで与えるこ
とができる。
According to the above method, a lighting object corresponding to a light source is added, and it is necessary to process a Z value of a lighting polygon constituting the lighting object. However, it is determined whether or not to increase the luminance value for each pixel. This is merely a comparison of the Z values, and the amount of calculation is significantly reduced as compared with the case where a conventional inner product value is obtained. Therefore, an image processing apparatus that performs image processing by such a method can give the effect of light irradiation from a moving light source to a moving image or the like in real time.

【0011】更に、光源が複数に及ぶ場合は、光源毎に
上記した一対のライティングメモリを設け、描画対象の
ポリゴンのピクセルが、それぞれの一対のライティング
メモリに挟まれるZ値であるか否かの判断をすること
で、同様の手法によりライティング処理を行うことがで
きる。
Further, when there are a plurality of light sources, the above-mentioned pair of writing memories is provided for each light source, and it is determined whether or not the pixel of the polygon to be drawn has the Z value sandwiched between the pair of writing memories. By making the determination, the lighting process can be performed by the same method.

【0012】また、本発明は、ライティングオブジェク
トに限られず、シェーディングオブジェクトを利用して
シェーディング処理を行ったり、クリッピングオブジェ
クトを利用して一部の領域をクリッピング処理を行った
りすることも簡単にできる。
In addition, the present invention is not limited to a lighting object, and can easily perform a shading process using a shading object, or perform a clipping process on a partial area using a clipping object.

【0013】上記の目的を達成する為に、本発明は、オ
ブジェクトを構成するポリゴンに対して表示画面内の座
標データと色データとを含むポリゴンデータが与えら
れ、前記座標データに従って各ポリゴン内のピクセルの
描画処理を行う画像処理装置において、前記ポリゴン
は、前記描画処理が行われる描画対象ポリゴンとライテ
ィング処理の対象領域のライティングオブジェクトを構
成するライティングポリゴンとを有し、前記画像処理装
置は、前記ライティングポリゴンのうち前記表示画面の
手前側に位置するライティングポリゴン内のピクセルの
Z値が書き込まれる第一のライティングメモリと、前記
ライティングポリゴンのうち前記表示画面の奥側に位置
するライティングポリゴン内のピクセルのZ値が書き込
まれる第二のライティングメモリと、前記表示画面に表
示されるピクセルの色データが書き込まれるピクセルメ
モリと、前記描画対象ポリゴン内のピクセルのZ値を前
記座標データから求め、該ピクセルのZ値が前記第一及
び第二のライティングメモリ内のZ値の間に位置する場
合に当該ピクセルの色データに輝度値を高めるライティ
ング処理を行い、該ライティング処理された色データを
前記ピクセルメモリに書き込む描画処理部とを有するこ
とを特徴とする。
In order to achieve the above object, according to the present invention, polygons including coordinate data and color data in a display screen are given to polygons constituting an object, and polygons in each polygon are given according to the coordinate data. In an image processing device that performs a pixel rendering process, the polygon includes a rendering target polygon on which the rendering process is performed and a writing polygon that forms a writing object in a target region of the writing process, and the image processing device includes: A first writing memory in which the Z value of a pixel in the writing polygon positioned on the near side of the display screen in the writing polygon is written; and a pixel in the writing polygon positioned on the back side of the display screen in the lighting polygon Second writer to which the Z value of is written A pixel memory in which color data of a pixel displayed on the display screen is written, and a Z value of a pixel in the polygon to be drawn is obtained from the coordinate data. And a drawing processing unit that performs a lighting process for increasing the luminance value on the color data of the pixel when the pixel data is located between the Z values in the writing memory, and writes the color data subjected to the lighting process to the pixel memory. Features.

【0014】上記の画像処理装置によれば、ライティン
グオブジェクトを構成するライティングポリゴンのZ値
を格納したライティングメモリの両Z値と、処理中の描
画対象ポリゴンのピクセルのZ値とを比較する簡単な演
算により、ライティング効果を与えるべきか否かの判定
を行うことができる。
According to the above-described image processing apparatus, a simple Z-value comparison between the two Z-values of the writing memory storing the Z-values of the writing polygons constituting the writing object and the Z-values of the pixels of the polygon to be rendered is being performed. Through the calculation, it can be determined whether or not the lighting effect should be given.

【0015】上記の目的を達成する為に、本発明は、オ
ブジェクトを構成するポリゴンに対して表示画面内の座
標データと色データとを含むポリゴンデータが与えら
れ、前記座標データに従って各ポリゴン内のピクセルの
描画処理を行う画像処理方法において、前記ポリゴン
は、前記描画処理が行われる描画対象ポリゴンとライテ
ィング処理の対象領域のライティングオブジェクトを構
成するライティングポリゴンとを有し、前記画像処理方
法は、前記ライティングポリゴンのデータが与えられた
時、該ライティングポリゴン内のピクセルのZ値を前記
座標データから求め、前記表示画面の手前側及び奥側に
位置する前記ライティングポリゴンの該ピクセルのZ値
を、対応する第一及び第二のライティングメモリ内に書
き込むライティングポリゴン描画工程と、前記描画対象
ポリゴンのデータが与えられた時、該描画対象ポリゴン
内のピクセルのZ値を前記座標データから求め、該ピク
セルのZ値が前記第一及び第二のライティングメモリ内
のZ値の間に位置する場合に当該ピクセルの色データに
輝度値を高めるライティング処理を行い、該ライティン
グ処理された色データをピクセルメモリに書き込む描画
対象ポリゴン描画工程とを有することを特徴とする。
In order to achieve the above object, according to the present invention, polygons including coordinate data and color data in a display screen are given to polygons constituting an object, and polygons in each polygon are given according to the coordinate data. In the image processing method for performing a pixel rendering process, the polygon includes a rendering target polygon on which the rendering process is performed and a lighting polygon that forms a lighting object in a target region of the lighting process, and the image processing method includes: When the data of the writing polygon is given, the Z value of the pixel in the writing polygon is obtained from the coordinate data, and the Z value of the pixel of the writing polygon located on the near side and the back side of the display screen is calculated. Writing points to be written in the first and second writing memories Gon drawing step, and when the data of the drawing target polygon is given, the Z value of the pixel in the drawing target polygon is obtained from the coordinate data, and the Z value of the pixel is stored in the first and second writing memories. A writing process for increasing the luminance value of the color data of the pixel when the pixel data is located between the Z values, and writing the polygon data to the pixel memory. .

【0016】上記の画像処理方法によれば、ライティン
グポリゴンも描画対象ポリゴンも同様にポリゴンとして
処理され、ライティングポリゴンの場合の描画処理はラ
イティングメモリ内へのZ値の書き込みであり、描画対
象ポリゴンの場合の画像処理はピクセルのZ値を利用し
てライティング処理すべきか否かを判定し、必要ならそ
の輝度を高めてピクセルメモリに書き込むことである。
したがって、簡単な演算処理によりポリゴンの所定領域
にライティング効果を与えることができる。
According to the above-described image processing method, both the writing polygon and the polygon to be drawn are processed as polygons. In the case of the writing polygon, the drawing process is to write the Z value into the writing memory. The image processing in such a case is to determine whether or not to perform the lighting process by using the Z value of the pixel, and if necessary, to increase the brightness and write it to the pixel memory.
Therefore, a lighting effect can be given to a predetermined area of the polygon by a simple arithmetic processing.

【0017】[0017]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面に従って説明する。しかしながら、本発明の技術
的範囲がその実施の形態に限定されるものではない。
Embodiments of the present invention will be described below with reference to the drawings. However, the technical scope of the present invention is not limited to the embodiment.

【0018】図1は、ライティング効果の例について示
す図である。この例では、手すりが取り付けられた階段
のオブジェクト12に対して、右横に位置する指向性を
もつ光源10からの光が照射される。階段のオブジェク
ト12を構成するポリゴン13,14,15の一部領域
に光源からのライティング(照射)が行われ、図中斜線
で示した領域16の輝度が高くなる。光源の位置と方向
が変化した場合は、ライティングの領域はオブジェクト
の形状に応じて変化する。
FIG. 1 is a diagram showing an example of a lighting effect. In this example, light from a light source 10 having directivity located on the right side is applied to the object 12 on the stairs to which the handrail is attached. Lighting (irradiation) from a light source is performed on a part of the polygons 13, 14, and 15 constituting the staircase object 12, and the brightness of the region 16 indicated by oblique lines in the drawing increases. When the position and direction of the light source change, the lighting area changes according to the shape of the object.

【0019】図2は、本実施の形態例におけるライティ
ングオブジェクトを説明する図である。図1の例の場合
に、光源10からの光が円錐状(コーン状)に照射され
るときに、その光が照射される領域からなる円錐形状の
ライティングオブジェクト20を定義する。このライテ
ィングオブジェクト20は、通常のオブジェクトと同様
に取り扱われる。即ち、図2の例では、太線で示した円
錐形状のライティングオブジェクト20は、多角錐を構
成する複数の平面ポリゴンで構成される。そして、視点
から見たときに階段オブジェクト12を構成するポリゴ
ン13,14,15のピクセルが、ライティングオブジ
ェクト20内に位置するか否かの判定が行われる。
FIG. 2 is a view for explaining a lighting object in the present embodiment. In the example of FIG. 1, when the light from the light source 10 is radiated in a conical shape (cone shape), a cone-shaped lighting object 20 including an area irradiated with the light is defined. The lighting object 20 is handled in the same manner as a normal object. That is, in the example of FIG. 2, the conical lighting object 20 indicated by the thick line is constituted by a plurality of planar polygons forming a polygonal pyramid. Then, it is determined whether or not the pixels of the polygons 13, 14, and 15 constituting the staircase object 12 when viewed from the viewpoint are located in the lighting object 20.

【0020】図3は、ポリゴンのピクセルがライティン
グオブジェクト20内に位置するか否かの判定を容易に
する為のライティングメモリを説明する図である。図3
に示されたライティングメモリは、図2の表示画面の水
平ライン上に位置するライティングポリゴン内のピクセ
ルのZ値の分布を示す。図2の視点に対して、ライティ
ングオブジェクト20は、視点側の方向に法線ベクトル
を有する手前側ポリゴンと、視点側と反対の方向に法線
ベクトルを有する奥側ポリゴンとから構成される。即
ち、視点に対して、奥側に位置するライティングポリゴ
ンと手前側に位置するライティングポリゴンとから構成
される。
FIG. 3 is a diagram for explaining a writing memory for facilitating determination as to whether or not a pixel of a polygon is located in the lighting object 20. FIG.
2 shows the distribution of the Z values of the pixels in the writing polygon located on the horizontal line of the display screen of FIG. With respect to the viewpoint in FIG. 2, the lighting object 20 is composed of a near-side polygon having a normal vector in a direction toward the viewpoint and a back-side polygon having a normal vector in a direction opposite to the viewpoint. That is, it is composed of a writing polygon located on the back side and a lighting polygon located on the front side with respect to the viewpoint.

【0021】図3(a)は、視点から見て奥側に位置す
るライティングポリゴンのZ値の分布を示す。一方、図
3(b)は、視点から見て手前側に位置するライティン
グポリゴンのZ値の分布を示す。即ち、視点からライテ
ィングオブジェクト20に対して直線を貫通させる場
合、その直線はライティングオブジェクト20に対して
手前側で内部に挿入され、奥側で外部に出ることにな
る。従って、奥側に位置するライティングポリゴンはZ
値が大きく、手前側に位置するライティングポリゴンは
Z値が小さい。従って、図3(a)の分布は、ライティ
ングオブジェクトの視点とは反対側の形状を示し、図3
(b)の分布は、ライティングオブジェクトの視点側の
形状を示す。
FIG. 3A shows the distribution of the Z value of the lighting polygon located on the far side when viewed from the viewpoint. On the other hand, FIG. 3B shows the distribution of the Z value of the lighting polygon located on the near side as viewed from the viewpoint. That is, when a straight line passes through the lighting object 20 from the viewpoint, the straight line is inserted inside the lighting object 20 on the near side and goes outside on the far side. Therefore, the lighting polygon located on the back side is Z
The value is large, and the lighting polygon located on the near side has a small Z value. Therefore, the distribution in FIG. 3A shows the shape on the opposite side to the viewpoint of the lighting object.
The distribution (b) shows the shape of the lighting object on the viewpoint side.

【0022】本実施の形態例では、ライティングオブジ
ェクト20を構成するライティングポリゴンの処理にお
いて、手前側のライティングポリゴンのZ値を格納する
第一のライティングメモリ(図3(b))と、奥側のラ
イティングポリゴンのZ値を格納する第二のライティン
グメモリ(図3(a))とを作成する。その後に、描画
ポリゴンのピクセル毎の描画処理において、そのピクセ
ルのZ値が両メモリのZ値の間の値か否かの判定を行
う。そして、ピクセルのZ値が両メモリのZ値の間の値
である場合は、描画処理中のピクセルがライティングオ
ブジェクトの中に位置すると判断して、その輝度値を上
げた画像データを1フレーム分のピクセルメモリに書き
込む。
In the present embodiment, in the processing of the writing polygon constituting the writing object 20, a first writing memory (FIG. 3B) for storing the Z value of the front side writing polygon and a back side of the first side are stored. A second writing memory (FIG. 3A) for storing the Z value of the writing polygon is created. Thereafter, in the rendering process for each pixel of the rendering polygon, it is determined whether or not the Z value of the pixel is a value between the Z values of both memories. If the Z value of the pixel is a value between the Z values of both memories, it is determined that the pixel being rendered is located in the lighting object, and the image data whose luminance value has been increased is equivalent to one frame. Write to the pixel memory of

【0023】第一のライティングメモリに書き込むべき
手前側のライティングポリゴンか、第二のライティング
メモリに書き込むべき奥側のライティングポリゴンかの
判断は、上記の様に例えばそのZ値を比較することによ
り行うことができる。ここでは、ライティングオブジェ
クトは、凸オブジェクトであることを前提としている。
即ち、凸オブジェクトとは、任意の直線と交差した場合
2点で交差するか、或いは1点で接するかするオブジェ
クトである。
The determination as to whether a front-side writing polygon to be written to the first writing memory or a back-side writing polygon to be written to the second writing memory is made by comparing, for example, the Z value as described above. be able to. Here, it is assumed that the lighting object is a convex object.
That is, a convex object is an object that intersects at two points or intersects at one point when it intersects with an arbitrary straight line.

【0024】別の方法として、ライティングポリゴンの
法線ベクトルを求め、その法線ベクトルのZ値が正であ
れば、奥側に位置するライティングポリゴンであり、そ
のZ値は第二のライティングメモリに書き込むべきポリ
ゴンであり、法線ベクトルのZ値が負であれば、手前側
に位置するライティングポリゴンであり、そのZ値は第
一のライティングメモリに書き込むべきポリゴンである
と判断する。
As another method, a normal vector of the writing polygon is obtained, and if the Z value of the normal vector is positive, the writing polygon is located on the back side, and the Z value is stored in the second writing memory. If the Z value of the normal vector is negative, it is determined that the writing polygon is located on the near side and the Z value is a polygon to be written in the first writing memory.

【0025】図4は、本実施の形態例の画像処理装置の
全体構成図である。この例では、ゲーム装置やシミュレ
ーション装置等の画像処理部として、操作入力に応じて
表示すべきポリゴンの三次元座標値を求め、その三次元
座標値を表示画面座標に透視変換するCPU22と、そ
のCPU22からポリゴンデータを与えられ、ポリゴン
の属性に応じて描画処理を行う描画エンジン24と、そ
の描画エンジン24にメモリバスを介して接続されるピ
クセルメモリ26、Z値メモリ28、第一のライティン
グメモリ30及び第二のライティングメモリ32とを有
する。描画エンジン24には、表示装置34が接続さ
れ、1フレーム分のピクセル毎の画像データが格納され
たピクセルメモリ26から画像データが与えられて、画
像が表示される。
FIG. 4 is an overall configuration diagram of the image processing apparatus according to the present embodiment. In this example, as an image processing unit of a game device, a simulation device, or the like, a CPU 22 that obtains three-dimensional coordinate values of a polygon to be displayed in accordance with an operation input, and performs a perspective transformation of the three-dimensional coordinate values into display screen coordinates, A rendering engine 24 which receives polygon data from the CPU 22 and performs a rendering process according to the attribute of the polygon; a pixel memory 26, a Z value memory 28, and a first writing memory connected to the rendering engine 24 via a memory bus 30 and a second writing memory 32. A display device 34 is connected to the drawing engine 24, and image data is given from a pixel memory 26 in which image data for each pixel of one frame is stored, and an image is displayed.

【0026】図5は、本実施の形態例のポリゴンデータ
の構成例を示す図である。この例では、通常の描画ポリ
ゴン、ライティングオブジェクトを構成するライティン
グポリゴンの両方を構成できるデータ構成を示す。ま
ず、ポリゴン属性データP10として、(1)ライティ
ング非参照ポリゴン、(2)ライティング参照ポリゴ
ン、(3)手前側ライティングポリゴン及び(4)奥側
ライティングポリゴンのいずれかを有する。更に、ポリ
ゴンデータには、ポリゴンの頂点座標V0,V1,V2
を有する。具体的には、透視変換された表示画面の二次
元座標(X0,Y0)、(X1,Y1)、(X2,Y
2)と、それぞれの表示画面内の奥行きを示すZ値Z
0,Z1,Z2から構成される。また、ポリゴンデータ
には、カラーデータ(色データ)が含まれる。図5に示
したカラーデータの例は、単色を示すデータである。更
に複雑なカラーデータの場合は、例えば頂点毎のカラー
データ、ポリゴン表面に貼り付けられるテクスチャーデ
ータ等が含まれる。
FIG. 5 is a diagram showing a configuration example of polygon data according to the present embodiment. This example shows a data configuration that can form both a normal drawing polygon and a writing polygon that forms a lighting object. First, the polygon attribute data P10 has any one of (1) a non-lighting reference polygon, (2) a lighting reference polygon, (3) a front lighting polygon, and (4) a back lighting polygon. Furthermore, the vertex coordinates V0, V1, V2 of the polygon are included in the polygon data.
Having. Specifically, two-dimensional coordinates (X0, Y0), (X1, Y1), (X2, Y
2) and Z value Z indicating the depth in each display screen
0, Z1, and Z2. The polygon data includes color data (color data). The example of the color data shown in FIG. 5 is data indicating a single color. In the case of more complex color data, for example, color data for each vertex, texture data to be pasted on the polygon surface, and the like are included.

【0027】上記したポリゴン属性について、更に説明
すると、(1)ライティング非参照ポリゴンとは、例え
ば、ポリゴンの法線ベクトルが光源とは反対側の方向を
有し、本来ライティング効果の必要がない描画対象ポリ
ゴンである。例えば、光源から影になる部分のポリゴン
である。かかるポリゴンの場合は、例えライティングオ
ブジェックト内に位置しても、ライティング効果を与え
る必要はない。従って、CPU側からライティング効果
が必要ないポリゴンに対しては、この属性が与えられ
る。このポリゴンは、単に描画処理が施されるだけであ
り、ピクセルメモリ26とZ値メモリ28にそのデータ
が書き込まれる。
The above-mentioned polygon attributes will be further described. (1) A non-lighting polygon refers to a drawing in which the normal vector of the polygon has a direction opposite to that of the light source and does not need a lighting effect. This is the target polygon. For example, it is a polygon of a portion that becomes a shadow from a light source. In the case of such a polygon, it is not necessary to provide a lighting effect even if the polygon is located in the lighting object. Accordingly, polygons that do not require a lighting effect are given this attribute by the CPU. This polygon is simply subjected to a drawing process, and the data is written in the pixel memory 26 and the Z value memory 28.

【0028】次に、(2)ライティング参照ポリゴンと
は、ライティング効果を施す必要がある描画対象ポリゴ
ンである。例えば、図1に示された階段を構成するポリ
ゴン13,14,15の如く法線ベクトルが光源10側
を向いているポリゴンである。この属性もCPU22側
から与えられる。ライティング参照ポリゴンの場合は、
ライティングオブジェクト内に位置するか否かの判定が
行われ、更に、描画処理によりピクセルメモリ26とZ
値メモリ28にそのデータが書き込まれる。
Next, (2) the writing reference polygon is a polygon to be rendered which requires a lighting effect. For example, the polygon whose normal vector is directed to the light source 10 side is the polygon such as the polygons 13, 14, and 15 constituting the steps shown in FIG. This attribute is also given from the CPU 22 side. For lighting reference polygons,
A determination is made as to whether the pixel memory 26 is located within the lighting object or not.
The data is written to the value memory 28.

【0029】ライティングオブジェクトを構成するライ
ティングポリゴンは、(3)手前側ライティングポリゴ
ンと(4)奥側ライティングポリゴンとに分けられる。
この分け方は、既に説明した通りであり、ここの例では
CPU22において既に区分けし、それぞれの属性をポ
リゴン属性P10として与える。ライティングポリゴン
の場合は、ライティングメモリ30,32にそのZ値デ
ータが書き込まれる。
The lighting polygons constituting the lighting object are divided into (3) a front side lighting polygon and (4) a back side lighting polygon.
This dividing method is as described above. In this example, the CPU 22 already divides the image and gives each attribute as a polygon attribute P10. In the case of a writing polygon, the Z value data is written in the writing memories 30 and 32.

【0030】図6は、ライティング処理を伴う画像処理
の例のフローチャート図である。フローチャートに示さ
れた工程に沿って処理の概略を説明する。CPU22
は、遊技者や操作者により入力される入力操作信号に従
って、三次元空間内の幾何演算を行い画面内のポリゴン
の三次元座標を求め、表示画面座標に透視変換する(S
10)。そして、それぞれのポリゴン毎に図5で示した
ポリゴンデータを描画エンジン24に順次与える。通常
は、1つのフレームの中のライティングポリゴンが先に
与えられる。与えられたライティングポリゴンに対し
て、描画エンジン24では、例えばポリゴンをラスタス
キャンして、頂点のZ値から補間演算することによりピ
クセル毎のZ値を求め、対応するライティングメモリ3
0,32に書き込む。CPU22から与えられるポリゴ
ンの属性が手前側のライティングポリゴンである場合
は、第一のライティングメモリ30にそのZ値Z1が記
憶され、奥側のライティングポリゴンである場合は、第
二のライティング32にそのZ値Z2が記憶される。
FIG. 6 is a flowchart of an example of image processing involving lighting processing. An outline of the processing will be described along the steps shown in the flowchart. CPU 22
Performs a geometric operation in a three-dimensional space according to an input operation signal input by a player or an operator to obtain three-dimensional coordinates of polygons in a screen, and performs perspective transformation to display screen coordinates (S
10). Then, the polygon data shown in FIG. 5 is sequentially provided to the drawing engine 24 for each polygon. Normally, the lighting polygon in one frame is given first. For the given writing polygon, the rendering engine 24 performs, for example, raster scanning of the polygon and performs an interpolation operation from the Z value of the vertex to obtain a Z value for each pixel.
Write to 0,32. If the attribute of the polygon provided by the CPU 22 is a front-side writing polygon, the Z value Z1 is stored in the first writing memory 30. If the attribute is a back-side writing polygon, the Z-value Z1 is stored in the second lighting 32. The Z value Z2 is stored.

【0031】次に、CPU22から描画エンジン24
に、描画ポリゴンのポリゴンデータが与えられる。描画
ポリゴンのうち、ライティング効果を与える必要がある
ポリゴンに対して、ラスタスキャン等により求めたピク
セル毎のZ値を、ライティングメモリ内のZ値Z1,Z
2と比較し、両Z値の間にピクセルのZ値が位置するか
否かの判定を行う(S14)。その判定の結果、ピクセ
ルのZ値が両Z値の間に位置する場合は、カラーデータ
に対してその輝度値を上げた場合のカラーデータに修正
するライティング処理を行い、そのデータを画像データ
としてピクセルメモリ26の対応するピクセル領域に書
き込む(S16)。上記のステップS14,S16は、
描画ポリゴン内のピクセル全てに対して行われ、また全
ての描画ポリゴンに対しても行われる。
Next, from the CPU 22 to the drawing engine 24
Is given polygon data of the drawing polygon. Among the drawing polygons, the Z value for each pixel obtained by raster scanning or the like for the polygon for which a lighting effect needs to be given is replaced with the Z values Z1, Z in the writing memory.
Then, it is determined whether or not the Z value of the pixel is located between the two Z values (S14). As a result of the determination, if the Z value of the pixel is located between the two Z values, a lighting process for correcting the color data to color data when the luminance value is increased is performed, and the data is used as image data. The data is written to the corresponding pixel area of the pixel memory 26 (S16). The above steps S14 and S16
This is performed for all the pixels in the drawing polygon, and also for all the drawing polygons.

【0032】尚、Z値メモリ28には、初期値として例
えば無限大のデータが書き込まれる。そして、その後に
描画すべきポリゴンのピクセルのZ値との比較が行わ
れ、処理中のピクセルのZ値が小さい場合は、手前に位
置するとして、その画像データがピクセルメモリ26に
書き込まれ、そのピクセルのZ値がZ値メモリに新たに
書き込まれる。Z値メモリ28を利用することにより、
描画ポリゴンをアトランダムに描画エンジンに与えて
も、表示すべきピクセルの画像データのみがピクセルメ
モリ26に書き込まれる。
Incidentally, for example, infinite data is written in the Z value memory 28 as an initial value. Then, a comparison with the Z value of the pixel of the polygon to be drawn is performed. If the Z value of the pixel being processed is small, it is determined that the pixel is located on the near side, and the image data is written to the pixel memory 26. The Z value of the pixel is newly written to the Z value memory. By using the Z value memory 28,
Even if rendering polygons are given to the rendering engine at random, only the image data of the pixels to be displayed is written to the pixel memory 26.

【0033】1フレーム内の全てのポリゴンに対する描
画処理が終了すると、ピクセルメモリ26に書き込まれ
た画像データが読み出され、表示装置に与えられ、ライ
ティング処理された画像が表示される(S18)。
When the drawing process for all the polygons in one frame is completed, the image data written in the pixel memory 26 is read out, given to the display device, and the image subjected to the lighting process is displayed (S18).

【0034】以上が、ライティング処理を伴う画像処理
の例である。上記説明から明らかな通り、従来から一般
に行われている、ポリゴン内のピクセル毎の描画処理に
加えて、ライティングポリゴンをライティングメモリに
描画する処理工程と、描画ポリゴンに対してピクセル毎
にライティングオブジェクト内に位置するか否かのZ値
の比較工程とが追加されるだけである。しかも、追加さ
れた処理は、内積値を求める等と異なり、簡単な演算を
伴うだけである。
The above is an example of image processing involving lighting processing. As is clear from the above description, in addition to the drawing processing for each pixel in a polygon, which has been conventionally performed in general, a processing step of drawing a writing polygon in a writing memory, Is simply added. Moreover, the added processing differs from the calculation of the inner product value and the like, and involves only a simple operation.

【0035】図7は、描画エンジンの詳細構成を示す図
である。図4と対応する部分には同じ引用番号を付して
いる。CPU22は、前述した通り、全てのポリゴンの
頂点座標変換等の幾何学演算を行い、表示画面の二次元
座標に透視変換されたポリゴンデータを描画コマンドD
1として描画エンジン24に与える。CPU22の演算
処理やプログラムの制御時に、ROMやRAM等のメモ
リ23が利用される。
FIG. 7 is a diagram showing a detailed configuration of the drawing engine. Parts corresponding to those in FIG. 4 are denoted by the same reference numerals. As described above, the CPU 22 performs a geometric operation such as vertex coordinate conversion of all polygons, and converts the perspectively transformed polygon data into two-dimensional coordinates on the display screen using the drawing command D.
1 is given to the drawing engine 24. A memory 23 such as a ROM and a RAM is used when the CPU 22 performs arithmetic processing and program control.

【0036】描画エンジン24は、ライティングポリゴ
ンのライティングメモリへの描画、描画ポリゴンのピク
セルメモリ及びZ値メモリへの描画を行う。まず、描画
エンジン24内には、全体の描画処理のタイミング制御
部241が設けられる。CPU22からの描画コマンド
D1は、CPUバスインターフェース部242に入力さ
れる。入力された描画コマンドD1は、描画コマンドラ
ッチ部243でそのポリゴンの描画処理が終了するまで
記憶される。描画コマンド解析部244にて、描画コマ
ンドD1が解析され、図5で示した4種類のポリゴン属
性の解析が行われる。
The drawing engine 24 performs drawing of a writing polygon on a writing memory and drawing of a drawing polygon on a pixel memory and a Z-value memory. First, a timing control unit 241 for the entire drawing process is provided in the drawing engine 24. The drawing command D1 from the CPU 22 is input to the CPU bus interface unit 242. The input drawing command D1 is stored in the drawing command latch unit 243 until drawing processing of the polygon is completed. The drawing command analysis unit 244 analyzes the drawing command D1, and analyzes the four types of polygon attributes shown in FIG.

【0037】更に、稜線処理部245では、ポリゴンを
ラスタスキャンする為の1ラインのデータD2を生成す
る。具体的には、ポリゴンの頂点間を結ぶ稜線に沿って
1ラインの視点Sと終点Eの二次元座標とZ値とが、頂
点データに基づいて補間演算法により求められる。図1
1は、そのラスタスキャンを説明する図である。三角形
のポリゴンに対して、頂点0,1,2の稜線R01とR02
上の点Sと点Eとの座標値が、それぞれの内分比t1,
t2及びt3,t4により補間演算により求められる。
その結果、1ラインの始点S(Sx Sy Sz )と終点
(Ex Ey Ez )の座標がそれぞれ求められる。そし
て、ライン発行部247は、上記の始点Sと終点Eとの
座標値を1ラインのデータD2として、ライン処理部2
5に与える。
Further, the ridge processing unit 245 generates one-line data D2 for raster-scanning the polygon. Specifically, the two-dimensional coordinates and the Z value of the viewpoint S and the end point E of one line along the ridge line connecting the vertices of the polygon are obtained by the interpolation calculation method based on the vertex data. FIG.
FIG. 1 is a diagram illustrating the raster scan. For triangular polygons, edges R01 and R02 at vertices 0, 1, 2
The coordinate values of the upper point S and the point E are represented by the respective internal division ratios t1,
It is obtained by an interpolation operation using t2, t3, and t4.
As a result, the coordinates of the start point S (SxSySz) and the end point (ExEyEz) of one line are obtained. Then, the line issuing unit 247 sets the coordinate values of the start point S and the end point E as one-line data D2,
Give 5

【0038】ライン処理部25では、上記稜線発行部2
46で生成されたライン内のピクセルの描画処理が行わ
れる。ライン内の各ピクセルは、始点Sと終点Eでの座
標データを内分比で補間することにより求められる。ラ
イン用データラッチ部251では、与えられた1ライン
分のデータが1ラインの描画処理が終了するまで記憶さ
れる。Z値算出部252では、各ピクセルのZ値が、始
点Sと終点EのZ値Sz 、Ez とを内分比に従って補間
演算することにより求められる。
In the line processing unit 25, the ridge line issuing unit 2
The drawing process of the pixels in the line generated in 46 is performed. Each pixel in the line is obtained by interpolating the coordinate data at the start point S and the end point E by the internal division ratio. The line data latch unit 251 stores the given data for one line until the drawing processing for one line is completed. The Z value calculator 252 obtains the Z value of each pixel by interpolating the Z values Sz and Ez of the start point S and the end point E according to the internal division ratio.

【0039】Z値メモリのZ値比較部253では、処理
中のピクセルのZ値と既にZ値メモリ28に格納されて
いる描画対象のピクセルのZ値とが比較される。ここで
の比較は、一般的なZ値バッファを利用した描画処理と
同じであり、より手前に位置するピクセルのZ値が最も
小さいことを利用して、表示すべきピクセルか否かの判
定をZ値メモリ内のZ値と比較することにより行う。
The Z value comparing section 253 of the Z value memory compares the Z value of the pixel being processed with the Z value of the pixel to be drawn already stored in the Z value memory 28. The comparison here is the same as a drawing process using a general Z-value buffer, and using the fact that the Z-value of the pixel located in the foreground is the smallest, it is determined whether or not the pixel is a pixel to be displayed. This is performed by comparing with the Z value in the Z value memory.

【0040】一方、ライティングメモリのZ値比較部2
54では、処理中のポリゴンの属性に応じて異なる処理
がなされる。即ち、処理中のポリゴンがライティング非
参照ポリゴンの場合は、ここのZ値比較部254での処
理は行われない。処理中のポリゴンがライティング参照
ポリゴンの場合は、処理中のピクセルのZ値とライティ
ングメモリ30,32内に記憶されているZ値Z1,Z
2とが比較される。Z1<処理中ピクセルのZ値<Z2
の関係にあれば、そのピクセルの輝度値が高められる。
処理中のポリゴンが手前側ライティングポリゴンの場合
は、処理中のピクセルのZ値が第一のライティングメモ
リ30に記憶され、処理中のポリゴンが奥側ライティン
グポリゴンの場合は、処理中のピクセルのZ値が第二の
ライティングメモリ32に記憶される。
On the other hand, the Z value comparison unit 2 of the writing memory
At 54, different processing is performed according to the attribute of the polygon being processed. That is, if the polygon being processed is a non-lighting reference polygon, the processing in the Z value comparison unit 254 is not performed. If the polygon being processed is a lighting reference polygon, the Z value of the pixel being processed and the Z values Z1, Z stored in the lighting memories 30, 32
2 is compared. Z1 <Z value of pixel under processing <Z2
, The luminance value of the pixel is increased.
If the polygon being processed is the front side writing polygon, the Z value of the pixel being processed is stored in the first writing memory 30. If the polygon being processed is the back side writing polygon, the Z value of the pixel being processed is stored. The value is stored in the second writing memory 32.

【0041】Zメモリインターフェース部255は、Z
値メモリ28とのインターフェースを行い、ライティン
グメモリインターフェース部256は、ライティングメ
モリ30,32とのインターフェースを行う。
The Z memory interface unit 255
The interface with the value memory 28 is performed, and the writing memory interface unit 256 interfaces with the writing memories 30 and 32.

【0042】ピクセル描画許可判別部257では、処理
中のピクセルを描画すべきか否か、描画する場合に輝度
を高めるべきか否かを判別し、ライティングエリア内の
ピクセルに対して輝度を高める処理も行う。この判断、
処理については後で詳述する。以上がライン処理部25
の構成である。
The pixel drawing permission determining unit 257 determines whether or not to draw a pixel being processed and whether or not to increase the brightness when drawing, and also increases the brightness of the pixels in the writing area. Do. This judgment,
The processing will be described later in detail. The above is the line processing unit 25
It is a structure of.

【0043】更に、描画エンジン24には、ピクセルデ
ータ決定部248が設けられる。このピクセルデータ決
定部248は、ピクセル描画許可判別部257が出力す
る描画許可信号によって、最終的にピクセルメモリ26
に書き込むデータを決定する。即ち、処理中のライティ
ング参照ポリゴンのピクセルがライティングオブジェク
ト内に位置する場合は、ポリゴンカラーの輝度を高める
処理が行われる。それ以外の場合は、ピクセルのポリゴ
ンカラーがそのままピクセルメモリ26に書き込まれ
る。以上の様に、ライティング処理されたピクセルデー
タD9が、ピクセルメモリインターフェース部27を介
して、ピクセルメモリ26に記憶される。また、表示ピ
クセル読み出し部35により、ピクセルメモリ26内の
ピクセルデータが表示制御部26において、例えばデレ
ビ用の同期信号に重畳されて画像信号D10として、表
示装置であるテレビ受像器34に与えられる。
Further, the drawing engine 24 is provided with a pixel data determination unit 248. The pixel data determination unit 248 finally determines the pixel memory 26 based on the drawing permission signal output from the pixel drawing permission determination unit 257.
Determine the data to be written to That is, when the pixel of the lighting reference polygon being processed is located in the lighting object, processing for increasing the brightness of the polygon color is performed. Otherwise, the polygon color of the pixel is written to the pixel memory 26 as it is. As described above, the pixel data D9 subjected to the lighting process is stored in the pixel memory 26 via the pixel memory interface unit 27. Further, the display pixel readout unit 35 superimposes the pixel data in the pixel memory 26 on the synchronizing signal for, for example, a video signal in the display control unit 26 and provides the image signal D10 to the television receiver 34 as a display device.

【0044】図8は、図7の描画エンジンでの処理の詳
細フローチャート図である。図9は、更に描画エンジン
の中のライン処理部での処理の詳細フローチャート図で
ある。更に、図10は、ライティングメモリ、ピクセル
メモリのデータの変遷を示す図である。図7、図10を
参照しながら、フローチャートに従って詳細な処理を説
明する。
FIG. 8 is a detailed flowchart of the processing in the drawing engine of FIG. FIG. 9 is a detailed flowchart of the processing in the line processing unit in the drawing engine. FIG. 10 is a diagram showing transition of data in the writing memory and the pixel memory. Detailed processing will be described according to flowcharts with reference to FIGS.

【0045】1つのフレームを描画するにあたり、図1
0(a)に示される通り、ライティングメモリ1,2に
は、ピクセルに対応する領域にそれぞれ無限大∞のZ値
が初期値として書き込まれる。また、ピクセルメモリ2
6にはピクセルに対応する領域にそれぞれ透明データT
が書き込まれる。これらのメモリは、望ましくはピクセ
ル毎に記憶領域を有する。メモリ領域を小さくする為
に、数ピクセル毎に記憶領域を割り当てることもでき
る。
In drawing one frame, FIG.
As shown in FIG. 0 (a), in the writing memories 1 and 2, a Z value of infinity ∞ is written as an initial value in an area corresponding to each pixel. Also, the pixel memory 2
6 shows the transparent data T in each of the areas corresponding to the pixels.
Is written. These memories preferably have a storage area for each pixel. In order to reduce the memory area, a storage area can be allocated every several pixels.

【0046】最初にCPUバスインターフェース部24
2が、CPU22から描画コマンドデータD1を取得す
る。この描画コマンドD1には図5で示したポリゴンデ
ータが含まれる。そして、描画コマンドラッチ部243
に記憶される(S40)。描画コマンドラッチ部243
から読み出されたポリゴン属性のデータが、描画コマン
ド解析部244で判別され(S41)、ライティング非
参照ポリゴン描画の場合は、ライティングスイッチをオ
フに、ライティングメモリ1スイッチとライティングメ
モリ2スイッチとを共にオフにする(S42,S4
3)。これらのスイッチは、例えばレジスタ内のフラグ
等で実現される。また、ライティング参照ポリゴンの場
合は、ライティングスイッチがオン、ライティングメモ
リスイッチは共にオフとなる(S44,S45)。更
に、手前側ライティングポリゴンの場合は、ライティン
グスイッチがオン、ライティングメモリ1のスイッチが
オン、ライティングメモリ2のスイッチがオフとなる
(S46,S47)。奥側ライティングポリゴンの場合
は、逆にライティングメモリ2のスイッチがオンとなる
(S48,S49)。
First, the CPU bus interface unit 24
2 obtains the drawing command data D1 from the CPU 22. This drawing command D1 includes the polygon data shown in FIG. Then, the drawing command latch unit 243
(S40). Drawing command latch unit 243
Is determined by the drawing command analysis unit 244 (S41). In the case of writing non-reference polygon drawing, the writing switch is turned off and both the writing memory 1 switch and the writing memory 2 switch are turned off. Turn off (S42, S4
3). These switches are realized by, for example, flags in a register. In the case of a writing reference polygon, the writing switch is turned on and the writing memory switch is turned off (S44, S45). Further, in the case of the front side writing polygon, the lighting switch is turned on, the switch of the writing memory 1 is turned on, and the switch of the writing memory 2 is turned off (S46, S47). In the case of the back side writing polygon, the switch of the writing memory 2 is turned on (S48, S49).

【0047】次に、稜線処理部245において、描画コ
マンドD1に含まれるポリゴンの頂点座標から、補間演
算により稜線状の始点Sと終点Eの座標が求められる
(S50)。図11に示した通り、これにより1ライン
分の座標データが生成される。この1ラインのデータD
2がライン処理部25に与えられて、上記のコマンド解
析部で判別したポリゴンの属性に応じた処理が行われる
(S51)。この処理については、図9に詳細に示され
る。
Next, in the ridge processing unit 245, the coordinates of the start point S and the end point E of the ridge are obtained by interpolation from the vertex coordinates of the polygon included in the drawing command D1 (S50). As shown in FIG. 11, this generates coordinate data for one line. This one line of data D
2 is given to the line processing unit 25, and processing according to the attribute of the polygon determined by the command analysis unit is performed (S51). This process is shown in detail in FIG.

【0048】上記の処理が、ポリゴンの全てのラインに
ついて終了すると(S52)、1つのポリゴンの処理が
終了する。そして、1フレーム内の全てのポリゴンに対
する処理が終了してから、そのフレームの表示が行われ
る。
When the above processing is completed for all the lines of the polygon (S52), the processing for one polygon is completed. After the processing for all the polygons in one frame is completed, the display of the frame is performed.

【0049】図9は、図8のステップS51でライン描
画部を起動してから後のライン描画部での詳細な処理を
示す。図11に示される通り、稜線上の始点Sから終点
Eまでの1ライン上のピクセルについて、順に処理が行
われる。ライン用データラッチ部251により1ライン
データが入力され、1ライン分の処理が終了するまでラ
ッチされる(S53)。そこで、Z値算出部252によ
り、ピクセル毎の画面上の座標(X、Y)が補間演算に
より算出される(S54)。更に、ピクセル毎のZ座標
も同様に算出される(S55)。
FIG. 9 shows detailed processing in the line drawing unit after the line drawing unit is activated in step S51 of FIG. As shown in FIG. 11, the processing is sequentially performed on the pixels on one line from the start point S to the end point E on the ridge line. One line data is input by the line data latch unit 251 and latched until the processing for one line is completed (S53). Therefore, the coordinates (X, Y) on the screen for each pixel are calculated by the interpolation calculation by the Z value calculation unit 252 (S54). Further, the Z coordinate for each pixel is calculated in the same manner (S55).

【0050】そこで、処理中のポリゴンがライティング
ポリゴンの場合は、ライティングメモリスイッチのいず
れかがオンであるので(S56,S58)、Z値比較部
254により、インターフェース部256を介して対応
するライティングメモリ30,32にそのピクセルのZ
値をメモリ内の(X、Y)座標に対応する領域に書き込
む(S57,S59)。ライティングポリゴンに対する
処理は以上で終了である。
If the polygon being processed is a writing polygon, one of the writing memory switches is turned on (S56, S58), so that the Z value comparison unit 254 outputs the corresponding writing memory via the interface unit 256. 30 and 32 indicate the Z of the pixel.
The value is written in the area corresponding to the (X, Y) coordinates in the memory (S57, S59). This is the end of the processing for the lighting polygon.

【0051】この時点でのライティングメモリ内のデー
タ例が、図10(b)に示される。この例では、両ライ
ティングメモリのピクセルP=3〜6に、それぞれ手前
側のライティングポリゴンのZ値と、奥側のライティン
グポリゴンのZ値とが記憶される。
FIG. 10B shows an example of data in the writing memory at this time. In this example, the Z value of the writing polygon on the near side and the Z value of the writing polygon on the back side are stored in pixels P = 3 to 6 of both writing memories, respectively.

【0052】処理中のポリゴンが描画ポリゴンの場合
は、ライティングメモリスイッチが共にオフであるので
(S56,S58)、Z値比較部253により、座標
(X、Y)に対応するZ値Z’がZ値メモリ28から読
み出される(S60)。そして、そのZ値Z’が処理中
のピクセルのZ値Zと比較され、Z<Z’の場合は、処
理中のピクセルが手前に位置して描画すべきピクセルで
あることが判明する(S61)。その場合は、ピクセル
描画許可判別部257が、Z値メモリ28に新たなZ値
Zを書き込んで更新する(S62)。
When the polygon being processed is a drawing polygon, the writing memory switches are both off (S56, S58), and the Z value Z 'corresponding to the coordinates (X, Y) is calculated by the Z value comparing unit 253. It is read from the Z value memory 28 (S60). Then, the Z value Z ′ is compared with the Z value Z of the pixel being processed, and if Z <Z ′, it is determined that the pixel being processed is a pixel to be drawn in front of the pixel (S61). ). In that case, the pixel drawing permission determining unit 257 writes a new Z value Z in the Z value memory 28 and updates it (S62).

【0053】更に、ライティングスイッチがオン(S6
3)の場合は、ライティング参照ポリゴンであるので、
ライティング処理が必要か否かの判定がZ値比較部25
4及びピクセル描画許可判別部257にて行われる。具
体的には、Z値比較部254がライティングメモリ1と
2からそれぞれのZ値Z1,Z2を読み出し(S64、
S65)、処理中のピクセルのZ値が両Z値Z1,Z2
の間に位置するか否かの判定が行われる(S66)。両
Z値Z1,Z2の間に位置する場合は、処理中のピクセ
ルがライティングオブジェクト内に位置することを意味
し、ピクセルデータ決定部248にて、ピクセルカラー
をポリゴンデータから算出すると共にその輝度値を高め
る処理が行われる(S68)。
Further, the lighting switch is turned on (S6).
In the case of 3), since it is a lighting reference polygon,
The determination whether the lighting process is necessary is made by the Z value
4 and the pixel drawing permission determining unit 257. Specifically, the Z value comparison unit 254 reads the respective Z values Z1 and Z2 from the writing memories 1 and 2 (S64,
S65), when the Z value of the pixel being processed is the two Z values Z1 and Z2
Is determined (S66). If the pixel is located between the two Z values Z1 and Z2, it means that the pixel being processed is located within the lighting object, and the pixel data determination unit 248 calculates the pixel color from the polygon data and the luminance value. Is performed (S68).

【0054】例えば、図10(c)に太線で示される通
り、描画すべき通常ポリゴンがピクセルP=2からP=
7まで描画されるとすると、それに対応するピクセルの
Z値Zが、ライティングメモリ30,32に記憶された
Z値と比較される。その結果、ピクセルP=2,3,7
に対しては、ライティングオブジェクトの外に位置する
と判断され、カラーデータCがそのままピクセルデータ
としてピクセルメモリ26に書き込まれる。更に、ピク
セルP=4.5.6に対しては、ライティングオブジェ
クトの中に位置すると判断され、カラーデータに対して
輝度値が高められたデータCCがピクセルデータとして
ピクセルメモリ26に書き込まれる(S69)。
For example, as shown by the bold line in FIG. 10C, the normal polygons to be drawn are pixels P = 2 to P =
If the drawing is performed up to 7, the Z value Z of the corresponding pixel is compared with the Z values stored in the writing memories 30 and 32. As a result, pixel P = 2, 3, 7
Is determined to be located outside the lighting object, and the color data C is written to the pixel memory 26 as pixel data as it is. Further, for the pixel P = 4.5.6, it is determined that it is located in the lighting object, and the data CC whose luminance value has been increased with respect to the color data is written to the pixel memory 26 as pixel data (S69). ).

【0055】ライティングスイッチがオフ(S63)の
場合は、例えば光源から影になる位置或いは方向を向い
たポリゴンであり、ライティング非参照ポリゴンである
ので、ピクセルデータ決定部248にて通常通りピクセ
ルカラーをポリゴンデータから算出される(S67)。
ライティング効果の処理は行われない。そして最後に、
そのデータがピクセルメモリ26に書き込まれる(S6
9)。
When the lighting switch is off (S63), the polygon is, for example, a polygon oriented in a position or a direction from a light source to a shadow and is a non-lighting reference polygon. It is calculated from the polygon data (S67).
No processing of the lighting effect is performed. And finally,
The data is written to the pixel memory 26 (S6
9).

【0056】以上の通り、最初にライティングポリゴン
に対する描画処理が行われてライティングメモリへのZ
値の書き込みが行われた後に、描画対象のポリゴンの描
画処理が行われる。その場合は、ライティング参照ポリ
ゴンに対してはライティングメモリのZ値との比較が行
われ、ライティング対象のポリゴンの場合は、その輝度
値を高める処理が行われる。表示すべきピクセルか否か
の判別は、通常通り、Z値メモリを利用して、Z値が最
も手前にあるピクセルのカラーデータのみがピクセルデ
ータとしてピクセルメモリ(フレームメモリ)に書き込
まれる。
As described above, first, the drawing processing is performed on the writing polygon, and the Z is stored in the writing memory.
After the value has been written, the drawing processing of the drawing target polygon is performed. In this case, the writing reference polygon is compared with the Z value of the writing memory, and in the case of a writing target polygon, a process of increasing the brightness value is performed. To determine whether a pixel is to be displayed or not, as usual, using the Z value memory, only the color data of the pixel having the foremost Z value is written to the pixel memory (frame memory) as pixel data.

【0057】図12は、1フレーム内に複数の光源が含
まれ、従って複数のライティングオブジェクトが存在す
る場合を示す図である。図12では、光源10Aと10
Bに対してライティングオブジェクト20Aと20Bと
が存在する。この例では、ライティングオブジェクト2
0Aが画面のより手前側に位置する。かかる場合に、両
方のライティングオブジェクトを合体したオブジェクト
をライティングオブジェクトとすると、その形状は、凸
オブジェクトにはならず、凹オブジェクトになる可能性
がある。その場合は、凸部分には光が照射されていない
にもかかわらずライティングメモリの両Z値の間に位置
するピクセルにも輝度値を高める処理が施される可能性
がある。
FIG. 12 is a diagram showing a case where a plurality of light sources are included in one frame and a plurality of lighting objects are present. In FIG. 12, the light sources 10A and 10A
B has lighting objects 20A and 20B. In this example, lighting object 2
0A is located closer to the screen. In such a case, if an object obtained by combining both the lighting objects is set as a lighting object, the shape may not be a convex object but a concave object. In such a case, there is a possibility that a process of increasing the luminance value is performed on a pixel located between the two Z values of the writing memory even though the convex portion is not irradiated with light.

【0058】そこで、本実施の形態例では、複数の光源
が存在する場合は、それぞれのライティングオブジェク
トに対して一対のライティングメモリを割り当てる。図
13は、図12の例の場合にライティングオブジェクト
20Aと20Bそれぞれに割り当てられたライティング
メモリ(図13(1) 〜(4) )を示す図である。図3の場
合と同様に、表示画面のある水平線上におけるピクセル
での、Z値がそれぞれ太線で示される。破線は、同じラ
イティングオブジェクトの反対側のZ値を示す。
Therefore, in this embodiment, when a plurality of light sources are present, a pair of lighting memories is allocated to each lighting object. FIG. 13 is a diagram showing the writing memories (FIGS. 13 (1) to (4)) assigned to the lighting objects 20A and 20B in the case of the example of FIG. As in the case of FIG. 3, the Z values at pixels on a certain horizontal line of the display screen are indicated by thick lines. The dashed line indicates the opposite Z value of the same lighting object.

【0059】この様に、ライティングオブジェクト毎に
一対のライティングメモリを設けることで、常にライテ
ィングオブジェクトを凸オブジェクトとして取り扱うこ
とができる。従って、上記した処理の延長上で複数の光
源に対するライティング処理を簡単に行うことができ
る。
As described above, by providing a pair of lighting memories for each lighting object, the lighting object can always be handled as a convex object. Therefore, the lighting process for a plurality of light sources can be easily performed on an extension of the above process.

【0060】[ライティング効果以外の効果を与える処
理の例]上記の実施の形態例では、光源に対するライテ
ィングオブジェクトの領域は光が照射される領域として
その後の輝度値を高めるなどのライティング処理を行っ
た。しかし、任意のオブジェクト内に処理中のピクセル
のZ値が位置するか否かの判定を利用して、ライティン
グ以外の効果を与えることも可能になる。
[Example of Process for Providing Effects Other than Lighting Effect] In the above-described embodiment, the lighting object region for the light source is subjected to lighting processing such as increasing the luminance value after that as a region to be irradiated with light. . However, it is also possible to give an effect other than lighting by using the determination as to whether or not the Z value of the pixel being processed is located within an arbitrary object.

【0061】図14は、シェーディングオブジェクトを
利用してポリゴンの一部の表面にシェーディング処理を
施す場合を説明する図である。図14の例は、光源10
に対してその光を遮蔽する物体100が存在する場合の
例である。例えば、指向性のない光源10の存在によ
り、画面内のポリゴンは一律輝度値を高める処理が施さ
れる。しかし、遮蔽物100の存在により階段のポリゴ
ン111,112,113上にはその影であるシェーデ
ィング領域120が生成される。このシェーディング領
域120を生成する為に、上記のライティングオブジェ
クトと同等の考え方によるシェーディングオブジェクト
110を利用する。
FIG. 14 is a diagram for explaining a case where shading processing is performed on a partial surface of a polygon using a shading object. The example of FIG.
This is an example in the case where there is an object 100 that blocks the light. For example, due to the presence of the light source 10 having no directivity, polygons in the screen are subjected to a process of uniformly increasing the luminance value. However, due to the presence of the shield 100, a shading area 120, which is a shadow thereof, is generated on the polygons 111, 112, and 113 of the steps. In order to generate the shading area 120, the shading object 110 based on the same concept as the above-described lighting object is used.

【0062】即ち、光源10と遮蔽物100から形成さ
れるシェーディングオブジェクト110がCPUにより
生成され、そのシェーディングオブジェクトを構成する
シェーディングポリゴンが生成される。その後の処理
は、上記したライティングオブジェクトの場合と同様
に、一対のシェーディングメモリ内に手前側と奥側のシ
ェーディングポリゴンのZ値を記憶し、その後に処理さ
れる描画対象ポリゴンに対して、ピクセルが両方のシェ
ーディングメモリのZ値の間に入るか否かの判断が行わ
れる。間に入る場合は、そのピクセルの輝度値を低める
等のシェーディング処理が施される。
That is, a shading object 110 formed by the light source 10 and the shield 100 is generated by the CPU, and a shading polygon constituting the shading object is generated. In the subsequent processing, as in the case of the lighting object described above, the Z values of the front and rear shading polygons are stored in a pair of shading memories. A determination is made as to whether it falls between the Z values of both shading memories. If the pixel falls within the range, shading processing such as lowering the luminance value of the pixel is performed.

【0063】従って、シェーディングポリゴンという属
性を追加し、シェーディングメモリを追加することによ
り、ライティングオブジェクトの場合と同様の簡単な演
算処理によりポリゴン表面の一部の領域にシェーディン
グ効果を与えることができる。
Therefore, by adding an attribute called a shading polygon and adding a shading memory, a shading effect can be given to a partial area on the polygon surface by the same simple arithmetic processing as in the case of a lighting object.

【0064】図15は、三次元クリッピングオブジェク
トの例を示す図である。図15の例では、三次元クリッ
ピングオブジェクトを利用してオブジェクトの内部の状
態を一部表示する処理がなされる。図15(a)は、本
棚のオブジェクトが表示される例である。この本棚のオ
ブジェクトを構成するポリゴン131,132,133
の内部は、図15(a)の画面からは見えない。
FIG. 15 is a diagram showing an example of a three-dimensional clipping object. In the example of FIG. 15, a process of partially displaying the internal state of the object using the three-dimensional clipping object is performed. FIG. 15A shows an example in which bookshelf objects are displayed. Polygons 131, 132, 133 that make up the bookshelf object
Is not visible from the screen of FIG.

【0065】そこで、本実施の形態例では、例えば球状
の三次元クリッピングオブジェクトを導入する。この三
次元クリッピングオブジェクトも、ライティングオブジ
ェクトと同様にピクセルメモリ内には描画されず、一対
のクリッピングメモリに奥側のZ値と手前側のZ値とが
記憶される。そして、描画ポリゴンの処理中のピクセル
がクリッピングメモリのZ値の間に位置する場合は、そ
のピクセルに対してピックセルメモリ内に何らデータを
書き込まないというクリッピング処理を行う。即ち、三
次元クリッピングオブジェクト内に位置するピクセルの
描画を行わない処理である。その結果、クリッピングオ
ブジェクトが存在する位置は、えぐられた様な効果で表
示される。尚、このクリッピング処理により、当然なが
らZ値メモリにもそのピクセルのZ値は書き込まれな
い。
Therefore, in this embodiment, for example, a spherical three-dimensional clipping object is introduced. The three-dimensional clipping object is not drawn in the pixel memory like the lighting object, and the Z value on the far side and the Z value on the near side are stored in a pair of clipping memories. If the pixel being processed for the drawing polygon is located between the Z values of the clipping memory, a clipping process of not writing any data in the pick cell memory is performed on the pixel. That is, this is a process in which pixels located in the three-dimensional clipping object are not drawn. As a result, the position where the clipping object is present is displayed with a scrambled effect. By the clipping process, the Z value of the pixel is not written in the Z value memory.

【0066】図15(b)は、球状の三次元クリッピン
グオブジェクト130(図示されず)の位置のポリゴン
が表示されないので、この例では、ポリゴン131,1
32の一部が非表示になり、ポリゴン133の内面側が
表示される。かかる効果は、例えば、住宅建築におい
て、外観を維持しつつ所望の一部分について内部を表示
するなどの要求がある場合に利用される。しかも、その
処理は、上記のライティングオブジェクトの場合と同様
に簡単な演算処理により行うことができる。
In FIG. 15B, since the polygon at the position of the spherical three-dimensional clipping object 130 (not shown) is not displayed, the polygons 131 and 1 are used in this example.
32 is hidden, and the inner side of the polygon 133 is displayed. Such an effect is used, for example, when there is a request to display the inside of a desired part while maintaining the appearance in a residential building. In addition, the processing can be performed by simple arithmetic processing as in the case of the above-described lighting object.

【0067】以上の通り、本発明は、ライティングオブ
ジェクトを利用したライティング効果処理に限らず、シ
ェーディングオブジェクトを利用したシェーディング効
果処理、三次元クリッピングオブジェクトを利用した一
部除去するクリッピング処理などにも応用することがで
きる。それぞれの一対のメモリにZ値を記憶させ、描画
ポリゴンに対してそれらのZ値の間の位置するか否かの
判定をして、間に位置するピクセルに対して、輝度値を
上げる、輝度値を下げる、描画しないなどの対応する処
理を行うことにより、簡単に描画処理を行うことができ
る。
As described above, the present invention is not limited to the lighting effect processing using a lighting object, but is also applied to a shading effect processing using a shading object, a clipping processing for partially removing using a three-dimensional clipping object, and the like. be able to. Each pair of memories stores the Z value, determines whether or not the drawing polygon is located between those Z values, and increases the luminance value for the pixels located between them. By performing corresponding processing such as lowering the value or not drawing, the drawing processing can be easily performed.

【0068】[汎用コンピュータの例]図16は、上記
してきた画像処理を汎用コンピュータを利用して行う場
合の画像処理装置の構成図である。汎用コンピュータを
利用して画像処理を行う場合は、画像処理の演算は記録
媒体内に格納されたプログラムに従って行われる。従っ
て、画像処理プログラムをコンピュータが読み取り可能
な記録媒体に格納することで、汎用コンピュータは画像
処理専用コンピュータとして動作する。画像処理プログ
ラムは、上記したフローチャート等で説明した各手順を
コンピュータに実行させる。
[Example of General-Purpose Computer] FIG. 16 is a configuration diagram of an image processing apparatus when the above-described image processing is performed using a general-purpose computer. When image processing is performed using a general-purpose computer, image processing calculations are performed according to a program stored in a recording medium. Therefore, the general-purpose computer operates as a computer dedicated to image processing by storing the image processing program in a computer-readable recording medium. The image processing program causes a computer to execute the procedures described in the flowcharts and the like.

【0069】図16の例では、CPU23、演算用のR
AM231、ゲームプログラムや画像処理プログラムが
格納されたROM232が、バス236に接続される。
また、バス236に接続された入出力部233は、操作
者が操作する操作部234に接続され、操作信号を入力
する。また、画像処理の為に、Z値メモリ28,ライテ
ィングメモリ30,32が設けられ、それぞれバス23
6に接続される。また、フレームメモリであるピクセル
メモリ26も、バス236に接続され、外部の表示装置
34にも接続される。
In the example shown in FIG. 16, the CPU 23
The AM 231 and the ROM 232 storing the game program and the image processing program are connected to the bus 236.
The input / output unit 233 connected to the bus 236 is connected to an operation unit 234 operated by an operator, and inputs an operation signal. For image processing, a Z-value memory 28 and lighting memories 30 and 32 are provided.
6 is connected. The pixel memory 26, which is a frame memory, is also connected to the bus 236, and is also connected to an external display device.

【0070】この例では、画像処理プログラムがROM
232内に格納されているが、それ以外に、外部のCD
ROMや磁気テープなどの記録媒体235からRAM2
31内に画像処理プログラムをインストールすることも
できる。
In this example, the image processing program is a ROM
232, but besides, an external CD
From a recording medium 235 such as a ROM or a magnetic tape to a RAM 2
An image processing program can be installed in the server 31.

【0071】上記してきた実施の形態例では、Z値メモ
リ28を利用して表示すべきピクセルか否かの判断を行
ったが、描画ポリゴンが既にZ値の大きい順にソーティ
ングされて供給される場合は、Z値メモリ28は不要で
ある。
In the above-described embodiment, the determination as to whether or not the pixel is a pixel to be displayed is made by using the Z value memory 28. However, in the case where the drawing polygons are already sorted and supplied in descending order of the Z value, they are supplied. Does not require the Z-value memory 28.

【0072】[0072]

【発明の効果】以上説明した通り、本発明によれば、光
源に対してライティングオブジェクトを利用し、画面の
手前側と奥側のライティングオブジェクトのZ値を記憶
するライティングメモリを設け、描画処理中のピクセル
が一対のライティングメモリのZ値の間に位置するか否
かの判定により、ポリゴン内の一部のピクセルに対して
輝度値を上げるなどのライティング処理を与えることが
できる。従って、従来の描画回路に大きな変更を加える
ことなく少ないハードウエアと簡単な演算処理により、
従来困難であったライティング処理を行うことができ
る。
As described above, according to the present invention, the lighting object is used for the light source, and the writing memory for storing the Z values of the lighting objects on the near side and the back side of the screen is provided. By determining whether or not the pixel is located between the Z values of the pair of writing memories, it is possible to give a lighting process such as increasing the luminance value to some pixels in the polygon. Therefore, with little hardware and simple arithmetic processing without making significant changes to the conventional drawing circuit,
Lighting processing, which was conventionally difficult, can be performed.

【0073】更に、本発明によれば、上記のライティン
グオブジェクトと同様の考え方で、シェーディングオブ
ジェクトやクリッピングオブジェクトに対応する一対の
メモリを設け、それらにそれぞれのシェーディングオブ
ジェクトやクリッピングオブジェクトの手前側と奥側の
Z値を書き込み、描画対象のピクセルに対して、両Z値
の間の位置する時に、対応する処理を施すことができ
る。従って、簡単なハードウエアの追加と簡単な演算処
理の追加で、シェーディング処理や、任意の領域のクリ
ッピング処理を与えることができる。
Further, according to the present invention, a pair of memories corresponding to the shading objects and the clipping objects are provided in the same way as the above-mentioned lighting objects, and the near side and the back side of the respective shading objects and the clipping objects are provided in these memories. Is written, and when a pixel to be drawn is located between the two Z values, a corresponding process can be performed. Therefore, shading processing and clipping processing of an arbitrary area can be provided by adding simple hardware and simple arithmetic processing.

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

【図1】ライティング効果の例について示す図である。FIG. 1 is a diagram illustrating an example of a lighting effect.

【図2】本実施の形態例におけるライティングオブジェ
クトを説明する図である。
FIG. 2 is a diagram illustrating a lighting object according to the embodiment.

【図3】ライティングメモリを説明する図である。FIG. 3 is a diagram illustrating a writing memory.

【図4】本実施の形態例の画像処理装置の全体構成図で
ある。
FIG. 4 is an overall configuration diagram of an image processing apparatus according to the embodiment.

【図5】本実施の形態例のポリゴンデータの構成例を示
す図である。
FIG. 5 is a diagram illustrating a configuration example of polygon data according to the embodiment;

【図6】ライティング処理を伴う画像処理の例のフロー
チャート図である。
FIG. 6 is a flowchart illustrating an example of image processing involving lighting processing.

【図7】描画エンジンの詳細構成を示す図である。FIG. 7 is a diagram showing a detailed configuration of a drawing engine.

【図8】図7の描画エンジンでの処理の詳細フローチャ
ート図である。
FIG. 8 is a detailed flowchart of the processing in the drawing engine of FIG. 7;

【図9】描画エンジンの中のライン処理部での処理の詳
細フローチャート図である。
FIG. 9 is a detailed flowchart of processing in a line processing unit in the drawing engine.

【図10】ライティングメモリ、ピクセルメモリのデー
タの変遷を示す図である。
FIG. 10 is a diagram showing transition of data in a writing memory and a pixel memory.

【図11】ラスタスキャンを説明する図である。FIG. 11 is a diagram illustrating a raster scan.

【図12】複数のライティングオブジェクトが存在する
場合を示す図である。
FIG. 12 is a diagram illustrating a case where a plurality of lighting objects exist.

【図13】ライティングオブジェクト20Aと20Bそ
れぞれに割り当てられたライティングメモリを示す図で
ある。
FIG. 13 is a diagram showing a writing memory assigned to each of the writing objects 20A and 20B.

【図14】シェーディングオブジェクトを利用してポリ
ゴンの一部の表面にシェーディング処理を施す場合を説
明する図である。
FIG. 14 is a diagram illustrating a case where shading processing is performed on a partial surface of a polygon using a shading object.

【図15】三次元クリッピングオブジェクトの例を示す
図である。
FIG. 15 is a diagram illustrating an example of a three-dimensional clipping object.

【図16】画像処理を汎用コンピュータを利用して行う
場合の画像処理装置の構成図である。
FIG. 16 is a configuration diagram of an image processing apparatus when performing image processing using a general-purpose computer.

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

10 光源 20 ライティングオブジェクト 24 描画処理部、描画エンジン 26 ピクセルメモリ 28 Z値メモリ 30,32 ライティングメモリ 34 表示装置 110 シェーディングオブジェクト 130 クリッピングオブジェクト Reference Signs List 10 light source 20 lighting object 24 drawing processing unit, drawing engine 26 pixel memory 28 Z value memory 30, 32 writing memory 34 display device 110 shading object 130 clipping object

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】オブジェクトを構成するポリゴンに対して
表示画面内の座標データと色データとを含むポリゴンデ
ータが与えられ、前記座標データに従って各ポリゴン内
のピクセルの描画処理を行う画像処理装置において、 前記ポリゴンは、前記描画処理が行われる描画対象ポリ
ゴンとライティング処理の対象領域のライティングオブ
ジェクトを構成するライティングポリゴンとを有し、 前記画像処理装置は、 前記ライティングポリゴンのうち前記表示画面の手前側
に位置するライティングポリゴン内のピクセルのZ値が
書き込まれる第一のライティングメモリと、 前記ライティングポリゴンのうち前記表示画面の奥側に
位置するライティングポリゴン内のピクセルのZ値が書
き込まれる第二のライティングメモリと、 前記表示画面に表示されるピクセルの色データが書き込
まれるピクセルメモリと、 前記描画対象ポリゴン内のピクセルのZ値を前記座標デ
ータから求め、該ピクセルのZ値が前記第一及び第二の
ライティングメモリ内のZ値の間に位置する場合に当該
ピクセルの色データに輝度値を高めるライティング処理
を行い、該ライティング処理された色データを前記ピク
セルメモリに書き込む描画処理部とを有することを特徴
とする画像処理装置。
1. An image processing apparatus which is provided with polygon data including coordinate data and color data in a display screen for a polygon constituting an object, and performs drawing processing of pixels in each polygon in accordance with the coordinate data. The polygon has a drawing target polygon on which the drawing process is performed and a lighting polygon that constitutes a writing object of a target region of the lighting process.The image processing apparatus includes, in the writing polygon, a front side of the display screen. A first writing memory in which a Z value of a pixel in a located writing polygon is written; and a second writing memory in which a Z value of a pixel in a writing polygon positioned at the far side of the display screen among the writing polygons is written. Displayed on the display screen A pixel memory in which color data of a pixel to be written is written; and a Z value of a pixel in the polygon to be drawn is determined from the coordinate data, and a Z value of the pixel is between a Z value in the first and second writing memories. An image processing device comprising: a rendering processing unit that performs a lighting process for increasing the luminance value on the color data of the pixel when the pixel data is located in the pixel data and writes the color data subjected to the lighting process to the pixel memory.
【請求項2】請求項1において、 前記描画処理部は、前記ライティングポリゴンのデータ
が与えられた時、該ライティングポリゴン内のピクセル
のZ値を前記座標データから求め、該ピクセルのZ値を
対応する第一または第二のライティングメモリ内に書き
込むことを特徴とする画像処理装置。
2. The drawing processing unit according to claim 1, wherein when the data of the writing polygon is given, the drawing processing unit obtains a Z value of a pixel in the writing polygon from the coordinate data, and determines a Z value of the pixel. An image processing apparatus for writing in a first or second writing memory.
【請求項3】請求項1において、 前記描画対象ポリゴンは、更にライティング対象ポリゴ
ンとライティング非対象ポリゴンとを有し、 前記描画処理部は、前記描画対象ポリゴンがライティン
グ対象ポリゴンの場合は、前記ポリゴン内のピクセルの
Z値に応じて前記ライティング処理を行い、前記描画対
象ポリゴンがライティング非対象ポリゴンの場合は、前
記ライティング処理を行うことなくピクセルの色データ
を前記ピクセルメモリに書き込むことを特徴とする画像
処理装置。
3. The rendering target polygon according to claim 1, wherein the rendering target polygon further comprises a writing target polygon and a non-writing target polygon. The writing process is performed according to the Z value of the pixel in the pixel, and when the rendering target polygon is a non-writing target polygon, the color data of the pixel is written to the pixel memory without performing the lighting process. Image processing device.
【請求項4】請求項1〜3において、 前記第一および第二のライティングポリゴンが、複数の
ライティングオブジェクトに対応して複数対設けられ、
前記描画処理部は、前記描画対象ポリゴン内のピクセル
のZ値と前記複数対の第一および第二のライティングポ
リゴン内のZ値との比較をそれぞれ行うことを特徴とす
る画像処理装置。
4. The method according to claim 1, wherein a plurality of pairs of the first and second lighting polygons are provided corresponding to a plurality of lighting objects.
The image processing apparatus, wherein the drawing processing unit compares the Z value of a pixel in the drawing target polygon with the Z value in the plurality of pairs of first and second writing polygons.
【請求項5】オブジェクトを構成するポリゴンに対して
表示画面内の座標データと色データとを含むポリゴンデ
ータが与えられ、前記座標データに従って各ポリゴン内
のピクセルの描画処理を行う画像処理方法において、 前記ポリゴンは、前記描画処理が行われる描画対象ポリ
ゴンとライティング処理の対象領域のライティングオブ
ジェクトを構成するライティングポリゴンとを有し、 前記画像処理方法は、 前記ライティングポリゴンのデータが与えられた時、該
ライティングポリゴン内のピクセルのZ値を前記座標デ
ータから求め、前記表示画面の手前側及び奥側に位置す
る前記ライティングポリゴンの該ピクセルのZ値を、対
応する第一及び第二のライティングメモリ内に書き込む
ライティングポリゴン描画工程と、 前記描画対象ポリゴンのデータが与えられた時、該描画
対象ポリゴン内のピクセルのZ値を前記座標データから
求め、該ピクセルのZ値が前記第一及び第二のライティ
ングメモリ内のZ値の間に位置する場合に当該ピクセル
の色データに輝度値を高めるライティング処理を行い、
該ライティング処理された色データをピクセルメモリに
書き込む描画対象ポリゴン描画工程とを有することを特
徴とする画像処理方法。
5. An image processing method wherein polygon data including coordinate data and color data in a display screen is given to a polygon constituting an object, and a drawing process of a pixel in each polygon is performed according to the coordinate data. The polygon has a drawing target polygon on which the drawing processing is performed and a lighting polygon that constitutes a writing object of a target area of the lighting processing.The image processing method includes the steps of: The Z value of the pixel in the writing polygon is obtained from the coordinate data, and the Z value of the pixel of the writing polygon located on the near side and the back side of the display screen is stored in the corresponding first and second writing memories. A writing polygon drawing process to be written; Given the data of the gon, the Z value of a pixel in the polygon to be drawn is obtained from the coordinate data, and the Z value of the pixel is located between the Z values in the first and second writing memories. In that case, a lighting process for increasing the luminance value is performed on the color data of the pixel,
A rendering target polygon rendering step of writing the lighting-processed color data into a pixel memory.
【請求項6】オブジェクトを構成するポリゴンに対して
表示画面内の座標データと色データとを含むポリゴンデ
ータが与えられ、前記座標データに従って各ポリゴン内
のピクセルの描画処理を行う画像処理プログラムを記録
した機械読み取り可能な記録媒体において、 前記ポリゴンは、前記描画処理が行われる描画対象ポリ
ゴンとライティング処理の対象領域のライティングオブ
ジェクトを構成するライティングポリゴンとを有し、 前記画像処理プログラムは、 前記ライティングポリゴンのデータが与えられた時、該
ライティングポリゴン内のピクセルのZ値を前記座標デ
ータから求め、前記表示画面の手前側及び奥側に位置す
る前記ライティングポリゴンの該ピクセルのZ値を対応
する第一及び第二のライティングメモリ内に書き込むラ
イティングポリゴン描画手順と、 前記描画対象ポリゴンのデータが与えられた時、該描画
対象ポリゴン内のピクセルのZ値を前記座標データから
求め、該ピクセルのZ値が前記第一及び第二のライティ
ングメモリ内のZ値の間に位置する場合に当該ピクセル
の色データに輝度値を高めるライティング処理を行い、
該ライティング処理された色データをピクセルメモリに
書き込む描画対象ポリゴン描画手順とをコンピュータに
実行させることを特徴とする画像処理プログラムを記録
した記録媒体。
6. Polygon data including coordinate data and color data in a display screen is given to polygons constituting an object, and an image processing program for drawing a pixel in each polygon in accordance with the coordinate data is recorded. In the machine-readable recording medium described above, the polygon has a drawing target polygon on which the drawing process is performed and a writing polygon constituting a writing object in a target region of the writing process, and the image processing program includes: Is given, the Z value of the pixel in the writing polygon is obtained from the coordinate data, and the Z value of the pixel of the writing polygon located on the near side and the back side of the display screen is corresponding to the first value. And a line to be written into the second writing memory. A drawing polygon drawing procedure, and when data of the drawing target polygon is given, a Z value of a pixel in the drawing target polygon is obtained from the coordinate data, and the Z value of the pixel is stored in the first and second writing memories. Performing lighting processing to increase the luminance value on the color data of the pixel when the pixel is located between the Z values in
A recording medium storing an image processing program for causing a computer to execute a rendering target polygon rendering procedure for writing the lighting-processed color data into a pixel memory.
【請求項7】オブジェクトを構成するポリゴンに対して
表示画面内の座標データと色データとを含むポリゴンデ
ータが与えられ、前記座標データに従って各ポリゴン内
のピクセルの描画処理を行う画像処理装置において、 前記ポリゴンは、前記描画処理が行われる描画対象ポリ
ゴンと特殊処理の対象領域の特殊処理オブジェクトを構
成する特殊処理ポリゴンとを有し、 前記画像処理装置は、 前記特殊処理ポリゴンのうち前記表示画面の手前側に位
置する特殊処理ポリゴン内のピクセルのZ値が書き込ま
れる第一の特殊処理メモリと、 前記特殊処理ポリゴンのうち前記表示画面の奥側に位置
する特殊処理ポリゴン内のピクセルのZ値が書き込まれ
る第二の特殊処理メモリと、 前記表示画面に表示されるピクセルの色データが書き込
まれるピクセルメモリと、 前記描画対象ポリゴン内のピクセルのZ値を前記座標デ
ータから求め、該ピクセルのZ値が前記第一及び第二の
特殊処理メモリ内のZ値の間に位置する場合に当該ピク
セルの色データに特殊な処理を行う描画処理部とを有す
ることを特徴とする画像処理装置。
7. An image processing apparatus which is provided with polygon data including coordinate data and color data in a display screen for polygons constituting an object, and performs drawing processing of pixels in each polygon in accordance with the coordinate data. The polygon includes a drawing target polygon on which the drawing processing is performed and a special processing polygon that forms a special processing object in a target area of the special processing. The image processing apparatus includes: A first special processing memory in which the Z value of a pixel in the special processing polygon positioned on the near side is written, and a Z value of a pixel in the special processing polygon positioned on the back side of the display screen among the special processing polygons A second special processing memory to be written, and a pixel to which color data of a pixel displayed on the display screen is written. A cell memory, a Z value of a pixel in the polygon to be drawn is obtained from the coordinate data, and if the Z value of the pixel is located between the Z values in the first and second special processing memories, And a drawing processing unit for performing a special process on the color data.
【請求項8】請求項7において、 前記特殊処理は、輝度値を下げるシェーディング処理で
あり、前記特殊処理オブジェクトは、光源に対する影が
形成されるシェーディングオブジェクトであることを特
徴とする画像処理装置。
8. The image processing apparatus according to claim 7, wherein the special processing is shading processing for lowering a luminance value, and the special processing object is a shading object that forms a shadow on a light source.
【請求項9】請求項7において、 前記特殊処理は、前記特殊処理オブジェクト内に位置す
るピクセルの色データは前記ピクセルメモリに書き込ま
ない処理であり、前記特殊処理オブジェクトは、その領
域内の描画対象ポリゴンの描画を禁止するクリッピング
ポリゴンであることを特徴とする画像処理装置。
9. The special process according to claim 7, wherein the special process is a process in which color data of a pixel located in the special process object is not written in the pixel memory. An image processing apparatus, wherein the image processing apparatus is a clipping polygon that prohibits polygon drawing.
JP30550197A 1997-11-07 1997-11-07 Processor and method for image processing and recording medium where image processing program thereof is recorded Withdrawn JPH11144079A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30550197A JPH11144079A (en) 1997-11-07 1997-11-07 Processor and method for image processing and recording medium where image processing program thereof is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30550197A JPH11144079A (en) 1997-11-07 1997-11-07 Processor and method for image processing and recording medium where image processing program thereof is recorded

Publications (1)

Publication Number Publication Date
JPH11144079A true JPH11144079A (en) 1999-05-28

Family

ID=17945923

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30550197A Withdrawn JPH11144079A (en) 1997-11-07 1997-11-07 Processor and method for image processing and recording medium where image processing program thereof is recorded

Country Status (1)

Country Link
JP (1) JPH11144079A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001092988A (en) * 1999-09-20 2001-04-06 Namco Ltd Spot light source display device
JP2008102963A (en) * 2007-12-27 2008-05-01 Mitsubishi Electric Corp Navigation system for vehicle

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001092988A (en) * 1999-09-20 2001-04-06 Namco Ltd Spot light source display device
JP2008102963A (en) * 2007-12-27 2008-05-01 Mitsubishi Electric Corp Navigation system for vehicle

Similar Documents

Publication Publication Date Title
US5828378A (en) Three dimensional graphics processing apparatus processing ordinary and special objects
US20020027555A1 (en) Method of rendering motion blur image and apparatus therefor
US6246414B1 (en) Image processing in which polygon is divided
US6646640B2 (en) System and method for creating real-time shadows of complex transparent objects
JP2007066064A (en) Image generating device and image generating program
US8133117B2 (en) Game apparatus, game message displaying method and storage medium storing game program
JPH11203501A (en) Picture processor and picture processing method
US6784882B1 (en) Methods and apparatus for rendering an image including portions seen through one or more objects of the image
US20030193496A1 (en) Image processing system, image processing method, semiconductor device, computer program, and recording medium
US20200184707A1 (en) Data processing systems
JP3352982B2 (en) Rendering method and device, game device, and computer-readable recording medium for storing program for rendering three-dimensional model
US20020101435A1 (en) Apparatus and method for rendering antialiased image
JPH11203500A (en) Image processor and recording medium stored with bump map data to be utilized therefor
KR100295709B1 (en) Spotlight characteristic forming method and image processor using the same
JP2003233836A (en) Image processor for conducting rendering shading processing by using distance component in modeling and its method
JPH11144079A (en) Processor and method for image processing and recording medium where image processing program thereof is recorded
JP3979162B2 (en) Image processing apparatus and method
US6900804B1 (en) Method of forming polygon image and image processing apparatus using the same
JP2002251629A (en) Method for expressing image and program used for the same
JPH10134205A (en) Shading method for computer graphics
JPH06301362A (en) Image generator
JP5321385B2 (en) Image processing program and computer-readable recording medium
JP4204114B2 (en) Polygon data processing method
JP3453410B2 (en) Image processing apparatus and method
JPH07152925A (en) Image generating device

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