JP5253118B2 - Image generation system, program, and information storage medium - Google Patents

Image generation system, program, and information storage medium Download PDF

Info

Publication number
JP5253118B2
JP5253118B2 JP2008309517A JP2008309517A JP5253118B2 JP 5253118 B2 JP5253118 B2 JP 5253118B2 JP 2008309517 A JP2008309517 A JP 2008309517A JP 2008309517 A JP2008309517 A JP 2008309517A JP 5253118 B2 JP5253118 B2 JP 5253118B2
Authority
JP
Japan
Prior art keywords
image
effect
color
buffer
processing
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.)
Active
Application number
JP2008309517A
Other languages
Japanese (ja)
Other versions
JP2010134671A (en
Inventor
嘉樹 堂前
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.)
Namco Ltd
Bandai Namco Entertainment Inc
Original Assignee
Namco Ltd
Namco Bandai Games Inc
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 Namco Ltd, Namco Bandai Games Inc filed Critical Namco Ltd
Priority to JP2008309517A priority Critical patent/JP5253118B2/en
Publication of JP2010134671A publication Critical patent/JP2010134671A/en
Application granted granted Critical
Publication of JP5253118B2 publication Critical patent/JP5253118B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Generation (AREA)

Description

本発明は、画像生成システム、プログラム及び情報記憶媒体に関する。   The present invention relates to an image generation system, a program, and an information storage medium.

従来より、仮想的な3次元空間であるオブジェクト空間において仮想カメラ(所与の視点)から見える画像を生成する画像生成システム(ゲームシステム)が知られており、いわゆる仮想現実を体験できるものとして人気が高い。格闘ゲームを楽しむことができる画像生成システムを例に取れば、プレーヤは、操作部(ゲームコントローラ等)を用いて移動体(キャラクタ等)に関する操作(攻撃操作、防御操作、移動操作等)を行い、他のプレーヤ(コンピュータプレーヤも含まれる)の移動体と格闘するゲームを楽しむ。   Conventionally, an image generation system (game system) that generates an image that can be viewed from a virtual camera (a given viewpoint) in an object space that is a virtual three-dimensional space is known, and is popular as a so-called virtual reality experience. Is expensive. Taking an image generation system capable of enjoying a fighting game as an example, a player performs operations (attack operation, defense operation, movement operation, etc.) related to a moving body (character, etc.) using an operation unit (game controller, etc.). Enjoy a game of fighting with the moving bodies of other players (including computer players).

ところで、上述した画像生成システムに関し、オブジェクト空間を仮想カメラから見た原画像に対して、炎や煙や閃光などのパーティクルを表現するエフェクト画像を合成することにより視覚効果が高い画像を生成する手法が知られているが、エフェクト画像は描画する際の処理負荷が重いものが多いため、エフェクト画像の解像度を原画像よりも低くして原画像に合成する手法が提案されている(非特許文献1参照)。
川瀬 正樹、泥OUBLE-S.T.E.A.L.におけるリアルタイムCG表現技法煤A[online]、2002年、株式会社ぶんか社ゲーム開発事業部、[平成20年11月14日検索]、インターネット<URL:http://www.bunkasha-games.com/cedec2002/kawase_ppt.html>
By the way, regarding the above-described image generation system, a method for generating an image having a high visual effect by synthesizing an effect image representing particles such as flame, smoke, and flash light with an original image obtained by viewing the object space from a virtual camera. However, since many effect images have a heavy processing load at the time of drawing, a method of combining the original image with a resolution of the effect image lower than that of the original image has been proposed (Non-Patent Document). 1).
Masaki Kawase, real-time CG expression technique in mud OUBLE-STEAL 煤 A [online], 2002, Bunka Co., Ltd. Game Development Division, [searched November 14, 2008], Internet <URL: http: // www.bunkasha-games.com/cedec2002/kawase_ppt.html>

しかしながら、このような従来の手法では、エフェクト画像を描画する際の処理負荷は軽減されるものの、エフェクト画像と重なる領域の原画像の解像度も低くなってしまうことにより、画像が劣化してしまうという問題が発生していた。   However, with such a conventional method, although the processing load when drawing the effect image is reduced, the resolution of the original image in the area overlapping with the effect image is also lowered, so that the image is deteriorated. There was a problem.

本出願は上記事情に鑑みてなされたものであり、その目的は、エフェクト画像を描画する際の処理負荷を軽減しつつ、画像の劣化を回避することができるようにした画像生成システム、プログラム及び情報記憶媒体を提供することにある。   The present application has been made in view of the above circumstances, and an object of the present application is an image generation system, a program, and a program that can avoid image degradation while reducing the processing load when rendering an effect image. An object is to provide an information storage medium.

(1)本発明は、
画像を生成するための画像生成システムであって、
オブジェクト空間に設定されたオブジェクトを仮想カメラから見た原画像を第1カラーバッファに描画する処理を行う原画像描画部と、
前記原画像と前記原画像の色を調整するためのエフェクト画像とを合成するエフェクト処理を行うエフェクト処理部とを含み、
前記エフェクト処理部は前記エフェクト処理として、
前記第1カラーバッファに描画された前記原画像を前記第1カラーバッファよりも解像度が低い第2カラーバッファに描画する処理と、
前記エフェクト画像を前記第2カラーバッファに描画する処理と、
前記エフェクト画像を描画するピクセルを指定するステンシル画像を、前記原画像の奥行き値と前記エフェクト画像の奥行き値とに基づいて、前記第2カラーバッファよりも解像度が高いステンシルバッファに描画する処理と、
前記第2カラーバッファに描画された前記エフェクト画像を、前記ステンシル画像に基づいて前記第1カラーバッファに描画する処理と、
を行うことを特徴とする画像生成システムに関するものである。また本発明は、上記各部としてコンピュータを機能させるプログラム及びそのようなプログラムを記憶するコンピュータが読み取り可能な情報記憶媒体に関するものである。
(1) The present invention
An image generation system for generating an image,
An original image drawing unit that performs processing of drawing an original image obtained by viewing an object set in the object space from a virtual camera in the first color buffer;
An effect processing unit that performs effect processing for combining the original image and an effect image for adjusting the color of the original image;
The effect processing unit as the effect processing,
Processing to draw the original image drawn in the first color buffer in a second color buffer having a resolution lower than that of the first color buffer;
Drawing the effect image in the second color buffer;
Processing to draw a stencil image for designating pixels for drawing the effect image in a stencil buffer having a resolution higher than that of the second color buffer based on the depth value of the original image and the depth value of the effect image;
Processing to draw the effect image drawn in the second color buffer in the first color buffer based on the stencil image;
It is related with the image generation system characterized by performing. The present invention also relates to a program that causes a computer to function as each of the above-described units, and a computer-readable information storage medium that stores such a program.

本発明では、原画像の奥行き値とエフェクト画像の奥行き値とに基づいてステンシル画像が描画されるため、仮想カメラから見てエフェクト画像の手前にオブジェクトが重なる場合に、当該オブジェクトに対応するピクセルについては描画しないピクセルとして指定し、当該オブジェクトと重ならないエフェクト画像に対応するピクセルについては描画するピクセルとして指定するステンシル画像が描画される。従って本発明では、このような場合に、第1カラーバッファのピクセルのうち、仮想カメラから見てエフェクト画像の手前に重なるオブジェクトに対応するピクセルについては、第1カラーバッファに描画された原画像が残り、当該オブジェクトと重ならないエフェクト画像に対応するピクセルについては、第2カラーバッファに描画されたエフェクト画像が描画される。こうして本発明によれば、エフェクト画像を描画する際の処理負荷を軽減しつつ、画像の劣化を回避することができる。   In the present invention, since the stencil image is drawn based on the depth value of the original image and the depth value of the effect image, when the object overlaps the effect image as viewed from the virtual camera, the pixel corresponding to the object Is designated as a pixel that is not drawn, and a stencil image that is designated as a pixel to be drawn is drawn for a pixel corresponding to an effect image that does not overlap the object. Therefore, according to the present invention, in such a case, among the pixels of the first color buffer, for the pixel corresponding to the object overlapping before the effect image when viewed from the virtual camera, the original image drawn in the first color buffer is the same. For the remaining pixels corresponding to the effect image that does not overlap the object, the effect image drawn in the second color buffer is drawn. Thus, according to the present invention, it is possible to avoid image degradation while reducing the processing load when rendering an effect image.

(2)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
前記エフェクト画像の位置を前記仮想カメラから見て特定オブジェクトよりも奥に設定する処理を行うようにしてもよい。
(2) In the image generation system, program, and information storage medium of the present invention,
The effect processing unit
You may make it perform the process which sets the position of the said effect image behind a specific object seeing from the said virtual camera.

このようにすれば、複数のエフェクト画像が仮想カメラから見て特定オブジェクトの手前と奥とで特定オブジェクトと重なるように設定されることがないため、エフェクト画像を第2カラーバッファに描画する際に、原画像の奥行き値とエフェクト画像の奥行き値とに基づいて描画しなくとも、ステンシル画像により画像の劣化を回避することができる。   In this way, since the plurality of effect images are not set to overlap the specific object before and behind the specific object when viewed from the virtual camera, when the effect image is drawn in the second color buffer, Even if drawing is not performed based on the depth value of the original image and the depth value of the effect image, it is possible to avoid image degradation due to the stencil image.

(3)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
前記原画像の奥行き値と前記エフェクト画像の奥行き値とに基づいて、前記エフェクト画像を前記第2カラーバッファに描画する処理を行うようにしてもよい。
(3) In the image generation system, program, and information storage medium of the present invention,
The effect processing unit
A process of drawing the effect image in the second color buffer may be performed based on the depth value of the original image and the depth value of the effect image.

このようにすれば、複数のエフェクト画像が特定オブジェクトの手前と奥に仮想カメラから見て特定オブジェクトと重なるように設定されても、エフェクト画像を第2カラーバッファに描画する際に、原画像の奥行き値とエフェクト画像の奥行き値とに基づいて描画することにより、これらの前後関係を正確に描画しつつ、ステンシル画像により画像の劣化を回避することができる。   In this way, even if a plurality of effect images are set to overlap the specific object when viewed from the virtual camera in front and behind the specific object, when the effect image is drawn in the second color buffer, By rendering based on the depth value and the depth value of the effect image, it is possible to avoid degradation of the image due to the stencil image while accurately rendering these front-rear relationships.

(4)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
前記仮想カメラから見て前記特定オブジェクトよりも手前に設定される第1エフェクト画像について前記エフェクト処理を行う第1エフェクト処理と、前記仮想カメラから見て前記特定オブジェクトよりも奥に設定される第2エフェクト画像について前記エフェクト処理を行う第2エフェクト処理とを行うようにしてもよい。
(4) In the image generation system, program, and information storage medium of the present invention,
The effect processing unit
A first effect process for performing the effect process on a first effect image set in front of the specific object when viewed from the virtual camera, and a second effect set at the back of the specific object as viewed from the virtual camera. You may make it perform the 2nd effect process which performs the said effect process about an effect image.

このようにすれば、第1エフェクト画像と第2エフェクト画像とが特定オブジェクトの手前と奥に仮想カメラから見て特定オブジェクトと重なるように設定されても、第1エフェクト画像についての第1エフェクト処理と第2エフェクト画像についての第2エフェクト処理とが行われることにより、エフェクト画像を第2カラーバッファに描画する際に、原画像の奥行き値とエフェクト画像の奥行き値とに基づいて描画しなくとも、これらの前後関係を正確に描画しつつ、ステンシル画像により画像の劣化を回避することができる。   In this way, even if the first effect image and the second effect image are set to overlap the specific object when viewed from the virtual camera before and behind the specific object, the first effect processing for the first effect image is performed. And the second effect processing for the second effect image, when the effect image is drawn in the second color buffer, it is not necessary to draw based on the depth value of the original image and the depth value of the effect image. The stencil image can avoid the deterioration of the image while accurately drawing these contexts.

(5)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
エフェクト用テクスチャをエフェクト用オブジェクトにマッピングすることにより前記エフェクト画像を前記第2カラーバッファに描画する処理を行い、
前記エフェクト用オブジェクトの奥行き値に基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うようにしてもよい。
(5) In the image generation system, program, and information storage medium of the present invention,
The effect processing unit
Mapping the effect texture to the effect object to render the effect image in the second color buffer;
A process of drawing the stencil image in the stencil buffer may be performed based on the depth value of the effect object.

このようにすれば、ステンシル画像を描画する際の処理負荷を軽減することができる。   In this way, it is possible to reduce the processing load when drawing a stencil image.

(6)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
前記エフェクト用オブジェクトの形状に基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うようにしてもよい。
(6) Further, in the image generation system, program and information storage medium of the present invention,
The effect processing unit
A process of drawing the stencil image in the stencil buffer may be performed based on the shape of the effect object.

このようにすれば、ステンシル画像を描画する際の処理負荷を更に軽減することができる。   In this way, the processing load when drawing a stencil image can be further reduced.

(7)また本発明の画像生成システム、プログラム及び情報記憶媒体では、
前記エフェクト処理部は、
前記エフェクト用テクスチャに基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うようにしてもよい。
(7) In the image generation system, program, and information storage medium of the present invention,
The effect processing unit
A process of drawing the stencil image in the stencil buffer may be performed based on the effect texture.

このようにすれば、エフェクト用テクスチャに対応する詳細なステンシル画像が描画されることにより、画像の劣化を更に回避することができる。   In this way, the detailed stencil image corresponding to the texture for the effect is drawn, so that deterioration of the image can be further avoided.

以下、本発明の実施形態について説明する。なお、以下に説明する本発明の実施形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また本発明の実施形態で説明される構成の全てが、本発明の必須構成要件であるとは限らない。   Hereinafter, embodiments of the present invention will be described. The embodiment of the present invention described below does not unduly limit the content of the present invention described in the claims. In addition, all the configurations described in the embodiments of the present invention are not necessarily essential configuration requirements of the present invention.

1.第1実施形態
1−1.構成
図1に第1実施形態の画像生成システム(ゲームシステム)の機能ブロック図の例を示す。なお本実施形態の画像生成システムは図1の構成要素(各部)の一部を省略した構成としてもよい。
1. 1. First embodiment 1-1. Configuration FIG. 1 shows an example of a functional block diagram of the image generation system (game system) of the first embodiment. Note that the image generation system of the present embodiment may have a configuration in which some of the components (each unit) in FIG. 1 are omitted.

操作部10は、プレーヤがプレーヤオブジェクト(移動体オブジェクトの一例、プレーヤが操作するプレーヤキャラクタなど)の操作データを入力するためのものであり、その機能は、レバー、ボタン、ステアリング、マイク、タッチパネル型ディスプレイ、或いは筺体などにより実現できる。   The operation unit 10 is for a player to input operation data of a player object (an example of a moving object, a player character operated by the player, etc.), and its functions are lever, button, steering, microphone, touch panel type. It can be realized by a display or a housing.

