MML/opengl


Total: 6034 / Today: 1 / Yesterday: 1

OpenGLレンダリング要素:<opengl>

この要素は、OpenGLによる描画の指定に使います。現在は、テスクチャおよび、フォグをサポートしています。この要素には、以下の子要素を持っています:<txtr_clear>, <texture>,<model_clear>, <model>,<fog>

まず、最初の<txtr_clear>は、これで指定されているテスクチャをセットし、そのテスクチャにセットされているオプションを解除します。たとえば、シーケンス値であるcoll属性などがあった場合、それらの属性は除かれます。この要素の後ろで、テスクチャのオプションを指定することが可能です。

次の<texture>は、各のテスクチャのオプションを指定します。この要素に含まれる属性は以下の通りです。

collコレクション(必修)
cult上記のコレクションのカラーテーブルで、0~7まで指定できます。デフォルト値は-1で、特別な値として無敵状態(8)、シルエット(9)などがあります。
bitmap割り当てるビットマップファイルです(必修)
opac_type透明化の種類(デフォルトは0:crips edges)
opac_scal透明化の倍率(デフォルトは1:変化無し)
opac_shift透明化のシフト値。掛けた後に足される値(デフォルトは0:変化無し)
void_visibleテクスチャを通して空白(マップのポリゴンでないもの)が見えるか。にじみ(Smearing)や奇妙な表示が見えるかもしれません。(デフォルト:偽、空白は見えない)
normal_image「通常の」レンダリング(ライトのレベルに依存)を置換する画像のファイル名
normal_mask「通常の」レンダリング(ライトのレベルに依存)を置換する画像の透過マスクのファイル名。normal_imageファイルといっしょに使わなければなりません
glow_image「グロー」レンダリング(ライトのレベルに依存)を置換する画像のファイル名
glow_mask「グロー」レンダリング(ライトのレベルに依存)を置換する画像の透過マスクのファイル名。glow_imageファイルといっしょに使わなければならない
normal_blend半透明の通常のテクスチャーのブレンドモード(デフォルトは0:クロスフェード)
glow_blend半透明のグローテクスチャーのブレンドモード(デフォルトは0:クロスフェード)
image_scaleピクセル単位から内部の距離単位への置換スプライトの倍率。もしゼロ以下ならば、これとオフセットは無視されます
x_offset左上から右側への内部単位でのシフト値。
y_offset左上から下への内部単位でのシフト値。
type画質調整の用途へのテクスチャー・タイプ。セットされないならば、グラフィックス初期設定での画質セッティングは無視され、ファイルの最大のバージョンが使われるます
normal_premultiply通常の画像がプリマルチプライ済みアルファを使う。(デフォルトは偽:画像はプリマルチプライ済みアルファを使わない)
glow_premultiplyグロー画像がプリマルチプライ済みアルファを使う。(デフォルトは偽:画像はプリマルチプライ済みアルファを使わない)

注意:全ての結果の値は0から1までの範囲に固定されます。これは透明タイプの種類です。

はっきりとしたエッジ
1ぼやけたエッジ
2ぼやけたエッジ(単一のカラーチャンネルによる平均)
3ぼやけたエッジ(すべてのカラーチャンネル)

ここに半透明レンダリングに使われるブレンドタイプがあります。

クロスフェードブレンド。半透明の発光していない物体に適する
1付加的なブレンド。グローの透明度の低い物体に適する

最初以外の全ての透明度はopec_scaleで掛けられてopec_shiftを足されます。これらの最初はよく定義された淵のある物体に適します。他は、雲、炎、エネルギー武器の電光などで、はっきりとした境界のない物体に適しています。平均と最大モードは、どんな新しいファイルでも加えることなく可変の不透明を生産する方法として含まれました。このハックはTomb Raiderシリーズでの半透明の扱いを参考にしました。ここでの考えはこれらの場合はより明るい領域はおそらくもより透過的であるだろうということです。それらがいくらか異なって振る舞うので私は両方を置きました。最大は灰色と同じ浸透色の強さをもし、平均は灰色よりも小さな強さを持ちます。

テクスチャのタイプは以下のものです。

1000
1001背景
1002人物
1003手持ちの武器

次の<model_clear>は、すべてのモデル定義を消します。これは<txtr_clear>のように働きます。

