Env fog controller

From Valve Developer Community
< Zh
Revision as of 22:13, 13 October 2019 by 求生的兔 (talk | contribs)
Jump to navigation Jump to search
English (en)Hrvatski (hr)中文 (zh)Translate (Translate)
Fog controller.png

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

Tip.png提示:在多人游戏中,此实体可以向player(玩家)实体发送输入SetFogController来修改每个客户端的雾气效果,最好是通过!activator

求生之路系列求生之路系列中, 多个 env_fog_controller可以结合fog_volume实体来创建不同区域实现不同雾气效果。 除此之外,如果不设置fog_volume指定到任意一个env_fog_controller上,或者未启用单个fog_volume则可以设置标签/flags Master作为主要的全局雾气控制。 Template:PreservedEnt:zh

向地图增加雾气可以导致/要求光照更加真实。光照穿过雾气的时候会散射和被吸收。雾气越浓,效果会越好:

  • Falloff - (或衰减),是光线随着距离而衰减的率。 雾气越浓厚则衰减距离越小。
  • Tyndall effects - 可以透过雾气粒子反射光效给玩家。 雾气越浓厚,光圈效果和光束则越明显。
  • Diffused Lighting - 随着雾气的浓淡,光与影的边界将不明显。 详见 Lightmap Scaleshadow_control的distance属性。

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. (关于早期起源引擎的处理雾气的老方法,在求生之路后被修改。此方法很糟糕。会导致镜头移动雾气忽淡忽浓,即使不移动也会。↑)

Template:注意


待完善: This template is currently using deprecated suf or {{Lang}}-based translations. Please use the main {{Code class}} instead, which uses {{Autolang}}.

在源代码中,它由 class CFogController 代表,定义于 fogcontroller.cpp


标签/Flags

  • 1: Master - 如果有多个env_fog_controller被弃用,此实体永远是优先的。

键值

Fog Enabled (fogenable) <布尔型(en)>
使雾实体启用。
Fog Start (fogstart) <浮点型(en)>
雾效果应该距离玩家视角多远开始出现。即雾开始的距离。
Fog End (fogend) <浮点型(en)>
距离玩家视角多远达到Fog Max Density(雾效果最大浓度)。即雾结束的距离,挂钩与最大浓度。
Fog Max Density (fogmaxdensity) <浮点型(en)>
雾效果能达到的最大浓度。以小数点表示百分比,如0.45代表45%。
Far Z Clip Plane (farz) <整数(en)>
以世界距离为单位,超过多远的物体不渲染。这项应该比Fog End更高。如果启用了此项, Fog Max Density则应该设置为1,否则有可能看到空洞(地图外面的黑色效果) 。
Primary Fog Color (fogcolor) <color255(en)>
雾气的主要颜色。
Secondary Fog Color (fogcolor2) <color255(en)>
雾气的次要颜色。如果 Fog Blend 被禁用,则不会启用此颜色。
Fog Blend (fogblend) <布尔型(en)>
启用在Primary Fog ColorSecondary Fog Color之间的色彩混合。 当玩家注视着 Primary Fog Direction,则启用Primary颜色。 当远离这个特定位置,雾气启用 Secondary 颜色。如果即不是远离也不是注视, 则混合两种颜色。利用Primary Fog Direction 为 "-1 -1 1", Primary Fog Color 为 "120 110 100" 和Secondary Fog Color 为 "80 70 60"可以用来提升角度为Yaw 45度,Pitch -45度的太阳光。
Primary Fog Direction (fogdir) <vector/向量(en)>
向量(以空格分割XYZ), 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) <布尔型(en)>
Pitch Yaw Roll 设置 Fog Blend 方向而不是 Primary Fog Direction. 除非你想要方位旋转,否则没什么用。
Interpolate time (foglerptime) <浮点型(en)>
输入 StartFogTransition 的淡入时间。
HDR Color Scale (HDRColorScale) <浮点型(en)> (存在于自 求生之路 以来)
HDR 模式下雾颜色的倍数.
Zoom Fog Scale (ZoomFogScale) <浮点型(en)> (存在于自 反恐精英:全球攻势 以来)
利用瞄准镜的时候,玩家起始雾和结束雾距离的标量。(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]

SystemLevelChoice:

Minimum CPU Level (mincpulevel) <choices> (存在于自 求生之路 以来)
CPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的效果细节决定。
Maximum CPU Level (maxcpulevel) <choices> (存在于自 求生之路 以来)
  • 0: Default/默认
  • 1: Low/低
  • 2: Medium/中
  • 3: High/高
Minimum GPU Level (mingpulevel) <choices> (存在于自 求生之路 以来)
GPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的Shader细节决定。
Maximum GPU Level (maxgpulevel) <choices> (存在于自 求生之路 以来)
  • 0: Default/默认
  • 1: Very low/非常低
  • 2: Low/低
  • 3: Medium/中
  • 4: High/高
Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
The redirect page got deleted, therefore this page should too.
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.

输入

