SoilFog

Posted By: Rigoletto

SoilFog - 09/25/05 20:03

For your graveyard...



Only needs VS 1.0, try to improve it further.
Code:
 
float AddSoilFog(float3 Pos)
{
float value;
float low;
float high;
float3 P = mul( Pos, matWorld );
high = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
low = ( P.y / 30 ); // min. low fog
value = lerp( high, low, 0.2); // mixing high and low fog
return value;
}


Posted By: Rhuarc

Re: SoilFog - 09/25/05 21:02

Very nice
Posted By: Lion_Ts

Re: SoilFog - 09/25/05 22:04

Thank you, I have one big graveyard in my proj
Posted By: PHeMoX

Re: SoilFog - 09/25/05 22:26

Simple but very effective, thanks man!

Cheers
Posted By: Pappenheimer

Re: SoilFog - 09/25/05 22:28

Thanks! Looks very useful! Don't remember that I've ever seen this in a game!
Posted By: Rhuarc

Re: SoilFog - 09/26/05 02:17

Quote:

Thanks! Looks very useful! Don't remember that I've ever seen this in a game!




Quake3 used it...
Posted By: Matt_Aufderheide

Re: SoilFog - 09/26/05 02:48

Can someone explain what this is? i dont quite get it.
Posted By: Rhuarc

Re: SoilFog - 09/26/05 02:54

It's ground fogging. Volumetric based on height.

-Rhuarc
Posted By: jumpman

Re: SoilFog - 09/26/05 02:56

if you would throw in some nice looking sprites, youd have a kick ass looking fog on your hands!!
Posted By: task1

Re: SoilFog - 09/26/05 09:18

thanks for this!Iīve been looking for something like this for a loooooooong time!
Posted By: XNASorcerer

Re: SoilFog - 09/26/05 12:31

How can we use this?
Posted By: slacer

Re: SoilFog - 09/26/05 12:37

Hi Rigoletto,

can you post the full shader here?
Maybe you have some hints for the graveyard?
- how would you animate it for best visual effect?
- could you perturb the result?

Just for the case a skelleton walks around through this scenery it would be nice to see an effect to the fog.
Ok, I really have a very dark scene in my current project. Some nice fog like yours could improve the mood.

-- slacer
Posted By: Nicolas_B

Re: SoilFog - 09/26/05 14:06

thank you.
nice job.
Posted By: Rigoletto

Re: SoilFog - 09/26/05 16:48

Hi,

here is the full code. I try to add a function so that the heigh of the fog changes slightly, but i think if itīs too much you will see that it is a faked "volumetric" fog.

Interactive fog is just behind my knowledge, perhaps further.



Code:
 
