Add option to use the old style of light leak fixing using the lightmap

This commit is contained in:
Xonk 2023-07-16 22:15:41 -04:00
parent 63bb1d3ad4
commit 8489bad7bc
3 changed files with 10 additions and 4 deletions

View File

@ -852,7 +852,11 @@ void main() {
DirectLightColor = vec3(0.0);
#endif
if(hand) DirectLightColor *= max(eyeBrightnessSmooth.y,0)/240.;
#ifdef OLD_LIGHTLEAK_FIX
DirectLightColor *= pow(clamp(eyeBrightnessSmooth.y/240. + lightmap.y,0.0,1.0),2.0);
#else
if(hand) DirectLightColor *= pow(clamp(eyeBrightnessSmooth.y/240. + lightmap.y,0.0,1.0),2.0);
#endif
vec3 AmbientLightColor = averageSkyCol_Clouds;

View File

@ -437,3 +437,5 @@ uniform int moonPhase;
#define Lightning_R 0.3 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 ]
#define Lightning_G 0.6 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 ]
#define Lightning_B 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 ]
// #define OLD_LIGHTLEAK_FIX

View File

@ -65,7 +65,7 @@ PhysicsMod_support [LabPBR]
######## LIGHTING
### DIRECT LIGHT
screen.Direct_Light.columns=1
screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] sunPathRotation sun_illuminance moon_illuminance
screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] sunPathRotation sun_illuminance moon_illuminance OLD_LIGHTLEAK_FIX
screen.Shadows.columns=1
screen.Shadows = SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS <empty> [Filtering] shadowMapResolution shadowDistance shadowDistanceRenderMul