- changed handling of DynLight in shader to serve as a global dynamic light color for all lighting modes.

This commit is contained in:
Christoph Oelckers 2014-05-11 16:49:17 +02:00
parent 53f4cd0108
commit 52056a05bd
12 changed files with 61 additions and 89 deletions

View file

@ -100,8 +100,7 @@ CUSTOM_CVAR (Bool, gl_lights_additive, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG
// Sets up the parameters to render one dynamic light onto one plane
//
//==========================================================================
bool gl_GetLight(Plane & p, ADynamicLight * light,
int desaturation, bool checkside, bool forceadditive, FDynLightData &ldata)
bool gl_GetLight(Plane & p, ADynamicLight * light, bool checkside, bool forceadditive, FDynLightData &ldata)
{
Vector fn, pos;
int i = 0;
@ -147,14 +146,6 @@ bool gl_GetLight(Plane & p, ADynamicLight * light,
i = 1;
}
if (desaturation>0)
{
float gray=(r*77 + g*143 + b*37)/257;
r= (r*(32-desaturation)+ gray*desaturation)/32;
g= (g*(32-desaturation)+ gray*desaturation)/32;
b= (b*(32-desaturation)+ gray*desaturation)/32;
}
float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(8)];
data[0] = x;
data[1] = z;
@ -176,7 +167,7 @@ bool gl_GetLight(Plane & p, ADynamicLight * light,
//
//==========================================================================
bool gl_SetupLight(Plane & p, ADynamicLight * light, Vector & nearPt, Vector & up, Vector & right,
float & scale, int desaturation, bool checkside, bool forceadditive)
float & scale, bool checkside, bool forceadditive)
{
Vector fn, pos;