#navi(../)
# 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までの範囲に固定されます。これは透明タイプの種類です。

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

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

|     |     |
| --- | --- |
|~0| クロスフェードブレンド。半透明の発光していない物体に適する|
|~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]).

---

## Page Navigation

- Canonical URL: https://mjolnir.logue.be/MML/opengl
- Permalink: https://mjolnir.logue.be/66d98a09fc4c8b004bff175c
- Parent: [MML](/66d989eafc4c8b004bff173e.md)
- Children: 0 total
- Total descendants: 0
- Siblings: 26 total
  - [animated_textures](/66d989ecfc4c8b004bff1740.md)
  - [cheats](/66d989eefc4c8b004bff1742.md)
  - [control_panels](/66d989f0fc4c8b004bff1744.md)
  - [damage_kicks](/66d989f2fc4c8b004bff1746.md)
  - [dynamic_limits](/66d989f4fc4c8b004bff1748.md)
  - [faders](/66d989f6fc4c8b004bff174a.md)
  - [infravision](/66d989f9fc4c8b004bff174c.md)
  - [interface](/66d989fbfc4c8b004bff174e.md)
  - [items](/66d989fdfc4c8b004bff1750.md)
  - [keyboard](/66d989fffc4c8b004bff1752.md)
  - [landscapes](/66d98a01fc4c8b004bff1754.md)
  - [liquids](/66d98a03fc4c8b004bff1756.md)
  - [marathon_levels](/66d98a05fc4c8b004bff1758.md)
  - [motion_sensor](/66d98a07fc4c8b004bff175a.md)
  - [overhead_map](/66d98a0bfc4c8b004bff175e.md)
  - [platforms](/66d98a0dfc4c8b004bff1760.md)
  - [player](/66d98a0ffc4c8b004bff1762.md)
  - [player_name](/66d98a11fc4c8b004bff1764.md)
  - [scenery](/66d98a13fc4c8b004bff1766.md)
  - [sounds](/66d98a15fc4c8b004bff1768.md)
  - [stringset](/66d98a18fc4c8b004bff176a.md)
  - [texture_loading](/66d98a1afc4c8b004bff176c.md)
  - [view](/66d98a1cfc4c8b004bff176e.md)
  - [weapons](/66d98a1efc4c8b004bff1770.md)
  - [値のリスト](/66d98a20fc4c8b004bff1772.md)
  - [追加要素](/66d98a22fc4c8b004bff1774.md)
- Last updated: 2024-09-05T10:58:51.394Z by 
- Full page listing (all children regardless of count): https://mjolnir.logue.be/_api/v3/page-listing/children?id=66d98a09fc4c8b004bff175c
