Fog tutorial: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 6: Line 6:
[[Image:Fogtute01.jpg]]
[[Image:Fogtute01.jpg]]


The solution is to make your fog color match the skybox as closely as possible, but a problem arises that if the skybox texture does not appear to have fog on it, things look strange.
The solution is to make your fog color match the skybox as closely as possible, but a problem arises that if the skybox texture does not appear to have fog on it, things look strange.<br/>
You could make your own skybox that has the appearance of fog which would solve this problem but as a quick fix these settings will work fine.
You could make your own skybox that has the appearance of fog which would solve this problem but as a quick fix these settings will work fine.


First thing you have to use "sky_day02_10" for your sky map. (If you look at it, it actually is fogy on the texture which is why it works.)  
First thing you have to use "sky_day02_10" for your sky map. (If you look at it, it actually is fogy on the texture which is why it works.)  


then your "env_fog_controller" should be something like this:  
then your "env_fog_controller" should be something like this: <br/>
primary fog colour: 176 192 202  
primary fog colour: 176 192 202 <br/>
Secondary fog colour: 206 216 222  
Secondary fog colour: 206 216 222 <br/>


These are the exact settings used on the bridge level in HL2.
These are the exact settings used on the bridge level in HL2.<br/>
This is an example of how it can look:<br/>
This is an example of how it can look:<br/>
[[Image:Fogtute02.jpg]]
[[Image:Fogtute02.jpg]]


Apparently with the use of a 3D skybox this problem can be solved using the sky_camera’s fog settings. Someone will need to clarify that because I couldn’t get it to work.
Apparently with the use of a 3D skybox this problem can be solved using the sky_camera’s fog settings. Someone will need to clarify that because I couldn’t get it to work.

Revision as of 17:58, 29 June 2005

Reasonable fog tute Half-Life 2

I’v written this because it took me a long time to work out and had a lot of people coming up with allsorts of crazy answers that didn’t work for me so this is my solution to the problem.

The problem is that the env_fog_controller does not affect the skybox and will come out looking like this:
Fogtute01.jpg

The solution is to make your fog color match the skybox as closely as possible, but a problem arises that if the skybox texture does not appear to have fog on it, things look strange.
You could make your own skybox that has the appearance of fog which would solve this problem but as a quick fix these settings will work fine.

First thing you have to use "sky_day02_10" for your sky map. (If you look at it, it actually is fogy on the texture which is why it works.)

then your "env_fog_controller" should be something like this:
primary fog colour: 176 192 202
Secondary fog colour: 206 216 222

These are the exact settings used on the bridge level in HL2.
This is an example of how it can look:
Fogtute02.jpg

Apparently with the use of a 3D skybox this problem can be solved using the sky_camera’s fog settings. Someone will need to clarify that because I couldn’t get it to work.