Zh/Env fog controller: Difference between revisions
< Zh
Jump to navigation
Jump to search
(Created page with "{{lang|Env fog controller}} left|link={{point_ent:zh|env_fog_controller}} 它定义了整个地图的雾气效果。 {{提示|在多人游戏中...") |
m (Multipage removal) |
||
(22 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{this is a|point entity|name=env_fog_controller}} | |||
{{infotable | |||
|env_fog_controller | |||
|img=[[File:fog_controller.png]] | |||
|type=e0 | |||
|engine=2 | |||
|in=0 | |||
}} | |||
这个实体定义了整个地图的雾气效果。 | |||
{{Tip|在多人游戏中,此实体可以向{{ent|player}}(玩家)实体发送输入<code>SetFogController</code>来修改每个客户端的雾气效果,最好是通过{{ent:zh-cn|!activator}}!}} | |||
在{{l4ds}}中, 多个 {{ent:zh-cn|env_fog_controller}}可以结合{{ent:zh-cn|fog_volume}}实体来创建不同区域实现不同雾气效果。 除此之外,如果不设置<code>fog_volume</code>指定到任意一个<code>env_fog_controller</code>上,或者未启用单个<code>fog_volume</code>则可以设置标签/flags ''Master''作为主要的全局雾气控制。 | |||
{{PreservedEnt}} | {{PreservedEnt}} | ||
向地图增加雾气可以导致/要求{{L|lighting|光照}}更加真实。光照穿过雾气的时候会散射和被吸收。雾气越浓,效果会越好: | |||
* | *{{L|Falloff|光照衰减}},是光线随着距离而衰减的率。 雾气越浓厚则衰减距离越小。 | ||
*[[Lighting#Tyndall effects| | *[[Lighting#Tyndall effects|丁达尔效应]] - 可以透过雾气粒子反射光效给玩家。 雾气越浓厚,光圈效果和光束则越明显。 | ||
* | *漫反射光照 - 随着雾气的浓淡,光与影的边界将不明显。 详见 [[Lightmap#Lightmap Scale|Lightmap Scale]] 和 {{ent:zh-cn|shadow_control}}的distance属性。 | ||
比较古老的起源游戏将雾渲染成离摄像机一定距离的平面。这种方法很糟糕,因为旋转视角会加强或减弱某个地方的明显雾量,即使玩家根本没有移动。在{{L|Left 4 Dead|求生之路1}}中,V社通过实施一种与视角无关的新径向方法来解决的。 | |||
<!-- 傻逼VDC阉割了Mediawiki的主页面注释功能,按照起源模组制作圈的共识,以L4D1区分起源整体分支的新旧。半条命2、传送门等在L4D1之前发布的起源游戏称为“旧起源”,L4D2、传送门2等在L4D1之后发布的起源游戏称为“新起源” --> | |||
{{ | {{Note|{{L|3D Skybox}}的远景效果,其{{ent:zh-cn|sky_camera}}相关雾气属性应该与{{ent:zh-cn|env_fog_controller}}一致。}} | ||
{{code class|CFogController|fogcontroller.cpp}} | {{code class:zh-cn|CFogController|fogcontroller.cpp}} | ||
==Flags== | ==标签/Flags== | ||
*1: Master - | *1: Master - 如果有多个{{ent:zh-cn|env_fog_controller}}被弃用,此实体永远是优先的。 | ||
== | ==键值== | ||
{{KV|Fog Enabled | {{KV:zh-cn|Fog Enabled|intn=fogenable|bool|使雾实体启用。}} | ||
{{KV|Fog Start | {{KV:zh-cn|Fog Start|intn=fogstart|float|雾效果应该距离玩家视角多远开始出现。即雾开始的距离。}} | ||
{{KV|Fog End | {{KV:zh-cn|Fog End|intn=fogend|float|距离玩家视角多远达到'''Fog Max Density'''(雾效果最大浓度)。即雾结束的距离,挂钩与最大浓度。}} | ||
{{KV|Fog Max Density | {{KV:zh-cn|Fog Max Density|intn=fogmaxdensity|float|雾效果能达到的最大浓度。以小数点表示百分比,如0.45代表45%。}} | ||
{{KV|Far Z Clip Plane | {{KV:zh-cn|Far Z Clip Plane|intn=farz|integer|以世界距离为单位,超过多远的物体不渲染。这项应该比'''Fog End'''更高。如果启用了此项, '''Fog Max Density'''则应该设置为<code>1</code>,否则有可能看到{{L|void|空洞}}(地图外面的黑色效果) 。}} | ||
{{KV|Primary Fog Color | {{KV:zh-cn|Primary Fog Color|intn=fogcolor|color255|雾气的主要颜色。}} | ||
{{KV|Secondary Fog Color | {{KV:zh-cn|Secondary Fog Color|intn=fogcolor2|color255|雾气的次要颜色。如果 '''Fog Blend''' 被禁用,则不会启用此颜色。}} | ||
{{KV|Fog Blend | {{KV:zh-cn|Fog Blend|intn=fogblend|bool|启用在'''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 | {{KV:zh-cn|Primary Fog Direction|intn=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 | {{KV:zh-cn|Use Angles for Fog Dir|intn=use_angles|bool|以'''Pitch Yaw Roll''' 设置 '''Fog Blend''' 方向而不是 '''Primary Fog Direction'''. 除非你想要方位旋转,否则没什么用。}} | ||
{{KV|Interpolate time | {{KV:zh-cn|Interpolate time|intn=foglerptime|float|输入 <code>StartFogTransition</code> 的淡入时间。}} | ||
{{KV|HDR Color Scale | {{KV:zh-cn|HDR Color Scale|intn=HDRColorScale|since=L4D|float|{{L|HDR}} 模式下雾颜色的倍数.}} | ||
{{KV|Zoom Fog Scale | {{KV:zh-cn|Zoom Fog Scale|intn=ZoomFogScale|since=CSGO|float|利用瞄准镜的时候,玩家起始雾和结束雾距离的标量。(e.g. AWP).}} | ||
{{KV DXLevelChoice}} | {{KV DXLevelChoice:zh-cn}} | ||
{{KV SystemLevelChoice}} | {{KV SystemLevelChoice:zh-cn}} | ||
{{KV BaseEntity|css=1}} | {{KV BaseEntity:zh-cn|css=1}} | ||
== | ==输入== | ||
{{IO|TurnOn| | {{IO:zh-cn|TurnOn|开启.}} | ||
{{IO|TurnOff| | {{IO:zh-cn|TurnOff|关闭.}} | ||
{{IO|SetStartDist|param=float| | {{IO:zh-cn|SetStartDist|param=float|设置 '''Fog Start'''距离}} | ||
{{IO|SetEndDist|param=float| | {{IO:zh-cn|SetEndDist|param=float|设置 '''Fog End''' 距离}} | ||
{{IO|SetColor|param=color255| | {{IO:zh-cn|SetColor|param=color255|设置 '''Primary Fog Color'''的颜色}} | ||
{{IO|SetColorSecondary|param=color255| | {{IO:zh-cn|SetColorSecondary|param=color255|设置 '''Secondary Fog Color'''的颜色}} | ||
{{IO|SetFarZ|param=integer| | {{IO:zh-cn|SetFarZ|param=integer|设置 '''Far Z Clip Plane'''距离.}} | ||
{{IO|SetAngles|param=angles| | {{IO:zh-cn|SetAngles|param=angles|设置 '''Primary Fog Direction'''角度.}} | ||
{{IO|Set2DSkyboxFogFactor|param=float|since=l4d2| | {{IO:zh-cn|Set2DSkyboxFogFactor|param=float|since=l4d2|把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45{{l4d2}} only.}} | ||
{{IO|SetZoomFogScale|param=float|since=CSGO| | {{IO:zh-cn|SetZoomFogScale|param=float|since=CSGO|设置 '''Zoom Fog Scale'''.}} | ||
{{IO|SetColorLerpTo|param=color255|since=EP1| | {{IO:zh-cn|SetColorLerpTo|param=color255|since=EP1|储存一个'''Primary Fog Color'''的颜色值,在 <code>StartFogTransition</code> 输入时触发。}} | ||
{{IO|SetColorSecondaryLerpTo|param=color255|since=EP1| | {{IO:zh-cn|SetColorSecondaryLerpTo|param=color255|since=EP1|储存一个 '''Secondary Fog Color''' 的颜色值,在 <code>StartFogTransition</code>输入时触发。}} | ||
{{IO|SetStartDistLerpTo|param=float|since=EP1| | {{IO:zh-cn|SetStartDistLerpTo|param=float|since=EP1|储存一个 '''Fog Start''' 的距离值,在 <code>StartFogTransition</code>输入时触发。}} | ||
{{IO|SetEndDistLerpTo|param=float|since=EP1| | {{IO:zh-cn|SetEndDistLerpTo|param=float|since=EP1|储存一个 '''Fog End''' 的距离值,在 <code>StartFogTransition</code> 输入时触发。}} | ||
{{IO|SetMaxDensityLerpTo|param=float|since=L4D| | {{IO:zh-cn|SetMaxDensityLerpTo|param=float|since=L4D|储存一个 '''Fog Max Density'''的浓度,在 <code>StartFogTransition</code>输入时触发 This one does ''not'' have any non-"LerpTo" counterpart.}} | ||
{{IO|Set2DSkyboxFogFactorLerpTo|param=float|since=l4d2| | {{IO:zh-cn|Set2DSkyboxFogFactorLerpTo|param=float|since=l4d2|把当前雾气的量混合到2D skybox,表示为小数百分比,45%请使用0.45。只有 <code>StartFogTransition</code>输入时触发。 {{only:zh-cn|{{l4d2}}}}.}} | ||
{{IO|StartFogTransition|since=EP1| | {{IO:zh-cn|StartFogTransition|since=EP1|当输入触发,雾气变化通过 "<code>LerpTo</code>" 输入。变化时间通过 '''Interpolate time''' 键值定义。 | ||
{{bug| | {{bug|并没有正确地工作。过度时间为0会突然改变为新值。见于{{l4d2}}{{csgo}}.}}}} | ||
{{I BaseEntity|prel4d=1}} | {{I BaseEntity:zh-cn|prel4d=1}} | ||
== | ==输出== | ||
{{O BaseEntity|l4d=1}} | {{O BaseEntity:zh-cn|l4d=1}} | ||
== | ==参见== | ||
* | *{{L|Fog tutorial|雾教程(已有中文,右上角切换)}} | ||
* | *{{L|Fog Basics|雾基础}} | ||
* | *{{L|Dust, Fog, & Smoke|尘,雾和烟}} |
Latest revision as of 06:27, 12 July 2024
env_fog_controller
是一个点实体 ,可在所有的 起源 游戏中使用。
这个实体定义了整个地图的雾气效果。

SetFogController
来修改每个客户端的雾气效果,最好是通过!activator!在中, 多个 env_fog_controller可以结合fog_volume实体来创建不同区域实现不同雾气效果。 除此之外,如果不设置
fog_volume
指定到任意一个env_fog_controller
上,或者未启用单个fog_volume
则可以设置标签/flags Master作为主要的全局雾气控制。

- 在新一轮中,它不会故意将自己重置为其默认属性(包括位置)。
解决方案:如果这是一个问题,你可以采用 logic_auto 实体模拟重置它。
- 通过
Kill
杀死它会永远移除它,因为它不会在新一轮重生。 - 它不能用 point_template 生成。
- 把这个实体与非保留实体绑定可能会导致不良影响。
向地图增加雾气可以导致/要求光照 更加真实。光照穿过雾气的时候会散射和被吸收。雾气越浓,效果会越好:
- 光照衰减 ,是光线随着距离而衰减的率。 雾气越浓厚则衰减距离越小。
- 丁达尔效应 - 可以透过雾气粒子反射光效给玩家。 雾气越浓厚,光圈效果和光束则越明显。
- 漫反射光照 - 随着雾气的浓淡,光与影的边界将不明显。 详见 Lightmap Scale 和 shadow_control的distance属性。
比较古老的起源游戏将雾渲染成离摄像机一定距离的平面。这种方法很糟糕,因为旋转视角会加强或减弱某个地方的明显雾量,即使玩家根本没有移动。在求生之路1 中,V社通过实施一种与视角无关的新径向方法来解决的。

待完善: 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)
<布尔值 > - 使雾实体启用。
- 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)
<向量 > - 向量(以空格分割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).
DXLevelChoice:
- 最低DX水平 (mindxlevel) <choices>
- 如果引擎在给定的DirectX Versions
范围之外运行,该实体将不存在。从
求生之路开始,被SystemLevelChoice取代。
警告:如果使用这些,当用户切换他们的DirectX设置时,该对象可能会中断。
SystemLevelChoice:

cpu_level
命令;效果详细信息使用的命令。

gpu_level
命令; Shader Details 使用的命令。输入
- 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
输入时触发。 (仅存在于中).



Base:
- 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输入时响应此输出。