diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index f283ab4..4059a65 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -104,6 +104,12 @@ uniform vec3 nsunColor; uniform float waterEnteredAltitude; +#ifdef WATER_INTERACTION + uniform vec3 waterEnteredPosition; + uniform float waterEnteredTime; + uniform vec3 waterEnteredVelocity; +#endif + #include "/lib/util.glsl" #include "/lib/Shadow_Params.glsl" #include "/lib/color_transforms.glsl" @@ -418,6 +424,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #endif vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos; + vec3 worldPos = feetPlayerPos + cameraPosition; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////// MATERIAL MASKS //////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -458,6 +465,11 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) vec3 Albedo = toLinear(gl_FragData[0].rgb); + vec3 shadowPlayerPos = feetPlayerPos + gbufferModelViewInverse[3].xyz; + #if (defined DISTANT_HORIZONS && DH_CHUNK_FADING > 0) || defined RIPPLE_WATER + float viewDist = length(shadowPlayerPos); + #endif + #ifndef WhiteWorld #ifdef Vanilla_like_water if (isWater) Albedo *= sqrt(luma(Albedo)); @@ -469,11 +481,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #endif #endif - vec3 shadowPlayerPos = feetPlayerPos + gbufferModelViewInverse[3].xyz; - #if (defined DISTANT_HORIZONS && DH_CHUNK_FADING > 0) || defined RIPPLE_WATER - float viewDist = length(shadowPlayerPos); - #endif - #if defined DISTANT_HORIZONS && DH_CHUNK_FADING > 0 float ditherFade = smoothstep(0.98 * far, 1.03 * far, viewDist); @@ -560,16 +567,37 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #ifdef RIPPLE_WATER if(viewDist < 35 && rainStrength > 0.0 && biome_precipitation == 1 && abs(worldSpaceNormal.z) < 0.95 && abs(worldSpaceNormal.x) < 0.95) { float effectStrength = smoothstep(0.85, 1.0, lightmap.y); - rippleBump = ripples(feetPlayerPos.xz+cameraPosition.xz); + rippleBump = ripples(worldPos.xz); waterPos.xyz += RIPPLE_STRENGTH * rippleBump * rainStrength * effectStrength * smoothstep(35, 10, viewDist); } #endif vec3 bump = normalize(getWaveNormal(waterPos, playerPos)); + + float bumpmult = WATER_WAVE_STRENGTH; bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult); + // nice little wave effect when leaving water + #ifdef WATER_INTERACTION + float distFromWaterPos = length(worldPos - waterEnteredPosition); + float maxWaveDist = 3.5; + if (distFromWaterPos < maxWaveDist) { + float newTime = frameTimeCounter - waterEnteredTime; + newTime *= 2.15; + + float smoothDistFromWaterPos = smoothstep(maxWaveDist, 0.0, distFromWaterPos); + float waveWidth = 0.2; + float waveHeight = 0.3 * smoothstep(2.0, 20.0, length(waterEnteredVelocity)) + 0.5; + + float enterWave = waveHeight * smoothstep(newTime - waveWidth, newTime, distFromWaterPos-0.1) * smoothstep(newTime + waveWidth, newTime, distFromWaterPos-0.1) * smoothDistFromWaterPos; + + bump.y = enterWave + (1.0 - enterWave) * bump.y; + bump = normalize(bump); + } + #endif + NormalTex.xyz = bump; } #endif @@ -622,7 +650,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #endif if(HELD_ITEM_BRIGHTNESS > 0.0){ - float pointLight = clamp(1.0-length((feetPlayerPos+cameraPosition)-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0,1.0); + float pointLight = clamp(1.0-length((worldPos)-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0,1.0); lightmap.x = mix(lightmap.x , HELD_ITEM_BRIGHTNESS, pointLight*pointLight); } @@ -647,7 +675,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float waterdepth = max(-(feetPlayerPos.y + distanceFromWaterSurface),0.0); DirectLightColor *= exp(-vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B) * (waterdepth/abs(WsunVec.y))); - DirectLightColor *= pow(waterCaustics(feetPlayerPos + cameraPosition, WsunVec)*WATER_CAUSTICS_BRIGHTNESS, WATER_CAUSTICS_POWER); + DirectLightColor *= pow(waterCaustics(worldPos, WsunVec)*WATER_CAUSTICS_BRIGHTNESS, WATER_CAUSTICS_POWER); } float NdotL = clamp((-15 + dot(normal, normalize(WsunVec*mat3(gbufferModelViewInverse)))*255.0) / 240.0 ,0.0,1.0); @@ -663,7 +691,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) // Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2); Shadows *= mix(LM_shadowMapFallback,1.0,shadowMapFalloff2); - Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec); + Shadows *= GetCloudShadow(worldPos, WsunVec); Direct_lighting = DirectLightColor * NdotL * Shadows; @@ -683,8 +711,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #ifdef END_SHADER - float vortexBounds = clamp(vortexBoundRange - length(feetPlayerPos+cameraPosition), 0.0,1.0); - vec3 lightPos = LightSourcePosition(feetPlayerPos+cameraPosition, cameraPosition,vortexBounds); + float vortexBounds = clamp(vortexBoundRange - length(worldPos), 0.0,1.0); + vec3 lightPos = LightSourcePosition(worldPos, cameraPosition,vortexBounds); float lightningflash = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; vec3 lightColors = LightSourceColors(vortexBounds, lightningflash); @@ -692,7 +720,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float end_NdotL = clamp(dot(worldSpaceNormal, normalize(-lightPos))*0.5+0.5,0.0,1.0); end_NdotL *= end_NdotL; - float fogShadow = GetEndFogShadow(feetPlayerPos+cameraPosition, lightPos); + float fogShadow = GetEndFogShadow(worldPos, lightPos); float endPhase = endFogPhase(lightPos); Direct_lighting += lightColors * endPhase * end_NdotL * fogShadow; diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index 7128357..e3bbda7 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -173,8 +173,6 @@ void main() { #endif position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz; - - gl_Position = toClipSpace3(position); #if !defined ENTITIES && !defined HAND gl_Position = toClipSpace3(position); diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index a5c0dde..f9f3ee8 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -68,7 +68,7 @@ uniform float darknessFactor; uniform float darknessLightFactor; uniform float caveDetection; -#if defined CUMULONIMBUS_LIGHTNING && defined OVERWORLD_SHADER && defined CUMULONIMBUS +#if defined CUMULONIMBUS_LIGHTNING && defined OVERWORLD_SHADER && CUMULONIMBUS > 0 uniform float sunElevation; uniform vec4 lightningBoltPosition; @@ -603,7 +603,7 @@ void main() { bool isLightning = false; -#if defined OVERWORLD_SHADER && defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS && defined VOLUMETRIC_CLOUDS +#if defined OVERWORLD_SHADER && defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 && defined VOLUMETRIC_CLOUDS vec2 cloudDepth = imageLoad(cloudDepthTex, ivec2(gl_FragCoord.xy*VL_RENDER_RESOLUTION*RENDER_SCALE)).rg; diff --git a/shaders/dimensions/composite3.vsh b/shaders/dimensions/composite3.vsh index 60f6368..3d444fc 100644 --- a/shaders/dimensions/composite3.vsh +++ b/shaders/dimensions/composite3.vsh @@ -3,7 +3,7 @@ varying vec2 texcoord; flat varying vec3 zMults; -#if defined BorderFog || (defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS) +#if defined BorderFog || (defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS) > 0 uniform sampler2D colortex4; #include "/lib/scene_controller.glsl" #endif @@ -43,7 +43,7 @@ void main() { #endif WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition); - #if defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS + #if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog); #endif #endif diff --git a/shaders/dimensions/final.fsh b/shaders/dimensions/final.fsh index 12bb208..88de83c 100644 --- a/shaders/dimensions/final.fsh +++ b/shaders/dimensions/final.fsh @@ -10,7 +10,7 @@ uniform sampler2D depthtex2; uniform sampler2D noisetex; uniform sampler2D shadowcolor1; -#if DEBUG_VIEW == debug_CLOUDDEPTHTEX && defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS +#if DEBUG_VIEW == debug_CLOUDDEPTHTEX && defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 #extension GL_NV_gpu_shader5 : enable #extension GL_ARB_shader_image_load_store : enable #extension GL_EXT_shader_image_load_store : enable @@ -35,6 +35,11 @@ uniform mat4 gbufferPreviousModelView; // uniform mat4 gbufferModelViewInverse; // uniform mat4 gbufferModelView; +#ifdef DROWNING_EFFECT + uniform float drowningSmooth; + uniform float currentPlayerAir; +#endif + #include "/lib/color_transforms.glsl" #include "/lib/color_dither.glsl" #include "/lib/res_params.glsl" @@ -151,6 +156,10 @@ void main() { // for making the fun, more fun applyGameplayEffects(COLOR, texcoord, noise); #endif + + #ifdef DROWNING_EFFECT + if (currentPlayerAir != -1.0) COLOR *= 0.2 + 0.8*drowningSmooth; + #endif #ifdef VIGNETTE COLOR *= doVignette(texcoord, noise); @@ -175,7 +184,7 @@ void main() { #if DEBUG_VIEW == debug_DEPTHTEX1 COLOR = vec3(ld(texture2D(depthtex1, texcoord*RENDER_SCALE).r)); #endif - #if DEBUG_VIEW == debug_CLOUDDEPTHTEX && defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS + #if DEBUG_VIEW == debug_CLOUDDEPTHTEX && defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 COLOR = imageLoad(cloudDepthTex, ivec2(gl_FragCoord.xy*VL_RENDER_RESOLUTION*RENDER_SCALE)).rgb; #endif diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index 7309c94..616d2a9 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -260,6 +260,28 @@ screen.Clouds = Cloud Settings option.CloudLayer1_scale = Scale option.CUMULONIMBUS = Cumulonimbus Clouds + value.CUMULONIMBUS.0 = Off + value.CUMULONIMBUS.1 = During/After Thunderstorm + value.CUMULONIMBUS.2 = Always On + option.CUMULONIMBUS_FADE_TIME = Fade Out Time + value.CUMULONIMBUS_FADE_TIME.0.0 = None + value.CUMULONIMBUS_FADE_TIME.0.25 = 15 seconds + value.CUMULONIMBUS_FADE_TIME.0.5 = 30 seconds + value.CUMULONIMBUS_FADE_TIME.0.75 = 45 seconds + value.CUMULONIMBUS_FADE_TIME.1.0 = 60 seconds + value.CUMULONIMBUS_FADE_TIME.1.25 = 75 seconds + value.CUMULONIMBUS_FADE_TIME.1.5 = 90 seconds + value.CUMULONIMBUS_FADE_TIME.1.75 = 105 seconds + value.CUMULONIMBUS_FADE_TIME.2.0 = 2 minutes + value.CUMULONIMBUS_FADE_TIME.3.0 = 3 minutes + value.CUMULONIMBUS_FADE_TIME.4.0 = 4 minutes + value.CUMULONIMBUS_FADE_TIME.5.0 = 5 minutes + value.CUMULONIMBUS_FADE_TIME.6.0 = 6 minutes + value.CUMULONIMBUS_FADE_TIME.7.0 = 7 minutes + value.CUMULONIMBUS_FADE_TIME.8.0 = 8 minutes + value.CUMULONIMBUS_FADE_TIME.9.0 = 9 minutes + value.CUMULONIMBUS_FADE_TIME.10.0 = 10 minutes + option.CUMULONIMBUS_LIGHTNING = Cumulonimbus Lightning option.CUMULONIMBUS_LIGHTNING_BRIGHTNESS = Lightning Brightness suffix.CUMULONIMBUS_LIGHTNING_BRIGHTNESS = % @@ -497,6 +519,8 @@ screen.World = World option.Water_Top_Layer = Ocean Y coordinate option.WATER_WAVE_STRENGTH = Wave Strength option.WATER_WAVE_SPEED = Wave Speed + option.WATER_INTERACTION = Water Interaction + option.WATER_INTERACTION.comment = Small wave when the player enters/leaves water §aPERFORMANCE COST:§r very low option.WAVE_DETAIL = Wave Detail option.SNELLS_WINDOW = Snell's Window option.MINIMUM_WATER_ABSORBANCE = Minimum Water Absorbance diff --git a/shaders/lib/end_fog.glsl b/shaders/lib/end_fog.glsl index 8c731ea..26543a2 100644 --- a/shaders/lib/end_fog.glsl +++ b/shaders/lib/end_fog.glsl @@ -234,9 +234,9 @@ vec4 GetVolumetricFog( verticalFactor = pow(verticalFactor, 2.0); #if defined DISTANT_HORIZONS - int SAMPLECOUNT = 17; - float expFactor = 35.0; - float maxDist = mix(840.0, 370.0, verticalFactor); + int SAMPLECOUNT = 19; + float expFactor = 33.0; + float maxDist = mix(800.0, 300.0, verticalFactor); #else int SAMPLECOUNT = 15; float expFactor = 11.0; @@ -297,7 +297,7 @@ vec4 GetVolumetricFog( float volumeCoeff = exp(-stormDensity*dd*dL); vec3 lightsources = LightSourceLighting(progressW, lightPosition, dither, volumeDensity, lightColors, vortexBounds); - vec3 indirect = vec3(0.5,0.75,1.0) * 0.2 * (exp((volumeDensity*volumeDensity) * -50) * 0.9 + 0.1) * 0.1; + vec3 indirect = vec3(0.3,0.36,1.0) * 0.2 * (exp((volumeDensity*volumeDensity) * -50) * 0.9 + 0.1) * 0.1; vec3 stormLighting = indirect + lightsources; diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index d5e823c..450b4e8 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -10,6 +10,7 @@ #define WATER_WAVE_STRENGTH 1.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] #define WATER_WAVE_SPEED 1.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] #define Dirt_Amount 0.12 // [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0] +#define WATER_INTERACTION #define Dirt_Scatter_R 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ] #define Dirt_Scatter_G 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ] @@ -387,10 +388,11 @@ uniform int moonPhase; #define CloudLayer1_tallness 300.0 // [0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 110.0 120.0 130.0 140.0 150.0 160.0 170.0 180.0 190.0 200.0 210.0 220.0 230.0 240.0 250.0 260.0 270.0 280.0 290.0 300.0 310.0 320.0 330.0 340.0 350.0 360.0 370.0 380.0 390.0 400.0 410.0 420.0 430.0 440.0 450.0 460.0 470.0 480.0 490.0 500.0 510.0 520.0 530.0 540.0 550.0 560.0 570.0 580.0 590.0 600.0 700.0 800.0 900.0 1000.0 1250.0 1500.0 1750.0 2000.0 2250.0 2500.0 2750.0 3000.0 4000.0 5000.0] #define CloudLayer1_scale 1.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] -// #define CUMULONIMBUS +#define CUMULONIMBUS 0 // [0 1 2] #define CUMULONIMBUS_LIGHTNING #define CUMULONIMBUS_LIGHTNING_BRIGHTNESS 100.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.0 100.0 105.0 110.0 115.0 120.0 125.0 130.0 135.0 140.0 145.0 150.0 155.0 160.0 165.0 170.0 175.0 180.0 185.0 190.0 195.0 200.0] #define CUMULONIMBUS_LIGHTNING_DELAY 0.5 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 3.5 4.0 4.5 5.0 6.0 7.0 8.0 9.0 10.0] +#define CUMULONIMBUS_FADE_TIME 1.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0] // #define CUSTOM_LIGHTNING_POS #define CUSTOM_LIGHTNING_SCALE 1.0 // [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] #define CUSTOM_LIGHTNING_POS_X 100 // [-200 -195 -190 -185 -180 -175 -170 -165 -160 -155 -150 -145 -140 -135 -130 -125 -120 -115 -110 -105 -100 -95 -90 -85 -80 -75 -70 -65 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] @@ -668,6 +670,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #define LOW_HEALTH_EFFECT #define LOW_HEALTH_EFFECT_START 6.0 // [1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0] #define CRITICALLY_LOW_HEALTH_EFFECT_START 2.0 // [1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0] +#define DROWNING_EFFECT #endif #define WATER_ON_CAMERA_EFFECT diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index bb8d6c9..26d75f9 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -19,14 +19,18 @@ float lightningFlashTimer = floor(frameTimeCounter * 11.0); float randomSeed = fract(sin(dot(vec2(lightningFlashTimer), vec2(12.9898,78.233))) * 43758.5453); float lightningFlash = mix(0.1, 2.5, randomSeed); -#ifdef CUMULONIMBUS +#if CUMULONIMBUS > 0 float lightningDuration = 0.75 + CUMULONIMBUS_LIGHTNING_DELAY; float lightningTimer = floor(frameTimeCounter / lightningDuration); float timeInLightning = (frameTimeCounter / (lightningDuration) - lightningTimer) * lightningDuration; float lightningFade = smoothstep(0.6, 0.22, timeInLightning); #endif -#if defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS +#if CUMULONIMBUS == 1 + uniform float cumulonimbusStrength; +#endif + +#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 #extension GL_NV_gpu_shader5 : enable #extension GL_ARB_shader_image_load_store : enable #extension GL_EXT_shader_image_load_store : enable @@ -171,44 +175,6 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight, float tallness = maxHeight - minHeight; float posToMax = maxHeight - position.y; - if(LayerIndex == CUMULONIMBUS_LAYER){ - float cumulonimbusScale = 1.0; - smallCloud = texture2D(noisetex, (samplePos.zx - cloud_movement*6.0) / 17000.0 * cumulonimbusScale * 0.2).b; - - smallCloud = abs(smallCloud* -2.3); - - float val = 1.3 + Rain_coverage * rainStrength; - float shape = min(max(val - smallCloud,0.0)/sqrt(val),1.0) * smoothstep(5000.0, 10000.0, length(position.xz - cameraPosition.xz)); - - - shape = min(min(shape, clamp(posToMax,0,1)), 1.0 - clamp(minHeight - position.y,0,1)); - float bottomShape = 1.0-pow(1.0-min(max(position.y-minHeight,0.0) / 5.0, 1.0), 5.0); - - float topShape = min(max(posToMax,0.0) / max(tallness,1.0),1.0); - topShape = min(exp(-1.0 * (1.0-topShape)), 1.0-pow(1.0-topShape,5.0)); - - float topShape2 = min(max(posToMax,0.0) / max(tallness,1.0),1.0); - topShape2 = min(exp(-0.1 * (1.0-topShape2)), 1.0-pow(1.0-topShape2,7.0)); - - shape = max((shape - 1.0) + topShape * bottomShape + (1- topShape2) * bottomShape, 0.0); - if(shape > 0.001){ - if (LOD < 1) return max(shape - 0.27*0.5,0.0); - - samplePos.xz -= cloud_movement/4.0; - samplePos.xz += pow( max(position.y - (minHeight+20.0), 0.0) / (max(tallness,1.0)*0.20), 1.5); - - float omShape = 1.0 - shape; - float erosion = (1.0 - densityAtPos(samplePos * 100.0 * cumulonimbusScale*0.05)) * sqrt(omShape); - - float falloff = 1.0 - clamp((posToMax)/200.0,0.0,1.0); - erosion += abs(densityAtPos(samplePos * 370.0 * cumulonimbusScale*0.05) - falloff) * 0.65 * (omShape) * (1.0-falloff*0.5); - - erosion = erosion*erosion*erosion*erosion; - - - return max(shape - erosion*0.5,0.0); - } else return 0.0; - } if(LayerIndex == LARGECUMULUS_LAYER){ coverage = parameters.largeCumulus.x; coverage += Rain_coverage * rainStrength; @@ -291,7 +257,94 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight, } -#if defined CUMULONIMBUS && defined CUMULONIMBUS_LIGHTNING +vec2 getCumulonimbusShape(int LayerIndex, int LOD, in vec3 position, float minHeight, float maxHeight){ + + float largeCloud = 0.0; + float smallCloud = 0.0; + + vec3 samplePos = position*vec3(1.0, 1.0/48.0, 1.0)/4.0; + float tallness = maxHeight - minHeight; + float posToMax = maxHeight - position.y; + + float cumulonimbusScale = 1.0; + //largeCloud = texture2D(noisetex, (samplePos.zx - cloud_movement*6.0) / 17000.0 * cumulonimbusScale * 0.2).b; + + //largeCloud = abs(largeCloud* -8.0); + + //float val = 2.8 + Rain_coverage * rainStrength; + //float shape = min(max(val - largeCloud,0.0)/sqrt(val),1.0) * smoothstep(5000.0, 10000.0, length(position - cameraPosition)); + + largeCloud = (max(sin((samplePos.z - cloud_movement*10.0)/2700) * cos((samplePos.x - cloud_movement*10.0)/2700), 0.0)); + largeCloud = mix(max(min(largeCloud - 0.25, 0.5)*2.0, 0.0), max(min(largeCloud, 0.25)*4.0, 0.0), thunderStrength); + float shape = largeCloud * smoothstep(5000.0, 10000.0, length(position - cameraPosition)); + // return vec2(shape, 1.0); + + float isLarge = smoothstep(0.0, 1.0, shape); + // isLarge = 0.0; + + float bottomShape = 1.0-pow(1.0-min(max(position.y-minHeight,0.0) / 5.0, 1.0), 5.0); + + + float smallMaxHeight = (tallness*0.35 + minHeight); + + float shape2 = 0.0; + if (position.y < smallMaxHeight) { + float smallTallness = smallMaxHeight - minHeight; + + smallCloud = 1-texture2D(noisetex, (samplePos.xz - cloud_movement*4.0) / 1800.0 * cumulonimbusScale * 0.2).r * smoothstep(smallMaxHeight, tallness*0.2+minHeight, position.y); + + shape2 = min(max(1.1 - smallCloud,0.0)/sqrt(1.1),1.0) * smoothstep(3000.0, 7000.0, length(position - cameraPosition)); + + shape2 = min(min(shape2, clamp(smallMaxHeight - position.y,0,1)), 1.0 - clamp(minHeight - position.y,0,1)); + + float smallTopShape = min(max(posToMax,0.0) / max(smallTallness,1.0),1.0); + smallTopShape = min(exp(-1.0 * (1.0-smallTopShape)), 1.0-pow(1.0-smallTopShape,5.0)); + + shape2 = max((shape2 - 1.0) + smallTopShape * bottomShape, 0.0); + } + + + shape = min(min(shape, clamp(posToMax,0,1)), 1.0 - clamp(minHeight - position.y,0,1)); + + float topShape = min(max(posToMax,0.0) / max(tallness,1.0),1.0); + topShape = min(exp(-1.0 * (1.0-topShape)), 1.0-pow(1.0-topShape,5.0)); + + float topShape2 = min(max(posToMax,0.0) / max(tallness,1.0),1.0); + + topShape2 = min(exp(-0.1 * (1.0-topShape2)), 1.0-pow(1.0-topShape2,7.0)); + + shape = max((shape - 1.0) + topShape * bottomShape + (1- topShape2) * bottomShape, 0.0); + + shape = pow(shape, 1 + smoothstep(tallness*0.4+minHeight, tallness*0.8+minHeight, position.y)); + + shape += shape2; + + #if CUMULONIMBUS == 1 + shape *= pow(cumulonimbusStrength, mix(1.0, 6.0, smoothstep(tallness * 0.75 + minHeight, maxHeight, position.y))); + #endif + + if(shape > 0.001){ + if (LOD < 1) return vec2(max(shape - 0.27*0.5,0.0), isLarge); + + samplePos.xz -= cloud_movement/4.0; + samplePos.xz += pow( max(position.y - (minHeight+20.0), 0.0) / (max(tallness,1.0)*0.20), 1.5); + + float omShape = 1.0 - shape; + + float erosion = (1.0 - densityAtPos(samplePos * 190 * cumulonimbusScale*0.05)) * sqrt(omShape); + + float falloff = 1.0 - clamp((posToMax)/4600.0,0.0,1.0); + + erosion += abs(densityAtPos(samplePos * 580 * cumulonimbusScale*0.05) - falloff) * 0.65 * (omShape) * (1.0-falloff*0.5); + + erosion = erosion*erosion*erosion*erosion*smoothstep(maxHeight, tallness*0.5+minHeight, position.y); + + + return vec2(max(shape - erosion*0.5,0.0), isLarge); + } else return vec2(0.0, isLarge); +} + +#if CUMULONIMBUS > 0 && defined CUMULONIMBUS_LIGHTNING vec3 getLightningPosition(float minHeight, float maxHeight) { float angle = rand(lightningTimer) * 6.28318530718; @@ -299,8 +352,12 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight, float rMax = 13000.0; float radius = sqrt(mix(rMin * rMin, rMax * rMax, rand(lightningTimer + 1))); - vec3 lightningPos = vec3(radius * cos(angle), minHeight + 0.5 * (maxHeight - minHeight), radius * sin(angle)); - float shapeAtLightningPos = getCloudShape(CUMULONIMBUS_LAYER, 1, lightningPos, minHeight, maxHeight); + vec3 lightningPos = vec3(radius * cos(angle), minHeight + 0.62 * (maxHeight - minHeight), radius * sin(angle)); + + float shapeAtLightningPos = getCumulonimbusShape(CUMULONIMBUS_LAYER, 1, lightningPos, minHeight, maxHeight).x; + float moveUp = 0.48; + //if (shapeAtLightningPos < 0.1 && thunderStrength > 0.0) moveUp = mix(0.5, 0.1, thunderStrength); + lightningPos.y = minHeight + (maxHeight - minHeight) * moveUp; lightningPos.y -= cameraPosition.y; if (shapeAtLightningPos < 0.1) lightningPos = vec3(0.0); @@ -344,16 +401,16 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){ startPosition = playerPos + sunVector / abs(sunVector.y) * max(CloudLayer2_height - playerPos.y, 0.0); cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height)*parameters.altostratus.y * (1.0-abs(WsunVec.y)); #endif - #ifdef CUMULONIMBUS + #if CUMULONIMBUS > 0 startPosition = playerPos + sunVector / abs(sunVector.y) * max((600 + 20.0) - playerPos.y, 0.0); - cloudShadows += getCloudShape(CUMULONIMBUS_LAYER, 0, startPosition, 600, 12000)*(6.8); + cloudShadows += getCumulonimbusShape(CUMULONIMBUS_LAYER, 0, startPosition, 600, 12000).x*(6.8); #endif cloudShadows *= CLOUD_SHADOW_STRENGTH; - #if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2 || defined CUMULONIMBUS + #if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2 || CUMULONIMBUS > 0 totalShadow *= exp((cloudShadows*cloudShadows) * -200.0); #endif #endif @@ -399,8 +456,12 @@ float getCloudScattering( } // float fadeddensity = density * pow(clamp((shadowRayPosition.y - minHeight)/(max(maxHeight-minHeight,1.0)*0.25),0.0,1.0),2.0); - - shadow += getCloudShape(LayerIndex, LOD, shadowRayPosition, minHeight, maxHeight) * density; + if(LayerIndex != CUMULONIMBUS_LAYER) { + shadow += getCloudShape(LayerIndex, LOD, shadowRayPosition, minHeight, maxHeight) * density; + } else { + shadow += getCumulonimbusShape(LayerIndex, LOD, shadowRayPosition, minHeight, maxHeight).x * density; + } + } return shadow; @@ -560,7 +621,7 @@ vec4 raymarchCloud( #endif vec3 lightningPos = vec3(0.0); - #if defined CUMULONIMBUS && defined CUMULONIMBUS_LIGHTNING + #if CUMULONIMBUS > 0 && defined CUMULONIMBUS_LIGHTNING if(LayerIndex == CUMULONIMBUS_LAYER || thunderStrength > 0.0){ lightningPos = getLightningPosition(minHeight, maxHeight); } @@ -576,9 +637,17 @@ vec4 raymarchCloud( // check if the pixel is in the bounding box before doing work. if(clamp(rayPosition.y - maxHeight,0.0,1.0) < 1.0 && clamp(rayPosition.y - minHeight,0.0,1.0) > 0.0){ - - float shape = getCloudShape(LayerIndex, 1, rayPosition, minHeight, maxHeight); - float shapeWithDensity = shape*density; + + float shape = 0.0; + float isLarge = 0.0; + if (LayerIndex != CUMULONIMBUS_LAYER) { + shape = getCloudShape(LayerIndex, 1, rayPosition, minHeight, maxHeight); + } else { + vec2 cumulonimbusCloud = getCumulonimbusShape(LayerIndex, 1, rayPosition, minHeight, maxHeight); + shape = cumulonimbusCloud.x; + isLarge = cumulonimbusCloud.y; + } + float shapeWithDensity = shape*density*(1.0 + 4.0 * isLarge); float shapeWithDensityFaded = shape*density * pow(clamp((rayPosition.y - minHeight)/(max(maxHeight-minHeight,1.0)*0.25),0.0,1.0),2.0); if(shapeWithDensityFaded > densityTresholdCheck){ @@ -621,7 +690,7 @@ vec4 raymarchCloud( } // lightning strikes in cumulonimbus clouds - #if defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS + #if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 if(LayerIndex == CUMULONIMBUS_LAYER || thunderStrength > 0.0){ horizontalDist = length(newPos.xz); float lightningDist = length((newPos) - lightningPos); @@ -642,17 +711,14 @@ vec4 raymarchCloud( newPos.xz /= max(newPos.y,0.0)*0.0025 + 1.0; newPos.y = min(newPos.y,0.0); - - float distancefog = exp2(-0.0002*length(newPos)); + + float distancefog = exp2(-0.0002*length(newPos)); + vec3 atmosphereHaze = (sampledSkyCol - sampledSkyCol * distancefog); lighting = lighting * distancefog + atmosphereHaze; float densityCoeff = exp(-distanceFactor*shapeWithDensityFaded); color += (lighting - lighting * densityCoeff) * totalAbsorbance; - - if(LayerIndex == CUMULONIMBUS_LAYER) { - color *= mix(smoothstep(minHeight, maxHeight, rayPosition.y/(2.4*shape)), 1.0, mix((1-shapeWithDensity)*smoothstep(12000, 15000, horizontalDist), 1.0, rainStrength)); - } totalAbsorbance *= densityCoeff; @@ -782,7 +848,6 @@ vec4 GetVolumetricClouds( float sunVis = smoothstep(-0.06, 0.1, sunElevation); sunVis = sunVis * sunVis; float moonVis = smoothstep(-0.04, 0.15, -sunElevation); - moonVis = moonVis * moonVis; #if defined EXCLUDE_WRITE_TO_LUT && defined USE_CUSTOM_CLOUD_LIGHTING_COLORS directLightCol = dot(directLightCol,vec3(0.21, 0.72, 0.07)) * vec3(DIRECTLIGHT_CLOUDS_R,DIRECTLIGHT_CLOUDS_G,DIRECTLIGHT_CLOUDS_B); @@ -795,8 +860,12 @@ vec4 GetVolumetricClouds( vec3 sunMultiScattering = directLightCol; vec3 moonScattering = directLightCol2 * (phaseCloud(SdotV2, 0.85) + phaseCloud(SdotV2, 0.75)) * 3.14; vec3 moonMultiScattering = directLightCol2; - vec3 skyScattering = indirectLightCol * (1.0 + pow(1.0-pow(1.0-clamp(sunVector.y,0.0,1.0),5.0),5.0));; + vec3 skyScattering = indirectLightCol * (1.0 + sunVis); + vec3 moonScattering3 = moonScattering * moonVis; + vec3 moonMultiScattering3 = moonMultiScattering * moonVis; + + moonVis = moonVis * moonVis; vec3 sunScattering2 = sunScattering * sunVis; vec3 sunMultiScattering2 = sunMultiScattering * sunVis; vec3 moonScattering2 = moonScattering * moonVis; @@ -816,8 +885,7 @@ vec4 GetVolumetricClouds( #ifdef CloudLayer1 vec2 cloudLayer1_Distance = vec2(startDistance, 1.0); - float largeCumulusDistance = length(rayPosition - cameraPosition); - if(smallCumulusClouds.a > 1e-5 || cameraPosition.y > minHeight) { + if(smallCumulusClouds.a > 1e-5 || cameraPosition.y > CloudLayer1_height) { cloudheight = CloudLayer1_tallness; minHeight = CloudLayer1_height; maxHeight = cloudheight + minHeight; @@ -829,25 +897,26 @@ vec4 GetVolumetricClouds( largeCumulusClouds = raymarchCloud(LARGECUMULUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering2, sunMultiScattering2, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer1_Distance); } + float largeCumulusDistance = length(rayPosition - cameraPosition); #endif ////------- RENDER CUMULONIMBUS CLOUDS vec4 cumulonimbusClouds = cloudColor; - #ifdef CUMULONIMBUS + #if CUMULONIMBUS > 0 vec2 cloudLayer4_Distance = vec2(startDistance, 1.0); - float cumulonimbusDistance = length(rayPosition - cameraPosition); if(smallCumulusClouds.a > 1e-5 && largeCumulusClouds.a > 1e-5) { cloudheight = 240*17; minHeight = 600; maxHeight = cloudheight + minHeight; - cloudDist.xz = vec2(10.0); + cloudDist.xz = vec2(8.0); rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)/samples); rayPosition = getRayOrigin(rayDirection, cameraPosition, dither.y, minHeight, maxHeight); cumulonimbusClouds = raymarchCloud(CUMULONIMBUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering2, sunMultiScattering2, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer4_Distance); } + float cumulonimbusDistance = length(rayPosition - cameraPosition); #endif moonVis = smoothstep(-0.04, 0.15, -sunElevation); @@ -868,7 +937,7 @@ vec4 GetVolumetricClouds( rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)); rayPosition = getRayOrigin(rayDirection, cameraPosition, dither.y, minHeight, maxHeight); - altoStratusClouds = raymarchCloud(ALTOSTRATUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering, sunMultiScattering, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer2_Distance); + altoStratusClouds = raymarchCloud(ALTOSTRATUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering, sunMultiScattering, moonScattering3, moonMultiScattering3, skyScattering, lViewPosM, sampledSkyCol, cloudLayer2_Distance); } #endif @@ -886,54 +955,97 @@ vec4 GetVolumetricClouds( rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)); rayPosition = getRayOrigin(rayDirection, cameraPosition, dither.y, minHeight, maxHeight); - cirrusClouds = raymarchCloud(CIRRUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering, sunMultiScattering, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer3_Distance); + cirrusClouds = raymarchCloud(CIRRUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering, sunMultiScattering, moonScattering3, moonMultiScattering3, skyScattering, lViewPosM, sampledSkyCol, cloudLayer3_Distance); } #endif ////------- BLEND LAYERS - #if defined CloudLayer0 && !defined CloudLayer1 && !defined CloudLayer2 - cloudPlaneDistance = cloudLayer0_Distance.x; + #if defined CloudLayer0 && defined CloudLayer1 + if (cameraPosition.y > CloudLayer1_height) { + vec2 temp = cloudLayer1_Distance; + cloudLayer1_Distance = cloudLayer0_Distance; + cloudLayer0_Distance = temp; + } #endif - #if defined CloudLayer0 && defined CloudLayer1 && !defined CloudLayer2 - cloudPlaneDistance = mix(cloudLayer0_Distance.x, cloudLayer1_Distance.x, cloudLayer0_Distance.y); - #endif - - #if defined CloudLayer0 && defined CloudLayer1 && defined CloudLayer2 - cloudPlaneDistance = mix(cloudLayer2_Distance.x, cloudLayer1_Distance.x, cloudLayer2_Distance.y); - cloudPlaneDistance = mix(cloudLayer0_Distance.x, cloudPlaneDistance, cloudLayer0_Distance.y); - #endif - - #if defined CloudLayer0 && !defined CloudLayer1 && defined CloudLayer2 - cloudPlaneDistance = mix(cloudLayer2_Distance.x, cloudLayer0_Distance.x, cloudLayer2_Distance.y); - cloudPlaneDistance = mix(cloudLayer0_Distance.x, cloudPlaneDistance, cloudLayer0_Distance.y); - #endif - - #if !defined CloudLayer0 && defined CloudLayer1 && defined CloudLayer2 - cloudPlaneDistance = mix(cloudLayer2_Distance.x, cloudLayer1_Distance.x, cloudLayer2_Distance.y); - cloudPlaneDistance = mix(cloudLayer1_Distance.x, cloudPlaneDistance, cloudLayer1_Distance.y); - #endif - - #if defined CloudLayer0 && !defined CloudLayer1 && !defined CloudLayer2 - cloudPlaneDistance = cloudLayer0_Distance.x; - #endif - #if !defined CloudLayer0 && defined CloudLayer1 && !defined CloudLayer2 - cloudPlaneDistance = cloudLayer1_Distance.x; - #endif - #if !defined CloudLayer0 && !defined CloudLayer1 && defined CloudLayer2 - cloudPlaneDistance = cloudLayer2_Distance.x; - #endif - - #if !defined CloudLayer0 && !defined CloudLayer1 && !defined CloudLayer2 && defined CloudLayer3 - cloudPlaneDistance = cloudLayer3_Distance.x; - #endif - - #if defined CUMULONIMBUS + #if CUMULONIMBUS > 0 && !defined CloudLayer3 && !defined CloudLayer0 && !defined CloudLayer1 && !defined CloudLayer2 cloudPlaneDistance = cloudLayer4_Distance.x; + #else + #if defined CloudLayer0 + #if defined CloudLayer1 + #if defined CloudLayer2 + #if defined CloudLayer3 + float temp = mix(cloudLayer3_Distance.x, cloudLayer2_Distance.x, cloudLayer3_Distance.y); + temp = mix(cloudLayer1_Distance.x, temp, cloudLayer1_Distance.y); + cloudPlaneDistance = mix(cloudLayer0_Distance.x, temp, cloudLayer0_Distance.y); + #else + float temp = mix(cloudLayer2_Distance.x, cloudLayer1_Distance.x, cloudLayer2_Distance.y); + cloudPlaneDistance = mix(cloudLayer0_Distance.x, temp, cloudLayer0_Distance.y); + #endif + #else + #if defined CloudLayer3 + float temp = mix(cloudLayer3_Distance.x, cloudLayer1_Distance.x, cloudLayer3_Distance.y); + cloudPlaneDistance = mix(cloudLayer0_Distance.x, temp, cloudLayer0_Distance.y); + #else + cloudPlaneDistance = mix(cloudLayer0_Distance.x, cloudLayer1_Distance.x, cloudLayer0_Distance.y); + #endif + #endif + #else + #if defined CloudLayer2 + #if defined CloudLayer3 + float temp = mix(cloudLayer3_Distance.x, cloudLayer2_Distance.x, cloudLayer3_Distance.y); + cloudPlaneDistance = mix(cloudLayer0_Distance.x, temp, cloudLayer0_Distance.y); + #else + float temp = mix(cloudLayer2_Distance.x, cloudLayer0_Distance.x, cloudLayer2_Distance.y); + cloudPlaneDistance = mix(cloudLayer0_Distance.x, temp, cloudLayer0_Distance.y); + #endif + #else + #if defined CloudLayer3 + cloudPlaneDistance = mix(cloudLayer0_Distance.x, cloudLayer3_Distance.x, cloudLayer0_Distance.y); + #else + cloudPlaneDistance = cloudLayer0_Distance.x; + #endif + #endif + #endif + #else + #if defined CloudLayer1 + #if defined CloudLayer2 + #if defined CloudLayer3 + float temp = mix(cloudLayer3_Distance.x, cloudLayer2_Distance.x, cloudLayer3_Distance.y); + cloudPlaneDistance = mix(cloudLayer1_Distance.x, temp, cloudLayer1_Distance.y); + #else + float temp = mix(cloudLayer2_Distance.x, cloudLayer1_Distance.x, cloudLayer2_Distance.y); + cloudPlaneDistance = mix(cloudLayer1_Distance.x, temp, cloudLayer1_Distance.y); + #endif + #else + #if defined CloudLayer3 + cloudPlaneDistance = mix(cloudLayer1_Distance.x, cloudLayer3_Distance.x, cloudLayer1_Distance.y); + #else + cloudPlaneDistance = cloudLayer1_Distance.x; + #endif + #endif + #else + #if defined CloudLayer2 + #if defined CloudLayer3 + cloudPlaneDistance = mix(cloudLayer2_Distance.x, cloudLayer3_Distance.x, cloudLayer2_Distance.y); + #else + cloudPlaneDistance = cloudLayer2_Distance.x; + #endif + #else + #if defined CloudLayer3 + cloudPlaneDistance = cloudLayer3_Distance.x; + #else + cloudPlaneDistance = 0.0; + #endif + #endif + #endif + #endif #endif - #if defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS + + + #if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 #ifdef CloudLayer0 if (smallCumulusClouds.a < 1.0) cloudDistance.r = smallCumulusDistance; #endif @@ -967,6 +1079,7 @@ vec4 GetVolumetricClouds( cloudColor.a *= altoStratusClouds.a; #endif #ifdef CUMULONIMBUS + #if CUMULONIMBUS > 0 cloudColor.rgb *= cumulonimbusClouds.a; cloudColor.rgb += cumulonimbusClouds.rgb; cloudColor.a *= cumulonimbusClouds.a; diff --git a/shaders/lib/waterBump.glsl b/shaders/lib/waterBump.glsl index 80e5de6..7e6b81a 100644 --- a/shaders/lib/waterBump.glsl +++ b/shaders/lib/waterBump.glsl @@ -60,7 +60,7 @@ vec3 getWaveNormal(vec3 waterPos, vec3 playerpos){ #ifdef HYPER_DETAILED_WAVES float deltaPos = 0.025; #else - float deltaPos = mix(1/WAVE_DETAIL, 0.15, largeWavesCurved); + float deltaPos = mix(1.0/WAVE_DETAIL, 0.15, largeWavesCurved); // reduce high frequency detail as distance increases. reduces noise on waves. why have more details than pixels? float range = min(length(playerpos) / (16.0*24.0), 3.0); deltaPos += range; diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 8a4ebb5..b43676f 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -4,13 +4,13 @@ #=============== EVERYTHING BELOW HERE IS NOT FOR CUSTOM SCENE CONTROLLER STUFF AND SHOULD NOT BE MODIFIED UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING =============== #==================================================================================================================================================================== -profile.POTATO = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 !CUMULONIMBUS CloudLayer0 !CloudLayer1 !CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:0 VL_SAMPLES:4 !REALMOON shadowMapResolution:512 shadowDistance:64.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED !SAND_STORMS !SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.7 SHARPENING:0.55 !FORWARD_ENVIORNMENT_REFLECTION -profile.VERY_LOW = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 !CUMULONIMBUS CloudLayer0 !CloudLayer1 !CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:0 VL_SAMPLES:4 REALMOON shadowMapResolution:1024 shadowDistance:96.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED !SAND_STORMS !SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.8 SHARPENING:0.5 !FORWARD_ENVIORNMENT_REFLECTION -profile.LOW = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 !CUMULONIMBUS CloudLayer0 !CloudLayer1 CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:1 VL_SAMPLES:6 REALMOON shadowMapResolution:1536 shadowDistance:112.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED SAND_STORMS SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.9 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION -profile.MEDIUM = !RIPPLE_PUDDLES RIPPLE_WATER !Puddles ShaderSnow:0 !CUMULONIMBUS CloudLayer0 CloudLayer1 CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.5 indirect_effect:1 SAMPLES:6 REALMOON shadowMapResolution:1536 shadowDistance:128.0 DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION -profile.HIGH = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 !CUMULONIMBUS CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:0.5 indirect_effect:1 SAMPLES:8 REALMOON shadowMapResolution:2048 shadowDistance:128.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION -profile.VERY_HIGH = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 !CUMULONIMBUS CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:1.0 indirect_effect:1 SAMPLES:8 REALMOON shadowMapResolution:2048 shadowDistance:144.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION -profile.ULTRA = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 CUMULONIMBUS CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:1.0 indirect_effect:1 SAMPLES:10 REALMOON shadowMapResolution:3172 shadowDistance:144.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION +profile.POTATO = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 CUMULONIMBUS:0 CloudLayer0 !CloudLayer1 !CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:0 VL_SAMPLES:4 !REALMOON shadowMapResolution:512 shadowDistance:64.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED !SAND_STORMS !SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.7 SHARPENING:0.55 !FORWARD_ENVIORNMENT_REFLECTION +profile.VERY_LOW = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 CUMULONIMBUS:0 CloudLayer0 !CloudLayer1 !CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:0 VL_SAMPLES:4 REALMOON shadowMapResolution:1024 shadowDistance:96.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED !SAND_STORMS !SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.8 SHARPENING:0.5 !FORWARD_ENVIORNMENT_REFLECTION +profile.LOW = !RIPPLE_PUDDLES !RIPPLE_WATER !Puddles ShaderSnow:0 CUMULONIMBUS:0 CloudLayer0 !CloudLayer1 CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.25 indirect_effect:1 VL_SAMPLES:6 REALMOON shadowMapResolution:1536 shadowDistance:112.0 !DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED SAND_STORMS SNOW_STORMS TAA_UPSCALING SCALE_FACTOR:0.9 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION +profile.MEDIUM = !RIPPLE_PUDDLES RIPPLE_WATER !Puddles ShaderSnow:0 CUMULONIMBUS:0 CloudLayer0 CloudLayer1 CloudLayer2 !CloudLayer3 VL_RENDER_RESOLUTION:0.5 indirect_effect:1 SAMPLES:6 REALMOON shadowMapResolution:1536 shadowDistance:128.0 DH_SCREENSPACE_REFLECTIONS !LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION +profile.HIGH = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 CUMULONIMBUS:0 CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:0.5 indirect_effect:1 SAMPLES:8 REALMOON shadowMapResolution:2048 shadowDistance:128.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION +profile.VERY_HIGH = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 CUMULONIMBUS:0 CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:1.0 indirect_effect:1 SAMPLES:8 REALMOON shadowMapResolution:2048 shadowDistance:144.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION +profile.ULTRA = RIPPLE_PUDDLES RIPPLE_WATER Puddles ShaderSnow:1 CUMULONIMBUS:1 CloudLayer0 CloudLayer1 CloudLayer2 CloudLayer3 VL_RENDER_RESOLUTION:1.0 indirect_effect:1 SAMPLES:10 REALMOON shadowMapResolution:3172 shadowDistance:144.0 DH_SCREENSPACE_REFLECTIONS LPV_ENABLED SAND_STORMS SNOW_STORMS !TAA_UPSCALING SCALE_FACTOR:0.75 SHARPENING:0.45 FORWARD_ENVIORNMENT_REFLECTION clouds=off @@ -46,7 +46,7 @@ iris.features.optional = ENTITY_TRANSLUCENT REVERSED_CULLING COMPUTE_SHADERS CUS customTexture.snowTexR = texture/snowR.png #endif -#if defined CUMULONIMBUS_LIGHTNING && defined CUMULONIMBUS +#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 customTexture.lightningTex1 = texture/lightning/lightning1.png customTexture.lightningTex2 = texture/lightning/lightning2.png customTexture.lightningTex3 = texture/lightning/lightning3.png @@ -174,7 +174,7 @@ alphaTest.gbuffers_water = false alphaTest.gbuffers_skybasic = false alphaTest.gbuffers_skytextured = false -sliders = NOISE_RESOLUTION NOISE_INTENSITY NOISE_DROPOFF WAVE_DETAIL DH_CHUNK_FADING CLOUD_MOVEMENT_TYPE LIGHTLEAKFIX_MODE RAIN_AMBIENT_LIGHT_MODIFIER EMISSIVE_ORES_STRENGTH RIPPLE_STRENGTH RIPPLE_INTENSITY CUSTOM_LIGHTNING_SCALE CUSTOM_LIGHTNING_R CUSTOM_LIGHTNING_G CUSTOM_LIGHTNING_B CUSTOM_LIGHTNING_TEX CUSTOM_LIGHTNING_POS_X CUSTOM_LIGHTNING_POS_Y CUSTOM_LIGHTNING_POS_Z CUMULONIMBUS_LIGHTNING_BRIGHTNESS CUMULONIMBUS_LIGHTNING_DELAY ShaderSnow ShaderSnowStrength BorderFogIntensity CAVE_DETECTION ON_FIRE_DISTORT_EFFECT_STRENGTH USE_CUSTOM_SKY_GROUND_LIGHTING_COLORS DIRECTLIGHT_DIFFUSE_R DIRECTLIGHT_DIFFUSE_G DIRECTLIGHT_DIFFUSE_B INDIRECTLIGHT_DIFFUSE_R INDIRECTLIGHT_DIFFUSE_G INDIRECTLIGHT_DIFFUSE_B DIRECTLIGHT_CLOUDS_R DIRECTLIGHT_CLOUDS_G DIRECTLIGHT_CLOUDS_B INDIRECTLIGHT_CLOUDS_R INDIRECTLIGHT_CLOUDS_G INDIRECTLIGHT_CLOUDS_B DIRECTLIGHT_FOG_R DIRECTLIGHT_FOG_G DIRECTLIGHT_FOG_B INDIRECTLIGHT_FOG_R INDIRECTLIGHT_FOG_G INDIRECTLIGHT_FOG_B SKY_GROUND_R SKY_GROUND_G SKY_GROUND_B DOF_DISPERSION_MULT FLASHLIGHT_BRIGHTNESS_MULT FLASHLIGHT_BRIGHTNESS_FALLOFF_MULT FLASHLIGHT_RANGE FLASHLIGHT_SIZE FLASHLIGHT_R FLASHLIGHT_G FLASHLIGHT_B LOW_HEALTH_EFFECT_START CRITICALLY_LOW_HEALTH_EFFECT_START CloudLayer2_scale CloudLayer0_scale CloudLayer1_scale CloudLayer3_scale CloudLayer0_tallness CloudLayer1_tallness EXPOSURE_DARKENING EXPOSURE_BRIGHTENING VIGNETTE_STRENGTH CURVATURE_AMOUNT MINIMUM_WATER_ABSORBANCE CHROMATIC_ABERRATION_STRENGTH SELECT_BOX_COL_R SELECT_BOX_COL_G SELECT_BOX_COL_B LPV_VL_FOG_ILLUMINATION_BRIGHTNESS minRayMarchSteps MOTION_BLUR_STRENGTH OVERDRAW_MAX_DISTANCE DAY0_l3_coverage DAY0_l3_density DAY1_l3_coverage DAY1_l3_density DAY2_l3_coverage DAY2_l3_density DAY3_l3_coverage DAY3_l3_density DAY4_l3_coverage DAY4_l3_density DAY5_l3_coverage DAY5_l3_density DAY6_l3_coverage DAY6_l3_density DAY7_l3_coverage DAY7_l3_density DAY8_l3_coverage DAY8_l3_density DAY9_l3_coverage DAY9_l3_density DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DAY3_l0_coverage DAY3_l1_coverage DAY3_l2_coverage DAY3_ufog_density DAY3_l0_density DAY3_l1_density DAY3_l2_density DAY3_cfog_density DAY4_l0_coverage DAY4_l1_coverage DAY4_l2_coverage DAY4_ufog_density DAY4_l0_density DAY4_l1_density DAY4_l2_density DAY4_cfog_density DAY5_l0_coverage DAY5_l1_coverage DAY5_l2_coverage DAY5_ufog_density DAY5_l0_density DAY5_l1_density DAY5_l2_density DAY5_cfog_density DAY6_l0_coverage DAY6_l1_coverage DAY6_l2_coverage DAY6_ufog_density DAY6_l0_density DAY6_l1_density DAY6_l2_density DAY6_cfog_density DAY7_l0_coverage DAY7_l1_coverage DAY7_l2_coverage DAY7_ufog_density DAY7_l0_density DAY7_l1_density DAY7_l2_density DAY7_cfog_density DAY8_l0_coverage DAY8_l1_coverage DAY8_l2_coverage DAY8_ufog_density DAY8_l0_density DAY8_l1_density DAY8_l2_density DAY8_cfog_density DAY9_l0_coverage DAY9_l1_coverage DAY9_l2_coverage DAY9_ufog_density DAY9_l0_density DAY9_l1_density DAY9_l2_density DAY9_cfog_density sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS WATER_CAUSTICS_POWER DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height CloudLayer3_coverage CloudLayer3_density CloudLayer3_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed Cloud_Speed_Rain Cloud_Speed_Thunder ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Thunder_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size Puddle_Reflection_Strength LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL LPV_SATURATION LPV_TINT_SATURATION LPV_NORMAL_STRENGTH +sliders = CUMULONIMBUS_FADE_TIME CUMULONIMBUS NOISE_RESOLUTION NOISE_INTENSITY NOISE_DROPOFF WAVE_DETAIL DH_CHUNK_FADING CLOUD_MOVEMENT_TYPE LIGHTLEAKFIX_MODE RAIN_AMBIENT_LIGHT_MODIFIER EMISSIVE_ORES_STRENGTH RIPPLE_STRENGTH RIPPLE_INTENSITY CUSTOM_LIGHTNING_SCALE CUSTOM_LIGHTNING_R CUSTOM_LIGHTNING_G CUSTOM_LIGHTNING_B CUSTOM_LIGHTNING_TEX CUSTOM_LIGHTNING_POS_X CUSTOM_LIGHTNING_POS_Y CUSTOM_LIGHTNING_POS_Z CUMULONIMBUS_LIGHTNING_BRIGHTNESS CUMULONIMBUS_LIGHTNING_DELAY ShaderSnow ShaderSnowStrength BorderFogIntensity CAVE_DETECTION ON_FIRE_DISTORT_EFFECT_STRENGTH USE_CUSTOM_SKY_GROUND_LIGHTING_COLORS DIRECTLIGHT_DIFFUSE_R DIRECTLIGHT_DIFFUSE_G DIRECTLIGHT_DIFFUSE_B INDIRECTLIGHT_DIFFUSE_R INDIRECTLIGHT_DIFFUSE_G INDIRECTLIGHT_DIFFUSE_B DIRECTLIGHT_CLOUDS_R DIRECTLIGHT_CLOUDS_G DIRECTLIGHT_CLOUDS_B INDIRECTLIGHT_CLOUDS_R INDIRECTLIGHT_CLOUDS_G INDIRECTLIGHT_CLOUDS_B DIRECTLIGHT_FOG_R DIRECTLIGHT_FOG_G DIRECTLIGHT_FOG_B INDIRECTLIGHT_FOG_R INDIRECTLIGHT_FOG_G INDIRECTLIGHT_FOG_B SKY_GROUND_R SKY_GROUND_G SKY_GROUND_B DOF_DISPERSION_MULT FLASHLIGHT_BRIGHTNESS_MULT FLASHLIGHT_BRIGHTNESS_FALLOFF_MULT FLASHLIGHT_RANGE FLASHLIGHT_SIZE FLASHLIGHT_R FLASHLIGHT_G FLASHLIGHT_B LOW_HEALTH_EFFECT_START CRITICALLY_LOW_HEALTH_EFFECT_START CloudLayer2_scale CloudLayer0_scale CloudLayer1_scale CloudLayer3_scale CloudLayer0_tallness CloudLayer1_tallness EXPOSURE_DARKENING EXPOSURE_BRIGHTENING VIGNETTE_STRENGTH CURVATURE_AMOUNT MINIMUM_WATER_ABSORBANCE CHROMATIC_ABERRATION_STRENGTH SELECT_BOX_COL_R SELECT_BOX_COL_G SELECT_BOX_COL_B LPV_VL_FOG_ILLUMINATION_BRIGHTNESS minRayMarchSteps MOTION_BLUR_STRENGTH OVERDRAW_MAX_DISTANCE DAY0_l3_coverage DAY0_l3_density DAY1_l3_coverage DAY1_l3_density DAY2_l3_coverage DAY2_l3_density DAY3_l3_coverage DAY3_l3_density DAY4_l3_coverage DAY4_l3_density DAY5_l3_coverage DAY5_l3_density DAY6_l3_coverage DAY6_l3_density DAY7_l3_coverage DAY7_l3_density DAY8_l3_coverage DAY8_l3_density DAY9_l3_coverage DAY9_l3_density DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DAY3_l0_coverage DAY3_l1_coverage DAY3_l2_coverage DAY3_ufog_density DAY3_l0_density DAY3_l1_density DAY3_l2_density DAY3_cfog_density DAY4_l0_coverage DAY4_l1_coverage DAY4_l2_coverage DAY4_ufog_density DAY4_l0_density DAY4_l1_density DAY4_l2_density DAY4_cfog_density DAY5_l0_coverage DAY5_l1_coverage DAY5_l2_coverage DAY5_ufog_density DAY5_l0_density DAY5_l1_density DAY5_l2_density DAY5_cfog_density DAY6_l0_coverage DAY6_l1_coverage DAY6_l2_coverage DAY6_ufog_density DAY6_l0_density DAY6_l1_density DAY6_l2_density DAY6_cfog_density DAY7_l0_coverage DAY7_l1_coverage DAY7_l2_coverage DAY7_ufog_density DAY7_l0_density DAY7_l1_density DAY7_l2_density DAY7_cfog_density DAY8_l0_coverage DAY8_l1_coverage DAY8_l2_coverage DAY8_ufog_density DAY8_l0_density DAY8_l1_density DAY8_l2_density DAY8_cfog_density DAY9_l0_coverage DAY9_l1_coverage DAY9_l2_coverage DAY9_ufog_density DAY9_l0_density DAY9_l1_density DAY9_l2_density DAY9_cfog_density sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS WATER_CAUSTICS_POWER DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height CloudLayer3_coverage CloudLayer3_density CloudLayer3_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed Cloud_Speed_Rain Cloud_Speed_Thunder ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Thunder_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size Puddle_Reflection_Strength LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL LPV_SATURATION LPV_TINT_SATURATION LPV_NORMAL_STRENGTH screen.columns=2 screen = \ @@ -312,9 +312,10 @@ SHADER_VERSION_LABEL \ CloudLayer0_tallness CloudLayer1_tallness \ CloudLayer0_scale CloudLayer1_scale \ \ - CUMULONIMBUS CUMULONIMBUS_LIGHTNING \ - CUMULONIMBUS_LIGHTNING_BRIGHTNESS CUMULONIMBUS_LIGHTNING_DELAY \ - [CUSTOM_LIGHTNING] + CUMULONIMBUS CUMULONIMBUS_FADE_TIME \ + CUMULONIMBUS_LIGHTNING CUMULONIMBUS_LIGHTNING_BRIGHTNESS \ + CUMULONIMBUS_LIGHTNING_DELAY [CUSTOM_LIGHTNING] + screen.CUSTOM_LIGHTNING.columns = 2 screen.CUSTOM_LIGHTNING = CUSTOM_LIGHTNING_POS CUSTOM_LIGHTNING_TEX \ CUSTOM_LIGHTNING_POS_X CUSTOM_LIGHTNING_R \ @@ -359,7 +360,7 @@ SHADER_VERSION_LABEL \ REFRACTION_SMUDGE MINIMUM_WATER_ABSORBANCE \ SNELLS_WINDOW Water_Top_Layer \ WATER_WAVE_STRENGTH WATER_WAVE_SPEED \ - WAVE_DETAIL + WAVE_DETAIL WATER_INTERACTION screen.Water_fog_color.columns=1 screen.Water_fog_color = Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B @@ -396,7 +397,7 @@ SHADER_VERSION_LABEL \ SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL ### COOL GAMEPLAY EFFECTS - screen.GAMEPLAY_EFFECTS = FLASHLIGHT [FLASHLIGHT_SETTING] MOTION_AMOUNT WATER_ON_CAMERA_EFFECT DAMAGE_TAKEN_EFFECT ON_FIRE_DISTORT_EFFECT ON_FIRE_DISTORT_EFFECT_STRENGTH LOW_HEALTH_EFFECT LOW_HEALTH_EFFECT_START CRITICALLY_LOW_HEALTH_EFFECT_START + screen.GAMEPLAY_EFFECTS = FLASHLIGHT [FLASHLIGHT_SETTING] MOTION_AMOUNT WATER_ON_CAMERA_EFFECT DAMAGE_TAKEN_EFFECT ON_FIRE_DISTORT_EFFECT ON_FIRE_DISTORT_EFFECT_STRENGTH LOW_HEALTH_EFFECT LOW_HEALTH_EFFECT_START CRITICALLY_LOW_HEALTH_EFFECT_START DROWNING_EFFECT screen.FLASHLIGHT_SETTING.columns = 2 screen.FLASHLIGHT_SETTING = FLASHLIGHT FLASHLIGHT_R \ FLASHLIGHT_SPECULAR FLASHLIGHT_G \ @@ -610,6 +611,10 @@ uniform.float.snowAmount = 0.0 uniform.float.snowAmount = 1.0 #endif +#if CUMULONIMBUS == 1 + variable.float.cumulonimbusFadeTime = (CUMULONIMBUS_FADE_TIME * 60.0) + 60.0 + uniform.float.cumulonimbusStrength = smooth(if(thunderStrength > 0.0, 1.0, 0.0), 60.0, cumulonimbusFadeTime) +#endif #in(biome_category, CAT_ICY) # in(biome_category, CAT_DESERT, CAT_SAVANNA, CAT_MESA) @@ -625,15 +630,33 @@ uniform.bool.isInJungleBiomes = in(biome_category, CAT_JUNGLE) # force water surface level to a fixed height if you entered the water from an area in low light levels (caves). if youre above the hardcoded y level, allow it use the current height variable.float.waterEnteredLowLight = if(eyeBrightness.y < 0.004, max(eyeAltitude, SEA_LEVEL), eyeAltitude) -variable.float.freezeTranstion = if(isEyeInWater == 1, 100000000000000.0, 0.0) +variable.float.waterState = smooth(if(isEyeInWater == 0,1.0,0.0),0.1,0.1) +variable.float.freezeTranstion = if(waterState < 0.35 || waterState > 0.65, 100000000000000.0, 0.0) uniform.float.waterEnteredAltitude = smooth(waterEnteredLowLight, freezeTranstion, freezeTranstion) +#ifdef WATER_INTERACTION + variable.float.waterEnteredPosition_X = smooth(eyePosition.x, freezeTranstion, freezeTranstion) + variable.float.waterEnteredPosition_Y = smooth(eyePosition.y, freezeTranstion, freezeTranstion) + variable.float.waterEnteredPosition_Z = smooth(eyePosition.z, freezeTranstion, freezeTranstion) + uniform.vec3.waterEnteredPosition = vec3(waterEnteredPosition_X, waterEnteredPosition_Y, waterEnteredPosition_Z) + uniform.float.waterEnteredTime = smooth(frameTimeCounter, freezeTranstion, freezeTranstion) + + variable.vec3.currentVelocity = cameraPosition - previousCameraPosition + variable.float.waterEnteredVelocity_X = smooth(currentVelocity.x/frameTime, freezeTranstion, freezeTranstion) + variable.float.waterEnteredVelocity_Y = smooth(currentVelocity.y/frameTime, freezeTranstion, freezeTranstion) + variable.float.waterEnteredVelocity_Z = smooth(currentVelocity.z/frameTime, freezeTranstion, freezeTranstion) + uniform.vec3.waterEnteredVelocity = vec3(waterEnteredVelocity_X, waterEnteredVelocity_Y, waterEnteredVelocity_Z) +#endif variable.float.exitedBiomePos_X = smooth(cameraPosition.x, freezeCameraPos, freezeCameraPos) variable.float.exitedBiomePos_Y = smooth(cameraPosition.y, freezeCameraPos, freezeCameraPos) variable.float.exitedBiomePos_Z = smooth(cameraPosition.z, freezeCameraPos, freezeCameraPos) variable.vec3.VARexitedBiomePos = vec3(exitedBiomePos_X, exitedBiomePos_Y, exitedBiomePos_Z) +#ifdef DROWNING_EFFECT +uniform.float.drowningSmooth = smooth(if(currentPlayerAir < 0.01, 0.0, 1.0), 6.0, 12.0) +#endif + variable.float.distanceTreshold = 200.0 variable.bool.checkDistanceEpislonFromExitPos = equals(cameraPosition.x, VARexitedBiomePos.x, distanceTreshold) && equals(cameraPosition.y, VARexitedBiomePos.y, distanceTreshold) && equals(cameraPosition.z, VARexitedBiomePos.z, distanceTreshold)