diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 40b6a5881..9fd5d15fb 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -447,7 +447,7 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside) // FF_FOG requires an inverted logic where to get the light from lightlist_t *light = P_GetPlaneLight(sector, plane.plane, underside); - lightlevel = *light->p_lightlevel; + lightlevel = gl_ClampLight(*light->p_lightlevel); if (rover->flags & FF_FOG) Colormap.LightColor = (light->extra_colormap)->Fade; else Colormap.CopyFrom3DLight(light); @@ -544,7 +544,7 @@ void GLFlat::ProcessSector(sector_t * frontsector) if ((!(sector->GetFlags(sector_t::floor)&PLANEF_ABSLIGHTING) || light->lightsource == NULL) && (light->p_lightlevel != &frontsector->lightlevel)) { - lightlevel = *light->p_lightlevel; + lightlevel = gl_ClampLight(*light->p_lightlevel); } Colormap.CopyFrom3DLight(light); @@ -607,7 +607,7 @@ void GLFlat::ProcessSector(sector_t * frontsector) if ((!(sector->GetFlags(sector_t::ceiling)&PLANEF_ABSLIGHTING)) && (light->p_lightlevel != &frontsector->lightlevel)) { - lightlevel = *light->p_lightlevel; + lightlevel = gl_ClampLight(*light->p_lightlevel); } Colormap.CopyFrom3DLight(light); } diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 4414e3874..630229ff6 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -866,11 +866,15 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s if (lightbottom < particle->Pos.Z) { - lightlevel = *lightlist[i].p_lightlevel; + lightlevel = gl_ClampLight(*lightlist[i].p_lightlevel); Colormap.LightColor = (lightlist[i].extra_colormap)->Color; break; } } + if (glset.nocoloredspritelighting) + { + Colormap.Decolorize(); // ZDoom never applies colored light to particles. + } } else { @@ -884,6 +888,7 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s OverrideShader = 0; ThingColor = particle->color; + ThingColor.g = 255; ThingColor.a = 255; modelframe=NULL; @@ -939,6 +944,7 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s actor=NULL; this->particle=particle; + fullbright = !!particle->bright; // [BB] Translucent particles have to be rendered without the alpha test. if (gl_particles_style != 2 && trans>=1.0f-FLT_EPSILON) hw_styleflags = STYLEHW_Solid; diff --git a/src/gl/scene/gl_wall.h b/src/gl/scene/gl_wall.h index 10df57c63..f6dde1531 100644 --- a/src/gl/scene/gl_wall.h +++ b/src/gl/scene/gl_wall.h @@ -314,7 +314,7 @@ public: friend struct GLDrawList; friend void Mod_RenderModel(GLSprite * spr, model_t * mdl, int framenumber); - BYTE lightlevel; + int lightlevel; BYTE foglevel; BYTE hw_styleflags; bool fullbright; diff --git a/src/gl/scene/gl_weapon.cpp b/src/gl/scene/gl_weapon.cpp index e086007f5..9c179e148 100644 --- a/src/gl/scene/gl_weapon.cpp +++ b/src/gl/scene/gl_weapon.cpp @@ -272,7 +272,7 @@ void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep) if (lightbottomviewz) { cm = lightlist[i].extra_colormap; - lightlevel = *lightlist[i].p_lightlevel; + lightlevel = gl_ClampLight(*lightlist[i].p_lightlevel); break; } }