Zh/Env fog controller: Difference between revisions
(Created page with "{{lang|Env fog controller}} left|link={{point_ent:zh|env_fog_controller}} 它定义了整个地图的雾气效果。 {{提示|在多人游戏中...") |
No edit summary |
||
Line 2: | Line 2: | ||
[[File:fog_controller.png|left|link=]]{{point_ent:zh|env_fog_controller}} 它定义了整个地图的雾气效果。 | [[File:fog_controller.png|left|link=]]{{point_ent:zh|env_fog_controller}} 它定义了整个地图的雾气效果。 | ||
{{提示| | {{提示|在多人游戏中,此实体可以向{{ent|player}}(玩家)实体发送输入<code>SetFogController</code>来修改每个客户端的雾气效果,最好是通过{{ent|!activator}}!}} | ||
在{{l4ds}}中, 多个 <code>env_fog_controller</code>可以结合{{ent|fog_volume}}实体来创建不同区域实现不同雾气效果。 除此之外,如果不设置<code>fog_volume</code>指定到任意一个<code>env_fog_controller</code>上,或者未启用单个<code>fog_volume</code>则可以设置标签/flags ''Master''作为主要的全局雾气控制。 | |||
{{PreservedEnt:zh}} | |||
向地图增加雾气可以导致/要求[[lighting|光照]]更加真实。光照穿过雾气的时候会散射和被吸收。雾气越浓,效果会越好: | |||
*[[Falloff]] - (或衰减),是光线随着距离而衰减的率。 雾气越浓厚则衰减距离越小。 | |||
*[[Lighting#Tyndall effects|Tyndall effects]] - 可以透过雾气粒子反射光效给玩家。 雾气越浓厚,光圈效果和光束则越明显。 | |||
*[[Falloff]] - ( | *Diffused Lighting - 随着雾气的浓淡,光与影的边界将不明显。 详见 [[Lightmap#Lightmap Scale|Lightmap Scale]] 和 {{ent|shadow_control}}的distance属性。 | ||
*[[Lighting#Tyndall effects|Tyndall effects]] - | |||
*Diffused Lighting - | |||
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{{confirm}} onward, this is fixed by implementing a new radial method which is independent from the viewing angle. | 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{{confirm}} onward, this is fixed by implementing a new radial method which is independent from the viewing angle. | ||
(关于早期起源引擎的处理雾气的老方法,在求生之路后被修改。此方法很糟糕。会导致镜头移动雾气忽淡忽浓,即使不移动也会。↑) | |||
{{ | {{注意|[[3D Skybox]]的远景效果,其{{ent|sky_camera}}相关雾气属性应该与<code>env_fog_controller</code>一致。}} | ||
{{code class|CFogController|fogcontroller.cpp}} | {{code class:zh|CFogController|fogcontroller.cpp}} | ||
==Flags== | ==标签/Flags== | ||
*1: Master - | *1: Master - 如果有多个<code>env_fog_controller</code>被弃用,此实体永远是优先的。 | ||
== | ==键值== | ||
{{KV|Fog Enabled (fogenable)| | {{KV:zh-cn|Fog Enabled (fogenable)|布尔型|使雾实体启用。}} | ||
{{KV|Fog Start (fogstart)| | {{KV:zh-cn|Fog Start (fogstart)|浮点型|雾效果应该距离玩家视角多远开始出现。即雾开始的距离。}} | ||
{{KV|Fog End (fogend)| | {{KV:zh-cn|Fog End (fogend)|浮点型|距离玩家视角多远达到'''Fog Max Density'''(雾效果最大浓度)。即雾结束的距离,挂钩与最大浓度。}} | ||
{{KV|Fog Max Density (fogmaxdensity)| | {{KV:zh-cn|Fog Max Density (fogmaxdensity)|浮点型|雾效果能达到的最大浓度。以小数点表示百分比,如0.45代表45%。}} | ||
{{KV|Far Z Clip Plane (farz)| | {{KV:zh-cn|Far Z Clip Plane (farz)|整数型|以世界距离为单位,超过多远的物体不渲染。这项应该比'''Fog End'''更高。如果启用了此项, '''Fog Max Density'''则应该设置为<code>1</code>,否则有可能看到[[void|空洞]](地图外面的黑色效果) 。}} | ||
{{KV|Primary Fog Color (fogcolor)|color255| | {{KV:zh-cn|Primary Fog Color (fogcolor)|color255|雾气的主要颜色。}} | ||
{{KV|Secondary Fog Color (fogcolor2)|color255| | {{KV:zh-cn|Secondary Fog Color (fogcolor2)|color255|雾气的次要颜色。如果 '''Fog Blend''' 被禁用,则不会启用此颜色。}} | ||
{{KV|Fog Blend (fogblend)| | {{KV:zh-cn|Fog Blend (fogblend)|布尔型|启用在'''Primary Fog Color''' 和 '''Secondary 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度的太阳光。}} | ||
{{KV|Primary Fog Direction (fogdir)|vector| | {{KV:zh-cn|Primary Fog Direction (fogdir)|vector/向量|向量(以空格分割XYZ), which the viewer camera is checked against to figure out the blend between the primary and secondary fog colors.}} | ||
{{KV|Use Angles for Fog Dir (use_angles)| | {{KV:zh-cn|Use Angles for Fog Dir (use_angles)|布尔型|以'''Pitch Yaw Roll''' 设置 '''Fog Blend''' 方向而不是 '''Primary Fog Direction'''. 除非你想要方位旋转,否则没什么用。}} | ||
{{KV|Interpolate time (foglerptime)| | {{KV:zh-cn|Interpolate time (foglerptime)|浮点型|输入 <code>StartFogTransition</code> 的淡入时间。}} | ||
{{KV|HDR Color Scale (HDRColorScale)|since=L4D| | {{KV:zh-cn|HDR Color Scale (HDRColorScale)|since=L4D|浮点型|[[HDR]] 模式下雾颜色的倍数.}} | ||
{{KV|Zoom Fog Scale (ZoomFogScale)|since=CSGO| | {{KV:zh-cn|Zoom Fog Scale (ZoomFogScale)|since=CSGO|浮点型|利用瞄准镜的时候,玩家起始雾和结束雾距离的标量。(e.g. AWP).}} | ||
{{KV DXLevelChoice}} | {{KV DXLevelChoice}} | ||
{{KV SystemLevelChoice}} | {{KV SystemLevelChoice:zh}} | ||
{{KV BaseEntity|css=1}} | {{KV BaseEntity:zh|css=1}} | ||
== | ==输入== | ||
{{IO|TurnOn| | {{IO:zh|TurnOn|开启.}} | ||
{{IO|TurnOff| | {{IO:zh|TurnOff|关闭.}} | ||
{{IO|SetStartDist|param= | {{IO:zh|SetStartDist|param=浮点型|设置 '''Fog Start'''距离}} | ||
{{IO|SetEndDist|param= | {{IO:zh|SetEndDist|param=浮点型|设置 '''Fog End''' 距离}} | ||
{{IO|SetColor|param=color255| | {{IO:zh|SetColor|param=color255|设置 '''Primary Fog Color'''的颜色}} | ||
{{IO|SetColorSecondary|param=color255| | {{IO:zh|SetColorSecondary|param=color255|设置 '''Secondary Fog Color'''的颜色}} | ||
{{IO|SetFarZ|param= | {{IO:zh|SetFarZ|param=整数型|设置 '''Far Z Clip Plane'''距离.}} | ||
{{IO|SetAngles|param=angles| | {{IO:zh|SetAngles|param=angles|设置 '''Primary Fog Direction'''角度.}} | ||
{{IO|Set2DSkyboxFogFactor|param= | {{IO:zh|Set2DSkyboxFogFactor|param=浮点型|since=l4d2|把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45{{l4d2}} only.}} | ||
{{IO|SetZoomFogScale|param= | {{IO:zh|SetZoomFogScale|param=浮点型|since=CSGO|设置 '''Zoom Fog Scale'''.}} | ||
{{IO|SetColorLerpTo|param=color255|since=EP1| | {{IO:zh|SetColorLerpTo|param=color255|since=EP1|储存一个'''Primary Fog Color'''的颜色值,在 <code>StartFogTransition</code> 输入时触发。}} | ||
{{IO|SetColorSecondaryLerpTo|param=color255|since=EP1| | {{IO:zh|SetColorSecondaryLerpTo|param=color255|since=EP1|储存一个 '''Secondary Fog Color''' 的颜色值,在 <code>StartFogTransition</code>输入时触发。}} | ||
{{IO|SetStartDistLerpTo|param= | {{IO:zh|SetStartDistLerpTo|param=浮点型|since=EP1|储存一个 '''Fog Start''' 的距离值,在 <code>StartFogTransition</code>输入时触发。}} | ||
{{IO|SetEndDistLerpTo|param= | {{IO:zh|SetEndDistLerpTo|param=浮点型|since=EP1|储存一个 '''Fog End''' 的距离值,在 <code>StartFogTransition</code> 输入时触发。}} | ||
{{IO|SetMaxDensityLerpTo|param= | {{IO:zh|SetMaxDensityLerpTo|param=浮点型|since=L4D|储存一个 '''Fog Max Density'''的浓度,在 <code>StartFogTransition</code>输入时触发 This one does ''not'' have any non-"LerpTo" counterpart.}} | ||
{{IO|Set2DSkyboxFogFactorLerpTo|param= | {{IO:zh|Set2DSkyboxFogFactorLerpTo|param=浮点型|since=l4d2|把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45。只有 <code>StartFogTransition</code>输入时触发。 {{l4d2}} only.}} | ||
{{IO|StartFogTransition|since=EP1| | {{IO:zh|StartFogTransition|since=EP1|当输入触发,雾气变化通过 "<code>LerpTo</code>" 输入。变化时间通过 '''Interpolate time''' 键值定义。 | ||
{{bug| | {{bug|并没有正确地工作。过度时间为0会突然改变为新值。Seen in {{l4d2}}{{csgo}}.}}}} | ||
{{I BaseEntity|prel4d=1}} | {{I BaseEntity:zh|prel4d=1}} | ||
== | ==输出== | ||
{{O BaseEntity|l4d=1}} | {{O BaseEntity:zh|l4d=1}} | ||
== | ==参见== | ||
*[[Fog tutorial]] | *[[Fog tutorial|雾教程(已有中文,右上角切换)]] | ||
*[[Fog Basics]] | *[[Fog Basics|雾基础]] | ||
*[[Dust, Fog, & Smoke]] | *[[Dust, Fog, & Smoke|尘,雾和烟]] |
Revision as of 22:13, 13 October 2019

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

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 Scale 和 shadow_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. (关于早期起源引擎的处理雾气的老方法,在求生之路后被修改。此方法很糟糕。会导致镜头移动雾气忽淡忽浓,即使不移动也会。↑)
在源代码中,它由 class
CFogController
代表,定义于 fogcontroller.cpp
。
标签/Flags
- 1: Master - 如果有多个
env_fog_controller
被弃用,此实体永远是优先的。
键值
- Fog Enabled (fogenable) <布尔型 >
- 使雾实体启用。
- Fog Start (fogstart) <浮点型 >
- 雾效果应该距离玩家视角多远开始出现。即雾开始的距离。
- Fog End (fogend) <浮点型 >
- 距离玩家视角多远达到Fog Max Density(雾效果最大浓度)。即雾结束的距离,挂钩与最大浓度。
- Fog Max Density (fogmaxdensity) <浮点型 >
- 雾效果能达到的最大浓度。以小数点表示百分比,如0.45代表45%。
- Far Z Clip Plane (farz) <整数 >
- 以世界距离为单位,超过多远的物体不渲染。这项应该比Fog End更高。如果启用了此项, Fog Max Density则应该设置为
1
,否则有可能看到空洞(地图外面的黑色效果) 。
- Primary Fog Color (fogcolor) <color255 >
- 雾气的主要颜色。
- Secondary Fog Color (fogcolor2) <color255 >
- 雾气的次要颜色。如果 Fog Blend 被禁用,则不会启用此颜色。
- Fog Blend (fogblend) <布尔型 >
- 启用在Primary Fog Color 和 Secondary 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/向量 >
- 向量(以空格分割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) <布尔型 >
- 以Pitch Yaw Roll 设置 Fog Blend 方向而不是 Primary Fog Direction. 除非你想要方位旋转,否则没什么用。
- Interpolate time (foglerptime) <浮点型 >
- 输入
StartFogTransition
的淡入时间。
- Zoom Fog Scale (ZoomFogScale) <浮点型 > (存在于自
以来)
- 利用瞄准镜的时候,玩家起始雾和结束雾距离的标量。(e.g. AWP).
- 最低 / 最高 DX 水平 (mindxlevel / maxdxlevel) <integer choices > (被移除于
以来)
- 如果引擎在给定的 DirectX Versions 版本范围之外运行,该实体将不存在。
选择 警告:If these are used, the object may break when the user switches their DirectX settings.[missing string]
- 0 - 默认(无界线)
- 60 - DirectX 6 (不存在于FGD! for mindxlevel)
- 70 - DirectX 7
- 80 - DirectX 8 (GeForce4 Ti & FX 5000 series)
- 81 - DirectX 8.1 (GeForce FX 5800, 5900 & Radeon 8500/9100 and 9000/9200)
- 90 - DirectX 9 Shader Model 2
- 92 - OpenGL аналогичен DirectX 9 Shader Model 2 (using ToGL;
only) 不存在于FGD!
- 95 - DirectX 9 Shader Model 3 (存在于自
以来)
- 98 - Xbox 360 上的 DirectX 9 Shader Model 3 (
only) 不存在于FGD!
SystemLevelChoice:
- Maximum GPU Level (maxgpulevel) <choices> (存在于自
以来)
-
- 0: Default/默认
- 1: Very low/非常低
- 2: Low/低
- 3: Medium/中
- 4: High/高

Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
输入
- TurnOn
- 开启.
- TurnOff
- 关闭.
- SetStartDist <浮点型 >
- 设置 Fog Start距离
- SetEndDist <浮点型 >
- 设置 Fog End 距离
- SetColor <color255 >
- 设置 Primary Fog Color的颜色
- SetColorSecondary <color255 >
- 设置 Secondary Fog Color的颜色
- SetFarZ <整数 >
- 设置 Far Z Clip Plane距离.
- SetAngles <angles >
- 设置 Primary Fog Direction角度.
- Set2DSkyboxFogFactor <浮点型 > (存在于自
以来)
- 把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45
only.
- SetZoomFogScale <浮点型 > (存在于自
以来)
- 设置 Zoom Fog Scale.
- SetColorLerpTo <color255 > (存在于自
以来)
- 储存一个Primary Fog Color的颜色值,在
StartFogTransition
输入时触发。
- SetColorSecondaryLerpTo <color255 > (存在于自
以来)
- 储存一个 Secondary Fog Color 的颜色值,在
StartFogTransition
输入时触发。
- SetStartDistLerpTo <浮点型 > (存在于自
以来)
- 储存一个 Fog Start 的距离值,在
StartFogTransition
输入时触发。
- SetEndDistLerpTo <浮点型 > (存在于自
以来)
- 储存一个 Fog End 的距离值,在
StartFogTransition
输入时触发。
- SetMaxDensityLerpTo <浮点型 > (存在于自
以来)
- 储存一个 Fog Max Density的浓度,在
StartFogTransition
输入时触发 This one does not have any non-"LerpTo" counterpart.
- Set2DSkyboxFogFactorLerpTo <浮点型 > (存在于自
以来)
- 把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45。只有
StartFogTransition
输入时触发。only.



- AddContext <字符串 >
- 添加到实体的 Response Contexts/响应上下文列表。格式是
<key>:<value>
。
- ClearContext
- 从此实体的列表中删除所有上下文。
- ClearParent
- 从移动层次结构中删除该实体,使其可以自由移动。
- FireUser1 to FireUser4
- 触发相应的
OnUser
输出;详见 User Inputs and Outputs。
- Kill
- 从这个世界中删除此实体。
- KillHierarchy
- 功能类似
Kill
,尽管此实体与其父实体都被删除了,但比Kill
快一点。
- RemoveContext
- 从实体列表删除一个上下文。名字应与现有上下文进行匹配。
- SetParent <字符串 >
- 跟随此实体移动,详见 实体层级(依赖关系)。
- SetParentAttachmentMaintainOffset <字符串 >
- 同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
- DispatchResponse <字符串 > 不存在于FGD!
- 向实体发送一个上下文。 详见 Response
和 Concept
.
- DispatchEffect <字符串 > (被移除于
以来) 不存在于FGD!
- 在实体的原点坐标设置一个特定效果;参见 List of Client Effects
。自从
求生之路后由粒子系统取代。
- RunScriptCode <字符串 > (存在于自
以来)
- 在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。
修复:使用文本编辑器手动删除带有字符串的参数。
- SetLocalOrigin <coordinates > (存在于自
以来) 不存在于FGD!
- 将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
输出
Base/基础:
- OnUser1 to OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。 - OnKilled (仅存在于
之中)
- 当实体被Kill输入时响应此输出。