Creating a Material

From Valve Developer Community
< Ja
Revision as of 16:53, 12 July 2024 by Nesciuse (talk | contribs) (Multipage removal)
Jump to navigation Jump to search
English (en)Español (es)Français (fr)日本語 (ja)한국어 (ko)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)

マテリアル作成のチュートリアル

このチュートリアルでは、ステップ バイ ステップで、基礎的なマテリアルの製作を体験することができます。より、早い説明は、マテリアルの作成を見てください。ノーマルマップや、反射といった追加機能をマテリアルに加えるために、ページの一番下の See also セクションを参照してください。


テクスチャーを作る

  1. マテリアルのサイズを選択してください、そして、以下のように2つのステップを分でください。サイズは、2の乗数でなければなりませんが、真四角でなければないというわけではありません。大きな表面に使うテクスチャにとって、適切なサイズはゲーム内で10フィート(3.0m)になる512ピクセルです。よりディテールを持つモデルのためには、HL2の中で見られるモデルの解像度にマッチするようにしましょう。解像度があまりにも高すぎる場合、ミップマッピングが原因で実際見栄えは悪くなるでしょう。それが起きたときには、適度なサイズにまで縮小して、以下のフォルダに、無圧縮のTGA(en)としてセーブします。: C:\Program Files\Valve\Steam\SteamApps\Username\sourcesdk_content\gameshortname\materialsrc
  2. vtex.exeにドラックすることで、TGAをVTFにコンバートします。VTFは以下のフォルダに作成されます。 C:\Program Files\Valve\Steam\SteamApps\Username\gamename\gameshortname\materials
  3. テクスチャをこのディレクトリ(materials)に移動します。この例では、HL2向けのbrickwall.vtfテクスチャを作り、壁カテゴリーにいれたいとおもいます。すると場所は以下のようになります。: C:\Program Files\Valve\Steam\SteamApps\Username\half-life 2\hl2\materials\walls\brickwall.vtf

マテリアルファイルを作成する

.VMT(en)ファイルは、マテリアルがゲームとHammerエディターの中に現れるために必要です。VMTを作るためにNotepadを使いましょう。そして、.VTFのある同じディレクトリの中にセーブします。Notepadがファイルネームを.txtとして追加してしまうのを避けるために、ファイルタイプのドロップダウンボックスで「すべてのファイル」を選択しましょう。 これが、.VMTの中身です。:

"''shader type(シェーダータイプ)''"
{
    "$basetexture" "''texture name(テクスチャ名)''"
    "$surfaceprop" "''surface type(サーフェイスタイプ)''"
}

以下のShader type に置き換えることができます。:

LightmappedGeneric
これは最も一般的なもので、ライトが普通に当たるような表面に対して使われます。
UnlitGeneric
これはコンピュータスクリーンや、電球のように、常に全体が光っている表面に使われます。
VertexLitGeneric
これはモデルのために使われます。

"$basetexture"に続く部分にはテクスチャの名前(.VTF)をマテリアルフォルダーからのパスと共に、""の中に texture name のところに記入します。.VTFの拡張部分は含みません。 "$surfaceprop"に続く部分には、マテリアルのサーフェイスタイプを""の中に、surface type を記入します(これは、衝撃の音や、銃弾の穴の見栄えに影響を与えます)。次のサーフェイスの一つを選択しましょう。metal(金属)、paper(紙)、wood(木)、concrete(コンクリート)、glass(ガラス)、brick(レンガ)、tile(タイル)。他の選択肢については、Material properties(en) を見てください。 これで、.VMTの例として、brick wall テクスチャができました。:

"LightmappedGeneric"
{
    "$basetexture" "walls/brickwall"
    "$surfaceprop" "brick"
}

いくつかの一般的な追加オプション

"$model" 1
このラインは、モデルスキンのために必要です。また、スキンを使うモデラーのために、TGAは、VTFとVMTを同じディレクトリに入れておかなければならないことを指摘しておきます。一つのテクスチャで、それぞれのモデル全体のスキンは構成するようにしましょう-モデルに、マルチテクスチャーを使うことは、リソースをかなり無駄にします。モデルのためのシェーダータイプは、いつも"VertexLitGeneric"であることを覚えておきましょう。
"$decal" 1
これは、デカルのために必要です。
"$selfillum" 1
このラインを追加することで、ベースのテクスチャのアルファチャンネルに従って、セルフイルミネートに対してテクスチャを反応するようになります。例としては、目を除いて普通に光り、暗闇で光るコンバインソルジャーのヘルメットがあります。
"$nocull" 1
テクスチャを両方のサイドから見えるようにしたいなら、このラインを追加します。これは、ガラスや、ワイアーフェンスのような平面オブジェクトに対してのみ適用できます。
"$alpha" 0.5
このラインを追加することでテクスチャを半透明にすることができます。数字は、0から1の間に設定できます。
"$color" "[1 1 1]"
これはテクスチャの赤、緑、青の三原色の色を決めます。同じ姿のガラスを様々な色にするといった、複数のマテリアルのために同じテクスチャを使うことを望む場合、これを使います。
Note.pngTemplate:Dictionary/Note/ja:数字が単独で使われる時を除いて、.VMTに対して加えられるすべての記入は、括弧("")の中になければなりません。

See also

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|en}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

マテリアルの作成

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|en}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

Shader Types and Parameters

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|en}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

Creating Reflective Materials

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|en}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

Parallax mapping