Zh/Fog tutorial: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{lang|Fog_tutorial}}
{{lang|Fog_tutorial}}
[[Image:Fogtute01.jpg|thumb|150px|right|Note how the fog doesn't impact the skybox]]
[[Image:Fogtute01.jpg|thumb|150px|right|注意,雾不影响天空。]]


When you have fog in your map, you will most likely run into the problem that, while the geometry and models get affected by the fog, the [[Skybox (2D)|skybox]] will not. You have several ways of fixing this.
当你的地图设置创建雾的时候,你极有可能遇到这样的问题, 虽然固体和模型受到雾气影响但 [[Skybox (2D)|skybox]] 并不会受到影响。所以这里有几种修复方式。


{{tip|Match the fog settings in the [[sky_camera]] entity with the settings of your [[env_fog_controller]] for best results.}}
{{提示|[[sky_camera]] 实体与您的[[env_fog_controller]] 设置最好一致(相关属性)}}


==Matching Fog Settings with the Skybox==
==匹配雾设置与天空盒子设置。==
[[Image:Fogtute02.jpg|thumb|150px|right|This fog looks good because it matches the skybox]]
[[Image:Fogtute02.jpg|thumb|150px|right|这个雾气非常好,因为它匹配了天空盒。]]
For good looking fog, you'll need to match the fog colors with the skybox colors. You can always fall back on the settings Valve used in their official maps. 
为了让雾看起来更好, 你需要让地图雾气颜色与天空盒子雾气颜色相匹配.Valve的一些官方地图可以作为一些参考。


For our example, we'll be using <code>sky_day02_10</code>. If you're using this skybox, your [[env_fog_controller]] settings would need to be set like this.
譬如, 我们使用这个天空贴图<code>sky_day02_10</code>.则我们的 [[env_fog_controller]]需要设置成以下这样:


Primary fog color: <code>176 192 202</code><br/>
Primary fog color: <code>176 192 202</code><br/>
Secondary fog color: <code>206 216 222</code>
Secondary fog color: <code>206 216 222</code>


The settings above were used for the bridge section of [[Highway 17]].
这个设置被运用到了地图 [[Highway 17|17号高速公路]].


==Alternate Method using tools/toolsblack==
==备用方案,使用贴图tools/toolsblack==
[[Image:3-D Sky Fog Example.jpg|thumb|150px|right|Using tools/toolsblack can be more effective at achieving proper fog]]
[[Image:3-D Sky Fog Example.jpg|thumb|150px|right|使用贴图tools/toolsblack 也可以获得有效的效果。]]
Alternatively, you can change the skybox brushes to the [[Tool texture|tools/toolsblack]] texture. The sky will no longer be visible, allowing your fog settings to color the sky.
备用方案,你可以改变天空盒子固体为[[Tool texture|tools/toolsblack]] 材质,那么天空将不可见, 这样就好设置多了。


==Creating a Custom Skybox Texture==
==自定义天空贴图==
Understanding the creation of 2D skyboxes is important. A more in-depth tutorial on creating one is available [[2D_skybox#Creating_a_Custom_2D_Skybox_Texture|here]].
了解2D天空盒子贴图很重要,这里提供了教材:[[2D_skybox#Creating_a_Custom_2D_Skybox_Texture|点我!]].


Much like a regular skybox, you'll want to create six <code>UnlitGeneric</code> textures, each named corresponding to their direction. Leave off the [[$nofog]] parameter, however. This allows the fog to overdraw the skybox, without the need for it blending in.
常规创建方法。 但是,不要使用$ nofog参数。这允许雾覆盖天空盒,而无需将其融合。


==See also==
==参见==
* [[Dust, Fog, & Smoke]]
* [[Dust, Fog, & Smoke]]



Revision as of 22:26, 13 October 2019

English (en)Русский (ru)中文 (zh)Translate (Translate)
注意,雾不影响天空。

当你的地图设置创建雾的时候,你极有可能遇到这样的问题, 虽然固体和模型受到雾气影响但 skybox 并不会受到影响。所以这里有几种修复方式。

Tip.png提示:sky_camera 实体与您的env_fog_controller 设置最好一致(相关属性)

匹配雾设置与天空盒子设置。

这个雾气非常好,因为它匹配了天空盒。

为了让雾看起来更好, 你需要让地图雾气颜色与天空盒子雾气颜色相匹配.Valve的一些官方地图可以作为一些参考。

譬如, 我们使用这个天空贴图sky_day02_10.则我们的 env_fog_controller需要设置成以下这样:

Primary fog color: 176 192 202
Secondary fog color: 206 216 222

这个设置被运用到了地图 17号高速公路.

备用方案,使用贴图tools/toolsblack

使用贴图tools/toolsblack 也可以获得有效的效果。

备用方案,你可以改变天空盒子固体为tools/toolsblack 材质,那么天空将不可见, 这样就好设置多了。

自定义天空贴图

了解2D天空盒子贴图很重要,这里提供了教材:点我!.

常规创建方法。 但是,不要使用$ nofog参数。这允许雾覆盖天空盒,而无需将其融合。

参见