記憶部20は、処理部100や通信部70などのワーク領域となるもので、その機能はRAM(メインメモリ22)、VRAM(ビデオメモリ24)などにより実現できる。   The storage unit 20 serves as a work area for the processing unit 100, the communication unit 70, and the like, and its functions can be realized by a RAM (main memory 22), a VRAM (video memory 24), or the like.

情報記憶媒体30(コンピュータにより読み取り可能な媒体)は、プログラムやデータなどを格納するものであり、その機能は、光ディスク(CD、DVD)、光磁気ディスク(MO)、磁気ディスク、ハードディスク、磁気テープ、或いはメモリ(ROM)などにより実現できる。処理部100は、情報記憶媒体30に格納されるプログラム(データ)に基づいて本実施形態の種々の処理を行う。即ち情報記憶媒体30には、本実施形態の各部としてコンピュータを機能させるためのプログラム(各部の処理をコンピュータに実行させるためのプログラム)が記憶される。   An information storage medium 30 (a computer-readable medium) stores programs, data, and the like, and functions as an optical disk (CD, DVD), a magneto-optical disk (MO), a magnetic disk, a hard disk, and a magnetic tape. Alternatively, it can be realized by a memory (ROM). The processing unit 100 performs various processes of the present embodiment based on a program (data) stored in the information storage medium 30. That is, the information storage medium 30 stores a program for causing a computer to function as each unit of the present embodiment (a program for causing a computer to execute processing of each unit).

携帯型情報記憶装置40は、プレーヤの個人データやゲームのセーブデータなどが記憶されるものであり、この携帯型情報記憶装置40としては、メモリカードや携帯型ゲーム装置などにより実現できる。   The portable information storage device 40 stores player personal data, game save data, and the like. The portable information storage device 40 can be realized by a memory card, a portable game device, or the like.

表示部50は、本実施形態により生成された画像を出力するものであり、その機能は、CRT、LCD、タッチパネル型ディスプレイ、或いはHMD(ヘッドマウントディスプレイ)などにより実現できる。   The display unit 50 outputs an image generated according to the present embodiment, and its function can be realized by a CRT, LCD, touch panel display, HMD (head mounted display), or the like.

音出力部60は、本実施形態により生成された音を出力するものであり、その機能は、スピーカ、或いはヘッドフォンなどにより実現できる。   The sound output unit 60 outputs the sound generated by the present embodiment, and its function can be realized by a speaker, headphones, or the like.

通信部70は外部(例えばホスト装置や他の画像生成システム)との間で通信を行うための各種制御を行うものであり、その機能は、各種プロセッサ又は通信用ASICなどのハードウェアや、プログラムなどにより実現できる。   The communication unit 70 performs various controls for communicating with the outside (for example, a host device or other image generation system), and functions thereof are hardware such as various processors or communication ASICs, programs, and the like. It can be realized by.

なお本実施形態の各部としてコンピュータを機能させるためのプログラム(データ)は、ホスト装置(サーバー)が有する情報記憶媒体からネットワーク及び通信部70を介して情報記憶媒体30(あるいは記憶部20のメインメモリ22)に配信してもよい。このようなホスト装置(サーバー)の情報記憶媒体の使用も本発明の範囲内に含めることができる。   Note that a program (data) for causing a computer to function as each unit of the present embodiment is transmitted from the information storage medium of the host device (server) to the information storage medium 30 (or the main memory of the storage unit 20) via the network and communication unit 70. 22). Use of the information storage medium of such a host device (server) can also be included in the scope of the present invention.

処理部100(プロセッサ)は、操作部10からの操作データやプログラムなどに基づいて、ゲーム処理、画像生成処理、或いは音生成処理などの処理を行う。ここでゲーム処理としては、ゲーム開始条件が満たされた場合にゲームを開始する処理、ゲームを進行させる処理、イベント発生条件が満たされた場合にイベントを発生させる処理、キャラクタやマップなどのオブジェクトを配置する処理、オブジェクトを表示する処理、ゲーム結果を演算する処理、或いはゲーム終了条件が満たされた場合にゲームを終了する処理などがある。この処理部100は、記憶部20内のメインメモリ22をワーク領域として各種処理を行う。処理部100の機能は、各種プロセッサ(CPU(メインプロセッサ)、GPU(描画プロセッサ)、DSP等)、ASIC(ゲートアレイ等)などのハードウェアや、プログラムにより実現できる。   The processing unit 100 (processor) performs processing such as game processing, image generation processing, or sound generation processing based on operation data and programs from the operation unit 10. Here, the game process includes a process for starting a game when a game start condition is satisfied, a process for advancing the game, a process for generating an event when the event generation condition is satisfied, and an object such as a character or a map. There are a process for arranging, a process for displaying an object, a process for calculating a game result, a process for ending a game when a game end condition is satisfied, and the like. The processing unit 100 performs various processes using the main memory 22 in the storage unit 20 as a work area. The functions of the processing unit 100 can be realized by hardware such as various processors (CPU (main processor), GPU (drawing processor), DSP, etc.), ASIC (gate array, etc.), and programs.

そして処理部100は、オブジェクト空間設定部110、移動・動作処理部112、仮想カメラ制御部114、描画部120、音生成部130を含む。なおこれらの一部を省略する構成としてもよい。   The processing unit 100 includes an object space setting unit 110, a movement / motion processing unit 112, a virtual camera control unit 114, a drawing unit 120, and a sound generation unit 130. Note that some of these may be omitted.

オブジェクト空間設定部110は、オブジェクトデータ記憶部22Aに記憶されているオブジェクトデータに基づいて、キャラクタ、車、建物、樹木、柱、壁、コース(道路)、マップ(地形)などの表示物を表す各種オブジェクト(ポリゴン、自由曲面又はサブディビジョンサーフェスなどのプリミティブで構成されるオブジェクト)や、光が進行する方向や強さや色を示す光源をオブジェクト空間に配置設定する処理を行う。即ちワールド座標系でのオブジェクトの位置や回転角度(向き、方向と同義)を決定し、決定された位置(X、Y、Z)に決定された回転角度(X、Y、Z軸回りでの回転角度)でオブジェクトや光源を配置する。   The object space setting unit 110 represents display objects such as a character, a car, a building, a tree, a pillar, a wall, a course (road), and a map (terrain) based on the object data stored in the object data storage unit 22A. Various kinds of objects (objects composed of primitives such as polygons, free-form surfaces or subdivision surfaces) and light sources indicating the direction, intensity and color of light travel are set in the object space. That is, the position and rotation angle (synonymous with direction and direction) of the object in the world coordinate system are determined, and the determined rotation angle (about the X, Y, and Z axes) is determined at the determined position (X, Y, Z). Rotate the object and light source.

移動・動作処理部112は、オブジェクト(キャラクタ、車、又は飛行機等)の移動・動作演算(移動・動作シミュレーション)を行う。すなわち操作部10によりプレーヤが入力した操作データや、プログラム(移動・動作アルゴリズム)や、各種データ(モーションデータ)などに基づいて、オブジェクトをオブジェクト空間内で移動させたり、オブジェクトを動作(モーション、アニメーション)させる処理を行う。具体的には、オブジェクトの移動情報(位置、回転角度、速度、或いは加速度)や動作情報(オブジェクトを構成する各パーツの位置、或いは回転角度)を、1フレーム(1/60秒)毎に順次求めるシミュレーション処理を行う。なおフレームは、オブジェクトの移動・動作処理(シミュレーション処理)や画像生成処理を行う時間の単位である。   The movement / motion processing unit 112 performs a movement / motion calculation (movement / motion simulation) of an object (such as a character, a car, or an airplane). That is, the object is moved in the object space or the object is moved (motion, animation) based on the operation data input by the player through the operation unit 10, the program (movement / motion algorithm), various data (motion data), or the like. ) Is performed. Specifically, object movement information (position, rotation angle, speed, or acceleration) and motion information (position or rotation angle of each part that constitutes the object) are sequentially transmitted every frame (1/60 seconds). Perform the required simulation process. A frame is a unit of time for performing object movement / motion processing (simulation processing) and image generation processing.

仮想カメラ制御部114は、オブジェクト空間内の所与(任意)の視点から見える画像を生成するための仮想カメラ(視点)の制御処理を行う。具体的には、仮想カメラの位置(X、Y、Z)又は回転角度(X、Y、Z軸回りでの回転角度)を制御する処理(視点位置、視線方向あるいは画角を制御する処理)を行う。   The virtual camera control unit 114 performs a virtual camera (viewpoint) control process for generating an image viewed from a given (arbitrary) viewpoint in the object space. Specifically, processing for controlling the position (X, Y, Z) or rotation angle (rotation angle about the X, Y, Z axis) of the virtual camera (processing for controlling the viewpoint position, the line-of-sight direction or the angle of view) I do.

例えば仮想カメラによりオブジェクト(例えばキャラクタ、車)を後方から撮影する場合には、オブジェクトの位置又は回転の変化に仮想カメラが追従するように、仮想カメラの位置又は回転角度(仮想カメラの向き)を制御する。この場合には、移動・動作処理部112で得られたオブジェクトの位置、回転角度又は速度などの情報(所定の制御情報の一例)に基づいて、仮想カメラを制御できる。或いは、仮想カメラを、予め決められた回転角度で回転させたり、予め決められた移動経路で移動させたりする制御を行ってもよい。この場合には、仮想カメラの位置(移動経路)又は回転角度を特定するための仮想カメラデータ(所定の制御情報の一例)に基づいて仮想カメラを制御する。なお、仮想カメラ(視点)が複数存在する場合には、それぞれの仮想カメラについて上記の制御処理が行われる。   For example, when an object (for example, a character or a car) is photographed from behind with a virtual camera, the position or rotation angle (the direction of the virtual camera) of the virtual camera is set so that the virtual camera follows changes in the position or rotation of the object. Control. In this case, the virtual camera can be controlled based on information (an example of predetermined control information) such as the position, rotation angle, or speed of the object obtained by the movement / motion processing unit 112. Alternatively, control may be performed such that the virtual camera is rotated at a predetermined rotation angle or moved along a predetermined movement path. In this case, the virtual camera is controlled based on virtual camera data (an example of predetermined control information) for specifying the position (movement path) or rotation angle of the virtual camera. When there are a plurality of virtual cameras (viewpoints), the above control process is performed for each virtual camera.

描画部120は、処理部100で行われる種々の処理(ゲーム処理)の結果に基づいて描画処理を行い、これにより画像を生成し、表示部50に出力する。いわゆる3次元ゲーム画像を生成する場合には、まずオブジェクト(モデル)の各頂点の頂点データ(頂点の位置座標、テクスチャ座標、色データ、法線ベクトル或いはα値等)を含むオブジェクトデータ(モデルデータ)がオブジェクトデータ記憶部22Aから入力され、入力されたオブジェクトデータに含まれる頂点データに基づいて、頂点処理(頂点シェーダによるシェーディング)が行われる。なお頂点処理を行うに際して、必要に応じてポリゴンを再分割するための頂点生成処理(テッセレーション、曲面分割、ポリゴン分割)を行うようにしてもよい。頂点処理では、頂点処理プログラム(頂点シェーダプログラム、第1のシェーダプログラム)に従って、頂点の移動処理や、座標変換(ワールド座標変換、カメラ座標変換)、クリッピング処理、あるいは透視変換等のジオメトリ処理が行われ、その処理結果に基づいて、オブジェクトを構成する頂点群について与えられた頂点データを変更(更新、調整)する。そして、頂点処理後の頂点データに基づいてラスタライズ(走査変換)が行われ、ポリゴン(プリミティブ)の面とピクセル(画素)とが対応づけられる。そしてラスタライズに続いて、画像を構成するピクセル(表示画面を構成するフラグメント)を描画するピクセル処理(ピクセルシェーダによるシェーディング、フラグメント処理)が行われる。ピクセル処理では、ピクセル処理プログラム(ピクセルシェーダプログラム、第2のシェーダプログラム)に従って、テクスチャの読出し(テクスチャマッピング)、色データの設定/変更、半透明合成、アンチエイリアス等の各種処理を行って、画像を構成するピクセルの描画色を決定し、透視変換されたオブジェクトの描画色をレンダリングターゲット(ピクセル単位で画像情報を記憶できるバッファ。メインメモリ22のフレームバッファ22B、ビデオメモリ24の第1カラーバッファ24A、第2カラーバッファ24B、ステンシルバッファ24Eなど)に出力(描画)する。すなわち、ピクセル処理では、画像情報(色(色値、輝度値)、法線、α値等)をピクセル単位で設定あるいは変更するパーピクセル処理を行う。これにより、オブジェクト空間内において仮想カメラ(所与の視点)から見える画像が生成される。なお、仮想カメラ(視点)が複数存在する場合には、それぞれの仮想カメラから見える画像を分割画像として1画面に表示できるように画像を生成することができる。   The drawing unit 120 performs drawing processing based on the results of various processes (game processing) performed by the processing unit 100, thereby generating an image and outputting the image to the display unit 50. When generating a so-called three-dimensional game image, first, object data (model data) including vertex data (vertex position coordinates, texture coordinates, color data, normal vector, α value, etc.) of each vertex of the object (model) ) Is input from the object data storage unit 22A, and vertex processing (shading by a vertex shader) is performed based on the vertex data included in the input object data. When performing the vertex processing, vertex generation processing (tessellation, curved surface division, polygon division) for re-dividing the polygon may be performed as necessary. In the vertex processing, according to the vertex processing program (vertex shader program, first shader program), vertex movement processing, coordinate conversion (world coordinate conversion, camera coordinate conversion), clipping processing, perspective processing, and other geometric processing are performed. On the basis of the processing result, the vertex data given to the vertex group constituting the object is changed (updated or adjusted). Then, rasterization (scan conversion) is performed based on the vertex data after the vertex processing, and the surface of the polygon (primitive) is associated with the pixel (pixel). Subsequent to rasterization, pixel processing (shading or fragment processing by a pixel shader) for drawing pixels (fragments forming a display screen) constituting an image is performed. In pixel processing, according to a pixel processing program (pixel shader program, second shader program), various processes such as texture reading (texture mapping), color data setting / change, translucent composition, anti-aliasing, etc. are performed, and an image is processed. The drawing color of the pixel to be configured is determined, and the drawing color of the perspective-transformed object is rendered as a rendering target (a buffer capable of storing image information in units of pixels. The frame buffer 22B of the main memory 22; the first color buffer 24A of the video memory 24; 2nd color buffer 24B, stencil buffer 24E, etc.). That is, in pixel processing, per-pixel processing for setting or changing image information (color (color value, luminance value), normal, α value, etc.) in units of pixels is performed. Thereby, an image that can be seen from the virtual camera (given viewpoint) in the object space is generated. Note that when there are a plurality of virtual cameras (viewpoints), an image can be generated so that an image seen from each virtual camera can be displayed as a divided image on one screen.

