- removed unused forceadditive parameter from gl_GetLight.

- restricted gl_lights_additive to legacy code and removed menu entry for this.

For modern hardware this setting is completely pointless, it offers no advantage and degrades visual quality. Its only reason for existence was that drawing additive lights with textures is a lot faster, and that's all it's being used for now.
This commit is contained in:
Christoph Oelckers 2016-09-04 12:35:26 +02:00
parent 37d0f97808
commit e7856ce1e3
8 changed files with 8 additions and 14 deletions

View file

@ -57,6 +57,8 @@
#include "gl/data/gl_vertexbuffer.h" #include "gl/data/gl_vertexbuffer.h"
CVAR(Bool, gl_lights_additive, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
//========================================================================== //==========================================================================
// //
// Do some tinkering with the menus so that certain options only appear // Do some tinkering with the menus so that certain options only appear
@ -478,7 +480,7 @@ bool GLWall::PutWallCompat(int passflag)
if (sub->lighthead == nullptr) return false; if (sub->lighthead == nullptr) return false;
} }
bool foggy = !gl_isBlack(Colormap.FadeColor) || (level.flags&LEVEL_HASFADETABLE) || gl_lights_additive; bool foggy = gl_CheckFog(&Colormap, lightlevel) || (level.flags&LEVEL_HASFADETABLE) || gl_lights_additive;
bool masked = passflag == 2 && gltexture->isMasked(); bool masked = passflag == 2 && gltexture->isMasked();
int list = list_indices[masked][foggy]; int list = list_indices[masked][foggy];

View file

@ -58,7 +58,6 @@
#include "gl/utility/gl_templates.h" #include "gl/utility/gl_templates.h"
EXTERN_CVAR (Float, gl_lights_size); EXTERN_CVAR (Float, gl_lights_size);
EXTERN_CVAR (Bool, gl_lights_additive);
EXTERN_CVAR(Int, vid_renderer) EXTERN_CVAR(Int, vid_renderer)

View file

@ -184,7 +184,7 @@ struct FDynLightData
bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, bool forceadditive, FDynLightData &data); bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FDynLightData &data);
void gl_UploadLights(FDynLightData &data); void gl_UploadLights(FDynLightData &data);

View file

@ -74,18 +74,13 @@ CVAR (Float, gl_lights_intensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR (Float, gl_lights_size, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); CVAR (Float, gl_lights_size, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR (Bool, gl_light_sprites, 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); CVAR (Bool, gl_light_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CUSTOM_CVAR (Bool, gl_lights_additive, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
gl_DeleteAllAttachedLights();
gl_RecreateAllAttachedLights();
}
//========================================================================== //==========================================================================
// //
// Sets up the parameters to render one dynamic light onto one plane // Sets up the parameters to render one dynamic light onto one plane
// //
//========================================================================== //==========================================================================
bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, bool forceadditive, FDynLightData &ldata) bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FDynLightData &ldata)
{ {
int i = 0; int i = 0;
@ -103,7 +98,7 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, bo
float cs; float cs;
if (gl_lights_additive || light->flags4&MF4_ADDITIVE || forceadditive) if (light->IsAdditive())
{ {
cs = 0.2f; cs = 0.2f;
i = 2; i = 2;

View file

@ -154,7 +154,7 @@ void GLFlat::SetupSubsectorLights(int pass, subsector_t * sub, int *dli)
} }
p.Set(plane.plane); p.Set(plane.plane);
gl_GetLight(sub->sector->PortalGroup, p, light, false, false, lightdata); gl_GetLight(sub->sector->PortalGroup, p, light, false, lightdata);
node = node->nextLight; node = node->nextLight;
} }

View file

@ -158,7 +158,7 @@ void GLWall::SetupLights()
} }
if (outcnt[0]!=4 && outcnt[1]!=4 && outcnt[2]!=4 && outcnt[3]!=4) if (outcnt[0]!=4 && outcnt[1]!=4 && outcnt[2]!=4 && outcnt[3]!=4)
{ {
gl_GetLight(seg->frontsector->PortalGroup, p, node->lightsource, true, false, lightdata); gl_GetLight(seg->frontsector->PortalGroup, p, node->lightsource, true, lightdata);
} }
} }
} }

View file

@ -26,7 +26,6 @@ EXTERN_CVAR (Bool, gl_attachedlights);
EXTERN_CVAR (Bool, gl_lights_checkside); EXTERN_CVAR (Bool, gl_lights_checkside);
EXTERN_CVAR (Float, gl_lights_intensity); EXTERN_CVAR (Float, gl_lights_intensity);
EXTERN_CVAR (Float, gl_lights_size); EXTERN_CVAR (Float, gl_lights_size);
EXTERN_CVAR (Bool, gl_lights_additive);
EXTERN_CVAR (Bool, gl_light_sprites); EXTERN_CVAR (Bool, gl_light_sprites);
EXTERN_CVAR (Bool, gl_light_particles); EXTERN_CVAR (Bool, gl_light_particles);

View file

@ -198,7 +198,6 @@ OptionMenu "GLLightOptions"
Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo" Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo"
Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo" Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo"
Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo" Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo"
Option "$GLLIGHTMNU_FORCEADDITIVE", gl_lights_additive, "YesNo"
Slider "$GLLIGHTMNU_LIGHTINTENSITY", gl_lights_intensity, 0.0, 1.0, 0.1 Slider "$GLLIGHTMNU_LIGHTINTENSITY", gl_lights_intensity, 0.0, 1.0, 0.1
Slider "$GLLIGHTMNU_LIGHTSIZE", gl_lights_size, 0.0, 2.0, 0.1 Slider "$GLLIGHTMNU_LIGHTSIZE", gl_lights_size, 0.0, 2.0, 0.1
} }