Remove gl_light_math (reverts last remains of old lightmath branch)

This commit is contained in:
Magnus Norddahl 2016-10-04 00:25:35 +02:00
commit e9d13e5d74
9 changed files with 7 additions and 128 deletions

View file

@ -60,11 +60,6 @@ CVAR (Bool, gl_lights_checkside, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR (Bool, gl_light_sprites, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR (Bool, gl_light_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CUSTOM_CVAR(Int, gl_light_math, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self < 0 || self > 2) self = 0;
}
//==========================================================================
//
// Sets up the parameters to render one dynamic light onto one plane
@ -113,25 +108,10 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD
i = 1;
}
float worldPos[4] = { (float)pos.X, (float)pos.Z, (float)pos.Y, 1.0f };
float eyePos[4];
gl_RenderState.mViewMatrix.multMatrixPoint(worldPos, eyePos);
if (gl_light_math != 0)
{
// Move light up because flasks/vials have their light source location at/below the floor.
//
// If the point is exactly on the wall plane it might cause some acne as some pixels could
// be in front and some behind. Move light just a tiny bit to avoid this.
eyePos[0] += 0.01f;
eyePos[1] += 5.01f;
eyePos[2] += 0.01f;
}
float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(8)];
data[0] = eyePos[0];
data[1] = eyePos[1];
data[2] = eyePos[2];
data[0] = pos.X;
data[1] = pos.Z;
data[2] = pos.Y;
data[3] = radius;
data[4] = r;
data[5] = g;

View file

@ -158,7 +158,6 @@ bool FRenderState::ApplyShader()
activeShader->muTimer.Set(gl_frameMS * mShaderTimer / 1000.f);
activeShader->muAlphaThreshold.Set(mAlphaThreshold);
activeShader->muLightIndex.Set(mLightIndex); // will always be -1 for now
activeShader->muLightMath.Set(gl_light_math);
activeShader->muClipSplit.Set(mClipSplit);
if (mGlowEnabled)

View file

@ -220,7 +220,6 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
muColormapStart.Init(hShader, "uFixedColormapStart");
muColormapRange.Init(hShader, "uFixedColormapRange");
muLightIndex.Init(hShader, "uLightIndex");
muLightMath.Init(hShader, "uLightMath");
muFogColor.Init(hShader, "uFogColor");
muDynLightColor.Init(hShader, "uDynLightColor");
muObjectColor.Init(hShader, "uObjectColor");

View file

@ -266,7 +266,6 @@ class FShader
FUniform1i muFixedColormap;
FUniform4f muColormapStart;
FUniform4f muColormapRange;
FBufferedUniform1i muLightMath;
FBufferedUniform1i muLightIndex;
FBufferedUniformPE muFogColor;
FBufferedUniform4f muDynLightColor;

View file

@ -26,7 +26,6 @@ EXTERN_CVAR (Bool, gl_attachedlights);
EXTERN_CVAR (Bool, gl_lights_checkside);
EXTERN_CVAR (Bool, gl_light_sprites);
EXTERN_CVAR (Bool, gl_light_particles);
EXTERN_CVAR (Int, gl_light_math);
EXTERN_CVAR(Int, gl_fogmode)
EXTERN_CVAR(Int, gl_lightmode)