フォグは、プレイヤーの表示距離を不明瞭にするために使用できるレンダリング機能です。 フォグを使用して、レンダリング距離を超えてアンロードされたチャンクなど、境界線を遮ったり、大気効果を生成したりできます。 フォグにはいくつかの種類があり、さまざまな状況で使用できます。
フォグは、リソース パックの fogs ディレクトリにある個々の JSON ファイルで設定します。
フォグのスキーマ
{
version "format_version"
object "minecraft:fog_settings"
{
object "description"
{
string "identifier" // The identifier for these fog settings. The identifier must include a namespace.
}
object "distance" : opt // The distance fog settings for different camera locations.
{
object "air" : opt // The fog settings when the camera is in the air.
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
object "weather" : opt // The fog settings for when the camera is in the air with active weather (rain, snow, etc..).
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
object "water" : opt // The fog settings when the camera is in water.
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
object "lava" : opt // The fog settings when the camera is in lava.
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
object "lava_resistance" : opt // The fog settings when the camera is in lava and the player has the lava resistance effect active.
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
object "powder_snow" : opt // The fog settings when the camera is inside a Powder Snow block.
{
color "fog_color" // The color that the fog will take on.
float "fog_start"<0.000000-*> // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
float "fog_end"<0.000000-*> // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
string "render_distance_type"<"fixed", "render"> // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
}
}
object "volumetric" : opt // The volumetric fog settings.
{
object "density" : opt // The density settings for different camera locations.
{
object "air" : opt // Fog density values as light passes through air blocks.
{
float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0].
float "max_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density.
float "zero_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'.
bool "uniform" : opt // When set to true, the density will be uniform across all heights.
}
object "water" : opt // Fog density values as light passes through water blocks.
{
float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0].
float "max_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density.
float "zero_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'.
bool "uniform" : opt // When set to true, the density will be uniform across all heights.
}
object "lava" : opt // Fog density values as light passes through lava blocks.
{
float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0].
float "max_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density.
float "zero_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'.
bool "uniform" : opt // When set to true, the density will be uniform across all heights.
}
object "lava_resistance" : opt // Fog density values as light passes through lava blocks while the player has lava resistance.
{
float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0].
float "max_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density.
float "zero_density_height"<0.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'.
bool "uniform" : opt // When set to true, the density will be uniform across all heights.
}
}
object "media_coefficients" : opt // The coefficient settings for the volumetric fog in different blocks.
{
object "air" : opt // Fog coefficient values while light passes through air.
{
color "scattering" // Proportion of light that is scattered per block.
color "absorption" // Proportion of light that is absorbed (lost) per block.
}
object "water" : opt // Fog coefficient values while light passes through water.
{
color "scattering" // Proportion of light that is scattered per block.
color "absorption" // Proportion of light that is absorbed (lost) per block.
}
object "cloud" : opt // Fog coefficient values while light passes through clouds.
{
color "scattering" // Proportion of light that is scattered per block.
color "absorption" // Proportion of light that is absorbed (lost) per block.
}
}
}
}
}
アクティブ フォグ スタック
アクティブ フォグ スタックは、ゲーム内の任意の時点で使用するフォグ設定を決定するために使用されます。 プレイヤーごとに固有のフォグ スタックがあります。
ゲームでフォグの値を決定する必要があるたびに、現在の設定の種類の値が見つかるまで、フォグ スタックの一番上から順にチェックされます。 スタック上のフォグ設定に一致するものがない場合は、スタック内を下に移動してチェックを続けます。 一致する設定が見つからない場合は、エンジンによって定義されたデフォルト値が代わりに使用されます。
フォグ スタックは、最初は次のように設定されています。 一番下から順に示します。
- エンジン デフォルト: ハードコードされた値。
- データ デフォルト: デフォルトのデータ駆動型設定。
- バイオーム: 各バイオームに対して定義された設定。
- コマンド: サーバー コマンドによって設定された、プレイヤーに適用される設定。
エンジン デフォルト
データ駆動型の値がない場合に備えてハードコードされた値。ゲームがフォグ スタックの一番下に到達しても一致するフォグ設定がない場合は、エンジン デフォルトが読み込まれます。
データ デフォルト
fog_identifier によってフォグ定義が参照されている場合、biomes_client.json の default で定義されています。
バイオーム
バイオーム レイヤーは、プレイヤーの位置周辺のバイオームによって定義されたすべての設定の平均です。 バイオーム設定は、バイオームごとに biomes_client.json でも定義されています。
コマンド
コマンド レイヤーは、/fog コマンドによって設定されたすべての設定で、1 つのスタックとして上から順に評価されます。 詳細については、「フォグ コマンド」を参照してください。
バイオーム
バイオームのフォグ設定は、biomes_client.json で指定できます。 各バイオーム エントリでは、fog_identifier という変数を使用し、このバイオームで使用するフォグ設定に対応する名前を設定できます。
この方法で default エントリを設定することもできます。このエントリは、アクティブ フォグ スタックのバイオーム エントリの下で使用されます。 バイオームのフォグ設定はデフォルトの設定を完全に置き換えるわけではなく、「アクティブ フォグ スタック」で説明するように、デフォルトの上にバイオームが読み取られます。
default バイオーム エントリには、デフォルトで false に設定された remove_all_prior_fog タグがあります。
false に設定されている場合 (またはこのタグが入力されていない場合)、欠落しているフォグ定義は、その定義が入力されている下位のリソース パックによって入力されます。
true に設定すると、それを有効にした現在のパックより前のリソース パック内の以前のフォグ定義がすべて消去されるので、実質的に現在のリソース パックがすべてのフォグの新しい出発点となります。
各バイオーム (default を含む) には、デフォルトで false に設定された inherit_from_prior_fog タグがあります。
false に設定されている場合 (またはこのタグが入力されていない場合)、現在のリソース パックのバイオームは、現在保存されている fog_identifier タグを独自のタグで上書きします。
true に設定すると、一致するすべてのバイオームの fog_identifier タグがまとめて追加され、そのバイオームのマージされた新しいフォグ定義が作成されます。
フォグ コマンド
/fog コマンドを使用して、プレイヤーごとにアクティブ フォグ スタックのコマンド レイヤーにあるフォグ設定を管理できます。
このレイヤー内のフォグ設定は、/fog コマンドの push、pop、remove の各モードを介して順序付けられます。
フォグ設定は、アクティブ フォグ スタックの上から順に評価され、最初に現在のレイヤーの上から順に評価されます。
このレイヤー内のフォグ設定はプレイヤーごとに保存され、世界の読み込み時に復元されます。 世界の保存前にプッシュされたフォグ設定は世界の読み込み後も適用されるので、ポップすることができます。
push
ユーザーが指定した ID と共に、新しいフォグ設定を、指定したプレイヤーのアクティブ フォグ スタックのフォグ コマンド レイヤーの一番上にプッシュします。
pop
選択したプレイヤーから、ユーザーが指定した ID に一致する一番上のフォグ設定を削除します。
remove
選択したプレイヤーから、ユーザーが指定した ID に一致するすべてのフォグ設定を削除します。