material stone_tga
{
// Define your bitmaps as skins
skin1 = alphamap;
skin2 = effectmap;

effect
"
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Define your needed values
float4x4 matWorldViewProj; //
float4x4 matWorldView; //
float4x4 matWorld; // entity position/direction
float4 vecFog; // fog parameters
float4 vecViewPos; //
float4 vecTime; //

// Define your textures
texture entSkin1; // level texture
texture entSkin2; // shadow texture
texture mtlSkin1; // alpha texture
texture mtlSkin2; // effect texture

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Texture settings
sampler sBase = sampler_state // level texture
{
Texture = <entSkin1>; // Give your texture here
MipFilter = Linear; // None | Point | Linear | Anisotropic | PyramidalQuad | GaussianQuad
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap; // Wrap | Mirror | Clamp | Border | MirrorOnce
AddressV = Wrap;
AddressW = Wrap;
BorderColor = {255, 0, 0, 0}; // Color for AddressUVW with Border
};

sampler sShadow = sampler_state // shadow texture
{
Texture = <entSkin2>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

sampler sAlpha = sampler_state // alpha texture
{
Texture = <mtlSkin1>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

sampler sGrass = sampler_state // grass texture
{
Texture = <mtlSkin2>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Input and output structs
//
// Possible input values for vertexshader
//
// POSITION[n] position
// BLENDWEIGHT[n] blend weights
// BLENDINDICES[n] blend indices
// NORMAL[n] normal vector
// PSIZE[n] point size
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
// TANGENT[n] tangent
// BINORMAL[n] binormal
// TESSFACTOR[n] tessellation factor
//
// Possible output values for vertexshader
//
// POSITION Position
// PSIZE Point size
// FOG Vertex fog
// COLOR[n] Color (example: COLOR0)
// TEXCOORD[n] Texture coordinates (example: TEXCOORD0)
//
//
// Possible input values for pixelshader
//
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
//
// Possible output values for pixelshader
//
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
// DEPTH[n] Depth (example: DEPTH0)
//

// Define the input of your vertexshader
struct VS_IN
{
float4 Pos : POSITION;
float2 Shadow : TEXCOORD0;
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

// Define the output of your vertexshader
struct VS_OUT
{
float4 Pos : POSITION;
float2 Shadow : TEXCOORD0; // Shadow is binded to TEXCOORD0, so it get transported to the pixelshader
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
float Fog : FOG;
};

// Define the input for your pixelshader
struct PS_IN
{
float2 Shadow : TEXCOORD0; // The ouput of the vertexshader is given through TEXCOORD0
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

// Define the output for your pixelshader
struct PS_OUT
{
float4 Color : COLOR; // We only give a color value back
};

//////////////////////////////////////////////////////////////////////////////////////////////////////
// functions
float4 sfInvert( float4 value )
{
return 1 - value;
}

float4 sfNegate( float4 value )
{
return - value;
}

float4 sfSepia( float4 value )
{
float4 vGrey = float4( 0.3, 0.59, 0.11, 0 );
float4 vSepia = float4( 0.9, 0.70, 0.30, 1 );
return dot( value, vGrey) * vSepia;
}

float4 sfGrey( float4 value )
{
float4 vBW = float4( 0.3, 0.59, 0.11, 0 );
return dot( value, vBW);
}

float4 sfBlackWhite( float4 value, float level) // PS 1.4
{
float4 vBW = float4( 0.3, 0.59, 0.11, 0 );
value = dot( value, vBW );
value = 1 - step( value, level );
return value;
}

float4 sfPosterize( float4 value, float level ) // PS 1.4
{
if ( value.r < level ) value.r = 0; else value.r *= 1.0f;
if ( value.g < level ) value.g = 0; else value.g *= 1.0f;
if ( value.b < level ) value.b = 0; else value.b *= 1.0f;
return value;
}

float AddFog(float3 Pos)
{
float value;
float3 P = mul( Pos, matWorld );
value = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
return value;
}

float _AddSoilFog(float3 Pos)
{
float value;
float3 P = mul( Pos, matWorld );
value = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
//value = value + ( P.y / 60 ) * (1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z) / 16;
value = value + ( P.y / 60 );
return value;
}

float AddSoilFog(float3 Pos)
{
float value;
float low;
float high;
float3 P = mul( Pos, matWorld );
high = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
low = ( P.y / 30 ); // min. low fog
value = lerp( high, low, 0.2); // mixing high and low fog
return value;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// vertexshader
VS_OUT vs( VS_IN In )
{
VS_OUT Out = ( VS_OUT ) 0; // Declare your output

Out.Pos = mul( In.Pos, matWorldViewProj ); // Transform the ouput to the view

Out.Shadow = In.Shadow; // Get the shadow texture for the current position
Out.Base = In.Base; // Get the level texture for the current position
Out.Alpha = In.Base; // Cause alpha/grass texture have no current positions (they ar not applied to level geo)
Out.Grass = In.Base; // we use the positions of the level texture

Out.Alpha.y = In.Base.y - 0.5; // Shift the alpha to the bottom

Out.Fog = AddSoilFog( In.Pos );

return Out;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// pixelshader
PS_OUT ps( PS_IN In )
{
PS_OUT Out = ( PS_OUT ) 0; // Declare your output

float4 color; // Declare your needed variables
float4 shadow;
float4 alpha;
float4 grass;

color = tex2D( sBase, In.Base.xy ); // Get color of the texture sBase at the position In.Base.xy
shadow = tex2D( sShadow, In.Shadow.xy ); // ..
alpha = tex2D( sAlpha, In.Alpha.xy ); // ..
grass = tex2D( sGrass, In.Grass.xy ); // ..

color = lerp( color, grass, alpha); // Interpolates between color and grass via alpha
color = color * shadow; // and apply the shadow

Out.Color = color; // Write the output
return Out; // and give it back

// For more functions like tex2D or lerp take a look at
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/highlevellanguageshaders/intrinsicfunctions/intrinsicfunctions.asp
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//
technique test
{
// Define your passes
pass p0
{
// Compile your shaders
VertexShader = compile vs_1_0 vs();
PixelShader = compile ps_1_0 ps();
}
}
";
}


Posted By: XNASorcerer

Re: SoilFog - 09/26/05 16:53

Can this code work with terrains or models?
Posted By: slacer

Re: SoilFog - 09/26/05 16:59

Thank you man

-- slacer
Posted By: FeiHongJr

Re: SoilFog - 09/27/05 00:19

Thank you indeed, the screen shot looks impressive. Cant wait to try it out in a level of my own.

OT ... Lovin my new Gfx card
Posted By: Rigoletto

Re: SoilFog - 09/27/05 17:41

Yes, it works with modells and terrain.
Posted By: broozar

Re: SoilFog - 09/28/05 17:10

humm... sorry but how is it supposed to work?
i am using your shader with level geometry and get this result:



why canīt i get any depth/fog height as in your pic? whyīs all so flat?!
Posted By: Rhuarc

Re: SoilFog - 09/28/05 17:36

Because it needs to be applied to all of the textures you want the fog to show up on...
Posted By: broozar

Re: SoilFog - 09/28/05 17:41

i just want it on one texture. i simply get no "volume" in it.

i tried a box, too, with all sides textured with the special texture/material. still doesnīt work.
please help!
Posted By: Rigoletto

Re: SoilFog - 09/28/05 17:52

Have you changed the values too much?

The foor and the walls around you are minimum to see the shader effect, perhaps you can mix it with the normal fog, i have it not tested yet.
Posted By: broozar

Re: SoilFog - 09/28/05 18:01

ummm... i didnīt change any value, perhaps thatīs the problem...

whatīs to change?
Posted By: Rigoletto

Re: SoilFog - 09/29/05 10:47

If your level very different scaled, change the min. fog value higher. But think you must have a wall or something similar applied with this shader to see the fog correct.
Posted By: broozar

Re: SoilFog - 09/29/05 16:09

very well, that solves it all
thx a lot
Posted By: Rigoletto

Re: SoilFog - 09/29/05 19:29



If tried to add some noise to the fog, but i canīt. I think the resolution of the vertexshader is to low. Itīs a job for pixelshader, or not? Is there a solution for this problem?
Posted By: Blitzblaster1

Re: SoilFog - 10/11/05 19:47

Hi !

Thanks for the fog code. Nice work ! I need it you my game Snap the Pac.

Regards
Blitzblaster1
Posted By: GeishaG

Re: SoilFog - 11/01/05 13:47

Thanks for adding this Rigoletto. I have added this code to your shader tutorial from the wiki. Here is the resulting code exactly:

Code:

////////////////////////////////////////////////////////////////////////
// A6 main wdl:
// Created by WED.
////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////
// The PATH keyword gives directories where template files can be found.
path "c:\\program files\\GSTUDIO6\\template_6"; // Path to A6 templates directory
path "c:\\program files\\GSTUDIO6\\template_6\\code"; // Path to A6 template code subdirectory
path "c:\\program files\\GSTUDIO6\\template_6\\images"; // Path to A6 template image subdirectory
path "c:\\program files\\GSTUDIO6\\template_6\\sounds"; // Path to A6 template sound subdirectory
path "c:\\program files\\GSTUDIO6\\template_6\\models"; // Path to A6 template model subdirectory

/////////////////////////////////////////////////////////////////
// Filename of the starting level.
string level_str = <pst1.WMB>; // give file names in angular brackets

////////////////////////////////////////////////////////////////////////////
// Included files
include <gid01.wdl>; // global ids
include <display00.wdl>; // basic display settings

bmap alphamap = <alpha.tga>;
bmap effectmap = <grass.tga>;

material stone_tga
{
// Define your bitmaps as skins
skin1 = alphamap;
skin2 = effectmap;

effect
"
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Define your needed values
float4x4 matWorldViewProj; //
float4x4 matWorldView; //
float4x4 matWorld; // entity position/direction
float4 vecFog; // fog parameters
float4 vecViewPos; //
float4 vecTime; //

// Define your textures
texture entSkin1; // level texture
texture entSkin2; // shadow texture
texture mtlSkin1; // alpha texture
texture mtlSkin2; // effect texture

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Texture settings
sampler sBase = sampler_state // level texture
{
Texture = <entSkin1>; // Give your texture here
MipFilter = Linear; // None | Point | Linear | Anisotropic | PyramidalQuad | GaussianQuad
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap; // Wrap | Mirror | Clamp | Border | MirrorOnce
AddressV = Wrap;
AddressW = Wrap;
BorderColor = {255, 0, 0, 0}; // Color for AddressUVW with Border
};

sampler sShadow = sampler_state // shadow texture
{
Texture = <entSkin2>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

sampler sAlpha = sampler_state // alpha texture
{
Texture = <mtlSkin1>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

sampler sGrass = sampler_state // grass texture
{
Texture = <mtlSkin2>;
MipFilter = Linear;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Input and output structs
//
// Possible input values for vertexshader
//
// POSITION[n] position
// BLENDWEIGHT[n] blend weights
// BLENDINDICES[n] blend indices
// NORMAL[n] normal vector
// PSIZE[n] point size
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
// TANGENT[n] tangent
// BINORMAL[n] binormal
// TESSFACTOR[n] tessellation factor
//
// Possible output values for vertexshader
//
// POSITION Position
// PSIZE Point size
// FOG Vertex fog
// COLOR[n] Color (example: COLOR0)
// TEXCOORD[n] Texture coordinates (example: TEXCOORD0)
//
//
// Possible input values for pixelshader
//
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
//
// Possible output values for pixelshader
//
// COLOR[n] diffuse and specular color
// TEXCOORD[n] texture coordinates
// DEPTH[n] Depth (example: DEPTH0)
//

// Define the input of your vertexshader
struct VS_IN
{
float4 Pos : POSITION;
float2 Shadow : TEXCOORD0;
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

// Define the output of your vertexshader
struct VS_OUT
{
float4 Pos : POSITION;
float2 Shadow : TEXCOORD0; // Shadow is binded to TEXCOORD0, so it get transported to the pixelshader
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
float Fog : FOG;
};

// Define the input for your pixelshader
struct PS_IN
{
float2 Shadow : TEXCOORD0; // The ouput of the vertexshader is given through TEXCOORD0
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

// Define the output for your pixelshader
struct PS_OUT
{
float4 Color : COLOR; // We only give a color value back
};

//////////////////////////////////////////////////////////////////////////////////////////////////////
// functions
float4 sfInvert( float4 value )
{
return 1 - value;
}

float4 sfNegate( float4 value )
{
return - value;
}

float4 sfSepia( float4 value )
{
float4 vGrey = float4( 0.3, 0.59, 0.11, 0 );
float4 vSepia = float4( 0.9, 0.70, 0.30, 1 );
return dot( value, vGrey) * vSepia;
}

float4 sfGrey( float4 value )
{
float4 vBW = float4( 0.3, 0.59, 0.11, 0 );
return dot( value, vBW);
}

float4 sfBlackWhite( float4 value, float level) // PS 1.4
{
float4 vBW = float4( 0.3, 0.59, 0.11, 0 );
value = dot( value, vBW );
value = 1 - step( value, level );
return value;
}

float4 sfPosterize( float4 value, float level ) // PS 1.4
{
if ( value.r < level ) value.r = 0; else value.r *= 1.0f;
if ( value.g < level ) value.g = 0; else value.g *= 1.0f;
if ( value.b < level ) value.b = 0; else value.b *= 1.0f;
return value;
}

float AddFog(float3 Pos)
{
float value;
float3 P = mul( Pos, matWorld );
value = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
return value;
}

float _AddSoilFog(float3 Pos)
{
float value;
float3 P = mul( Pos, matWorld );
value = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
//value = value + ( P.y / 60 ) * (1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z) / 16;
value = value + ( P.y / 60 );
return value;
}

float AddSoilFog(float3 Pos)
{
float value;
float low;
float high;
float3 P = mul( Pos, matWorld );
high = 1 - ( distance( P, vecViewPos ) - vecFog.x ) * vecFog.z;
low = ( P.y / 30 ); // min. low fog
value = lerp( high, low, 0.2); // mixing high and low fog
return value;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// vertexshader
VS_OUT vs( VS_IN In )
{
VS_OUT Out = ( VS_OUT ) 0; // Declare your output

Out.Pos = mul( In.Pos, matWorldViewProj ); // Transform the ouput to the view

Out.Shadow = In.Shadow; // Get the shadow texture for the current position
Out.Base = In.Base; // Get the level texture for the current position
Out.Alpha = In.Base; // Cause alpha/grass texture have no current positions (they ar not applied to level geo)
Out.Grass = In.Base; // we use the positions of the level texture

Out.Alpha.y = In.Base.y - 0.5; // Shift the alpha to the bottom

Out.Fog = AddSoilFog( In.Pos );

return Out;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// pixelshader
PS_OUT ps( PS_IN In )
{
PS_OUT Out = ( PS_OUT ) 0; // Declare your output

float4 color; // Declare your needed variables
float4 shadow;
float4 alpha;
float4 grass;

color = tex2D( sBase, In.Base.xy ); // Get color of the texture sBase at the position In.Base.xy
shadow = tex2D( sShadow, In.Shadow.xy ); // ..
alpha = tex2D( sAlpha, In.Alpha.xy ); // ..
grass = tex2D( sGrass, In.Grass.xy ); // ..

color = lerp( color, grass, alpha); // Interpolates between color and grass via alpha
color = color * shadow; // and apply the shadow

Out.Color = color; // Write the output
return Out; // and give it back

// For more functions like tex2D or lerp take a look at
// [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/highlevellanguageshaders/intrinsicfunctions/intrinsicfunctions.asp]http://msdn.microsoft.com/library/defaul...icfunctions.asp[/url]
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//
technique test
{
// Define your passes
pass p0
{
// Compile your shaders
VertexShader = compile vs_1_0 vs();
PixelShader = compile ps_1_0 ps();
}
}
";
}


/////////////////////////////////////////////////////////////////
// Desc: The main() function is started at game start
function main()
{
d3d_automaterial = 1;

// set some common flags and variables
// freeze all entity functions
freeze_mode = 1;
// no level has been loaded yet...
gid01_level_state = gid01_level_not_loaded;

// entry: Warning Level (0,1, or 2)
// entry_help: Sets sensitivity to warnings (0 = none, 1 = some, 2 = all).
warn_level = 2; // announce bad texture sizes and bad wdl code


// entry: Starting Mouse Mode (0, 1, or 2)
mouse_mode = 0;

// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);

wait(2); // let level load
// level should be loaded at this point...
gid01_level_state = gid01_level_loaded;

//+++ load starting values

freeze_mode = 0;

// main game loop
while(1)
{
if(gid01_level_state != gid01_level_loaded)
{
freeze_mode = 1; // pause the game
while(gid01_level_state != gid01_level_loaded) { wait(1); }
freeze_mode = 0; // resume the game
}
wait(1);
}

}


// Desc: this is the function used to restart the game.
function main_restart_game()
{
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);
// freeze the game
freeze_mode = 1;

wait(2); // 1-level loads, 2-entities load

//+++ load starting values

// un-freeze the game
freeze_mode = 0;
}


// Desc: this is the function used to quit the game.
function main_quit()
{
//+++ // save global skills & strings
exit;
}

/////////////////////////////////////////////////////////////////
// The following definitions are for the pro edition window composer
// to define the start and exit window of the application.
WINDOW WINSTART
{
TITLE "3D GameStudio";
SIZE 480,320;
MODE IMAGE; //STANDARD;
BG_COLOR RGB(240,240,240);
FRAME FTYP1,0,0,480,320;
// BUTTON BUTTON_START,SYS_DEFAULT,"Start",400,288,72,24;
BUTTON BUTTON_QUIT,SYS_DEFAULT,"Abort",400,288,72,24;
TEXT_STDOUT "Arial",RGB(0,0,0),10,10,460,280;
}

/* no exit window at all..
WINDOW WINEND
{
TITLE "Finished";
SIZE 540,320;
MODE STANDARD;
BG_COLOR RGB(0,0,0);
TEXT_STDOUT "",RGB(255,40,40),10,20,520,270;

SET FONT "",RGB(0,255,255);
TEXT "Any key to exit",10,270;
}*/


/////////////////////////////////////////////////////////////////
//INCLUDE <debug.wdl>;



The only problem is no fog is showing up when I run the level:

There is no fog

My graphics card is Radeon 9800.

Anyone have any ideas what my problem is?
Posted By: Rigoletto

Re: SoilFog - 11/01/05 19:41

You must activate the fog.

Code:
 
fog_color = 1;
camera.fog_start = 0.0 * camera.clip_near;
camera.fog_end = 0.2 * camera.clip_far;


Posted By: GeishaG

Re: SoilFog - 11/02/05 12:37

Rigoletto - thanks for getting back to me! I added those lines to the main, and
as you can see the screenshot looks different (darker) - however it still
doesn't look like yours. Was the main (after the level load) the right place to
add it? Is there any thing else you can think of that I need to add?


Posted By: Rigoletto

Re: SoilFog - 11/03/05 11:52

Change the color of the fog...
Posted By: GeishaG

Re: SoilFog - 11/05/05 07:13

OH, thanks you're the best! that was too obvious for me

I also realised I had to apply it to the walls to get that distance effect. Thanks for helping me out!


© 2024 lite-C Forums