Add cloud movement type option, fix fog upsample

fix fire snow overlay and replace DH chunk fade bayer dither with R2 dither
This commit is contained in:
Merlin1809
2025-07-08 15:04:49 +02:00
parent a612026d85
commit 53061a5c91
12 changed files with 47 additions and 22 deletions
+2 -2
View File
@@ -1,5 +1,4 @@
#include "/lib/settings.glsl"
#include "/lib/bayer_matrix.glsl"
varying vec4 pos;
@@ -81,6 +80,7 @@ float interleaved_gradientNoise(){
}
float R2_dither(){
vec2 coord = gl_FragCoord.xy + (frameCounter%40000) * 2.0;
vec2 alpha = vec2(0.75487765, 0.56984026);
return fract(alpha.x * coord.x + alpha.y * coord.y ) ;
}
@@ -229,6 +229,6 @@ void main() {
float viewDist = length(localPos.xyz);
float ditherFade = smoothstep(max(far-7,7), far-1, viewDist);
if (step(bayerDither()/ditherFade, ditherFade) == 0.0) discard;
if (step(R2_dither()/ditherFade, ditherFade) == 0.0) discard;
#endif
}
+1 -2
View File
@@ -3,7 +3,6 @@
#include "/lib/res_params.glsl"
#include "/lib/color_transforms.glsl"
#include "/lib/projections.glsl"
#include "/lib/bayer_matrix.glsl"
#ifdef OVERWORLD_SHADER
#define WATER_SUN_SPECULAR
@@ -458,7 +457,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
float viewDist = length(playerPos);
float ditherFade = smoothstep(max(far-9,9), far-1, viewDist);
if (step(bayerDither()/ditherFade, ditherFade) == 0.0) discard;
if (step(R2_dither()/ditherFade, ditherFade) == 0.0) discard;
}
#endif
}
+18 -3
View File
@@ -1,5 +1,4 @@
#include "/lib/settings.glsl"
#include "/lib/bayer_matrix.glsl"
// #if defined END_SHADER || defined NETHER_SHADER
// #undef IS_LPV_ENABLED
@@ -85,11 +84,13 @@ uniform vec3 previousCameraPosition;
#include "/lib/volumetricClouds.glsl"
#endif
#if defined IS_LPV_ENABLED || (defined DISTANT_HORIZONS && defined DH_CHUNK_FADING)
uniform int frameCounter;
#endif
#ifdef IS_LPV_ENABLED
uniform int heldItemId;
uniform int heldItemId2;
uniform int frameCounter;
#include "/lib/hsv.glsl"
#include "/lib/lpv_common.glsl"
@@ -262,6 +263,20 @@ float luma(vec3 color) {
}
uniform vec3 eyePosition;
#if defined DISTANT_HORIZONS && defined DH_CHUNK_FADING
float R2_dither(){
vec2 coord = gl_FragCoord.xy ;
#ifdef TAA
coord += + (frameCounter%40000) * 2.0;
#endif
vec2 alpha = vec2(0.75487765, 0.56984026);
return fract(alpha.x * coord.x + alpha.y * coord.y ) ;
}
#endif
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@@ -506,7 +521,7 @@ void main() {
#if defined DISTANT_HORIZONS && defined DH_CHUNK_FADING
float ditherFade = smoothstep(0.98*far, 1.0*far, viewDist);
if (step(ditherFade, bayerDither()) == 0.0) discard;
if (step(ditherFade, R2_dither()) == 0.0) discard;
#endif
#endif
+1 -2
View File
@@ -4,7 +4,6 @@
#include "/lib/blocks.glsl"
#include "/lib/entities.glsl"
#include "/lib/items.glsl"
#include "/lib/bayer_matrix.glsl"
#include "/lib/hsv.glsl"
flat varying int NameTags;
@@ -461,7 +460,7 @@ void main() {
float viewDist = length(playerpos);
float ditherFade = smoothstep(0.98 * far, 1.03 * far, viewDist);
if(step(ditherFade, bayerDither()) == 0.0) discard;
if(step(ditherFade, R2_dither()) == 0.0) discard;
#endif
#if defined HAND
+5 -1
View File
@@ -315,7 +315,11 @@ void main() {
if(mc_Entity.x == 103) EMISSIVE = 1.0; // amethyst cluster
if(mc_Entity.x == 244) EMISSIVE = 0.7; // soul fire
if(mc_Entity.x == 244) EMISSIVE = 1.5; // soul fire
#if defined Puddles || ShaderSnow > 0
if (mc_Entity.x == 244 || mc_Entity.x == 189) lmtexcoord.w = 0.0;
#endif
#ifdef EMISSIVE_ORES
if(mc_Entity.x == 502) EMISSIVE = EMISSIVE_ORES_STRENGTH;
+1 -2
View File
@@ -1,5 +1,4 @@
#include "/lib/settings.glsl"
#include "/lib/bayer_matrix.glsl"
#undef FLASHLIGHT_BOUNCED_INDIRECT
@@ -478,7 +477,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
#if defined DISTANT_HORIZONS && defined DH_CHUNK_FADING
float ditherFade = smoothstep(0.98 * far, 1.03 * far, viewDist);
if (step(ditherFade, bayerDither()) == 0.0) discard;
if (step(ditherFade, R2_dither()) == 0.0) discard;
#endif
#if defined LIGHTNING
+4 -4
View File
@@ -800,7 +800,7 @@ uniform float wetness;
float viewDist = length(worldPos - cameraPosition);
vec3 rippleNormal = flatNormals;
if(viewDist < 35 && rainStrength > 0.0 && biome_precipitation == 1) {
if(viewDist < 35 && rainStrength > 0.0 && biome_precipitation == 1 && snowAmount < 0.01) {
vec3 ripple = ripples(1.2 * worldPos.xz);
ripple = ripple.xzy;
@@ -828,18 +828,18 @@ uniform float wetness;
vec3 snowA = pow(texture2D(snowTexA, snowCoords).rgb, vec3(2.0/(ShaderSnowStrength-0.1)));
vec3 snowN = 2*texture2D(snowTexN, snowCoords).rgb - 1;
snowN = vec3(snowN.x, snowN.z, snowN.y);
snowN = snowN.xzy;
float omSA = 1-snowAmount;
float textureMult = smoothstep(0.1+0.5*omSA, 0.5+0.9*omSA, length(snowA)*snow*snowAmount);
normals = mix(normals, normalize(snowN), textureMult);
roughness = mix(roughness, 0.8*snowR, sqrt(textureMult));
roughness = mix(roughness, snowR, sqrt(textureMult));
albedo = mix(albedo, 2.5*snowA, textureMult);
// let it melt
roughness = mix(roughness, 0.5*snowR, smoothstep(0.15, 0.7, snowAmount)*smoothstep(1.0, 0.8, snowAmount)*effectStrength);
roughness = mix(roughness, 0.75*snowR, smoothstep(0.15, 0.7, snowAmount)*smoothstep(1.0, 0.8, snowAmount)*effectStrength);
}
#endif
}
+3 -3
View File
@@ -360,7 +360,7 @@ vec4 bilateralUpsample(out float outerEdgeResults, float referenceDepth, sampler
vec4 colorSum = vec4(0.0);
float edgeSum = 0.0;
float threshold = 1.0;
float threshold = 0.0000005;
vec2 coord = gl_FragCoord.xy - 1.5;
@@ -371,10 +371,10 @@ vec4 bilateralUpsample(out float outerEdgeResults, float referenceDepth, sampler
ivec2 UV_NOISE = ivec2(gl_FragCoord.xy*texelSize + 1);
ivec2 OFFSET[5] = ivec2[](
ivec2(-1,-1),
ivec2(-2,-2),
ivec2( 1, 1),
ivec2(-1, 1),
ivec2( 1,-1),
ivec2( 2,-2),
ivec2( 0, 0)
);
+3
View File
@@ -236,6 +236,9 @@ screen.Clouds = Cloud Settings
option.CLOUDS_QUALITY = Cloud Resolution Scaling
option.CLOUDS_SHADOWS = Cloud Shadows
option.CLOUD_SHADOW_STRENGTH = Cloud Shadow Strength
option.CLOUD_MOVEMENT_TYPE = Cloud Movement
value.CLOUD_MOVEMENT_TYPE.0 = World Time based
value.CLOUD_MOVEMENT_TYPE.1 = Real Time based
option.Cloud_Speed = Cloud Speed Multiplier
option.Rain_coverage = Extra Rain Coverage
option.Thunder_coverage = Extra Thunder Coverage
+1
View File
@@ -359,6 +359,7 @@ uniform int moonPhase;
#define VOLUMETRIC_CLOUDS
#define CLOUDS_QUALITY 0.5 // [0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
#define CLOUD_MOVEMENT_TYPE 0 // [0 1]
#define Cloud_Speed 2.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 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
#ifdef VOLUMETRIC_CLOUDS
+6 -1
View File
@@ -8,7 +8,12 @@ uniform float thunderStrength;
uniform int entityId;
uniform int worldDay;
uniform int worldTime;
float cloud_movement = (worldTime + mod(worldDay,100)*24000.0) / 24.0 * Cloud_Speed;
#if CLOUD_MOVEMENT_TYPE == 0
float cloud_movement = (worldTime + mod(worldDay,100)*24000.0) / 24.0 * Cloud_Speed;
#else
float cloud_movement = frameTimeCounter * Cloud_Speed;
#endif
float lightningFlashTimer = floor(frameTimeCounter * 11.0);
float randomSeed = fract(sin(dot(vec2(lightningFlashTimer), vec2(12.9898,78.233))) * 43758.5453);
File diff suppressed because one or more lines are too long