なお頂点処理やピクセル処理は、シェーディング言語によって記述されたシェーダプログラムによって、ポリゴン(プリミティブ)の描画処理をプログラム可能にするハードウェア、いわゆるプログラマブルシェーダ(頂点シェーダやピクセルシェーダ)により実現される。プログラマブルシェーダでは、頂点単位の処理やピクセル単位の処理がプログラム可能になることで描画処理内容の自由度が高く、従来のハードウェアによる固定的な描画処理に比べて表現力を大幅に向上させることができる。   The vertex processing and pixel processing are realized by hardware that enables polygon (primitive) drawing processing to be programmed by a shader program written in a shading language, so-called programmable shaders (vertex shaders and pixel shaders). Programmable shaders can be programmed with vertex-level processing and pixel-level processing, so that the degree of freedom of drawing processing is high, and expressive power is greatly improved compared to conventional hardware-based fixed drawing processing. Can do.

そして描画部120は、オブジェクトを描画する際に、ジオメトリ処理、テクスチャマッピング、隠面消去処理、αブレンディング、ステンシルテスト等を行う。   The drawing unit 120 performs geometry processing, texture mapping, hidden surface removal processing, α blending, stencil test, and the like when drawing an object.

ジオメトリ処理では、オブジェクトに対して、座標変換、クリッピング処理、透視投影変換、或いは光源計算等の処理が行われる。そして、ジオメトリ処理後(透視投影変換後)のオブジェクトデータ(オブジェクトの頂点の位置座標、テクスチャ座標、色データ(輝度データ)、法線ベクトル、或いはα値等)は、メインメモリ22のオブジェクトデータ記憶部22Aに保存される。   In the geometry processing, processing such as coordinate conversion, clipping processing, perspective projection conversion, or light source calculation is performed on the object. Then, object data (positional coordinates of object vertices, texture coordinates, color data (luminance data), normal vector, α value, etc.) after geometry processing (after perspective projection conversion) is stored in the object data in the main memory 22. Stored in the part 22A.

光源計算としては、光源に設定される各種パラメータ(光源の強さ、色、位置、光源ベクトルなど)、オブジェクト(プリミティブ)や頂点に設定される各種パラメータ(反射属性、法線などのベクトルなど)、仮想カメラに設定される各種パラメータ(視線ベクトル、視点の位置など)に基づいて光の反射をシミュレートし、頂点毎に基本色(ディフューズ)と鏡面反射成分(スペキュラ)とを求める。   For light source calculation, various parameters set for the light source (light source intensity, color, position, light source vector, etc.), various parameters set for objects (primitives) and vertices (vectors such as reflection attributes, normals, etc.) Then, light reflection is simulated based on various parameters (gaze vector, viewpoint position, etc.) set in the virtual camera, and a basic color (diffuse) and a specular reflection component (specular) are obtained for each vertex.

テクスチャマッピングは、ビデオメモリ24のテクスチャ記憶部24Cに記憶されるテクスチャ(テクセル値、UV座標値)をオブジェクトにマッピングするための処理である。具体的には、オブジェクトの頂点に設定(付与)されるテクスチャ座標等を用いてビデオメモリ24のテクスチャ記憶部24Cからテクスチャ(色(RGB)、α値などの表面プロパティ)を読み出す。そして、2次元の画像であるテクスチャをオブジェクトにマッピングする。この場合に、ピクセルとテクセルとを対応づける処理や、テクセルの補間としてバイリニア補間、トライリニア補間などを行う。   Texture mapping is a process for mapping a texture (texel value, UV coordinate value) stored in the texture storage unit 24C of the video memory 24 to an object. Specifically, the texture (surface properties such as color (RGB) and α value) is read from the texture storage unit 24C of the video memory 24 using the texture coordinates set (given) at the vertex of the object. Then, a texture that is a two-dimensional image is mapped to an object. In this case, processing for associating pixels with texels, bilinear interpolation, trilinear interpolation, etc. are performed as texel interpolation.

隠面消去処理としては、描画ピクセルの奥行き値(Z値)が格納されるデプスバッファ24D(奥行きバッファ)を用いた奥行き比較法(デプステスト、Zテスト)による隠面消去処理を行う。すなわちオブジェクトのプリミティブに対応する描画ピクセルを描画する際に、デプスバッファ24Dに格納される奥行き値をピクセルごとに参照する。そして参照されたデプスバッファ24Dの奥行き値と、プリミティブの描画ピクセルでの奥行き値とを比較し、描画ピクセルでの奥行き値が、仮想カメラから見て手前側となる奥行き値(例えば小さな奥行き値)である場合には、その描画ピクセルの描画処理を行うとともにデプスバッファ24Dの奥行き値を新たな奥行き値に更新する。   As the hidden surface removal processing, hidden surface removal processing is performed by a depth comparison method (depth test, Z test) using a depth buffer 24D (depth buffer) in which the depth value (Z value) of the drawing pixel is stored. That is, when drawing pixels corresponding to the primitives of the object are drawn, the depth value stored in the depth buffer 24D is referred to for each pixel. Then, the depth value of the referenced depth buffer 24D is compared with the depth value at the primitive drawing pixel, and the depth value at the drawing pixel is the front side when viewed from the virtual camera (for example, a small depth value). If it is, the drawing process of the drawing pixel is performed, and the depth value of the depth buffer 24D is updated to a new depth value.

αブレンディングとしては、α値(A値)に基づく半透明合成処理(通常αブレンディング、加算αブレンディング又は減算αブレンディング等)を行う。例えば通常αブレンディングの場合には下式(1)〜(3)の処理を行う。   As the α blending, a translucent synthesis process (usually α blending, addition α blending, subtraction α blending, or the like) based on the α value (A value) is performed. For example, in the case of normal α blending, the following processes (1) to (3) are performed.

=(1−α)×R+α×R (1)
=(1−α)×G+α×G (2)
=(1−α)×B+α×B (3)
R Q = (1−α) × R 1 + α × R 2 (1)
G Q = (1−α) × G 1 + α × G 2 (2)
B Q = (1−α) × B 1 + α × B 2 (3)

また、加算αブレンディングの場合には下式(4)〜(6)の処理を行う。なお単純加算の場合はα=1として下式(4)〜(6)の処理を行う。   In addition, in the case of addition α blending, the following expressions (4) to (6) are performed. In the case of simple addition, α = 1 and the following formulas (4) to (6) are performed.

=R+α×R (4)
=G+α×G (5)
=B+α×B (6)
R Q = R 1 + α × R 2 (4)
G Q = G 1 + α × G 2 (5)
B Q = B 1 + α × B 2 (6)

また、減算αブレンディングの場合には下式(7)〜(9)の処理を行う。なお単純減算の場合はα=1として下式(7)〜(9)の処理を行う。   In the case of subtractive α blending, the processing of the following equations (7) to (9) is performed. In the case of simple subtraction, α = 1 and the following formulas (7) to (9) are processed.

=R−α×R (7)
=G−α×G (8)
=B−α×B (9)
R Q = R 1 −α × R 2 (7)
G Q = G 1 −α × G 2 (8)
B Q = B 1 −α × B 2 (9)

ここで、R、G、Bは、フレームバッファ22Bあるいは第1カラーバッファ24A、第2カラーバッファ24Bに既に描画されている画像(原画像)のRGB成分(色値)であり、R、G、Bは、フレームバッファ22Bあるいは第1カラーバッファ24A、第2カラーバッファ24Bに描画すべき画像のRGB成分である。また、R、G、Bは、αブレンディングにより得られる画像のRGB成分である。なお、α値は、各ピクセル(テクセル、ドット)に関連づけて記憶できる情報であり、例えば色情報以外のプラスアルファの情報である。α値は、マスク情報、半透明度(透明度、不透明度と等価)、バンプ情報などとして使用できる。 Here, R 1 , G 1 and B 1 are RGB components (color values) of an image (original image) already drawn in the frame buffer 22B or the first color buffer 24A and the second color buffer 24B, and R 2 , G 2 , and B 2 are RGB components of an image to be drawn in the frame buffer 22B or the first color buffer 24A and the second color buffer 24B. R Q , G Q , and B Q are RGB components of an image obtained by α blending. The α value is information that can be stored in association with each pixel (texel, dot), for example, plus alpha information other than color information. The α value can be used as mask information, translucency (equivalent to transparency and opacity), bump information, and the like.

ステンシルテストとしては、ステンシルバッファ24Eの値(ステンシル画像)と、任意に設定できるステンシル参照値とを、任意に設定できる比較関数に基づいてピクセルごとに比較し、第1カラーバッファ24Aの画像や第2カラーバッファ24Bの画像の各ピクセルのデータを以降の処理において用いるか破棄するかを決定する処理を行う。例えば、ステンシルバッファ24Eのピクセルのうち「1」が格納されたピクセルについては、第2カラーバッファ24Bの色を以降の処理において用い、ステンシルバッファ24Eのピクセルのうち「0」が格納されたピクセルについては、第2カラーバッファ24Bの色を以降の処理において用いないようにすることができる。   As the stencil test, the value of the stencil buffer 24E (stencil image) and the stencil reference value that can be arbitrarily set are compared for each pixel based on a comparison function that can be arbitrarily set, and the image of the first color buffer 24A Processing for determining whether to use or discard the data of each pixel of the image of the two-color buffer 24B in the subsequent processing is performed. For example, for the pixel in which “1” is stored among the pixels in the stencil buffer 24E, the color in the second color buffer 24B is used in the subsequent processing, and the pixel in which “0” is stored among the pixels in the stencil buffer 24E. The color of the second color buffer 24B can be prevented from being used in the subsequent processing.

そして本実施形態では描画部120は、原画像描画部122と、エフェクト処理部124とを含む。   In the present embodiment, the drawing unit 120 includes an original image drawing unit 122 and an effect processing unit 124.

原画像描画部122は、上述のようにして、オブジェクト空間を仮想カメラから見た原画像を、第1カラーバッファ24Aに描画する処理を行う。   As described above, the original image drawing unit 122 performs a process of drawing the original image obtained by viewing the object space from the virtual camera in the first color buffer 24A.

エフェクト処理部124は、処理部100によるゲーム処理の結果に基づいて、爆発や炎上などのイベントが発生した場合に、原画像に対して炎や煙や閃光などを表現するエフェクト画像を合成するエフェクト処理を行う。   Based on the result of the game process performed by the processing unit 100, the effect processing unit 124 synthesizes an effect image that expresses flame, smoke, flash, or the like with the original image when an event such as an explosion or a fire occurs. Process.

