Zh/Fog tutorial: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{lang=Fog_tutorial}} thumb|150px|right|Note how the fog doesn't impact the skybox When you have fog in your map, you will most likely run into the pr...")
 
m (obsolete language category)
 
(9 intermediate revisions by 5 users not shown)
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]]
[[File: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.
当你的地图设置创建雾的时候,你极有可能遇到这样的问题,虽然固体和模型受到雾气影响但{{L|Skybox (2D)|天空盒}}并不会受到影响。所以这里有几种修复方式。


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


==Matching Fog Settings with the Skybox==
== 雾与天空盒设置的匹配 ==
[[Image:Fogtute02.jpg|thumb|150px|right|This fog looks good because it matches the skybox]]
[[File: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>。则我们的{{L|Env fog controller|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]].
这个设置被运用到了地图{{L|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]]
[[File: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.
备用方案,你可以改变天空盒子固体为{{L|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天空盒子贴图很重要,{{L|2D_skybox#创建一个自定义的2D天空盒贴图|这里}}有深入的教程。


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.
跟一般的天空盒相似,你会需要六个<code>UnlitGeneric</code>纹理,每一个名称与方向对应。但不要使用$nofog参数。这样可以使雾覆盖天空盒,而无需将其融合。


==See also==
== 参见 ==
* [[Dust, Fog, & Smoke]]
* {{L|Dust, Fog, & Smoke|尘土、雾、烟}}


[[Category:Level Design]]
{{ACategory|Level Design}}
[[Category:Level Design Tutorials]]
{{ACategory|Level Design Tutorials}}
[[Category:Tutorials]]
{{ACategory|Tutorials}}
[[Category:Abstract Mapping]]
{{ACategory|Abstract Mapping}}
[[Category:Fog]]
{{ACategory|Fog}}
[[Category:Chinese]]

Latest revision as of 04:15, 22 August 2024

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

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

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

雾与天空盒设置的匹配

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

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

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

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

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

使用tools/toolsblack的替代方案

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

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

自定义天空贴图

了解2D天空盒子贴图很重要,这里(en)有深入的教程。

跟一般的天空盒相似,你会需要六个UnlitGeneric纹理,每一个名称与方向对应。但不要使用$nofog参数。这样可以使雾覆盖天空盒,而无需将其融合。

参见