Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Fogシェーダー
Fog shaders are used to define how fog is added to (or subtracted from) a scene in
a given area. Fog shaders are always used together with
FogVolumes and volumetric fog. Fog shaders only have
one processing function, the fog() function.
Fogシェーダーの解像度はボリューメトリックフォグの視錐台ボクセルのグリッド解像度に依存します。したがってFogシェーダーが追加できるLODは、FogVolume がカメラにどれだけ近いかによって決まります。
Fog shaders are a special form of compute shader that is called once for every froxel that is touched by an axis-aligned bounding box of the associated FogVolume. This means that froxels that just barely touch a given FogVolume will still be used.
ビルトイン
Values marked as in are read-only. Values marked as out can optionally
be written to and will not necessarily contain sensible values. Samplers cannot
be written to so they are not marked.
グローバルビルトイン
グローバルビルトインはカスタム関数を含めあらゆる場所で使用できます。
ビルトイン |
説明 |
|---|---|
in float TIME |
Global time since the engine has started, in seconds. It repeats after every |
in float PI |
A |
in float TAU |
A |
in float E |
An |
Fogビルトイン
Fogボリュームの出力値はすべて互いに重なり合います。これにより FogVolumes をすべて一度に描画できるため、効率的にレンダリングできるようになります。
ビルトイン |
説明 |
|---|---|
in vec3 WORLD_POSITION |
ワールド空間における現在の視錐台ボクセルのセルの位置。 |
in vec3 OBJECT_POSITION |
ワールド空間における現在の FogVolume の中心の位置。 |
in vec3 UVW |
3-dimensional UV, used to map a 3D texture to the current FogVolume. |
in vec3 SIZE |
|
in vec3 SDF |
FogVolume の表面までのSigned Distance Field (SDF)。ボリューム内にある場合はマイナス値、外にある場合はプラス値です。 |
out vec3 ALBEDO |
基本の色を出力します。これは光と相互作用して最終的なカラーを生成します。使用する場合はフォグボリュームにのみ書き込まれます。 |
out float DENSITY |
密度の値を出力します。あるボリュームを別のボリュームから減算できるようにするにはマイナスの値を指定します。Fogシェーダーで何かに書き込む際は、この密度の指定は必須です。 |
out vec3 EMISSION |
発光色を出力します。光の通過中にこの発光色が追加されて最終的な色が生成されます。使用した際はフォグボリュームにのみ書き込まれます。 |