具体的にはエフェクト処理部124はエフェクト処理として、まず、第1カラーバッファ24Aに描画された原画像を構成する各ピクセルの色(RGB成分)を、第1カラーバッファ24Aよりも解像度が低い(ピクセル数が少ない、サイズが小さい)第2カラーバッファ24B(縮小バッファ)に描画(コピー)する処理を行う。本実施形態では、第2カラーバッファ24Bの解像度は第1カラーバッファ24Aの解像度の2分の1倍(ピクセル数、サイズは4分の1倍)となっている。   Specifically, as the effect processing, the effect processing unit 124 first has a lower resolution than the first color buffer 24A for the colors (RGB components) of the pixels constituting the original image drawn in the first color buffer 24A (see FIG. A process of drawing (copying) in the second color buffer 24B (reduction buffer) having a small number of pixels and a small size is performed. In the present embodiment, the resolution of the second color buffer 24B is half the resolution of the first color buffer 24A (the number of pixels and the size is a quarter).

そしてエフェクト処理部124は、原画像の色を調整するためのエフェクト画像を第2カラーバッファ24Bに描画する処理を行う。詳細にはエフェクト処理部124は、上述したオブジェクト空間設定部110として機能し、ゲーム処理の結果により決定されるオブジェクト空間における爆発や炎上などが発生した位置(ワールド座標系)に、矩形のポリゴンにより構成されたエフェクト用オブジェクトを設定する。そしてエフェクト処理部124は、このエフェクト用オブジェクトについて上述したジオメトリ処理を行い、このエフェクト用オブジェクトに炎や煙や閃光などを表現するエフェクト用テクスチャをマッピングしつつ、デプステストを行わずにエフェクト画像を第2カラーバッファ24Bに描画する処理を行う。   Then, the effect processing unit 124 performs processing for drawing an effect image for adjusting the color of the original image in the second color buffer 24B. More specifically, the effect processing unit 124 functions as the object space setting unit 110 described above, and uses a rectangular polygon at a position (world coordinate system) where an explosion or a flame occurs in the object space determined by the result of the game processing. Set the configured effect object. Then, the effect processing unit 124 performs the above-described geometry processing on the effect object, maps the effect texture that expresses flame, smoke, flash, or the like to the effect object, and performs the effect image without performing the depth test. A drawing process is performed in the second color buffer 24B.

するとエフェクト処理部124は、第1カラーバッファ24Aにおいてエフェクト画像を描画するピクセルを指定するステンシル画像を、エフェクト用オブジェクトの形状に基づいて、第2カラーバッファ24Bよりも解像度が高いステンシルバッファ24Eに描画する処理を行う。本実施形態では、ステンシルバッファ24Eの解像度は第2カラーバッファ24Bの解像度の2倍(ピクセル数、サイズは4倍)となっており、第1カラーバッファ24Aの解像度と同一となっている。   Then, the effect processing unit 124 draws the stencil image that specifies the pixel for drawing the effect image in the first color buffer 24A in the stencil buffer 24E having a higher resolution than the second color buffer 24B based on the shape of the effect object. Perform the process. In this embodiment, the resolution of the stencil buffer 24E is twice the resolution of the second color buffer 24B (the number of pixels and the size is four times), and is the same as the resolution of the first color buffer 24A.

詳細にはエフェクト処理部124は、上述したオブジェクト空間設定部110として機能し、ゲーム処理の結果により決定されるオブジェクト空間における爆発や炎上などが発生した位置(ワールド座標系)にエフェクト用オブジェクトを設定する。そしてエフェクト処理部124は、このエフェクト用オブジェクトについて上述したジオメトリ処理を行い、デプスバッファ24Dに格納された原画像の奥行き値と、エフェクト処理部124が設定するエフェクト用オブジェクトの位置に含まれる奥行き値(エフェクト画像の奥行き値の一例)との比較結果に基づいてデプステストを行いながら、仮想カメラから見えるエフェクト用オブジェクトの形状をステンシル画像としてステンシルバッファ24Eに描画する処理を行う。本実施形態ではエフェクト処理部124は、ステンシルバッファ24Eのピクセルのうちエフェクト用オブジェクトが最も手前になるピクセルについて「1」を格納し、エフェクト用オブジェクトが最も手前ではないピクセルについて「0」を格納することにより、ステンシル画像を描画する。   Specifically, the effect processing unit 124 functions as the object space setting unit 110 described above, and sets an effect object at a position (world coordinate system) where an explosion or a flame has occurred in the object space determined by the result of the game processing. To do. Then, the effect processing unit 124 performs the above-described geometry processing on the effect object, and the depth value of the original image stored in the depth buffer 24D and the depth value included in the position of the effect object set by the effect processing unit 124. While performing the depth test based on the comparison result with (an example of the depth value of the effect image), a process of drawing the shape of the effect object visible from the virtual camera in the stencil buffer 24E as a stencil image is performed. In the present embodiment, the effect processing unit 124 stores “1” for the pixel in the stencil buffer 24E where the effect object is closest, and stores “0” for the pixel whose effect object is not closest. Thus, a stencil image is drawn.

なおエフェクト処理部124は、エフェクト用オブジェクトの位置(エフェクト画像の位置の一例)を、仮想カメラから見て特定オブジェクト(キャラクタなど)よりも常に奥となるように設定する処理を行うようにしてもよい。この場合にはエフェクト処理部124は、仮想カメラの位置と特定オブジェクトの位置とに基づいて、エフェクト用オブジェクトの位置を仮想カメラから見て特定オブジェクトよりも常に奥となるように設定するようにしてもよいし、エフェクト用オブジェクトの位置や移動範囲が、仮想カメラから見て特定オブジェクトよりも常に奥となるような領域に予め設定されているようにしてもよい。   The effect processing unit 124 may perform processing for setting the position of the effect object (an example of the position of the effect image) so that it is always behind the specific object (such as a character) when viewed from the virtual camera. Good. In this case, the effect processing unit 124 sets the position of the effect object so that it is always behind the specific object when viewed from the virtual camera, based on the position of the virtual camera and the position of the specific object. Alternatively, the position and moving range of the effect object may be set in advance in an area that is always behind the specific object as viewed from the virtual camera.

そしてエフェクト処理部124は、上述のようにして第2カラーバッファ24Bに描画されたエフェクト画像を、ステンシル画像に基づいてステンシルテストを行いながら、第1カラーバッファ24Bに描画する処理を行う。本実施形態ではエフェクト処理部124は、ステンシル画像において「1」が格納されたピクセルについては、第2カラーバッファ24Bの色を第1カラーバッファ24Aに描画し、ステンシル画像において「0」が格納されたピクセルについては、第1カラーバッファ24Aの原画像の色を更新せずにそのまま残す。   Then, the effect processing unit 124 performs a process of drawing the effect image drawn in the second color buffer 24B as described above in the first color buffer 24B while performing a stencil test based on the stencil image. In the present embodiment, the effect processing unit 124 draws the color of the second color buffer 24B in the first color buffer 24A for the pixel in which “1” is stored in the stencil image, and “0” is stored in the stencil image. The remaining pixels are left as they are without updating the color of the original image in the first color buffer 24A.

音生成部130は、処理部100で行われる種々の処理の結果に基づいて音処理を行い、BGM、効果音、又は音声などのゲーム音を生成し、音出力部60に出力する。   The sound generation unit 130 performs sound processing based on the results of various processes performed by the processing unit 100, generates game sounds such as BGM, sound effects, or sounds, and outputs the game sounds to the sound output unit 60.

なお、本実施形態の画像生成システムは、1人のプレーヤのみがプレイできるシングルプレーヤモード専用のシステムにしてもよいし、複数のプレーヤがプレイできるマルチプレーヤモードも備えるシステムにしてもよい。また複数のプレーヤがプレイする場合に、これらの複数のプレーヤに提供するゲーム画像やゲーム音を、1つの端末を用いて生成してもよいし、ネットワーク(伝送ライン、通信回線)などで接続された複数の端末(ゲーム機、携帯電話)を用いて分散処理により生成してもよい。   Note that the image generation system of the present embodiment may be a system dedicated to the single player mode in which only one player can play, or may be a system having a multiplayer mode in which a plurality of players can play. Further, when a plurality of players play, game images and game sounds to be provided to the plurality of players may be generated using one terminal, or connected via a network (transmission line, communication line) or the like. Alternatively, it may be generated by distributed processing using a plurality of terminals (game machine, mobile phone).

1−2.本実施形態の手法
次に本実施形態の手法について、従来の手法と比較しながら図面を用いて説明する。
1-2. Next, the method of the present embodiment will be described with reference to the drawings while comparing with the conventional method.

1−2−1.従来の手法
図2は、従来の画像生成システムにおいて採用されている、エフェクト画像を描画する際の処理負荷を軽減させる手法を説明するための図である。図2では、仮想カメラから見て黒い球体オブジェクト(特定オブジェクトの一例)の奥(裏)に煙を表現するエフェクト画像を合成する例を挙げて説明する。まず図2のA1のように、従来の手法では、オブジェクト空間に設定された球体オブジェクトを仮想カメラから見た原画像の各ピクセルの色が、最終的な表示画像の解像度を有する第1カラーバッファ24Aに描画され、原画像の各ピクセルの奥行き値が、第1カラーバッファ24Aと同一の解像度を有する第1デプスバッファ24D1に格納される。
1-2-1. Conventional Technique FIG. 2 is a diagram for explaining a technique that is employed in a conventional image generation system to reduce the processing load when drawing an effect image. FIG. 2 illustrates an example in which an effect image that expresses smoke is synthesized behind a black spherical object (an example of a specific object) as viewed from the virtual camera. First, as shown in A1 of FIG. 2, in the conventional method, the color of each pixel of the original image obtained by viewing the spherical object set in the object space from the virtual camera has the resolution of the final display image. The depth value of each pixel of the original image drawn in 24A is stored in the first depth buffer 24D1 having the same resolution as the first color buffer 24A.

そして図2のA2のように、第1カラーバッファ24Aに描画された原画像の各ピクセルの色が、第1カラーバッファ24Aの2分の1倍の解像度の第2カラーバッファ24Bに縮小コピーされ、第1デプスバッファ24D1に描画された原画像の各ピクセルの奥行き値が、第1デプスバッファ24D1の2分の1倍の解像度の第2デプスバッファ24D2に縮小コピーされる。なお縮小コピーの手法としては、第1カラーバッファ24Aの2行2列の4つのピクセルのうち1つのピクセルの色が第2カラーバッファ24Bの1つのピクセルの色としてコピーされるようにしてもよいし、第1カラーバッファ24Aの4つのピクセルの色の平均値が第2カラーバッファ24Bの1つのピクセルの色としてコピーされるようにしてもよい。   Then, as shown in A2 of FIG. 2, the color of each pixel of the original image drawn in the first color buffer 24A is reduced and copied to the second color buffer 24B having a resolution twice that of the first color buffer 24A. The depth value of each pixel of the original image drawn in the first depth buffer 24D1 is reduced and copied to the second depth buffer 24D2 having a resolution half that of the first depth buffer 24D1. As a reduction copy method, the color of one pixel out of the four pixels in the second row and the second column of the first color buffer 24A may be copied as the color of one pixel of the second color buffer 24B. The average value of the colors of the four pixels in the first color buffer 24A may be copied as the color of one pixel in the second color buffer 24B.

すると図2のA3のように、ゲーム処理の結果により決定されるオブジェクト空間における爆発や炎上などが発生した位置(ワールド座標系)に基づいて、第2カラーバッファ24Bに煙を表現するエフェクト画像が描画される。図2の例では、図3(A)に示すように、頂点データのα値がα=1.0(不透明)に設定された矩形のポリゴンにより構成されるエフェクト用オブジェクトが設定される。そして、各テクセルに煙の粒子の色と0.0〜1.0の値をとるα値が設定された煙を表現するエフェクト用テクスチャが、このエフェクト用オブジェクトに対してマッピングされることによりエフェクト画像が第2カラーバッファ24Bに描画される。詳細にはエフェクト用テクスチャは、煙の粒子の色が設定されているテクセルには0.0<α≦1.0となるα値が設定され、煙の粒子の色が設定されていないテクセルにはα=0.0となるα値が設定されている。そして、図2の例では、図3(B)に示すように、10枚程度のエフェクト用オブジェクトが向きを変えながら重ねて設定され、各エフェクト用オブジェクトにエフェクト用テクスチャがマッピングされることにより、一様ではない自然な煙を表現するエフェクト画像が描画されるようにしている。   Then, as shown by A3 in FIG. 2, an effect image representing smoke is displayed in the second color buffer 24B based on the position (world coordinate system) where an explosion or a flame has occurred in the object space determined by the result of the game process. Drawn. In the example of FIG. 2, as shown in FIG. 3A, an effect object configured by rectangular polygons in which the α value of vertex data is set to α = 1.0 (opaque) is set. An effect texture that expresses smoke in which the color of smoke particles and an α value that takes a value of 0.0 to 1.0 is set for each texel is mapped to the effect object, thereby creating an effect. The image is drawn in the second color buffer 24B. Specifically, the texture for effects is set to a texel for which the smoke particle color is set, and an α value of 0.0 <α ≦ 1.0 is set for the texel for which the smoke particle color is set. Is set to an α value such that α = 0.0. In the example of FIG. 2, as shown in FIG. 3B, about 10 effect objects are set to overlap while changing the orientation, and the effect texture is mapped to each effect object. An effect image expressing natural smoke that is not uniform is drawn.

従って図2の例では、原画像の色と10枚程度のエフェクト用テクスチャの色とがαブレンディングにより合成される。しかも図2の例では、原画像の色にエフェクト用テクスチャの色が合成される際には、光源計算や質感表現などに用いられる各種パラメータがピクセル毎に参照されるため、各ピクセルの処理負荷は非常に重いものとなる。しかし図2の例では、第2カラーバッファ24Bに縮小コピーされた原画像に対してエフェクト画像を描画するため、第1カラーバッファ24Aの原画像に対してエフェクト画像を描画するよりも処理負荷が大幅に軽減されている。   Therefore, in the example of FIG. 2, the color of the original image and the color of about ten effect textures are synthesized by α blending. In addition, in the example of FIG. 2, when the effect texture color is combined with the color of the original image, various parameters used for light source calculation, texture expression, and the like are referred to for each pixel. Will be very heavy. However, in the example of FIG. 2, since the effect image is drawn on the original image reduced and copied to the second color buffer 24B, the processing load is higher than drawing the effect image on the original image in the first color buffer 24A. It has been greatly reduced.

また図2の例では、エフェクト画像が第2カラーバッファ24Bに描画される際には、エフェクト用オブジェクトの奥行き値と、第2デプスバッファ24D2に格納された原画像の奥行き値との比較結果に基づいてデプステストが行われる。図2の例では、ゲーム処理の結果により煙が発生する位置が仮想カメラから見て球体オブジェクトの奥となっているため、球体オブジェクトの奥にエフェクト用オブジェクトが設定されている。従って図2のA3のように、第2カラーバッファ24Bのピクセルのうち、仮想カメラから見てエフェクト用オブジェクトの手前に重なる球体オブジェクトに対応するピクセルについては、球体オブジェクトの色が描画され、仮想カメラから見て球体オブジェクトと重ならないエフェクト用オブジェクトに対応するピクセルについては、エフェクト画像の色が描画される。   In the example of FIG. 2, when the effect image is rendered in the second color buffer 24B, the comparison result between the depth value of the effect object and the depth value of the original image stored in the second depth buffer 24D2 is used. Based on the depth test. In the example of FIG. 2, the position where the smoke is generated as a result of the game process is behind the spherical object as viewed from the virtual camera, and thus the effect object is set behind the spherical object. Therefore, as shown by A3 in FIG. 2, among the pixels of the second color buffer 24B, for the pixel corresponding to the spherical object that overlaps in front of the effect object when viewed from the virtual camera, the color of the spherical object is drawn. For pixels corresponding to an effect object that does not overlap with the sphere object when viewed from the perspective, the color of the effect image is drawn.

そして図2の例では、第2カラーバッファ24Bの画像のうちエフェクト画像が抽出され、これが第1カラーバッファ24Aの解像度に合わせて2倍に拡大されて、図2のA4のように、第1カラーバッファ24Aにおけるエフェクト画像に対応する位置(ピクセル)に合成される。こうして図2の例では、エフェクト画像を描画する際の処理負荷を軽減しつつ、第1カラーバッファ24Aに描画された原画像にエフェクト画像を合成している。   In the example of FIG. 2, an effect image is extracted from the image of the second color buffer 24B, and this is doubled in accordance with the resolution of the first color buffer 24A. As shown in A4 of FIG. It is synthesized at a position (pixel) corresponding to the effect image in the color buffer 24A. In this way, in the example of FIG. 2, the effect image is combined with the original image drawn in the first color buffer 24A while reducing the processing load when drawing the effect image.

しかしこのような従来の手法では、第1カラーバッファ24Aの原画像に対して合成されるエフェクト画像とは、第2カラーバッファ24Bの画像において抽出されたエフェクト用オブジェクトに対応する画像が2倍に拡大されたものであるため、図4に示すように、球体オブジェクトとエフェクト画像との境界付近のピクセルの色が滲んだように描画されてしまう。特に図4において線で囲まれた部分においては、オブジェクトの色が描画されるべきピクセルにエフェクト画像の色が描画されてしまい、エフェクト画像の色が描画されるべきピクセルにオブジェクトの色が描画されてしまっている状態が顕著に表れている。   However, in such a conventional method, the effect image synthesized with the original image of the first color buffer 24A is twice the image corresponding to the effect object extracted from the image of the second color buffer 24B. Since the image is enlarged, as shown in FIG. 4, the pixel color near the boundary between the spherical object and the effect image is drawn as if blurred. In particular, in the part surrounded by a line in FIG. 4, the color of the effect image is drawn on the pixel where the color of the object is to be drawn, and the color of the object is drawn on the pixel where the color of the effect image is to be drawn. The state that has been marked appears remarkably.

1−2−2.本実施形態の手法の特徴
次に、本実施形態の手法の特徴について説明する。図5は、本実施形態の画像生成システムにおいて採用されている手法を説明するための図である。図5においても図2と同様に、仮想カメラから見て黒い球体オブジェクトの奥(裏)に煙を表現するエフェクト画像を合成する例を挙げて説明する。まず図5のB1のように、本実施形態の手法でも従来の手法と同様に、オブジェクト空間に設定された球体オブジェクトを仮想カメラから見た原画像の各ピクセルの色が、最終的な表示画像の解像度を有する第1カラーバッファ24Aに描画され、原画像の各ピクセルの奥行き値が、第1カラーバッファ24Aと同一の解像度を有するデプスバッファ24Dに格納される。更に本実施形態では、図5のB1のように、第1カラーバッファ24Aと同一の解像度を有するステンシルバッファ24Eの各ピクセルの値が0にリセットされる。
1-2-2. Next, features of the technique of this embodiment will be described. FIG. 5 is a diagram for explaining a technique employed in the image generation system of the present embodiment. In FIG. 5, as in FIG. 2, an example in which an effect image that expresses smoke is synthesized behind the black spherical object as viewed from the virtual camera will be described. First, as in B1 of FIG. 5, in the method of the present embodiment, as in the conventional method, the color of each pixel of the original image obtained by viewing the spherical object set in the object space from the virtual camera is the final display image. The depth value of each pixel of the original image is stored in a depth buffer 24D having the same resolution as the first color buffer 24A. Furthermore, in this embodiment, as shown by B1 in FIG. 5, the value of each pixel of the stencil buffer 24E having the same resolution as the first color buffer 24A is reset to zero.

そして図5のB2のように、第1カラーバッファ24Aに描画された原画像の各ピクセルの色が、第1カラーバッファ24Aの2分の1倍の解像度の第2カラーバッファ24Bに縮小コピーされる。しかし、本実施形態の手法では従来の手法と異なり、デプスバッファ24Dに描画された原画像の各ピクセルの奥行き値は縮小コピーされない。   Then, as shown in B2 of FIG. 5, the color of each pixel of the original image drawn in the first color buffer 24A is reduced and copied to the second color buffer 24B having a resolution half that of the first color buffer 24A. The However, in the method of the present embodiment, unlike the conventional method, the depth value of each pixel of the original image drawn in the depth buffer 24D is not reduced and copied.

すると図5のB3のように、第2カラーバッファ24Bに煙を表現するエフェクト画像が描画される。本実施形態の手法でも従来の手法と同様に、図3(A)に示すエフェクト用オブジェクトが、ゲーム処理の結果により決定されるオブジェクト空間における爆発や炎上などが発生した位置(ワールド座標系)に設定され、このエフェクト用オブジェクトに対してエフェクト用テクスチャがマッピングされることによりエフェクト画像が第2カラーバッファ24Bに描画される。ここで本実施形態でも図3(B)に示すように、10枚程度のエフェクト用オブジェクトが向きを変えながら重ねて設定され、各エフェクト用オブジェクトにエフェクト用テクスチャがマッピングされることにより、一様ではない自然な煙を表現するエフェクト画像が描画されるようにしている。   Then, as in B3 of FIG. 5, an effect image representing smoke is drawn in the second color buffer 24B. Also in the method of the present embodiment, as in the conventional method, the effect object shown in FIG. 3A is located at the position (world coordinate system) where an explosion or a flame has occurred in the object space determined by the result of the game process. The effect image is rendered in the second color buffer 24B by mapping the effect texture to the effect object. Here, in this embodiment as well, as shown in FIG. 3B, about 10 effect objects are set to overlap each other while changing the direction, and the effect texture is mapped to each effect object, thereby uniform. An effect image that expresses natural smoke is not drawn.

そして本実施形態の手法でも従来の手法と同様に、原画像の色と10枚程度のエフェクト用テクスチャの色とがαブレンディングにより合成され、この際には、光源計算や質感表現などに用いられる各種パラメータがピクセル毎に参照される。   Also in the method of the present embodiment, as in the conventional method, the colors of the original image and the colors of about 10 effect textures are synthesized by α blending, and in this case, they are used for light source calculation, texture expression, and the like. Various parameters are referenced for each pixel.

しかし本実施形態の手法では従来の手法と異なり、エフェクト画像が第2カラーバッファ24Bに描画される際には、エフェクト用オブジェクトの奥行き値と、第2デプスバッファ24D2に格納された原画像の奥行き値との比較結果に基づいてデプステストが行われない。従って図5の例では、ゲーム処理の結果により決定される煙が発生する位置が仮想カメラから見て球体オブジェクトの奥となっているが、デプステストが行われないため、図5のB3のように、第2カラーバッファ24Bに描画されている原画像の色にエフェクト画像の色が上書きされたように描画される。   However, in the method of the present embodiment, unlike the conventional method, when the effect image is drawn in the second color buffer 24B, the depth value of the effect object and the depth of the original image stored in the second depth buffer 24D2 are used. The depth test is not performed based on the comparison result with the value. Therefore, in the example of FIG. 5, the smoke generation position determined by the game processing result is behind the spherical object as viewed from the virtual camera, but since the depth test is not performed, as shown in B <b> 3 of FIG. 5. In addition, the color of the effect image is overwritten with the color of the original image drawn in the second color buffer 24B.

更に本実施形態の手法では従来の手法と異なり、図5のB4のように、第1カラーバッファ24Aにおいてエフェクト画像を描画するピクセルを指定するステンシル画像がステンシルバッファ24Eに描画される。詳細には本実施形態では、ゲーム処理の結果により決定される煙が発生する位置(ワールド座標系)に基づいて、エフェクト用オブジェクトが設定される。そして、デプスバッファ24Dに格納された原画像の奥行き値と、エフェクト用オブジェクトの位置に含まれる奥行き値との比較結果に基づいてデプステストが行われながら、矩形のエフェクト用オブジェクトがステンシルバッファ24Eに描画される。本実施形態では、ステンシルバッファ24Eのピクセルのうちエフェクト用オブジェクトが最も手前になるピクセルについて「1」が格納され、エフェクト用オブジェクトが最も手前ではないピクセルについて「0」が格納される。これにより図5のB4のように、10枚程度のエフェクト用オブジェクトが重なっている領域に対応するピクセルのうち球体オブジェクトに対応するピクセルを除くピクセルについて「1」(白)が格納され、その他のピクセルについて「0」が格納されたステンシル画像が描画される。   Further, in the method of the present embodiment, unlike the conventional method, a stencil image designating a pixel for drawing an effect image in the first color buffer 24A is drawn in the stencil buffer 24E as shown in B4 of FIG. Specifically, in the present embodiment, the effect object is set based on the position (world coordinate system) where smoke determined by the result of the game process is generated. The rectangular effect object is stored in the stencil buffer 24E while the depth test is performed based on the comparison result between the depth value of the original image stored in the depth buffer 24D and the depth value included in the position of the effect object. Drawn. In the present embodiment, “1” is stored for the pixel with the effect object closest to the pixel in the stencil buffer 24E, and “0” is stored for the pixel with the effect object closest to the front. As a result, as shown in B4 of FIG. 5, “1” (white) is stored for pixels other than the pixels corresponding to the spherical object among the pixels corresponding to the area where about 10 effect objects overlap, A stencil image storing “0” for a pixel is drawn.

そして本実施形態の手法では従来の手法と異なり、第2カラーバッファ24Bの全てのピクセルについて、上述のようにして描画されたステンシル画像に基づいてステンシルテストが行われる。そして、ステンシルテストをパスしたピクセルについては、図5のB5のように、第2カラーバッファ24Bの色が第1カラーバッファ24Bに拡大コピーされる。本実施形態では、ステンシル画像において「1」が格納されたピクセルについては、第2カラーバッファ24Bの色が第1カラーバッファ24Aに描画され、ステンシル画像において「0」が格納されたピクセルについては、第1カラーバッファ24Aの原画像の色が更新されずにそのまま残る。   In the method of this embodiment, unlike the conventional method, a stencil test is performed on all the pixels of the second color buffer 24B based on the stencil image drawn as described above. For pixels that pass the stencil test, the color of the second color buffer 24B is enlarged and copied to the first color buffer 24B, as shown in B5 of FIG. In the present embodiment, for pixels in which “1” is stored in the stencil image, the color of the second color buffer 24B is drawn in the first color buffer 24A, and for pixels in which “0” is stored in the stencil image, The color of the original image in the first color buffer 24A remains without being updated.

従って本実施形態の手法によれば、エフェクト画像が第1カラーバッファ24Aの原画像に対して合成される際に、第1カラーバッファ24Aと同一の解像度のステンシルバッファ24Eに描画されたステンシル画像によって球体オブジェクトに対応するピクセルがマスクされるので、球体オブジェクトの色が描画されるべきピクセルにエフェクト画像の色が描画されることがない。更に本実施形態の手法によれば、第2カラーバッファ24Bのエフェクト画像は、図5のB3のように、第2カラーバッファ24Bに描画されている原画像の色にエフェクト画像の色が上書きされたように描画されるので、第1カラーバッファ24Aに拡大コピーされても、エフェクト画像の色が描画されるべきピクセルに球体オブジェクトの色が描画されることがない。   Therefore, according to the method of the present embodiment, when the effect image is synthesized with the original image of the first color buffer 24A, the stencil image drawn in the stencil buffer 24E having the same resolution as the first color buffer 24A is used. Since the pixel corresponding to the spherical object is masked, the color of the effect image is not drawn in the pixel where the color of the spherical object is to be drawn. Furthermore, according to the method of the present embodiment, the effect image in the second color buffer 24B is overwritten with the color of the effect image over the color of the original image drawn in the second color buffer 24B as shown in B3 of FIG. Therefore, even when the enlarged copy is made in the first color buffer 24A, the color of the spherical object is not drawn in the pixel where the color of the effect image is to be drawn.

すなわち本実施形態の手法によれば、第1カラーバッファ24Aの原画像に対して合成されるエフェクト画像とは、第2カラーバッファ24Bの画像のうちエフェクト用オブジェクトに対応する画像が2倍に拡大されたものであるが、図6に示すように、球体オブジェクトとエフェクト画像との境界付近のピクセルの色が互いに滲むように描画されることがなく、従来の手法と比して画像の劣化が著しく回避されている。   That is, according to the method of the present embodiment, the effect image synthesized with the original image of the first color buffer 24A is twice as large as the image corresponding to the effect object in the image of the second color buffer 24B. However, as shown in FIG. 6, the pixels near the boundary between the spherical object and the effect image are not drawn so that the colors of the pixels blur each other, and the image is degraded as compared with the conventional method. Remarkably avoided.

1−3.本実施形態の処理
次に、本実施形態の処理の一例について図7のフローチャートを用いて説明する。図7に示すように、本実施形態の画像生成システムは、まず、フレームの更新タイミングが到来すると(ステップS10でY)、ステンシルバッファ24Eの全ピクセルの値を「0」にリセットする(ステップS12)。そして、第1カラーバッファ24Aの原画像の色を第2カラーバッファ24Bに縮小コピーする(ステップS14)。そして、ゲーム処理の結果により決定されるオブジェクト空間における位置にエフェクト用オブジェクトを設定し、エフェクト用オブジェクトにエフェクト用テクスチャをマッピングしつつ、デプステストを行わずにエフェクト画像の色を第2カラーバッファ24Bに描画する(ステップS16)。そして、デプスバッファ24Dの原画像の奥行き値とエフェクト用オブジェクトの奥行き値との比較結果に基づいてデプステストを行いながら、エフェクト用オブジェクトが最も手前となるピクセルを「1」とするステンシル画像をステンシルバッファEに描画する(ステップS18)。すると、第1カラーバッファ24Aのピクセルのうち、ステンシル画像において「1」が設定されたピクセルについて、第2カラーバッファ24Bに描画されたエフェクト画像の色を描画する(ステップS20)。
1-3. Processing of this Embodiment Next, an example of processing of this embodiment will be described using the flowchart of FIG. As shown in FIG. 7, the image generation system of the present embodiment first resets the values of all pixels in the stencil buffer 24E to “0” when the frame update timing arrives (Y in step S10) (step S12). ). Then, the color of the original image in the first color buffer 24A is reduced and copied to the second color buffer 24B (step S14). Then, the effect object is set at a position in the object space determined by the result of the game process, the effect texture is mapped to the effect object, and the color of the effect image is set to the second color buffer 24B without performing the depth test. (Step S16). Then, while performing a depth test based on a comparison result between the depth value of the original image in the depth buffer 24D and the depth value of the effect object, a stencil image in which the pixel closest to the effect object is “1” is converted into a stencil image. Drawing in the buffer E (step S18). Then, the color of the effect image drawn in the second color buffer 24B is drawn for the pixels for which “1” is set in the stencil image among the pixels in the first color buffer 24A (step S20).

