Skip to content

Commit fae3190

Browse files
committed
Use half-Lambert lighting iff grid lighting is used
Half-Lambert lighting makes goes well with the light grid: the single light direction is a crude approximation, so it makes sense to soften the directionality. For now this only changes anything for the `r_lightMode 2` debug option, but it may be useful for implementing grid lighting for BSP entities later.
1 parent 2bb6e7b commit fae3190

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/engine/renderer/glsl_source/computeLight_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void computeDeluxeLight( vec3 lightDir, vec3 normal, vec3 viewDir, vec3 lightCol
9090
// clamp( NdotL, 0.0, 1.0 ) is done below
9191
float NdotL = dot( normal, lightDir );
9292

93-
#if !defined(USE_BSP_SURFACE) && defined(r_halfLambertLighting)
93+
#if defined(USE_GRID_LIGHTING) && defined(r_halfLambertLighting)
9494
// http://developer.valvesoftware.com/wiki/Half_Lambert
9595
NdotL = NdotL * 0.5 + 0.5;
9696
NdotL *= NdotL;

0 commit comments

Comments
 (0)