TurnOn
开启.
TurnOff
关闭.
SetStartDist <浮点型(en)>
设置 Fog Start距离
SetEndDist <浮点型(en)>
设置 Fog End 距离
SetColor <color255(en)>
设置 Primary Fog Color的颜色
SetColorSecondary <color255(en)>
设置 Secondary Fog Color的颜色
SetFarZ <整数(en)>
设置 Far Z Clip Plane距离.
SetAngles <angles(en)>
设置 Primary Fog Direction角度.
Set2DSkyboxFogFactor <浮点型(en)> (存在于自 求生之路2 以来)
把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45求生之路2 only.
SetZoomFogScale <浮点型(en)> (存在于自 反恐精英:全球攻势 以来)
设置 Zoom Fog Scale.
SetColorLerpTo <color255(en)> (存在于自 半衰期2:第一章 以来)
储存一个Primary Fog Color的颜色值,在 StartFogTransition 输入时触发。
SetColorSecondaryLerpTo <color255(en)> (存在于自 半衰期2:第一章 以来)
储存一个 Secondary Fog Color 的颜色值,在 StartFogTransition输入时触发。
SetStartDistLerpTo <浮点型(en)> (存在于自 半衰期2:第一章 以来)
储存一个 Fog Start 的距离值,在 StartFogTransition输入时触发。
SetEndDistLerpTo <浮点型(en)> (存在于自 半衰期2:第一章 以来)
储存一个 Fog End 的距离值,在 StartFogTransition 输入时触发。
SetMaxDensityLerpTo <浮点型(en)> (存在于自 求生之路 以来)
储存一个 Fog Max Density的浓度,在 StartFogTransition输入时触发 This one does not have any non-"LerpTo" counterpart.
Set2DSkyboxFogFactorLerpTo <浮点型(en)> (存在于自 求生之路2 以来)
把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45。只有 StartFogTransition输入时触发。 求生之路2 only.
StartFogTransition  (存在于自 半衰期2:第一章 以来)
当输入触发,雾气变化通过 "LerpTo" 输入。变化时间通过 Interpolate time 键值定义。
Icon-Bug.png错误:并没有正确地工作。过度时间为0会突然改变为新值。Seen in 求生之路2反恐精英:全球攻势.  [todo tested in ?]
Base:
AddContext <字符串(en)>
添加到实体的 Response Contexts/响应上下文列表。格式是<key>:<value>
AddOutput <字符串(en)>
在此实体上分配新的键值/输出。对于键值,有些依赖于额外的必要代码来运行,如果它只是通过这个输入改变就行不通。必须遵循严格的格式:
语法:

ClearContext
从此实体的列表中删除所有上下文。
ClearParent
从移动层次结构中删除该实体,使其可以自由移动。
FireUser1 to FireUser4
触发相应的OnUser输出;详见 User Inputs and OutputsEnglish
Kill
从这个世界中删除此实体。
KillHierarchy
功能类似Kill,尽管此实体与其父实体都被删除了,但比Kill快一点。
RemoveContext
从实体列表删除一个上下文。名字应与现有上下文进行匹配。
SetParent <字符串(en)>
跟随此实体移动,详见 实体层级(依赖关系)
SetParentAttachment <字符串(en)>
更改此实体到其父级上的特定附属English点。实体将传送,以至于其骨骼方位English与附属匹配。在使用此输入前必须设置好实体的父实体。
SetParentAttachmentMaintainOffset <字符串(en)>
同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
Use  不存在于FGD!
与调用 +use 的玩家相同[玩家按 +use(使用,默认E按钮)];大多数情况下没有影响。
DispatchResponse <字符串(en)> 不存在于FGD!
向实体发送一个上下文。 详见 ResponseEnglishConceptEnglish.
DispatchEffect <字符串(en)> (被移除求生之路 以来) 不存在于FGD!
在实体的原点坐标设置一个特定效果;参见 List of Client EffectsEnglish。自从求生之路 求生之路后由粒子系统取代。
RunScriptFile <脚本(en)> (存在于自 求生之路2 以来)
从硬盘执行一个 VScript 脚本文件,不带文件后缀名。会合并接收实体的脚本域。
RunScriptCode <字符串(en)> (存在于自 求生之路2 以来)
在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。
Icon-Bug.png错误:在 Hammer 中,使用带有字符串的参数会破坏 VMFEnglish 文件的结构,使下一个 Hammer 会话无法查看该文件。  [todo tested in ?]
Note.png修复:使用文本编辑器手动删除带有字符串的参数。
CallScriptFunction <字符串(en)> (存在于自 求生之路2 以来) 不存在于FGD!
在接受实体脚本域上执行一段 VScript 函数。
SetLocalOrigin <coordinates(en)> (存在于自 异形丛生 以来) 不存在于FGD!
将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
SetLocalAngles <angles(en)> (存在于自 异形丛生 以来) 不存在于FGD!
设置该实体的角度。

输出

Base/基础:

OnUser1 to OnUser4
这些输出将分别响应于 FireUser1FireUser4 输入。 详见 User Inputs and Outputs
OnKilled  (存在于 求生之路系列求生之路系列 之中)
当实体被Kill输入时响应此输出。

参见