1−4.ハードウェア構成例
次に、本実施形態の画像生成システムを実現するハードウェアの構成の一例について図8を用いて説明する。なお図8では、主要な構成のみを図示しており、図8に示されていないハードウェア(メモリコントローラやスピーカなど)を必要に応じて設けることができる。
1-4. Hardware Configuration Example Next, an example of a hardware configuration for realizing the image generation system of the present embodiment will be described with reference to FIG. Note that FIG. 8 shows only main components, and hardware (such as a memory controller and a speaker) not shown in FIG. 8 can be provided as necessary.

メインプロセッサ200は、光ディスク272(CD、DVD、ブルーレイディスク等の情報記憶媒体)に格納されたプログラム、通信インターフェース280を介して転送されたプログラム、或いはハードディスク260に格納されたプログラムなどに基づき動作し、内部バスb4を介してアクセス可能なメインメモリ240を作業領域(ワーク領域)としてゲーム処理、画像処理、音処理などの種々の処理を実行する。   The main processor 200 operates based on a program stored on the optical disk 272 (an information storage medium such as a CD, DVD, or Blu-ray disc), a program transferred via the communication interface 280, or a program stored on the hard disk 260. The main memory 240 accessible via the internal bus b4 is used as a work area (work area) to execute various processes such as game processing, image processing, and sound processing.

メインプロセッサ200は、1基のプロセッサ210と複数のベクトルプロセッサ212で構成される。プロセッサ210は、OSの実行、ハードウェアリソースの管理、ゲーム処理、ベクトルプロセッサ212の動作管理などの種々の処理を実行する。またベクトルプロセッサ212は、ベクトル演算に特化したプロセッサであり、主にジオメトリ処理、画像データや音データのコーデック処理などの処理を実行する。   The main processor 200 includes a single processor 210 and a plurality of vector processors 212. The processor 210 executes various processes such as OS execution, hardware resource management, game processing, and operation management of the vector processor 212. The vector processor 212 is a processor specialized in vector operations, and mainly executes processes such as geometry processing and codec processing of image data and sound data.

描画プロセッサ220は、内部バスb1(第1の内部バス)を介してビデオメモリ230にアクセス可能に形成されている。また描画プロセッサ220は、描画プロセッサ220とメインプロセッサ200を接続する内部バスb2(第2の内部バス)と、メインプロセッサ200内部のバスb3と、メインプロセッサ200とメインメモリ240を接続する内部バスb4を介してメインメモリ240にアクセス可能に形成されている。すなわち描画プロセッサ220はビデオメモリ230と、メインメモリ240とをレンダリングターゲットとして利用することができる。   The drawing processor 220 is configured to be accessible to the video memory 230 via the internal bus b1 (first internal bus). The drawing processor 220 also includes an internal bus b2 (second internal bus) that connects the drawing processor 220 and the main processor 200, a bus b3 inside the main processor 200, and an internal bus b4 that connects the main processor 200 and the main memory 240. The main memory 240 can be accessed via the. That is, the drawing processor 220 can use the video memory 230 and the main memory 240 as a rendering target.

