Skip to content

Commit ced7066

Browse files
committed
Fix wrong default light grid (when BSP lacks one)
The direction vector encoding was wrong.
1 parent ddb05be commit ced7066

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/engine/renderer/tr_bsp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,9 +3443,9 @@ static void R_SetConstantColorLightGrid( const byte color[3] )
34433443
gridPoint1->color[ 1 ] = color[1];
34443444
gridPoint1->color[ 2 ] = color[2];
34453445
gridPoint1->ambientPart = 128;
3446-
gridPoint2->direction[ 0 ] = floatToSnorm8(0.0f);
3447-
gridPoint2->direction[ 1 ] = floatToSnorm8(0.0f);
3448-
gridPoint2->direction[ 2 ] = floatToSnorm8(1.0f);
3446+
gridPoint2->direction[ 0 ] = 128 + floatToSnorm8( 0.0f );
3447+
gridPoint2->direction[ 1 ] = 128 + floatToSnorm8( 0.0f );
3448+
gridPoint2->direction[ 2 ] = 128 + floatToSnorm8( 1.0f );
34493449
gridPoint2->isSet = 255;
34503450

34513451
w->lightGridData1 = gridPoint1;

0 commit comments

Comments
 (0)