MrShoe
07-17-2002, 04:41 PM
My terrain engine has a cull distance of 25.0, i want there to be for to cover up the culling of the terrain tiles. But i want the fog ONLY to be close to the culling distance, so that there is no fog between say 0.0 and 23.0 or something, but i cant seem to do this, as no metter that i set the start and end distance of the fog, its all the same... is it possible to mame the fog start at 23.0?? so that everything between 0.0 and 23.0 is perfectly clear??
my code atm:;
float FogColor[] = { 0.75, 0.75, 1.0 };
float FogStart = 23.0;
float FogEnd = 40.0;
float FogDensity = 0.8;
// We wil use a different fog depending on time of day.
if(day == 1){
FogColor[0] = 0.8;
FogColor[1] = 0.8;
FogColor[2] = 0.9;
}
else{
FogColor[0] = 0.3;
FogColor[1] = 0.3;
FogColor[2] = 0.35;
}
// Set the fog properties.
glFogi(GL_FOG_MODE, GL_EXP2);
glFogfv(GL_FOG_COLOR, FogColor);
glFogf(GL_FOG_DENSITY, FogDensity);
glFogf(GL_FOG_START, FogStart);
glFogf(GL_FOG_END, FogEnd);
glEnable(GL_FOG);
glHint(GL_FOG_HINT, GL_NICEST);
The results dont seem to change at all if i vary start and end distances.
my code atm:;
float FogColor[] = { 0.75, 0.75, 1.0 };
float FogStart = 23.0;
float FogEnd = 40.0;
float FogDensity = 0.8;
// We wil use a different fog depending on time of day.
if(day == 1){
FogColor[0] = 0.8;
FogColor[1] = 0.8;
FogColor[2] = 0.9;
}
else{
FogColor[0] = 0.3;
FogColor[1] = 0.3;
FogColor[2] = 0.35;
}
// Set the fog properties.
glFogi(GL_FOG_MODE, GL_EXP2);
glFogfv(GL_FOG_COLOR, FogColor);
glFogf(GL_FOG_DENSITY, FogDensity);
glFogf(GL_FOG_START, FogStart);
glFogf(GL_FOG_END, FogEnd);
glEnable(GL_FOG);
glHint(GL_FOG_HINT, GL_NICEST);
The results dont seem to change at all if i vary start and end distances.