描画プロセッサ220は、座標変換、透視変換、光源計算、曲面生成などのジオメトリ処理を行うものであり、高速並列演算が可能な積和算器や除算器を有し、マトリクス演算(ベクトル演算)を高速に実行する。例えば、座標変換、透視変換、光源計算などの処理を行う場合には、メインプロセッサ200で動作するプログラムが、その処理を描画プロセッサ220に指示する。   The drawing processor 220 performs geometric processing such as coordinate transformation, perspective transformation, light source calculation, and curved surface generation, and has a product-sum calculator and a divider capable of high-speed parallel computation, and performs matrix computation (vector computation). Run fast. For example, when processing such as coordinate transformation, perspective transformation, and light source calculation is performed, a program operating on the main processor 200 instructs the rendering processor 220 to perform the processing.

また描画プロセッサ220は、ジオメトリ処理後のオブジェクト(ポリゴンや曲面などのプリミティブ面で構成されるオブジェクト)の画像のレンダリング処理を高速に実行するものである。マルチパスレンダリング処理の際には、描画プロセッサ220は、描画データ(頂点データや他のパラメータ)等に基づいて、Zバッファ234などを利用した陰面消去を行いながら、画像をビデオメモリ230又はメインメモリ240の一方のメモリにレンダリングする。そしてビデオメモリ230又はメインメモリ240の一方のメモリに記憶された画像に基づき他方のメモリに新たな画像をレンダリングする処理を必要なレンダリングパスの回数だけ行う。描画プロセッサ220は、上記マルチパスレンダリング処理として、グレアフィルタ処理、モーションブラー処理、被写界深度処理、フォグ処理等のフィルタ処理(エフェクト処理)を行うことができる。   The drawing processor 220 executes image rendering processing of an object after geometry processing (an object composed of a primitive surface such as a polygon or a curved surface) at high speed. In the multi-pass rendering process, the drawing processor 220 performs the hidden surface removal using the Z buffer 234 and the like based on the drawing data (vertex data and other parameters) and the like, and displays the image in the video memory 230 or the main memory. Render to one of 240 memories. Then, a process of rendering a new image in the other memory based on the image stored in one of the video memory 230 and the main memory 240 is performed as many times as necessary. The rendering processor 220 can perform filter processing (effect processing) such as glare filter processing, motion blur processing, depth of field processing, and fog processing as the multi-pass rendering processing.

そして、最後のレンダリングパスで画像がビデオメモリ230に設けられたフレームバッファ232にレンダリングされると、その画像をディスプレイ250に出力する。また最後のレンダリングパスで画像がメインメモリ240にレンダリングされた場合には当該画像をフレームバッファ232にコピー(書き込み)した上でディスプレイ250に出力する。   When the image is rendered in the frame buffer 232 provided in the video memory 230 in the final rendering pass, the image is output to the display 250. When an image is rendered in the main memory 240 in the final rendering pass, the image is copied (written) to the frame buffer 232 and output to the display 250.

ハードディスク260にはシステムプログラム、セーブデータ、個人データなどが格納される。   The hard disk 260 stores system programs, save data, personal data, and the like.

光学ドライブ270は、プログラム、画像データ、或いは音データなどが格納される光ディスク272(情報記憶媒体)を駆動し、これらのプログラム、データへのアクセスを可能にする。   The optical drive 270 drives an optical disk 272 (information storage medium) that stores programs, image data, sound data, and the like, and enables access to these programs and data.

通信インターフェース280は、ネットワークを介して外部との間でデータ転送を行うためのインターフェースである。この場合に、通信インターフェース280に接続されるネットワークとしては、通信回線(アナログ電話回線、ISDN)、高速シリアルバスなどを考えることができる。そして、通信回線を利用することでインターネットを介したデータ転送が可能になる。また、高速シリアルバスを利用することで、他の画像生成システムとの間でのデータ転送が可能になる。   The communication interface 280 is an interface for performing data transfer with the outside via a network. In this case, as the network connected to the communication interface 280, a communication line (analog telephone line, ISDN), a high-speed serial bus, and the like can be considered. By using a communication line, data transfer via the Internet becomes possible. Further, by using the high-speed serial bus, data transfer with other image generation systems becomes possible.

上述したように本実施形態の画像生成システム(コンピュータ)は、内部バスb1(第1の内部バス)を介してビデオメモリ230にアクセス可能であるとともに、内部バスb2(第2の内部バス)を介してメインメモリ240にアクセス可能である描画プロセッサ220を含んで構成されており、描画プロセッサ220は、光ディスク272(情報記憶媒体の一例)あるいはハードディスク260(情報記憶媒体の一例)に格納されているシェーダプログラムに従って種々のシェーダ処理を実行する。   As described above, the image generation system (computer) according to the present embodiment can access the video memory 230 via the internal bus b1 (first internal bus) and also uses the internal bus b2 (second internal bus). The drawing processor 220 is accessible to the main memory 240 via the optical disk 272 (an example of an information storage medium) or the hard disk 260 (an example of an information storage medium). Various shader processes are executed according to the shader program.

なお、本実施形態の各部(各手段)は、その全てを、ハードウェアのみにより実現してもよいし、情報記憶媒体に格納されるプログラムや通信インターフェースを介して配信されるプログラムのみにより実現してもよい。或いは、ハードウェアとプログラムの両方により実現してもよい。   Note that all the units (units) of the present embodiment may be realized only by hardware, or only by a program stored in an information storage medium or a program distributed via a communication interface. May be. Alternatively, it may be realized by both hardware and a program.

そして、本実施形態の各部をハードウェアとプログラムの両方により実現する場合には、情報記憶媒体には、ハードウェア(コンピュータ)を本実施形態の各部として機能させるためのプログラムが格納されることになる。より具体的には、上記プログラムが、ハードウェアである各プロセッサ200、220等に処理を指示すると共に、必要であればデータを渡す。そして、各プロセッサ200、220等は、その指示と渡されたデータとに基づいて、本発明の各部を実現することになる。   And when each part of this embodiment is implement | achieved by both hardware and a program, the program for functioning hardware (computer) as each part of this embodiment is stored in an information storage medium. Become. More specifically, the program instructs the processors 200, 220, etc., which are hardware, and passes data if necessary. Each processor 200, 220, etc., implements each unit of the present invention based on the instruction and the passed data.

2.第2実施形態
2−1.構成
次に、第2実施形態の画像生成システム(ゲームシステム)について説明する。以下では、図1を参照しながら、第2実施形態の画像生成システムにおける機能ブロックの構成を説明するが、第1実施形態の画像生成システムにおける機能ブロックの構成と同様の点については詳細な説明を省略し、主要な相違点について説明する。
2. Second Embodiment 2-1. Configuration Next, an image generation system (game system) according to a second embodiment will be described. In the following, the configuration of functional blocks in the image generation system of the second embodiment will be described with reference to FIG. 1, but the same points as the configuration of functional blocks in the image generation system of the first embodiment will be described in detail. The main differences will be described.

本実施形態では上記第1実施形態と異なり、図1のデプスバッファ24は、第1カラーバッファ24Aと解像度が同一の第1デプスバッファ24D1と、第2カラーバッファ24Bと解像度が同一の第2デプスバッファ24D2とを含んでいる。   In the present embodiment, unlike the first embodiment, the depth buffer 24 in FIG. 1 includes a first depth buffer 24D1 having the same resolution as the first color buffer 24A and a second depth having the same resolution as the second color buffer 24B. And a buffer 24D2.

そして本実施形態ではエフェクト処理部124は、まず、第1カラーバッファ24Aに描画された原画像を構成する各ピクセルの色を第2カラーバッファ24Bに描画(縮小コピー)する処理を行うとともに、第1デプスバッファ24D1に描画された原画像を構成する各ピクセルの奥行き値を、第2デプスバッファ24D2(縮小バッファ)に描画(縮小コピー)する処理を行う。   In the present embodiment, the effect processing unit 124 first performs a process of drawing (reducing and copying) the color of each pixel constituting the original image drawn in the first color buffer 24A in the second color buffer 24B. The depth value of each pixel constituting the original image drawn in the 1-depth buffer 24D1 is drawn (reduced copy) in the second depth buffer 24D2 (reduced buffer).

更に本実施形態ではエフェクト処理部124は、第1実施形態と異なり、エフェクト画像を第2カラーバッファに描画する処理を行う際にデプステストを行う。詳細にはエフェクト処理部124は、ゲーム処理の結果により決定されるオブジェクト空間における爆発や炎上などが発生した位置(ワールド座標系)に、頂点データのα値が不透明に設定された矩形のポリゴンにより構成されたエフェクト用オブジェクトを設定する。そしてエフェクト処理部124は、このエフェクト用オブジェクトについて上述したジオメトリ処理を行い、このエフェクト用オブジェクトに炎や煙や閃光などを表現するエフェクト用テクスチャをマッピングしつつ、第2デプスバッファ24D2の原画像の奥行き値とエフェクト用オブジェクトの奥行き値との比較結果に基づいてデプステストを行いながら、エフェクト画像の色を第2カラーバッファ24Bに描画する処理を行う。   Furthermore, in the present embodiment, unlike the first embodiment, the effect processing unit 124 performs a depth test when performing a process of drawing an effect image in the second color buffer. Specifically, the effect processing unit 124 uses a rectangular polygon in which the alpha value of the vertex data is set to be opaque at a position (world coordinate system) where an explosion or a flame has occurred in the object space determined by the game processing result. Set the configured effect object. Then, the effect processing unit 124 performs the above-described geometry processing on the effect object, and maps the effect texture that expresses flame, smoke, flash, or the like to the effect object, while the original image of the second depth buffer 24D2 is mapped. While performing a depth test based on a comparison result between the depth value and the depth value of the effect object, a process of rendering the color of the effect image in the second color buffer 24B is performed.

2−2.本実施形態の手法の特徴
次に、本実施形態の手法の特徴について説明する。上述した第1実施形態の画像生成システムでは、図5のB3のように、第2カラーバッファ24Bに描画されている原画像の色にエフェクト画像の色が上書きされたように描画されるので、球体オブジェクトと、仮想カメラから見て球体オブジェクトよりも手前に設定される第1エフェクト画像と、仮想カメラから見て球体オブジェクトよりも奥に設定される第2エフェクト画像とが重なる場合には、これらの前後関係が正確に描画されない不都合が発生する場合がある。そこで本実施形態の画像生成システムでは、このような不都合が発生しないようにしている。
2-2. Next, features of the technique of this embodiment will be described. In the image generation system of the first embodiment described above, since the color of the effect image is overwritten on the color of the original image drawn in the second color buffer 24B as shown in B3 of FIG. When the spherical object, the first effect image set in front of the spherical object as viewed from the virtual camera, and the second effect image set in the back of the spherical object as viewed from the virtual camera overlap, Inconvenient cases may occur in which the front-and-rear relationship is not accurately drawn. Therefore, in the image generation system of this embodiment, such inconvenience is prevented from occurring.

図9は、本実施形態の画像生成システムにおいて採用されている手法を説明するための図である。図9でも図5と同様に、仮想カメラから見て黒い球体オブジェクトの奥(裏)に煙を表現するエフェクト画像を合成する例を挙げて説明する。まず図9のC1のように、本実施形態の手法でも第1実施形態の手法と同様に、オブジェクト空間に設定された球体オブジェクトを仮想カメラから見た原画像の各ピクセルの色が、最終的な表示画像の解像度を有する第1カラーバッファ24Aに描画され、原画像の各ピクセルの奥行き値が、第1カラーバッファ24Aと同一の解像度を有する第1デプスバッファ24D1に格納される。そして図9のC1のように、第1カラーバッファ24Aと同一の解像度を有するステンシルバッファ24Eの各ピクセルの値が0にリセットされる。   FIG. 9 is a diagram for explaining a technique employed in the image generation system of the present embodiment. In FIG. 9, as in FIG. 5, an example in which an effect image that expresses smoke is synthesized behind the black spherical object as viewed from the virtual camera will be described. First, as in C1 of FIG. 9, in the method of the present embodiment, the color of each pixel of the original image obtained by viewing the spherical object set in the object space from the virtual camera is the same as the method of the first embodiment. The depth value of each pixel of the original image is stored in the first depth buffer 24D1 having the same resolution as that of the first color buffer 24A. Then, as indicated by C1 in FIG. 9, the value of each pixel of the stencil buffer 24E having the same resolution as the first color buffer 24A is reset to zero.

そして図9のC2のように、第1カラーバッファ24Aに描画された原画像の各ピクセルの色が、第1カラーバッファ24Aの2分の1倍の解像度の第2カラーバッファ24Bに縮小コピーされる。そして、本実施形態の手法では第1実施形態の手法と異なり、第1デプスバッファ24D1に描画された原画像の各ピクセルの奥行き値が、第1デプスバッファ24D1の2分の1倍の解像度の第2デプスバッファ24D2に縮小コピーされる。   Then, as shown in C2 of FIG. 9, the color of each pixel of the original image drawn in the first color buffer 24A is reduced and copied to the second color buffer 24B having a resolution twice that of the first color buffer 24A. The In the method of the present embodiment, unlike the method of the first embodiment, the depth value of each pixel of the original image drawn in the first depth buffer 24D1 has a resolution twice that of the first depth buffer 24D1. The reduced copy is made to the second depth buffer 24D2.

すると図9のC3のように、第2カラーバッファ24Bに煙を表現するエフェクト画像が描画される。本実施形態の手法でも第1実施形態の手法と同様に、図3(A)に示すエフェクト用オブジェクトが設定され、このエフェクト用オブジェクトに対してエフェクト用テクスチャがマッピングされることによりエフェクト画像が第2カラーバッファ24Bに描画される。そして図3(B)に示すように、10枚程度のエフェクト用オブジェクトが向きを変えながら重ねて設定され、各エフェクト用オブジェクトにエフェクト用テクスチャがマッピングされることにより、一様ではない自然な煙を表現するエフェクト画像が描画されるようにしている。   Then, as in C3 of FIG. 9, an effect image representing smoke is drawn in the second color buffer 24B. In the method of the present embodiment, as in the method of the first embodiment, the effect object shown in FIG. 3A is set, and the effect image is mapped to the effect object by mapping the effect texture. The image is drawn in the two-color buffer 24B. Then, as shown in FIG. 3B, about 10 effect objects are overlapped while changing the direction, and the effect texture is mapped to each effect object. The effect image that expresses is drawn.

そして本実施形態の手法でも第1実施形態の手法と同様に、原画像の色と10枚程度のエフェクト用テクスチャの色とがαブレンディングにより合成され、この際には、光源計算や質感表現などに用いられる各種パラメータがピクセル毎に参照される。   Also in the method of the present embodiment, as in the method of the first embodiment, the colors of the original image and about ten effect texture colors are synthesized by α blending. In this case, light source calculation, texture expression, etc. Various parameters used in the are referred to for each pixel.

