From d47eb2776f6a8de0d5da3b60e491a8127d0cb190 Mon Sep 17 00:00:00 2001 From: Xonk Date: Mon, 23 Oct 2023 17:41:30 -0400 Subject: [PATCH] make hand no longer interfere with DOF autofocus. fix small lighting error for overworld translucents --- shaders/dimensions/all_translucent.fsh | 1 + shaders/dimensions/composite1.fsh | 5 +++-- shaders/dimensions/deferred.vsh | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 3745003..bc2ef52 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -445,6 +445,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float SkylightDir = ambientcoefs.y*1.5; float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + SkylightDir, 0.25); + AmbientLightColor *= skylight; // float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + viewToWorld(normal).y, 0.25) * 1.35; // Indirect_lighting = DoAmbientLighting(averageSkyCol_Clouds, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy, skylight); diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 96f9727..090e485 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -39,8 +39,9 @@ const bool colortex5MipmapEnabled = true; uniform sampler2D noisetex; //noise -uniform sampler2D depthtex1; //depth uniform sampler2D depthtex0; //depth +uniform sampler2D depthtex1; //depth +uniform sampler2D depthtex2; //depth uniform sampler2D colortex0; //clouds uniform sampler2D colortex1; //albedo(rgb),material(alpha) RGBA16 @@ -1017,7 +1018,7 @@ void main() { } #endif - // gl_FragData[0].rgb = vec3(1); + // gl_FragData[0].rgb = vec3(1) ; /* DRAWBUFFERS:3 */ diff --git a/shaders/dimensions/deferred.vsh b/shaders/dimensions/deferred.vsh index 1bb7d5b..6e7c729 100644 --- a/shaders/dimensions/deferred.vsh +++ b/shaders/dimensions/deferred.vsh @@ -25,6 +25,8 @@ flat varying float centerDepth; uniform sampler2D colortex4; uniform sampler2D colortex6; uniform sampler2D depthtex0; +uniform sampler2D depthtex1; +uniform sampler2D depthtex2; uniform mat4 gbufferModelViewInverse; uniform vec3 sunPosition; @@ -177,7 +179,7 @@ void main() { exposure = max(targetExposure*EXPOSURE_MULTIPLIER, 0); - float currCenterDepth = ld(texture2D(depthtex0, vec2(0.5)).r); + float currCenterDepth = ld(texture2D(depthtex2, vec2(0.5)).r); centerDepth = mix(sqrt(texelFetch2D(colortex4,ivec2(14,37),0).g/65000.0), currCenterDepth, clamp(DoF_Adaptation_Speed*exp(-0.016/frameTime+1.0)/(6.0+currCenterDepth*far),0.0,1.0)); centerDepth = centerDepth * centerDepth * 65000.0;