diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 46ce25e..814d189 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -308,13 +308,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #ifdef Vanilla_like_water if (iswater > 0.95){ - // gl_FragData[0].a = luma(Albedo.rgb); - Albedo = color.rgb * sqrt(luma(Albedo.rgb)); + Albedo *= sqrt(luma(Albedo)); + // Albedo = toLinear( gl_FragData[0].rgb * sqrt(luma(gl_FragData[0].rgb))); } #else if (iswater > 0.95){ Albedo = vec3(0.0); - gl_FragData[0] = vec4(vec3(0.0),1.0/255.0); + gl_FragData[0].a = 1.0/255.0; } #endif @@ -454,6 +454,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) // 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); + + #endif #ifdef NETHER_SHADER @@ -475,6 +477,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #endif Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy); + // Albedo = Albedo * exp2( (clamp(-dot(normal, normalize(viewPos)),0.0,1.0)) * -10.0);//pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0); vec3 FinalColor = (Indirect_lighting + Direct_lighting) * Albedo; @@ -496,7 +499,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float roughness = max(pow(1.0-SpecularTex.r,2.0),0.05); float f0 = SpecularTex.g; - + + roughness = 0.0; + // f0 = 0.9; + if (iswater > 0.0 && gl_FragData[0].a < 0.9999999){ vec3 Reflections_Final = vec3(0.0); vec4 Reflections = vec4(0.0); @@ -509,8 +515,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float normalDotEye = dot(normal, normalize(viewPos)); float fresnel = pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0); - - // float fresnel = exp(clamp(0.0 - dot(normal, normalize(viewPos)), 0.0, 1.0) * -5); // snells window looking thing if(isEyeInWater == 1 ) fresnel = pow(clamp(1.66 + normalDotEye,0.0,1.0), 25.0); diff --git a/shaders/dimensions/composite11.fsh b/shaders/dimensions/composite11.fsh index 18c4927..2f8f233 100644 --- a/shaders/dimensions/composite11.fsh +++ b/shaders/dimensions/composite11.fsh @@ -100,9 +100,9 @@ void main() { - // vec3 bloom = (texture2D(colortex3,texcoord/clampedRes*vec2(1920.,1080.)*0.5*BLOOM_QUALITY).rgb)/2./7.0; + vec3 bloom = (texture2D(colortex3,texcoord/clampedRes*vec2(1920.,1080.)*BLOOM_QUALITY).rgb)/2./7.0; - vec3 bloom = texture2D(colortex3, texcoord/clampedRes*vec2(1920.,1080.)*BLOOM_QUALITY).rgb / 2.0 / 7.0; + // vec3 bloom = texture2D(colortex3, texcoord/clampedRes*vec2(1920.,1080.)*BLOOM_QUALITY).rgb / 2.0 / 7.0; float lightScat = clamp(BLOOM_STRENGTH * 0.05 * pow(exposure.a, 0.2) ,0.0,1.0)*vignette; diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index cc28909..013e7be 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -98,7 +98,8 @@ vec4 BilateralUpscale(sampler2D tex, sampler2D depth,vec2 coord,float frDepth){ ivec2 posD = ivec2(coord*VL_RENDER_RESOLUTION)*scaling; ivec2 posVl = ivec2(coord*VL_RENDER_RESOLUTION); float dz = zMults.x; - ivec2 pos = (ivec2(gl_FragCoord.xy+frameCounter) % 2 )*2; + ivec2 pos = (ivec2(gl_FragCoord.xy) % 2 )*2; + //pos = ivec2(1,-1); ivec2 tcDepth = posD + ivec2(-2,-2) * scaling + pos * scaling; float dsample = ld(texelFetch2D(depth,tcDepth,0).r); @@ -194,12 +195,12 @@ void main() { // vec4 vl = texture2D(colortex0,texcoord * 0.5); ////// --------------- UNPACK OPAQUE GBUFFERS --------------- ////// - vec4 data_opaque = texture2D(colortex1,texcoord); - vec4 dataUnpacked1 = vec4(decodeVec2(data_opaque.z),decodeVec2(data_opaque.w)); // normals, lightmaps + // vec4 data_opaque = texture2D(colortex1,texcoord); + // vec4 dataUnpacked1 = vec4(decodeVec2(data_opaque.z),decodeVec2(data_opaque.w)); // normals, lightmaps // vec4 dataUnpacked2 = vec4(decodeVec2(data.z),decodeVec2(data.w)); - bool hand = abs(dataUnpacked1.w-0.75) < 0.01; - vec2 lightmap = dataUnpacked1.yz; + // bool hand = abs(dataUnpacked1.w-0.75) < 0.01; + // vec2 lightmap = dataUnpacked1.yz; ////// --------------- UNPACK TRANSLUCENT GBUFFERS --------------- ////// @@ -306,7 +307,7 @@ void main() { fogfade *= 1.0 - clamp( length(fragpos) / far,0.0,1.0); color.rgb *= fogfade ; - bloomyFogMult *= 0.0; + bloomyFogMult *= 0.3; } // apply VL fog to the scene diff --git a/shaders/dimensions/composite6.fsh b/shaders/dimensions/composite6.fsh index 930ce07..5f3f142 100644 --- a/shaders/dimensions/composite6.fsh +++ b/shaders/dimensions/composite6.fsh @@ -1,18 +1,13 @@ -uniform sampler2D depthtex1; +#include "/lib/settings.glsl" +#include "/lib/res_params.glsl" + +uniform sampler2D depthtex0; uniform sampler2D colortex1; uniform sampler2D colortex5; uniform vec2 texelSize; uniform float viewWidth; uniform float viewHeight; -vec3 decode (vec2 encn){ - vec3 n = vec3(0.0); - encn = encn * 2.0 - 1.0; - n.xy = abs(encn); - n.z = 1.0 - n.x - n.y; - n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn; - return clamp(normalize(n.xyz),-1.0,1.0); -} vec2 decodeVec2(float a){ const vec2 constant1 = 65535. / vec2( 256., 65536.); const float constant2 = 256. / 255.; @@ -30,12 +25,11 @@ void main() { /* DRAWBUFFERS:3 */ vec2 resScale = max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/vec2(1920.,1080.); -vec2 quarterResTC = gl_FragCoord.xy*2.*resScale*texelSize; +vec2 quarterResTC = gl_FragCoord.xy*2.0*resScale*texelSize; -vec4 data = texture2D(colortex1,quarterResTC); -vec4 dataUnpacked1 = vec4(decodeVec2(data.z),decodeVec2(data.w)); -float depth = texture2D(depthtex1,quarterResTC).x; -bool hand = abs(dataUnpacked1.w-0.75) < 0.01 && depth < 1.0; +vec2 texcoord = (gl_FragCoord.xy*2.0*texelSize) * RENDER_SCALE; + +bool hand = abs(decodeVec2(texture2D(colortex1,texcoord).w).y-0.75) < 0.01 && texture2D(depthtex0,texcoord).x < 1.0; //0.5 gl_FragData[0] = texture2D(colortex5,quarterResTC-1.0*vec2(texelSize.x,texelSize.y))/4.*0.5; @@ -61,5 +55,4 @@ bool hand = abs(dataUnpacked1.w-0.75) < 0.01 && depth < 1.0; gl_FragData[0].rgb = clamp(gl_FragData[0].rgb,0.0,65000.); if (hand || quarterResTC.x > 1.0 - 3.5*texelSize.x || quarterResTC.y > 1.0 -3.5*texelSize.y || quarterResTC.x < 3.5*texelSize.x || quarterResTC.y < 3.5*texelSize.y) gl_FragData[0].rgb = vec3(0.0); - } diff --git a/shaders/lib/res_params.glsl b/shaders/lib/res_params.glsl index 74d4c4b..c65e0b0 100644 --- a/shaders/lib/res_params.glsl +++ b/shaders/lib/res_params.glsl @@ -2,8 +2,6 @@ #undef TAA_UPSCALING #endif - - #ifdef TAA_UPSCALING #define SCALE_FACTOR 0.75 // render resolution multiplier. below 0.5 not recommended [0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95] diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 07963e2..0c9dd10 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -209,6 +209,7 @@ void DoSpecularReflections( vec3 L = Basis * Ln; float Fresnel = pow(clamp(1.0 + dot(-Ln, SamplePoints),0.0,1.0), 5.0); // Schlick's approximation + float RayContribution = lerp(F0, 1.0, Fresnel); // ensure that when the angle is 0 that the correct F0 is used. #ifdef Rough_reflections diff --git a/shaders/lib/waterBump.glsl b/shaders/lib/waterBump.glsl index df3bac0..d55b913 100644 --- a/shaders/lib/waterBump.glsl +++ b/shaders/lib/waterBump.glsl @@ -1,7 +1,5 @@ - - float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { // water waves - vec2 movement = vec2(frameTimeCounter*0.05); + vec2 movement = vec2(frameTimeCounter*0.05);// *0; vec2 pos = posxz ; float caustic = 1.0; float weightSum = 0.0;