Skip to content

Commit 2cef7e4

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 e0facd7 commit 2cef7e4

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
@@ -84,7 +84,7 @@ void computeDeluxeLight( vec3 lightDir, vec3 normal, vec3 viewDir, vec3 lightCol
8484
// clamp( NdotL, 0.0, 1.0 ) is done below
8585
float NdotL = dot( normal, lightDir );
8686

87-
#if !defined(USE_BSP_SURFACE) && defined(r_halfLambertLighting)
87+
#if defined(USE_GRID_LIGHTING) && defined(r_halfLambertLighting)
8888
// http://developer.valvesoftware.com/wiki/Half_Lambert
8989
NdotL = NdotL * 0.5 + 0.5;
9090
NdotL *= NdotL;

0 commit comments

Comments
 (0)