[client] Reverse the direction of sunlight

Maps specify sunlight as shining in a specific direction, but the
lighting system wants the direction to the sun as it's used directly in
shading calculations. Direction correctness confirmed by disabling other
lights and checking marcher's outside scene (ensuring the flat ground
was lit). As a bonus, I've finally confirmed I actually have the skybox
in the correct orientation (sunlight vector more or less matched the
position of the sun in marcher's sky).
This commit is contained in:
Bill Currie 2022-05-05 19:58:37 +09:00
parent d60602421b
commit b2928b5ed7

View file

@ -120,7 +120,7 @@ parse_sun (lightingdata_t *ldata, plitem_t *entity)
} }
VectorSet (1, 1, 1, light.color); VectorSet (1, 1, 1, light.color);
light.color[3] = sunlight; light.color[3] = sunlight;
light.position = sun_vector (sunangle); light.position = -sun_vector (sunangle);
light.direction = light.position; light.direction = light.position;
light.direction[3] = 1; light.direction[3] = 1;
light.attenuation = (vec4f_t) { 0, 0, 1, 0 }; light.attenuation = (vec4f_t) { 0, 0, 1, 0 };