From e1a5d822987f1c0cad8622b909b56a67a436e83c Mon Sep 17 00:00:00 2001 From: Xonk Date: Sat, 2 Mar 2024 14:58:27 -0500 Subject: [PATCH] possible mac fix? --- shaders/dimensions/all_solid.vsh | 4 ++-- shaders/dimensions/composite.fsh | 6 ++---- shaders/dimensions/composite1.fsh | 11 +++++------ shaders/dimensions/composite1.vsh | 13 ++++++------- shaders/dimensions/composite3.fsh | 1 - shaders/dimensions/composite3.vsh | 2 -- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index 85ed106..ec87353 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -218,10 +218,10 @@ void main() { #ifdef MC_NORMAL_MAP - tangent = vec4(normalize(gl_NormalMatrix *at_tangent.rgb),at_tangent.w); + tangent = vec4(normalize(gl_NormalMatrix * at_tangent.rgb), at_tangent.w); #endif - normalMat = vec4(normalize(gl_NormalMatrix *gl_Normal), 1.0); + normalMat = vec4(normalize(gl_NormalMatrix * gl_Normal), 1.0); FlatNormals = normalMat.xyz; blockID = mc_Entity.x; diff --git a/shaders/dimensions/composite.fsh b/shaders/dimensions/composite.fsh index 6385ea0..8a853f9 100644 --- a/shaders/dimensions/composite.fsh +++ b/shaders/dimensions/composite.fsh @@ -317,7 +317,8 @@ void main() { // bool blocklights = abs(dataUnpacked1.w-0.8) <0.01; - #ifdef DENOISE_SSS_AND_SSAO + gl_FragData[1] = vec4(0.0,0.0,0.0,texture2D(colortex14,texcoord).a); + #if defined DENOISE_SSS_AND_SSAO && indirect_effect == 1 float depth = z; #ifdef DISTANT_HORIZONS @@ -344,11 +345,8 @@ void main() { if(z >= 1.0){ FlatNormals = worldToView(normal); } - - gl_FragData[1] = vec4(0.0,0.0,0.0,texture2D(colortex14,texcoord).a); gl_FragData[1].xy = SSAO(viewPos, FlatNormals, hand, isLeaf, noise); - #endif #ifdef OVERWORLD_SHADER diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 5bce0e6..40d8ea3 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -43,21 +43,21 @@ uniform int hideGUI; uniform sampler2D noisetex; //noise uniform sampler2D depthtex0; uniform sampler2D depthtex1; -uniform sampler2D depthtex2; - +// uniform sampler2D depthtex2; +#ifdef DISTANT_HORIZONS uniform sampler2D dhDepthTex; uniform sampler2D dhDepthTex1; - +#endif uniform sampler2D colortex0; //clouds uniform sampler2D colortex1; //albedo(rgb),material(alpha) RGBA16 uniform sampler2D colortex2; //translucents(rgba) uniform sampler2D colortex3; //filtered shadowmap(VPS) // uniform sampler2D colortex4; //LUT(rgb), quarter res depth(alpha) -uniform sampler2D colortex5; //TAA buffer/previous frame +// uniform sampler2D colortex5; //TAA buffer/previous frame uniform sampler2D colortex6; //Noise uniform sampler2D colortex7; //water? uniform sampler2D colortex8; //Specular -uniform sampler2D colortex9; //Specular +// uniform sampler2D colortex9; //Specular uniform sampler2D colortex10; uniform sampler2D colortex11; uniform sampler2D colortex12; @@ -88,7 +88,6 @@ uniform float dhFarPlane; uniform float dhNearPlane; flat varying vec3 zMults; -flat varying vec3 zMults_DH; uniform vec2 texelSize; uniform float viewWidth; diff --git a/shaders/dimensions/composite1.vsh b/shaders/dimensions/composite1.vsh index e6593dd..90f8f34 100644 --- a/shaders/dimensions/composite1.vsh +++ b/shaders/dimensions/composite1.vsh @@ -1,7 +1,9 @@ #include "/lib/settings.glsl" #include "/lib/res_params.glsl" -flat varying float Flashing; +#ifdef END_SHADER + flat varying float Flashing; +#endif flat varying vec3 WsunVec; flat varying vec3 averageSkyCol_Clouds; @@ -9,13 +11,10 @@ flat varying vec4 lightCol; flat varying vec2 TAA_Offset; flat varying vec3 zMults; -flat varying vec3 zMults_DH; uniform sampler2D colortex4; // uniform float far; uniform float near; -uniform float dhFarPlane; -uniform float dhNearPlane; uniform mat4 gbufferModelViewInverse; uniform vec3 sunPosition; @@ -41,10 +40,11 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), void main() { gl_Position = ftransform(); - Flashing = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; + #ifdef END_SHADER + Flashing = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; + #endif zMults = vec3(1.0/(far * near),far+near,far-near); - zMults_DH = vec3(1.0/(dhFarPlane * dhNearPlane),dhFarPlane+dhNearPlane,dhFarPlane-dhNearPlane); lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb; lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0; @@ -52,7 +52,6 @@ void main() { averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb; WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) * sunPosition); - // WsunVec = normalize(LightDir); #ifdef TAA diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index 7cc6e63..2011d02 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -1,7 +1,6 @@ #include "/lib/settings.glsl" flat varying vec3 zMults; -flat varying vec3 zMults_DH; flat varying vec2 TAA_Offset; flat varying vec3 skyGroundColor; diff --git a/shaders/dimensions/composite3.vsh b/shaders/dimensions/composite3.vsh index ccf349a..97cd70f 100644 --- a/shaders/dimensions/composite3.vsh +++ b/shaders/dimensions/composite3.vsh @@ -2,7 +2,6 @@ varying vec2 texcoord; flat varying vec3 zMults; -flat varying vec3 zMults_DH; flat varying vec3 WsunVec; uniform float far; @@ -52,7 +51,6 @@ void main() { WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition); zMults = vec3(1.0/(far * near),far+near,far-near); - zMults_DH = vec3(1.0/(dhFarPlane * dhNearPlane),dhFarPlane+dhNearPlane,dhFarPlane-dhNearPlane); gl_Position = ftransform(); texcoord = gl_MultiTexCoord0.xy;