From ff9495fcf79c59c761967e40611800c9c67ec327 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sun, 2 May 2021 18:21:07 +0100 Subject: [PATCH] Try to improve hl2bsp light intensities to better match hl2. favour ldr lightmap textures, as we overbright too much otherwise. --- engine/client/r_surf.c | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index afaad34f..1f8888bf 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -1596,6 +1596,17 @@ static void Surf_BuildLightMap (model_t *model, msurface_t *surf, int map, int s if (surf->dlightframe == r_dlightframecount) Surf_AddDynamicLights_RGB (surf); +#ifdef HL2BSPS + if (model->fromgame == fg_halflife2) + for (i=0 ; ifromgame == fg_halflife2) + for (i=0 ; iwidth); } } @@ -1931,6 +1952,17 @@ static void Surf_BuildLightMap_Worker (model_t *wmodel, msurface_t *surf, int sh if (!r_stains.value || !surf->stained) stainsrc = NULL; +#ifdef HL2BSPS + if (wmodel->fromgame == fg_halflife2) + for (i=0 ; ifromgame == fg_halflife2) + for (i=0 ; iwidth); } @@ -4314,6 +4356,9 @@ uploadfmt_t Surf_LightmapMode(model_t *model) { #ifdef HL2BSPS case LM_E8BGR8: + //hdr SHOULD be true, but that doesn't match hl2, and there's a few areas with lightmaps that are set FAR too bright. + rgb = true; + break; #endif case LM_E5BGR9: hdr = rgb = true;