Env fog controller

From Valve Developer Community
< Zh
Revision as of 04:01, 13 October 2019 by 求生的兔 (talk | contribs) (Created page with "{{lang|Env fog controller}} left|link={{point_ent:zh|env_fog_controller}} 它定义了整个地图的雾气效果。 {{提示|在多人游戏中...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)Hrvatski (hr)中文 (zh)Translate (Translate)
Fog controller.png

起源 env_fog_controller是一个存在于所有的 起源 游戏的点实体。 它定义了整个地图的雾气效果。

Tip.png提示:在多人游戏中, fog may be changed per-client by sending the player entity (probably best accessed through !activator) a SetFogController input.

In 求生之路系列求生之路系列, multiple env_fog_controllers may be used in conjunction with fog_volumes to create different fog effects where needed. In addition, an env_fog_controller can be set as the Master fog controller under flags, in cases where a fog_volume is not tied to any specific env_fog_controller, or if no fog_volume is used in a region.

Note.png注意:在 中,这是一个保留实体(preserved entity)(en)
  • 在新一轮中,它不会故意将自己重置为其默认属性(包括位置)。
    PlacementTip.png解决方案:如果这是一个问题,你可以采用 logic_auto 实体模拟重置它。
  • 通过Kill(en)杀死它会永远移除它,因为它不会在新一轮重生
  • 它不能用 point_template 生成。
  • 把这个实体与非保留实体绑定可能会导致不良影响

Adding fog to a map can cause/require changes to the lighting for realism. Light is scattered and absorbed as it passes through fog. The denser the fog, the greater the effect:

  • Falloff - (or attenuation) is the rate at which light intensity decreases over distance. Falloff distance decreases as fog gets thicker.
  • Tyndall effects - can be seen when the fog particles reflect light toward the viewer. Halos and light beams become more visible as fog gets thicker.
  • Diffused Lighting - the boundary-line between light and shadow becomes more blurred (diffuse) as fog gets thicker. See Lightmap Scale and shadow_control's "distance" parameter.

Older Source games render fog as a plane a certain distance away from the camera. This method is bad, as rotating the camera will strengthen or weaken the apparent amount of fog in a particular spot, even though the viewer hasn't moved at all. In Left 4 Dead[证实] onward, this is fixed by implementing a new radial method which is independent from the viewing angle.

Note.png注意:The 3D Skybox fog levels set by the sky_camera parameters should correspond to your env_fog_controller settings.
C++ 在源代码中,它由 class CFogController 代表,定义于 fogcontroller.cpp

Flags

  • 1: Master - If multiple env_fog_controllers are active, this one will always take priority.

Keyvalues

Fog Enabled (fogenable) ([todo internal name (i)]) <布尔值(en)>
Make fog start active.
Fog Start (fogstart) ([todo internal name (i)]) <浮点型(en)>
How far away from the viewer the fog should start.
Fog End (fogend) ([todo internal name (i)]) <浮点型(en)>
How far away from the viewer the fog reaches Fog Max Density.
Fog Max Density (fogmaxdensity) ([todo internal name (i)]) <浮点型(en)>
Maximum density the fog may reach. Expressed as a decimal percent, so for 45% put 0.45.
Far Z Clip Plane (farz) ([todo internal name (i)]) <整数(en)>
Anything beyond this distance in world units will not be rendered. This should be higher than Fog End. If this is used, Fog Max Density should be set to 1 otherwise the void may be visible.
Primary Fog Color (fogcolor) ([todo internal name (i)]) <color255(en)>
Primary Fog Color.
Secondary Fog Color (fogcolor2) ([todo internal name (i)]) <color255(en)>
Secondary Fog Color. If Fog Blend is disabled, this color will never appear.
Fog Blend (fogblend) ([todo internal name (i)]) <布尔值(en)>
Enables color blending between Primary Fog Color and Secondary Fog Color. When the viewer looks in the Primary Fog Direction, fog will appear as the Primary color. When looking away from the specified direction, fog appears as the Secondary color. If the camera is not pointed directly at or away from the direction, a blend of the two colors will result. Sunlight with a Yaw of 45 degrees and a Pitch of -45 degrees could be enhanced using a Primary Fog Direction of "-1 -1 1", a Primary Fog Color of "120 110 100" and a Secondary Fog Color of "80 70 60".
Primary Fog Direction (fogdir) ([todo internal name (i)]) <向量(en)>
A vector (given by three space-separated numbers X Y Z) which the viewer camera is checked against to figure out the blend between the primary and secondary fog colors.
Use Angles for Fog Dir (use_angles) ([todo internal name (i)]) <布尔值(en)>
Use Pitch Yaw Roll for the Fog Blend direction instead of Primary Fog Direction. There isn't much use for this unless you want the direction to rotate.
Interpolate time (foglerptime) ([todo internal name (i)]) <浮点型(en)>
Fade time for the StartFogTransition input.
HDR Color Scale (HDRColorScale) ([todo internal name (i)]) <浮点型(en)> (存在于自 求生之路 以来)
Multiplier for fog color when in HDR mode.
Zoom Fog Scale (ZoomFogScale) ([todo internal name (i)]) <浮点型(en)> (存在于自 反恐精英:全球攻势 以来)
Scalar for fog start and end distances when the player is looking through a gun's scope (e.g. AWP).
最低 / 最高 DX 水平 (mindxlevel / maxdxlevel) <integer choices(en)> (被移除求生之路 以来)
如果引擎在给定的 DirectX Versions 版本范围之外运行,该实体将不存在。
选择
Warning.png警告:If these are used, the object may break when the user switches their DirectX settings.[missing string]
最低/最高效果细节等级 (mincpulevel / maxcpulevel) <integer choices(en)> (存在于自 求生之路 以来)
不要为效果细节等级超出最低或最高限度的玩家渲染。
选择
  • 0: 默认 ("Low" for mincpulevel, "High" for maxcpulevel)
  • 1: 低
  • 2: 中
  • 3: 高
最低/最高着色器细节等级 (mingpulevel / maxgpulevel) <integer choices(en)> (存在于自 求生之路 以来)
不要为着色器细节等级超出最低或最高限度的玩家渲染。
选择
  • 0: 默认 ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: 低
  • 2: 中
  • 3: 高
  • 4: 非常高
参见:  cpu_level / gpu_level convars


Inputs

TurnOn
Turns the fog on.
TurnOff
Turns the fog off.
SetStartDist <浮点型(en)>
Sets the Fog Start distance.
SetEndDist <浮点型(en)>
Sets the Fog End distance.
SetColor <color255(en)>
Sets the Primary Fog Color.
SetColorSecondary <color255(en)>
Sets the Secondary Fog Color.
SetFarZ <整数(en)>
Sets the Far Z Clip Plane distance.
SetAngles <angles(en)>
Sets the angles to use for the Primary Fog Direction.
Set2DSkyboxFogFactor <浮点型(en)> (存在于自 求生之路2 以来)
Set the current amount of fog to blend into the 2D skybox. Expressed as a decimal percent, so for 45% put 0.45. 求生之路2 only.
SetZoomFogScale <浮点型(en)> (存在于自 反恐精英:全球攻势 以来)
Sets the Zoom Fog Scale.
SetColorLerpTo <color255(en)> (存在于自 半衰期2:第一章 以来)
Stores a value for Primary Fog Color that is set once the StartFogTransition input fires.
SetColorSecondaryLerpTo <color255(en)> (存在于自 半衰期2:第一章 以来)
Stores a value for Secondary Fog Color that is set once the StartFogTransition input fires.
SetStartDistLerpTo <浮点型(en)> (存在于自 半衰期2:第一章 以来)
Stores a value for Fog Start that is set once the StartFogTransition input fires.
SetEndDistLerpTo <浮点型(en)> (存在于自 半衰期2:第一章 以来)
Stores a value for Fog End that is set once the StartFogTransition input fires.
SetMaxDensityLerpTo <浮点型(en)> (存在于自 求生之路 以来)
Stores a value for Fog Max Density that is set once the StartFogTransition input fires. This one does not have any non-"LerpTo" counterpart.
Set2DSkyboxFogFactorLerpTo <浮点型(en)> (存在于自 求生之路2 以来)
Set the current amount of fog to blend into the 2D skybox. Expressed as a decimal percent, so for 45% put 0.45. This will only change once the StartFogTransition input fires. 求生之路2 only.
StartFogTransition  (存在于自 半衰期2:第一章 以来)
When fired, the fog fades to any new values sent through the "LerpTo" inputs. Fade time is determined by the Interpolate time keyvalue.
Icon-Bug.png错误:Does not work correctly. The fog will transition to nothing and then abruptly change to the new values at the end of the interpolation time. Seen in 求生之路2反恐精英:全球攻势.  [todo tested in ?]


Outputs

See Also