次の<model>はあるシークエンスを置き換えるのに使う3Dモデルを指定します。モデルは、組み込みのアニメーションのない(大抵の3Dモデルフォーマット)静的なものも、そのようなアニメーションのある(例えばBrian BarnesのDim3モデルのような)動的なものも可能です。これらのアニメーションはシークエンス(BBの用語ではアニメーション)で指定されます。それぞれのシークエンスは少なくとも一つのフレームを持ちます。一つの特別な「シークエンス」、中立のポーズが存在し、アニメーションが適用されないモデルを指示します。この要素は子要素<seq_map>と<skin>を持ち、以下の属性を持ちます。

  • coll: どのコレクションか(必須)
  • seq: Marathonエンジンでどのシークエンスか。シークエンスマッピングがシークエンスを検索した後にチェックされる。もしシークエンスマッピングが使われている時は省略することができます。静的モデルでの使用が推奨されます。動的モデルでは、モデルの中立ポーズへとマップされます。
  • file: モデルデータを含むファイルの名前です。静的モデルでは、これは唯一のファイルです。Dim3モデルでは、これは「メッシュ」ファイル(基本モデルデータ)です。
  • file1: 追加のモデルデータファイルです。静的モデルでは不必要です。Dim3モデルでは、これは「ポーズ」ファイル(フレーム)です。
  • file2: 追加のモデルデータファイルです。静的モデルでは不必要です。Dim3モデルでは、これは「アニメート」ファイル(シークエンス)です。
  • type: モデルデータフォーマットを識別する文字列です。
    • Alias|Wavefront Object: "wave" から "wavefront"
    • 3D Studio Max Object: "3ds" から "3ds max" または "3dsmax"
    • QuickDraw 3D / Quesa 3D Metafile: "qd3d" または "3dmf" または "quesa"
    • Brian Barnes Dim3 animated model: "dim3"もし存在しないときは、タイプはファイルの内容から推測され、あるファイルでは動き他のファイルでは動かないかもしれません。
  • scale: どのくらいhow much to scale the model before rendering, from model coordinates to internal coordinates. A negative scale will cause the model to be reflected around all three axes (default: 1).
  • x_rot: rotation in degrees around the x-axis (default: 0).
  • y_rot: rotation in degrees around the y-axis (default: 0).
  • z_rot: rotation in degrees around the z-axis (default: 0).
  • x_shift: shift in internal units in the x direction (default: 0).
  • y_shift: shift in internal units in the y direction (default: 0).
  • z_shift: shift in internal units in the z direction (default: 0).
  • side: which side is visible (default: clockwise):
    • +: clockwise side
    • 0: both sides
    • -: counterclockwise side
  • norm_type: which sort of normals to use for doing the lighting (default: originals)
    • 0. None
    • 1. Original-model normals (may be none)
    • 2. Reverse-direction original-model normals (may be none)
    • 3. Normals in the direction of the polygons' clockwise sides
    • 4. Normals in the direction of the polygons' counterclockwise sides
  • norm_split: threshold for spltting the vertex normals for clockwise-side or counterclockwise-side normals; if the normals' standard deviation is greater than this value, then a vertex's normal is split into one for each of its polygons. (default: 0.5)
  • light_type: what sort of lighting to use (default: fast)
    • 0. Fast lighting; only one calculation of the player light
    • 1. Like above, but the player light won't fade off on the sides
    • 2. Individual-vertex calculation of the player light (more accurate, but slower)
    • 3. Like above, but the player light won't fade off on the sides
  • depth_type: what sort of depth to use in the depth sorting
    • +: Farthest bounding-box point (good for all-or-nothing-opacity objects)
    • 0: Center of bounding box
    • -: Nearest bounding-box point (good for semitransparent objects)
      Ideally, objects with all-or-nothing opacity ought to be rendered before semitransparent ones; these different depth options offer a way to approximate that effect.

The scaling and rotations will be applied before the shifts; the rotations will be applied in order x, y, and z.

Its child element of <seq_map> is the sequence-mapping element, has these attributes, both mandatory:

* seq: sequence in the Marathon engine to map to.
   * model_seq: sequence in the model, starting from 0. The model sequence -1 is the neutral pose.

A model element can have several such elements, covering many of a collection's sequences.

The model element's child element of <skin> has these attributes, which closely parallel those of <texture>:

* clut: which color table (default: -1 -- all of them).
   * opac_type: what type of opacity to use (default: 0 -- crisp edges).
   * opac_scale: scaling value for the opacity; how much to multiply it by (default: 1 -- no change).
   * opac_shift: shift value for the opacity; how much to add after multiplying (default: 0 -- no change).
   * normal_image: the name of the file whose image content to substitute in "normal" rendering (sensitive to light levels).
   * normal_mask: the name of the file whose image content becomes the opacity mask for "normal" rendering (sensitive to light levels). It must be used with a normal_image file.
   * glow_image: the name of the file whose image content to substitute in "glowing" rendering (independent of light levels).
   * glow_mask: the name of the file whose image content becomes the opacity mask for "glowing" rendering (independent of light levels). It must be used with a glow_image file.
   * normal_blend: which blend mode for semitransparent normal textures (default: 0 -- crossfade)
   * glow_blend: which blend mode for semitransparent glowing textures (default: 0 -- crossfade)

The final one, <fog>, has these attributes:

* type: which type of fog:
     1000. Above liquid
     1001. Below liquid
     The default is 0 (above liquid).
   * on: (boolean; default: false)
   * depth: the fog depth in World Units (default: 8)
   * landscapes: whether this fog affects landscape textures (default: true)

and a color subelement, which indicates the fog color (default: gray red = green = blue = 0.5?).


Last Modified: 2015-07-01 21:47:49