しかし本実施形態の手法では第1実施形態の手法と異なり、エフェクト画像が第2カラーバッファ24Bに描画される際には、エフェクト用オブジェクトの奥行き値と、第2デプスバッファ24D2に格納された原画像の奥行き値との比較結果に基づいてデプステストが行われる。図9の例では、ゲーム処理の結果により煙が発生する位置が仮想カメラから見て球体オブジェクトの奥となっているため、球体オブジェクトの奥にエフェクト用オブジェクトが設定されている。従って図9のC3のように、第2カラーバッファ24Bのピクセルのうち、仮想カメラから見てエフェクト用オブジェクトの手前に重なる球体オブジェクトに対応するピクセルについては、球体オブジェクトの色が描画され、仮想カメラから見て球体オブジェクトと重ならないエフェクト用オブジェクトに対応するピクセルについては、エフェクト画像の色が描画される。   However, unlike the method of the first embodiment, the method of the present embodiment differs from the method of the first embodiment when the effect image is drawn in the second color buffer 24B, and the depth value of the effect object and the original value stored in the second depth buffer 24D2. A depth test is performed based on the comparison result with the depth value of the image. In the example of FIG. 9, the position where smoke is generated as a result of the game process is behind the spherical object as viewed from the virtual camera, and therefore the effect object is set behind the spherical object. Therefore, as shown in C3 of FIG. 9, among the pixels of the second color buffer 24B, for the pixel corresponding to the spherical object that overlaps in front of the effect object when viewed from the virtual camera, the color of the spherical object is drawn. For pixels corresponding to an effect object that does not overlap with the sphere object when viewed from the perspective, the color of the effect image is drawn.

そして本実施形態の手法では第1実施形態の手法と同様に、図9のC4のように、第1カラーバッファ24Aにおいてエフェクト画像を描画するピクセルを指定するステンシル画像がステンシルバッファ24Eに描画される。詳細には本実施形態の手法でも第1実施形態の手法と同様に、ゲーム処理の結果により決定される煙が発生する位置に基づいて、エフェクト用オブジェクトが設定される。そして、デプスバッファ24Dに格納された原画像の奥行き値と、エフェクト用オブジェクトの位置に含まれる奥行き値との比較結果に基づいてデプステストを行いながら、矩形のエフェクト用オブジェクトがステンシルバッファ24Eに描画される。   In the method of the present embodiment, as in the method of the first embodiment, a stencil image that designates a pixel for drawing an effect image in the first color buffer 24A is drawn in the stencil buffer 24E, as in C4 of FIG. . More specifically, in the method of the present embodiment as well, as in the method of the first embodiment, the effect object is set based on the position where smoke determined by the game processing result is generated. Then, a rectangular effect object is drawn in the stencil buffer 24E while performing a depth test based on a comparison result between the depth value of the original image stored in the depth buffer 24D and the depth value included in the position of the effect object. Is done.

そして本実施形態の手法でも第1実施形態の手法と同様に、第2カラーバッファ24Bの全てのピクセルについて、上述のようにして描画されたステンシル画像に基づいてステンシルテストが行われる。そして、図9のC5のように、ステンシル画像において「1」が格納されたピクセルについては、第2カラーバッファ24Bの色が第1カラーバッファ24Aに描画され、ステンシル画像において「0」が格納されたピクセルについては、第1カラーバッファ24Aの原画像の色が更新されずにそのまま残る。   In the method of this embodiment, as in the method of the first embodiment, the stencil test is performed on all the pixels in the second color buffer 24B based on the stencil image drawn as described above. As for C5 in FIG. 9, for the pixel in which “1” is stored in the stencil image, the color of the second color buffer 24B is drawn in the first color buffer 24A, and “0” is stored in the stencil image. For the remaining pixels, the color of the original image in the first color buffer 24A remains without being updated.

従って本実施形態の手法によれば、エフェクト画像が第1カラーバッファ24Aの原画像に対して合成される際に、第1カラーバッファ24Aと同一の解像度のステンシルバッファ24Eに描画されたステンシル画像によって球体オブジェクトに対応するピクセルがマスクされるので、球体オブジェクトの色が描画されるべきピクセルにエフェクト画像の色が描画されることがない。一方、本実施形態における第2カラーバッファ24Bのエフェクト画像は、図9のC3のように、デプステストによって前後関係が判定されて描画されるので、第1カラーバッファ24Aに拡大コピーされると、エフェクト画像の色が描画されるべきピクセルに球体オブジェクトの色が描画されることがある。しかし本実施形態の手法によれば、第2カラーバッファ24Bのエフェクト画像はデプステストによって前後関係が判定されているので、第1エフェクト画像と第2エフェクト画像とが仮想カメラから見て特定オブジェクトの手前と奥とで特定オブジェクトと重なるように設定されても、これらの前後関係が正確に描画されない不都合が発生することがない。   Therefore, according to the method of the present embodiment, when the effect image is synthesized with the original image of the first color buffer 24A, the stencil image drawn in the stencil buffer 24E having the same resolution as the first color buffer 24A is used. Since the pixel corresponding to the spherical object is masked, the color of the effect image is not drawn in the pixel where the color of the spherical object is to be drawn. On the other hand, the effect image of the second color buffer 24B in the present embodiment is drawn after the context is determined by the depth test as shown by C3 in FIG. 9, and therefore when the enlarged image is copied to the first color buffer 24A, The color of the sphere object may be drawn at the pixel where the color of the effect image is to be drawn. However, according to the method of the present embodiment, the effect image of the second color buffer 24B has been determined in the depth test by the depth test, so that the first effect image and the second effect image are the specific object as viewed from the virtual camera. Even if it is set so as to overlap the specific object in the front and back, there is no inconvenience that these front-rear relations are not drawn accurately.

すなわち本実施形態の手法によれば、複数のエフェクト画像を球体オブジェクトとの位置関係に関わらず設定することができるとともに、図10に示すように、球体オブジェクトとエフェクト画像との境界付近において、エフェクト画像の色が球体オブジェクトの色に対して滲むように描画されることがなく、従来の手法と比して画像の劣化が十分に回避されている。   That is, according to the method of the present embodiment, a plurality of effect images can be set regardless of the positional relationship with the spherical object, and as shown in FIG. The image is not drawn so that the color of the image is blurred with respect to the color of the spherical object, and the deterioration of the image is sufficiently avoided as compared with the conventional method.

2−3.本実施形態の処理
次に、本実施形態の処理の一例について図11のフローチャートを用いて説明する。図11に示すように、本実施形態の画像生成システムは、まず、フレームの更新タイミングが到来すると(ステップS110でY)、ステンシルバッファ24Eの全ピクセルの値を「0」にリセットする(ステップS112)。そして、第1カラーバッファ24Aの原画像の色を第2カラーバッファ24Bに縮小コピーするとともに、第1デプスバッファ24D1の原画像の奥行き値を第2デプスバッファ24D2にコピーする(ステップS114)。そして、ゲーム処理の結果により決定されるオブジェクト空間における位置にエフェクト用オブジェクトを設定し、エフェクト用オブジェクトにエフェクト用テクスチャをマッピングしつつ、第2デプスバッファ24D2の原画像の奥行き値とエフェクト用オブジェクトの奥行き値との比較結果に基づいてデプステストを行いながら、エフェクト画像の色を第2カラーバッファ24Bに描画する(ステップS116)。そして、第1デプスバッファ24D1の原画像の奥行き値とエフェクト用オブジェクトの奥行き値との比較結果に基づいて、エフェクト用オブジェクトが最も手前となるピクセルを「1」とするステンシル画像をステンシルバッファEに描画する(ステップS118)。すると、第1カラーバッファ24Aのピクセルのうち、ステンシル画像において「1」が設定されたピクセルについて、第2カラーバッファ24Bに描画されたエフェクト画像の色を描画する(ステップS120)。
2-3. Processing of this Embodiment Next, an example of processing of this embodiment will be described using the flowchart of FIG. As shown in FIG. 11, in the image generation system of the present embodiment, first, when the frame update timing arrives (Y in step S110), the values of all pixels in the stencil buffer 24E are reset to “0” (step S112). ). Then, the original color of the first color buffer 24A is reduced and copied to the second color buffer 24B, and the depth value of the original image of the first depth buffer 24D1 is copied to the second depth buffer 24D2 (step S114). Then, the effect object is set at a position in the object space determined by the result of the game process, and the depth value of the original image in the second depth buffer 24D2 and the effect object are mapped while the effect texture is mapped to the effect object. The color of the effect image is drawn in the second color buffer 24B while performing the depth test based on the comparison result with the depth value (step S116). Then, based on the comparison result between the depth value of the original image in the first depth buffer 24D1 and the depth value of the effect object, a stencil image in which the pixel closest to the effect object is “1” is stored in the stencil buffer E. Drawing is performed (step S118). Then, the color of the effect image drawn in the second color buffer 24B is drawn with respect to the pixel for which “1” is set in the stencil image among the pixels in the first color buffer 24A (step S120).

3.変形例
なお本発明は、上記実施形態で説明したものに限らず、種々の変形実施が可能である。例えば、明細書又は図面中の記載において広義や同義な用語として引用された用語は、明細書又は図面中の他の記載においても広義や同義な用語に置き換えることができる。またグレアフィルタの手法は、本実施形態で説明したものに限定されず、これらと均等な手法も本発明の範囲に含まれる。
3. Modifications The present invention is not limited to that described in the above embodiment, and various modifications can be made. For example, terms cited as broad or synonymous terms in the description in the specification or drawings can be replaced with broad or synonymous terms in other descriptions in the specification or drawings. Further, the glare filter technique is not limited to that described in the present embodiment, and techniques equivalent to these techniques are also included in the scope of the present invention.

また上記実施形態では、エフェクト処理部124が1フレームについて1回のエフェクト処理を行う例を挙げて説明したが、エフェクト処理部124が1フレームについて複数回のエフェクト処理を行うようにしてもよい。例えば、仮想カメラから見て特定オブジェクトよりも手前に設定される第1エフェクト画像についてエフェクト処理を行う第1エフェクト処理と、仮想カメラから見て特定オブジェクトよりも奥に設定される第2エフェクト画像についてエフェクト処理を行う第2エフェクト処理とを行うようにしてもよい。この場合にはエフェクト処理部124が、第1カラーバッファ24Aに描画された原画像を第2カラーバッファ24Bに縮小コピーするとともに、第2カラーバッファ24Bと同一の解像度を有する第3カラーバッファにも縮小コピーしておき、第1エフェクト処理ではエフェクト画像のレンダリングターゲットとして第2カラーバッファ24Bを用い、第2エフェクト処理ではエフェクト画像のレンダリングターゲットとして第3カラーバッファを用いるようにしてもよい。   In the above-described embodiment, the effect processing unit 124 has been described with an example in which the effect processing is performed once for one frame. However, the effect processing unit 124 may perform the effect processing a plurality of times for one frame. For example, a first effect process that performs effect processing on a first effect image that is set in front of a specific object when viewed from the virtual camera, and a second effect image that is set behind the specific object when viewed from the virtual camera. You may make it perform the 2nd effect process which performs an effect process. In this case, the effect processing unit 124 reduces and copies the original image drawn in the first color buffer 24A to the second color buffer 24B, and also applies it to the third color buffer having the same resolution as the second color buffer 24B. The second color buffer 24B may be used as a rendering target for the effect image in the first effect processing, and the third color buffer may be used as the rendering target for the effect image in the second effect processing.

このようにすれば、第1エフェクト画像と第2エフェクト画像とが仮想カメラから見て特定オブジェクトの手前と奥とで特定オブジェクトと重なるように設定されても、第1エフェクト画像についての第1エフェクト処理と第2エフェクト画像についての第2エフェクト処理とが行われることにより、エフェクト画像を第2カラーバッファおよび第3カラーバッファに描画する処理を行う際に原画像の奥行き値とエフェクト画像の奥行き値とに基づいてデプステストを行わなくともこれらの前後関係を正確に描画しつつ、ステンシル画像により画像の劣化を回避することができる。   In this way, even if the first effect image and the second effect image are set so as to overlap the specific object before and behind the specific object when viewed from the virtual camera, the first effect image for the first effect image is set. When the processing and the second effect processing for the second effect image are performed, the depth value of the original image and the depth value of the effect image when performing the processing of rendering the effect image in the second color buffer and the third color buffer. Based on the above, it is possible to avoid the deterioration of the image by the stencil image while accurately drawing these front-rear relationships without performing the depth test.

また上記実施形態では、エフェクト処理部124が、仮想カメラから見えるエフェクト用オブジェクトの形状をステンシル画像としてステンシルバッファ24Eに描画する処理を行う例を挙げて説明したが、エフェクト処理部124が、エフェクト用テクスチャに基づいて、ステンシル画像をステンシルバッファ24Eに描画する処理を行うようにしてもよい。詳細にはエフェクト処理部124が、仮想カメラから見えるエフェクト用オブジェクトにエフェクト用テクスチャをマッピングし、エフェクト用テクスチャがマッピングされた領域のうち色が設定されているピクセルすなわちα値が0よりも大きいピクセルに「1」を格納し、α値が0であるピクセルに「0」を格納することにより、ステンシル画像をステンシルバッファ24Eに描画する処理を行うようにしてもよい。このようにすれば、エフェクト用テクスチャに対応する詳細なステンシル画像を描画することにより、画像の劣化を更に回避することができる。   In the above-described embodiment, the example has been described in which the effect processing unit 124 performs the process of drawing the shape of the effect object visible from the virtual camera as the stencil image in the stencil buffer 24E. Based on the texture, a process of drawing the stencil image in the stencil buffer 24E may be performed. Specifically, the effect processing unit 124 maps the effect texture to the effect object that can be seen from the virtual camera, and the pixel in which the color is set in the area to which the effect texture is mapped, that is, the pixel whose α value is larger than 0. In this case, “1” is stored in the pixel and “0” is stored in the pixel having the α value of 0, so that the stencil image may be drawn in the stencil buffer 24E. In this way, it is possible to further avoid image degradation by drawing a detailed stencil image corresponding to the texture for effect.

また上記実施形態では、エフェクト処理部124が、爆発や炎上などのイベントが発生した場合に、原画像に対して炎や煙や閃光などを表現するエフェクト画像を合成するエフェクト処理を行う例を挙げて説明したが、キャラクタが特定の技を使用する場合に、キャラクタの背後にオーラを表現するエフェクト画像を合成するようにしてもよいし、キャラクタが相手キャラクタの攻撃を受けた場合に、ダメージを表現するエフェクト画像を合成するようにしてもよい。   Further, in the above-described embodiment, an example in which the effect processing unit 124 performs effect processing for synthesizing an effect image expressing flame, smoke, flash, or the like with an original image when an event such as an explosion or a fire occurs. As described above, when a character uses a specific technique, an effect image representing an aura may be synthesized behind the character, or when the character is attacked by the opponent character, You may make it synthesize | combine the effect image to represent.

