Skip to content

Commit

Permalink
brightmaps: make brightmapping independent of sector light level
Browse files Browse the repository at this point in the history
In my previous implementation, I had the brightmapping of a texture
depend on the light level of the texture's line's front sector. This
looked quite realistic, as highlights were never fully brightmapped for
textures in very dark sectors, but on the other hand the brightmapping
would also oscillate for sectors with variable light levels and even
extinguish (!) when sectors go full dark. This was unacceptable. Now,
texture highlights are always brightmapped with full intensity.

With this change I consider my brightmaps implementation complete! \o/

What an unexpectedly athmospheric feature that I won't want to miss
anymore, thanks to all involved (especially @Nechaevsky for your
impressive support!). Fixes chocolate-doom#246.
  • Loading branch information
fabiangreffrath committed Dec 29, 2017
1 parent 49c13b6 commit bbc81eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/doom/r_segs.c
Expand Up @@ -265,7 +265,7 @@ R_RenderMaskedSegRange

// [crispy] optional brightmaps
dc_colormap[0] = walllights[index];
dc_colormap[1] = (crispy->brightmaps & BRIGHTMAPS_TEXTURES) ? walllights[MAXLIGHTSCALE-1] : dc_colormap[0];
dc_colormap[1] = (crispy->brightmaps & BRIGHTMAPS_TEXTURES) ? scalelight[LIGHTLEVELS-1][MAXLIGHTSCALE-1] : dc_colormap[0];
dc_brightmap = texturebrightmap[texnum];
}

Expand Down Expand Up @@ -391,7 +391,7 @@ void R_RenderSegLoop (void)

// [crispy] optional brightmaps
dc_colormap[0] = walllights[index];
dc_colormap[1] = (crispy->brightmaps & BRIGHTMAPS_TEXTURES) ? walllights[MAXLIGHTSCALE-1] : dc_colormap[0];
dc_colormap[1] = (crispy->brightmaps & BRIGHTMAPS_TEXTURES) ? scalelight[LIGHTLEVELS-1][MAXLIGHTSCALE-1] : dc_colormap[0];
dc_x = rw_x;
dc_iscale = 0xffffffffu / (unsigned)rw_scale;
}
Expand Down
2 changes: 1 addition & 1 deletion src/doom/r_things.c
Expand Up @@ -730,7 +730,7 @@ void R_ProjectSprite (mobj_t* thing)

// [crispy] brightmaps for select sprites
vis->colormap[0] = spritelights[index];
vis->colormap[1] = spritelights[MAXLIGHTSCALE-1];
vis->colormap[1] = scalelight[LIGHTLEVELS-1][MAXLIGHTSCALE-1];
}
vis->brightmap = R_BrightmapForThingType(thing->type);

Expand Down

0 comments on commit bbc81eb

Please sign in to comment.