A couple lighting tweaks ...
This commit is contained in:
parent
b89d27f083
commit
96068a55c9
3 changed files with 30 additions and 17 deletions
|
@ -185,7 +185,7 @@ static void fgUpdateViewParams() {
|
||||||
|
|
||||||
/* sky_brightness = 0.15; */ /* to force a dark sky (for testing) */
|
/* sky_brightness = 0.15; */ /* to force a dark sky (for testing) */
|
||||||
|
|
||||||
if ( ambient < 0.1 ) { ambient = 0.1; }
|
if ( ambient < 0.02 ) { ambient = 0.02; }
|
||||||
if ( diffuse < 0.0 ) { diffuse = 0.0; }
|
if ( diffuse < 0.0 ) { diffuse = 0.0; }
|
||||||
|
|
||||||
if ( sky_brightness < 0.1 ) { sky_brightness = 0.1; }
|
if ( sky_brightness < 0.1 ) { sky_brightness = 0.1; }
|
||||||
|
@ -623,9 +623,12 @@ int main( int argc, char *argv[] ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.40 1997/12/30 01:38:37 curt
|
/* Revision 1.41 1997/12/30 13:06:56 curt
|
||||||
/* Switched back to per vertex normals and smooth shading for terrain.
|
/* A couple lighting tweaks ...
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.40 1997/12/30 01:38:37 curt
|
||||||
|
* Switched back to per vertex normals and smooth shading for terrain.
|
||||||
|
*
|
||||||
* Revision 1.39 1997/12/22 23:45:45 curt
|
* Revision 1.39 1997/12/22 23:45:45 curt
|
||||||
* First stab at sunset/sunrise sky glow effects.
|
* First stab at sunset/sunrise sky glow effects.
|
||||||
*
|
*
|
||||||
|
|
|
@ -156,8 +156,10 @@ void fgSkyColorsInit() {
|
||||||
middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
|
middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
|
||||||
outer_color[i][j] = l->fog_color[j] + outer_amt[j];
|
outer_color[i][j] = l->fog_color[j] + outer_amt[j];
|
||||||
|
|
||||||
if ( middle_color[i][j] > 1.0 ) { middle_color[i][j] = 1.0; }
|
if ( middle_color[i][j] > 1.00 ) { middle_color[i][j] = 1.00; }
|
||||||
if ( outer_color[i][j] > 1.0 ) { outer_color[i][j] = 1.0; }
|
if ( middle_color[i][j] < 0.10 ) { middle_color[i][j] = 0.10; }
|
||||||
|
if ( outer_color[i][j] > 1.00 ) { outer_color[i][j] = 1.00; }
|
||||||
|
if ( outer_color[i][j] < 0.10 ) { outer_color[i][j] = 0.10; }
|
||||||
}
|
}
|
||||||
inner_color[i][3] = middle_color[i][3] = outer_color[i][3] =
|
inner_color[i][3] = middle_color[i][3] = outer_color[i][3] =
|
||||||
l->sky_color[3];
|
l->sky_color[3];
|
||||||
|
@ -191,8 +193,10 @@ void fgSkyColorsInit() {
|
||||||
middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
|
middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
|
||||||
outer_color[i][j] = l->fog_color[j] + outer_amt[j];
|
outer_color[i][j] = l->fog_color[j] + outer_amt[j];
|
||||||
|
|
||||||
if ( middle_color[i][j] > 1.0 ) { middle_color[i][j] = 1.0; }
|
if ( middle_color[i][j] > 1.00 ) { middle_color[i][j] = 1.00; }
|
||||||
if ( outer_color[i][j] > 1.0 ) { outer_color[i][j] = 1.0; }
|
if ( middle_color[i][j] < 0.10 ) { middle_color[i][j] = 0.10; }
|
||||||
|
if ( outer_color[i][j] > 1.00 ) { outer_color[i][j] = 1.00; }
|
||||||
|
if ( outer_color[i][j] < 0.15 ) { outer_color[i][j] = 0.15; }
|
||||||
}
|
}
|
||||||
inner_color[i][3] = middle_color[i][3] = outer_color[i][3] =
|
inner_color[i][3] = middle_color[i][3] = outer_color[i][3] =
|
||||||
l->sky_color[3];
|
l->sky_color[3];
|
||||||
|
@ -315,10 +319,13 @@ void fgSkyRender() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.8 1997/12/23 04:58:38 curt
|
/* Revision 1.9 1997/12/30 13:06:57 curt
|
||||||
/* Tweaked the sky coloring a bit to build in structures to allow finer rgb
|
/* A couple lighting tweaks ...
|
||||||
/* control.
|
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.8 1997/12/23 04:58:38 curt
|
||||||
|
* Tweaked the sky coloring a bit to build in structures to allow finer rgb
|
||||||
|
* control.
|
||||||
|
*
|
||||||
* Revision 1.7 1997/12/22 23:45:48 curt
|
* Revision 1.7 1997/12/22 23:45:48 curt
|
||||||
* First stab at sunset/sunrise sky glow effects.
|
* First stab at sunset/sunrise sky glow effects.
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
# include <sys/timeb.h> /* for ftime() and struct timeb */
|
# include <sys/timeb.h> /* for ftime() and struct timeb */
|
||||||
#else
|
#else
|
||||||
# include <sys/time.h> /* for get/setitimer, gettimeofday, struct timeval */
|
# include <sys/time.h> /* for get/setitimer, gettimeofday, struct timeval */
|
||||||
#endif USE_FTIME
|
#endif /* USE_FTIME */
|
||||||
|
|
||||||
#include "fg_timer.h"
|
#include "fg_timer.h"
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ void fgTimerInit(float dt, void (*f)()) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif HAVE_ITIMER
|
#endif /* HAVE_ITIMER */
|
||||||
|
|
||||||
|
|
||||||
/* This function returns the number of milleseconds since the last
|
/* This function returns the number of milleseconds since the last
|
||||||
|
@ -98,7 +98,7 @@ int fgGetTimeInterval() {
|
||||||
static struct timeval last;
|
static struct timeval last;
|
||||||
static struct timeval current;
|
static struct timeval current;
|
||||||
static struct timezone tz;
|
static struct timezone tz;
|
||||||
#endif USE_FTIME
|
#endif /* USE_FTIME */
|
||||||
|
|
||||||
if ( ! inited ) {
|
if ( ! inited ) {
|
||||||
inited = 1;
|
inited = 1;
|
||||||
|
@ -107,7 +107,7 @@ int fgGetTimeInterval() {
|
||||||
ftime(&last);
|
ftime(&last);
|
||||||
#else
|
#else
|
||||||
gettimeofday(&last, &tz);
|
gettimeofday(&last, &tz);
|
||||||
#endif
|
#endif /* USE_FTIME */
|
||||||
|
|
||||||
interval = 0;
|
interval = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -121,7 +121,7 @@ int fgGetTimeInterval() {
|
||||||
interval = 1000000 * (current.tv_sec - last.tv_sec) +
|
interval = 1000000 * (current.tv_sec - last.tv_sec) +
|
||||||
(current.tv_usec - last.tv_usec);
|
(current.tv_usec - last.tv_usec);
|
||||||
interval /= 1000; /* convert back to milleseconds */
|
interval /= 1000; /* convert back to milleseconds */
|
||||||
#endif
|
#endif /* USE_FTIME */
|
||||||
|
|
||||||
last = current;
|
last = current;
|
||||||
}
|
}
|
||||||
|
@ -131,9 +131,12 @@ int fgGetTimeInterval() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.6 1997/07/12 02:13:04 curt
|
/* Revision 1.7 1997/12/30 13:06:58 curt
|
||||||
/* Add ftime() support for those that don't have gettimeofday()
|
/* A couple lighting tweaks ...
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.6 1997/07/12 02:13:04 curt
|
||||||
|
* Add ftime() support for those that don't have gettimeofday()
|
||||||
|
*
|
||||||
* Revision 1.5 1997/06/26 19:08:38 curt
|
* Revision 1.5 1997/06/26 19:08:38 curt
|
||||||
* Restructuring make, adding automatic "make dep" support.
|
* Restructuring make, adding automatic "make dep" support.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue