fix VL_RENDER_RESOLUTION not working correct. add back OLD_LIGHTLEAK_FIX setting.

This commit is contained in:
Xonk 2023-10-08 15:33:05 -04:00
parent feeaec78ae
commit 447419a57c
3 changed files with 11 additions and 4 deletions

View File

@ -793,13 +793,16 @@ void main() {
inShadowmapBounds = true;
}
float lightmapAsShadows = 1.0 ;
float lightmapAsShadows = 1.0;
if(!inShadowmapBounds && !iswater){
lightmapAsShadows = min(max(lightmap.y-0.8, 0.0) * 25,1.0);
Shadows = lightmapAsShadows;
}
// if(!inShadowmapBounds) Shadows = 1.0;
#ifdef OLD_LIGHTLEAK_FIX
if (isEyeInWater == 0) Shadows *= clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); // light leak fix
#endif
@ -842,6 +845,7 @@ void main() {
}
if (isEyeInWater == 0) Direct_SSS *= clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); // light leak fix
if (!inShadowmapBounds) Direct_SSS *= lightmapAsShadows;
#endif

View File

@ -223,6 +223,7 @@ void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estE
void main() {
/* DRAWBUFFERS:0 */
// vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize+0.5*texelSize;
vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize+0.5*texelSize;
float z = texture2D(depthtex0,tc).x;
vec3 viewPos = toScreenSpace(vec3(tc/RENDER_SCALE,z));

View File

@ -1,5 +1,6 @@
#include "/lib/settings.glsl"
#include "/lib/util.glsl"
#include "/lib/res_params.glsl"
flat varying vec4 lightCol;
flat varying vec3 averageSkyCol;
@ -29,7 +30,8 @@ uniform int frameCounter;
void main() {
gl_Position = ftransform();
gl_Position.xy = (gl_Position.xy*0.5+0.5)*0.51*2.0-1.0;
// gl_Position.xy = (gl_Position.xy*0.5+0.5)*0.51*2.0-1.0;
gl_Position.xy = (gl_Position.xy*0.5+0.5)*(0.01+VL_RENDER_RESOLUTION)*2.0-1.0;
tempOffsets = HaltonSeq2(frameCounter%10000);