またエフェクト処理部124は、キャラクタが相手キャラクタに対して攻撃を行ったり、相手キャラクタから攻撃を受けた場合に、当該攻撃の種類や、当該攻撃が相手キャラクタまたはキャラクタにヒットしたか否かに応じて、エフェクト用オブジェクトの位置を仮想カメラから見て特定オブジェクトよりも奥となるように設定するようにしてもよいし、更に、操作部10に入力された方向情報に基づいて決定される攻撃方向が仮想カメラから見て奥方向に向く所定範囲の方向である場合に、エフェクト用オブジェクトの位置を仮想カメラから見て特定オブジェクトよりも奥となるように設定するようにしてもよい。   In addition, when the character attacks the opponent character or receives an attack from the opponent character, the effect processing unit 124 determines whether the attack hits the opponent character or the character. Thus, the position of the effect object may be set to be behind the specific object when viewed from the virtual camera, and the attack direction determined based on the direction information input to the operation unit 10 May be set so that the position of the effect object is behind the specific object when viewed from the virtual camera.

またエフェクト用オブジェクトの位置や移動範囲は、キャラクタの位置を示す代表点のみならず、キャラクタの手先や足先などの端部よりも仮想カメラから見て奥となる領域に設定されるようにしてもよい。例えば、キャラクタの端部の移動範囲を含むバウンディングボリュームをキャラクタに対して設定するとともに、このバウンディングボリュームとエフェクト用オブジェクトとのヒットチェックを行い、エフェクト用オブジェクトの位置を仮想カメラから見てこのバウンディングボリュームよりも奥となるように設定するようにしてもよい。   In addition, the position and movement range of the effect object are set not only to the representative point indicating the character position but also to an area farther from the virtual camera than the end of the character's hand or foot. Also good. For example, a bounding volume that includes the range of movement of the character's edge is set for the character, a hit check is performed between the bounding volume and the effect object, and the position of the effect object is viewed from the virtual camera. You may make it set so that it may become behind.

また原画像が描画される第1カラーバッファ24Aと、エフェクト画像が合成される第1カラーバッファ24Aとは、物理的に同一のバッファを用いてもよいし、異なるバッファを用いてもよい。   Further, the first color buffer 24A in which the original image is drawn and the first color buffer 24A in which the effect image is combined may use the physically same buffer or different buffers.

また本発明は種々のゲーム(格闘ゲーム、シューティングゲーム、ロボット対戦ゲーム、スポーツゲーム、競争ゲーム、ロールプレイングゲーム、音楽演奏ゲーム、ダンスゲーム等)に適用できる。また本発明は、業務用ゲームシステム、家庭用ゲームシステム、多数のプレーヤが参加する大型アトラクションシステム、シミュレータ、マルチメディア端末、ゲーム画像を生成するシステムボード、携帯電話等の種々の画像生成システムに適用できる。   The present invention can also be applied to various games (such as fighting games, shooting games, robot fighting games, sports games, competitive games, role playing games, music playing games, dance games, etc.). Further, the present invention is applied to various image generation systems such as a business game system, a home game system, a large attraction system in which a large number of players participate, a simulator, a multimedia terminal, a system board for generating a game image, and a mobile phone. it can.

第1実施形態の画像生成システムの機能ブロック図。The functional block diagram of the image generation system of 1st Embodiment. 従来の画像生成システムの手法の説明図。Explanatory drawing of the method of the conventional image generation system. 従来の画像生成システムの手法の説明図。Explanatory drawing of the method of the conventional image generation system. 従来の画像生成システムの手法の説明図。Explanatory drawing of the method of the conventional image generation system. 第1実施形態の手法の説明図。Explanatory drawing of the method of 1st Embodiment. 第1実施形態で生成される画像の一例を示す図。The figure which shows an example of the image produced | generated by 1st Embodiment. 第1実施形態の処理の流れを示すフローチャート。The flowchart which shows the flow of a process of 1st Embodiment. 第1実施形態の画像生成システムのハードウェア構成例。1 is a hardware configuration example of an image generation system according to a first embodiment. 第2実施形態の手法の説明図。Explanatory drawing of the method of 2nd Embodiment. 第2実施形態で生成される画像の一例を示す図。The figure which shows an example of the image produced | generated by 2nd Embodiment. 第2実施形態の処理の流れを示すフローチャート。The flowchart which shows the flow of a process of 2nd Embodiment.

符号の説明Explanation of symbols

10 操作部、20 記憶部、22 メインメモリ、
22A オブジェクトデータ記憶部、22B フレームバッファ、
24 ビデオメモリ、24A 第1カラーバッファ、24B 第2カラーバッファ、
24C テクスチャ記憶部、24D デプスバッファ、30 情報記憶媒体、
40 携帯型情報記憶装置、50 表示部、60 音出力部、70 通信部
100 処理部、110 オブジェクト空間設定部、112 移動・動作処理部、
114 仮想カメラ制御部、120 描画部、122 原画像描画部、
124 エフェクト処理部、130 音生成部
10 operation unit, 20 storage unit, 22 main memory,
22A object data storage unit, 22B frame buffer,
24 video memory, 24A first color buffer, 24B second color buffer,
24C texture storage unit, 24D depth buffer, 30 information storage medium,
40 portable information storage device, 50 display unit, 60 sound output unit, 70 communication unit 100 processing unit, 110 object space setting unit, 112 movement / motion processing unit,
114 virtual camera control unit, 120 drawing unit, 122 original image drawing unit,
124 effect processing unit, 130 sound generation unit

Claims (8)

画像を生成するためのプログラムであって、
オブジェクト空間に設定されたオブジェクトを仮想カメラから見た原画像を第1カラーバッファに描画する処理を行う原画像描画部と、
前記原画像と前記原画像の色を調整するためのエフェクト画像とを合成するエフェクト処理を行うエフェクト処理部としてコンピュータを機能させ、
前記エフェクト処理部は前記エフェクト処理として、
前記第1カラーバッファに描画された前記原画像を前記第1カラーバッファよりも解像度が低い第2カラーバッファに描画する処理と、
前記エフェクト画像を前記第2カラーバッファに描画する処理と、
前記第2カラーバッファに描画された前記エフェクト画像を描画するピクセルを指定するステンシル画像を、前記原画像の奥行き値と前記エフェクト画像の奥行き値とに基づいて、前記第2カラーバッファよりも解像度が高いステンシルバッファに描画する処理と、
前記第2カラーバッファに描画された前記エフェクト画像を、前記ステンシル画像に基づいて前記第1カラーバッファに描画する処理と、
を行うことを特徴とするプログラム。
A program for generating an image,
An original image drawing unit that performs processing of drawing an original image obtained by viewing an object set in the object space from a virtual camera in the first color buffer;
Causing the computer to function as an effect processing unit that performs effect processing for combining the original image and an effect image for adjusting the color of the original image;
The effect processing unit as the effect processing,
Processing to draw the original image drawn in the first color buffer in a second color buffer having a resolution lower than that of the first color buffer;
Drawing the effect image in the second color buffer;
Based on the depth value of the original image and the depth value of the effect image, a stencil image designating a pixel for drawing the effect image drawn in the second color buffer has a resolution higher than that of the second color buffer. Drawing in a high stencil buffer;
Processing to draw the effect image drawn in the second color buffer in the first color buffer based on the stencil image;
The program characterized by performing.
請求項1において、
前記エフェクト処理部は、
前記エフェクト画像の位置を前記仮想カメラから見て特定オブジェクトよりも奥に設定する処理を行うことを特徴とするプログラム。
In claim 1,
The effect processing unit
A program for performing a process of setting the position of the effect image behind the specific object as viewed from the virtual camera.
請求項1において、
前記エフェクト処理部は、
前記原画像の奥行き値と前記エフェクト画像の奥行き値とに基づいて、前記エフェクト画像を前記第2カラーバッファに描画する処理を行うことを特徴とするプログラム。
In claim 1,
The effect processing unit
A program for performing a process of drawing the effect image in the second color buffer based on a depth value of the original image and a depth value of the effect image.
請求項1において、
前記エフェクト処理部は、
前記仮想カメラから見て特定オブジェクトよりも手前に設定される第1エフェクト画像について前記エフェクト処理を行う第1エフェクト処理と、前記仮想カメラから見て前記特定オブジェクトよりも奥に設定される第2エフェクト画像について前記エフェクト処理を行う第2エフェクト処理とを行うことを特徴とするプログラム。
In claim 1,
The effect processing unit
A first effect process for performing the effect process on a first effect image set in front of the specific object as viewed from the virtual camera, and a second effect set in the back of the specific object as viewed from the virtual camera. A program for performing a second effect process for performing the effect process on an image.
請求項1〜4のいずれかにおいて、
前記エフェクト処理部は、
エフェクト用テクスチャをエフェクト用オブジェクトにマッピングすることにより前記エフェクト画像を前記第2カラーバッファに描画する処理を行い、
前記エフェクト用オブジェクトの奥行き値に基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うことを特徴とするプログラム。
In any one of Claims 1-4,
The effect processing unit
Mapping the effect texture to the effect object to render the effect image in the second color buffer;
A program for performing a process of drawing the stencil image in the stencil buffer based on a depth value of the effect object.
請求項5において、
前記エフェクト処理部は、
前記エフェクト用オブジェクトの形状に基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うことを特徴とするプログラム。
In claim 5,
The effect processing unit
A program for performing a process of drawing the stencil image in the stencil buffer based on the shape of the effect object.
請求項5において、
前記エフェクト処理部は、
前記エフェクト用テクスチャに基づいて、前記ステンシル画像を前記ステンシルバッファに描画する処理を行うことを特徴とするプログラム。
In claim 5,
The effect processing unit
A program for performing a process of drawing the stencil image in the stencil buffer based on the effect texture.
画像を生成するための画像生成システムであって、
オブジェクト空間に設定されたオブジェクトを仮想カメラから見た原画像を第1カラーバッファに描画する処理を行う原画像描画部と、
前記原画像と前記原画像の色を調整するためのエフェクト画像とを合成するエフェクト処理を行うエフェクト処理部とを含み、
前記エフェクト処理部は前記エフェクト処理として、
前記第1カラーバッファに描画された前記原画像を前記第1カラーバッファよりも解像度が低い第2カラーバッファに描画する処理と、
前記エフェクト画像を前記第2カラーバッファに描画する処理と、
前記エフェクト画像を描画するピクセルを指定するステンシル画像を、前記原画像の奥行き値と前記エフェクト画像の奥行き値とに基づいて、前記第2カラーバッファよりも解像度が高いステンシルバッファに描画する処理と、
前記第2カラーバッファに描画された前記エフェクト画像を、前記ステンシル画像に基づいて前記第1カラーバッファに描画する処理と、
を行うことを特徴とする画像生成システム。
An image generation system for generating an image,
An original image drawing unit that performs processing of drawing an original image obtained by viewing an object set in the object space from a virtual camera in the first color buffer;
An effect processing unit that performs effect processing for combining the original image and an effect image for adjusting the color of the original image;
The effect processing unit as the effect processing,
Processing to draw the original image drawn in the first color buffer in a second color buffer having a resolution lower than that of the first color buffer;
Drawing the effect image in the second color buffer;
Processing to draw a stencil image for designating pixels for drawing the effect image in a stencil buffer having a resolution higher than that of the second color buffer based on the depth value of the original image and the depth value of the effect image;
Processing to draw the effect image drawn in the second color buffer in the first color buffer based on the stencil image;
The image generation system characterized by performing.
JP2008309517A 2008-12-04 2008-12-04 Image generation system, program, and information storage medium Active JP5253118B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008309517A JP5253118B2 (en) 2008-12-04 2008-12-04 Image generation system, program, and information storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008309517A JP5253118B2 (en) 2008-12-04 2008-12-04 Image generation system, program, and information storage medium

Publications (2)

Publication Number Publication Date
JP2010134671A JP2010134671A (en) 2010-06-17
JP5253118B2 true JP5253118B2 (en) 2013-07-31

Family

ID=42345915

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008309517A Active JP5253118B2 (en) 2008-12-04 2008-12-04 Image generation system, program, and information storage medium

Country Status (1)

Country Link
JP (1) JP5253118B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713756B2 (en) 2018-05-01 2020-07-14 Nvidia Corporation HW-assisted upscaling and multi-sampling using a high resolution depth buffer
US11012694B2 (en) 2018-05-01 2021-05-18 Nvidia Corporation Dynamically shifting video rendering tasks between a server and a client

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6000389B2 (en) * 2015-02-18 2016-09-28 株式会社藤商事 Game machine

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3694468B2 (en) * 2001-05-16 2005-09-14 大日本印刷株式会社 Image generating apparatus and storage medium
JP4704615B2 (en) * 2001-06-25 2011-06-15 株式会社バンダイナムコゲームス Image generation system, program, and information storage medium
JP2006195882A (en) * 2005-01-17 2006-07-27 Namco Bandai Games Inc Program, information storage medium and image generation system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713756B2 (en) 2018-05-01 2020-07-14 Nvidia Corporation HW-assisted upscaling and multi-sampling using a high resolution depth buffer
US11012694B2 (en) 2018-05-01 2021-05-18 Nvidia Corporation Dynamically shifting video rendering tasks between a server and a client

Also Published As

Publication number Publication date
JP2010134671A (en) 2010-06-17

Similar Documents

Publication Publication Date Title
JP4804120B2 (en) Program, information storage medium, and image generation system
JP4804122B2 (en) Program, texture data structure, information storage medium, and image generation system
JP2006195882A (en) Program, information storage medium and image generation system
JP4305903B2 (en) Image generation system, program, and information storage medium
JP2007164557A (en) Program, information recording medium and image generation system
JP5253118B2 (en) Image generation system, program, and information storage medium
JP4073031B2 (en) Program, information storage medium, and image generation system
JP2008077408A (en) Program, information storage medium, and image generation system
JP4754384B2 (en) Program, information recording medium, and image generation system
JP2006323512A (en) Image generation system, program, and information storage medium
JP4743770B2 (en) Image generation system, program, and information storage medium
JP2001143099A (en) Image-forming system and information storage medium
JP4913399B2 (en) Program, information storage medium, and image generation system
JP4488346B2 (en) Program, information storage medium, and image generation system
JP4528008B2 (en) Program, information storage medium, and image generation system
US7710419B2 (en) Program, information storage medium, and image generation system
JP2010033299A (en) Image generation system, program and information storage medium
JP2010033288A (en) Image generation system, program and information storage medium
US7724255B2 (en) Program, information storage medium, and image generation system
JP2010033295A (en) Image generation system, program and information storage medium
JP2008077406A (en) Image generation system, program, and information storage medium
JP2010033302A (en) Image generation system, program and information storage medium
JP2010231364A (en) Image generation system, program and information recording medium
JP2010033253A (en) Program, information storage medium, and image generation system
JP2006323514A (en) Image forming system, program and information storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111014

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130307

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130327

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130416

R150 Certificate of patent or registration of utility model

Ref document number: 5253118

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160426

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R370 Written measure of declining of transfer procedure

Free format text: JAPANESE INTERMEDIATE CODE: R370

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250