diff --git a/shaders/dimensions/DH_solid.fsh b/shaders/dimensions/DH_solid.fsh index 3692691..f41afc9 100644 --- a/shaders/dimensions/DH_solid.fsh +++ b/shaders/dimensions/DH_solid.fsh @@ -60,11 +60,28 @@ vec3 toScreenSpace(vec3 p) { return viewPos.xyz / viewPos.w; } +uniform sampler2D noisetex; +uniform int frameCounter; +uniform float frameTimeCounter; +float blueNoise(){ + return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter); +} +float interleaved_gradientNoise(){ + return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+frameTimeCounter*51.9521); +} +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 ) ; +} /* RENDERTARGETS:1,7,8 */ void main() { // overdraw prevention - if(clamp(1.0-length(pos.xyz)/max(far-16,0.0),0,1) > 0 ) discard; + if(clamp(1.0-length(pos.xyz)/max(far - 16.0,0.0),0.0,1.0) > 0.0 ){ + discard; + return; + } vec3 normals = viewToWorld(normals_and_materials.xyz); float materials = normals_and_materials.a; diff --git a/shaders/dimensions/DH_translucent.fsh b/shaders/dimensions/DH_translucent.fsh index f5143e9..ebb1f42 100644 --- a/shaders/dimensions/DH_translucent.fsh +++ b/shaders/dimensions/DH_translucent.fsh @@ -281,11 +281,10 @@ void main() { #ifdef DISTANT_HORIZONS_SHADOWMAP float Shadows = 1.0; - mat4 DH_shadowProjection = DH_shadowProjectionTweak(shadowProjection); vec3 feetPlayerPos_shadow = mat3(gbufferModelViewInverse) * pos.xyz + gbufferModelViewInverse[3].xyz; vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos_shadow + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(DH_shadowProjection) * projectedShadowPosition + DH_shadowProjection[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; //apply distortion #ifdef DISTORT_SHADOWMAP @@ -344,7 +343,7 @@ void main() { vec3 skyReflection = skyCloudsFromTex(mat3(gbufferModelViewInverse) * reflectedVector, colortex4).rgb / 30.0 ; skyReflection = mix(skyReflection, ssReflections.rgb, ssReflections.a); - vec3 sunReflection = Direct_lighting * GGX(normals, -normalize(pos.xyz), WsunVec2, 0.05, vec3(0.02)); + vec3 sunReflection = Direct_lighting * GGX(normals, -normalize(pos.xyz), WsunVec2, 0.05, vec3(0.02)) * (1-ssReflections.a) ; gl_FragData[0].rgb = mix(gl_FragData[0].rgb, skyReflection, fresnel) + sunReflection ; gl_FragData[0].a = mix(gl_FragData[0].a, 1.0, fresnel); diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index c48963e..bb5b978 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -405,12 +405,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) vec3 feetPlayerPos_shadow = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; - mat4 DH_shadowProjection = DH_shadowProjectionTweak(shadowProjection); - // mat4 Custom_ViewMatrix = BuildShadowViewMatrix(LightDir); // vec3 projectedShadowPosition = mat3(Custom_ViewMatrix) * feetPlayerPos_shadow + Custom_ViewMatrix[3].xyz; vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos_shadow + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(DH_shadowProjection) * projectedShadowPosition + DH_shadowProjection[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; //apply distortion #ifdef DISTORT_SHADOWMAP diff --git a/shaders/dimensions/composite.fsh b/shaders/dimensions/composite.fsh index eeab97c..f8c2cb1 100644 --- a/shaders/dimensions/composite.fsh +++ b/shaders/dimensions/composite.fsh @@ -167,8 +167,8 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo -void main() { /* DRAWBUFFERS:3 */ +void main() { vec2 texcoord = gl_FragCoord.xy*texelSize; float z = texture2D(depthtex1,texcoord).x; @@ -229,13 +229,12 @@ void main() { if (LabSSS > 0.0) { - mat4 DH_shadowProjection = DH_shadowProjectionTweak(shadowProjection); vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(DH_shadowProjection) * projectedShadowPosition + DH_shadowProjection[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; //apply distortion #ifdef DISTORT_SHADOWMAP diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 110c901..954161a 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -572,6 +572,41 @@ vec4 renderInfiniteWaterPlane( return vec4(color, total_extinction); } + +// uniform float viewWidth; +// uniform float viewHeight; + +// uniform sampler2D depthtex0; +// uniform sampler2D dhDepthTex; + +// uniform mat4 gbufferProjectionInverse; +// uniform mat4 dhProjectionInverse; + +vec3 getViewPos() { + ivec2 uv = ivec2(gl_FragCoord.xy); + vec2 viewSize = vec2(viewWidth, viewHeight); + vec2 texcoord = gl_FragCoord.xy / viewSize; + + vec4 viewPos = vec4(0.0); + + float depth = texelFetch(depthtex0, uv, 0).r; + + if (depth < 1.0) { + vec4 ndcPos = vec4(texcoord, depth, 1.0) * 2.0 - 1.0; + viewPos = gbufferProjectionInverse * ndcPos; + viewPos.xyz /= viewPos.w; + } else { + depth = texelFetch(dhDepthTex, ivec2(gl_FragCoord.xy), 0).r; + + vec4 ndcPos = vec4(texcoord, depth, 1.0) * 2.0 - 1.0; + viewPos = dhProjectionInverse * ndcPos; + viewPos.xyz /= viewPos.w; + } + + return viewPos.xyz; +} + + void main() { vec3 DEBUG = vec3(1.0); @@ -623,6 +658,8 @@ void main() { vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos; vec3 feetPlayerPos_normalized = normVec(feetPlayerPos); + + vec3 playerPos = mat3(gbufferModelViewInverse) * getViewPos(); ////// --------------- UNPACK OPAQUE GBUFFERS --------------- ////// vec4 data = texture2D(colortex1,texcoord); @@ -798,22 +835,21 @@ void main() { #ifdef OVERWORLD_SHADER NdotL = clamp((-15 + dot(slopednormal, WsunVec)*255.0) / 240.0 ,0.0,1.0); - float shadowNDOTL = NdotL; - #ifndef Variable_Penumbra_Shadows - shadowNDOTL += LabSSS; - #endif + // float shadowNDOTL = NdotL; + // #ifndef Variable_Penumbra_Shadows + // shadowNDOTL += LabSSS; + // #endif - if(shadowNDOTL > 0.001){ + // if(shadowNDOTL > 0.001){ - mat4 DH_shadowProjection = DH_shadowProjectionTweak(shadowProjection); vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; if(!hand || !entities) GriAndEminShadowFix(shadowPlayerPos, viewToWorld(FlatNormals), vanilla_AO, lightmap.y, entities); vec3 projectedShadowPosition = mat3(shadowModelView) * shadowPlayerPos + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(DH_shadowProjection) * projectedShadowPosition + DH_shadowProjection[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; //apply distortion #ifdef DISTORT_SHADOWMAP @@ -851,7 +887,7 @@ void main() { #ifdef OLD_LIGHTLEAK_FIX if (isEyeInWater == 0) Shadows *= clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); // light leak fix #endif - } + // } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////// SUN SSS //////////////////////////////// @@ -1164,7 +1200,7 @@ void main() { gl_FragData[0].rgb = Direct_lighting; #endif #if DEBUG_VIEW == debug_VIEW_POSITION - gl_FragData[0].rgb = viewPos; + gl_FragData[0].rgb = viewPos * 0.001; #endif diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index d751ffb..ed45737 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -279,7 +279,6 @@ void main() { #endif vec3 viewPos = toScreenSpace_DH(tc/RENDER_SCALE, z, DH_z); - // vec3 viewPos = toScreenSpace(vec3(tc/RENDER_SCALE,z)); if (isEyeInWater == 0){ diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index 1ea6683..daeefd0 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -405,8 +405,7 @@ void main() { ////// --------------- FINALIZE #ifdef display_LUT - vec2 movedTC = texcoord; - vec3 thingy = texture2D(colortex4,movedTC).rgb / 30; + vec3 thingy = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy),0).rgb / 30; if(luma(thingy) > 0.0){ color.rgb = thingy; diff --git a/shaders/dimensions/composite5.fsh b/shaders/dimensions/composite5.fsh index 752641b..7e6a5ed 100644 --- a/shaders/dimensions/composite5.fsh +++ b/shaders/dimensions/composite5.fsh @@ -197,24 +197,57 @@ vec3 closestToCamera5taps(vec2 texcoord, sampler2D depth) uniform sampler2D dhDepthTex; uniform float dhFarPlane; uniform float dhNearPlane; + +#include "/lib/DistantHorizons_projections.glsl" + float DH_ld(float dist) { return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane)); } float DH_inv_ld (float lindepth){ return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane); } -uniform mat4 dhProjectionInverse; -uniform mat4 dhProjection; -vec3 DH_toScreenSpace(vec3 p) { - vec4 iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw); - vec3 feetPlayerPos = p * 2. - 1.; - vec4 viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3]; - return viewPos.xyz / viewPos.w; + +float linearizeDepthFast(const in float depth, const in float near, const in float far) { + return (near * far) / (depth * (near - far) + far); } -vec3 DH_toClipSpace3(vec3 viewSpacePosition) { - return projMAD(dhProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5; +float invertlinearDepthFast(const in float depth, const in float near, const in float far) { + return ((2.0*near/depth)-far-near)/(far-near); } +vec3 toClipSpace3Prev_DH( vec3 viewSpacePosition, bool depthCheck ) { + + mat4 projectionMatrix = depthCheck ? dhPreviousProjection : gbufferPreviousProjection; + + return projMAD(projectionMatrix, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5; +} + +vec3 toScreenSpace_DH_special(vec3 POS, bool depthCheck ) { + + vec4 viewPos = vec4(0.0); + vec3 feetPlayerPos = vec3(0.0); + vec4 iProjDiag = vec4(0.0); + #ifdef DISTANT_HORIZONS + if (depthCheck) { + iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw); + + feetPlayerPos = POS * 2.0 - 1.0; + viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3]; + viewPos.xyz /= viewPos.w; + + } else { + #endif + iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw); + + feetPlayerPos = POS * 2.0 - 1.0; + viewPos = iProjDiag * feetPlayerPos.xyzz + gbufferProjectionInverse[3]; + viewPos.xyz /= viewPos.w; + + #ifdef DISTANT_HORIZONS + } + #endif + + return viewPos.xyz; +} const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), @@ -226,6 +259,17 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), vec2(3,7.)/8., vec2(7.,-7.)/8.); +sampler2D swapSampler(sampler2D depth, sampler2D DHdepth, bool depthCheck ){ + + if(depthCheck){ + return dhDepthTex; + }else{ + return depth; + } +} + + + vec4 TAA_hq(){ #ifdef TAA_UPSCALING @@ -233,23 +277,25 @@ vec4 TAA_hq(){ #else vec2 adjTC = texcoord; #endif + + bool depthCheck = texture2D(depthtex0,adjTC).x >= 1.0; //use velocity from the nearest texel from camera in a 3x3 box in order to improve edge quality in motion #ifdef CLOSEST_VELOCITY #ifdef DISTANT_HORIZONS - vec3 closestToCamera = closestToCamera5taps(adjTC, depthtex0); + vec3 closestToCamera = closestToCamera5taps(adjTC, swapSampler(depthtex0, dhDepthTex, depthCheck)); #else vec3 closestToCamera = closestToCamera5taps(adjTC, depthtex0); #endif #endif #ifndef CLOSEST_VELOCITY - vec3 closestToCamera = vec3(texcoord,texture2D(depthtex1,adjTC).x); + vec3 closestToCamera = vec3(texcoord, texture2D(depthtex1,adjTC).x); #endif //reproject previous frame #ifdef DISTANT_HORIZONS - vec3 viewPos = DH_toScreenSpace(closestToCamera); + vec3 viewPos = toScreenSpace_DH_special(closestToCamera, depthCheck); #else vec3 viewPos = toScreenSpace(closestToCamera); #endif @@ -257,7 +303,7 @@ vec4 TAA_hq(){ viewPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition); vec3 previousPosition = mat3(gbufferPreviousModelView) * viewPos + gbufferPreviousModelView[3].xyz; - previousPosition = toClipSpace3Prev(previousPosition); + previousPosition = toClipSpace3Prev_DH(previousPosition, depthCheck); vec2 velocity = previousPosition.xy - closestToCamera.xy; previousPosition.xy = texcoord + velocity; diff --git a/shaders/dimensions/deferred.fsh b/shaders/dimensions/deferred.fsh index f09ddcd..86f810b 100644 --- a/shaders/dimensions/deferred.fsh +++ b/shaders/dimensions/deferred.fsh @@ -2,6 +2,13 @@ #define ReflectedFog +#define USE_WEATHER_PARAMS + +#ifdef Daily_Weather + flat varying vec4 dailyWeatherParams0; + flat varying vec4 dailyWeatherParams1; +#endif + flat varying vec3 averageSkyCol_Clouds; flat varying vec3 averageSkyCol; @@ -42,6 +49,7 @@ uniform vec3 cameraPosition; // uniform float far; uniform ivec2 eyeBrightnessSmooth; + vec4 lightCol = vec4(lightSourceColor, float(sunElevation > 1e-5)*2-1.); #include "/lib/util.glsl" @@ -161,11 +169,33 @@ if (gl_FragCoord.x > pixelPos6.x && gl_FragCoord.x < pixelPos6.x + 1 && gl_FragC gl_FragData[0] = vec4(1,0,0,1); } -if(accumuteSpeed < 1.0) mixhistory = 1.0; #ifdef OVERWORLD_SHADER + + ////////////////////////////////////////////// + /// --- STORE DAILY WEATHER PARAMETERS --- /// + ////////////////////////////////////////////// + + // the idea is to store the 8 values, coverage + density of 3 cloud layers and 2 fog density values. + + #ifdef Daily_Weather + ivec2 pixelPos = ivec2(0,0); + if (gl_FragCoord.x > 1 && gl_FragCoord.x < 3 && gl_FragCoord.y > 1 && gl_FragCoord.y < 2){ + + mixhistory = 0.01; + + if(gl_FragCoord.x < 2) gl_FragData[0] = dailyWeatherParams0; + if(gl_FragCoord.x > 2) gl_FragData[0] = dailyWeatherParams1; + + } + #endif + + + + + /////////////////////////////// /// --- STORE COLOR LUT --- /// /////////////////////////////// @@ -175,6 +205,8 @@ if(accumuteSpeed < 1.0) mixhistory = 1.0; // --- the color of the atmosphere + the average color of the atmosphere. vec3 skyGroundCol = skyFromTex(vec3(0, -1 ,0), colortex4).rgb;// * clamp(WsunVec.y*2.0,0.2,1.0); + + /// --- Save light values if (gl_FragCoord.x < 1. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 ) gl_FragData[0] = vec4(averageSkyCol_Clouds * AmbientLightTint,1.0); @@ -338,6 +370,7 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+ vec3 temp = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy),0).rgb; vec3 curr = gl_FragData[0].rgb*150.; +if(accumuteSpeed < 1.0) mixhistory = 1.0; gl_FragData[0].rgb = clamp(mix(temp, curr, mixhistory),0.0,65000.); diff --git a/shaders/dimensions/deferred.vsh b/shaders/dimensions/deferred.vsh index a254b32..4c6ebb1 100644 --- a/shaders/dimensions/deferred.vsh +++ b/shaders/dimensions/deferred.vsh @@ -22,6 +22,9 @@ flat varying float rodExposure; flat varying float avgL2; flat varying float centerDepth; +flat varying vec4 dailyWeatherParams0; +flat varying vec4 dailyWeatherParams1; + uniform sampler2D colortex4; uniform sampler2D colortex6; uniform sampler2D depthtex0; @@ -72,6 +75,24 @@ float ld(float depth) { uniform float nightVision; +uniform int worldDay; +void getWeatherParams( + inout vec4 weatherParams0, + inout vec4 weatherParams1, + + float layer0_coverage, + float layer1_coverage, + float layer2_coverage, + float uniformFog_density, + + float layer0_density, + float layer1_density, + float layer2_density, + float cloudyFog_density +){ + weatherParams0 = vec4(layer0_coverage, layer1_coverage, layer2_coverage, uniformFog_density); + weatherParams1 = vec4(layer0_density, layer1_density, layer2_density, cloudyFog_density); +} void main() { @@ -139,6 +160,25 @@ void main() { #endif +////////////////////////////////// +/// --- WEATHER PARAMETERS --- /// +////////////////////////////////// + +#ifdef Daily_Weather + int dayCounter = int(mod(worldDay, 10)); + + if(dayCounter == 0) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY0_l0_coverage, DAY0_l1_coverage, DAY0_l2_coverage, DAY0_ufog_density, DAY0_l0_density, DAY0_l1_density, DAY0_l2_density, DAY0_cfog_density); + if(dayCounter == 1) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY1_l0_coverage, DAY1_l1_coverage, DAY1_l2_coverage, DAY1_ufog_density, DAY1_l0_density, DAY1_l1_density, DAY1_l2_density, DAY1_cfog_density); + if(dayCounter == 2) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY2_l0_coverage, DAY2_l1_coverage, DAY2_l2_coverage, DAY2_ufog_density, DAY2_l0_density, DAY2_l1_density, DAY2_l2_density, DAY2_cfog_density); + if(dayCounter == 3) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY3_l0_coverage, DAY3_l1_coverage, DAY3_l2_coverage, DAY3_ufog_density, DAY3_l0_density, DAY3_l1_density, DAY3_l2_density, DAY3_cfog_density); + if(dayCounter == 4) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY4_l0_coverage, DAY4_l1_coverage, DAY4_l2_coverage, DAY4_ufog_density, DAY4_l0_density, DAY4_l1_density, DAY4_l2_density, DAY4_cfog_density); + if(dayCounter == 5) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY5_l0_coverage, DAY5_l1_coverage, DAY5_l2_coverage, DAY5_ufog_density, DAY5_l0_density, DAY5_l1_density, DAY5_l2_density, DAY5_cfog_density); + if(dayCounter == 6) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY6_l0_coverage, DAY6_l1_coverage, DAY6_l2_coverage, DAY6_ufog_density, DAY6_l0_density, DAY6_l1_density, DAY6_l2_density, DAY6_cfog_density); + if(dayCounter == 7) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY7_l0_coverage, DAY7_l1_coverage, DAY7_l2_coverage, DAY7_ufog_density, DAY7_l0_density, DAY7_l1_density, DAY7_l2_density, DAY7_cfog_density); + if(dayCounter == 8) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY8_l0_coverage, DAY8_l1_coverage, DAY8_l2_coverage, DAY8_ufog_density, DAY8_l0_density, DAY8_l1_density, DAY8_l2_density, DAY8_cfog_density); + if(dayCounter == 9) getWeatherParams(dailyWeatherParams0, dailyWeatherParams1, DAY9_l0_coverage, DAY9_l1_coverage, DAY9_l2_coverage, DAY9_ufog_density, DAY9_l0_density, DAY9_l1_density, DAY9_l2_density, DAY9_cfog_density); +#endif + ////////////////////////////// /// --- EXPOSURE STUFF --- /// ////////////////////////////// diff --git a/shaders/dimensions/deferred2.fsh b/shaders/dimensions/deferred2.fsh index 5823f7f..2a64ada 100644 --- a/shaders/dimensions/deferred2.fsh +++ b/shaders/dimensions/deferred2.fsh @@ -1,11 +1,15 @@ #include "/lib/settings.glsl" //Computes volumetric clouds at variable resolution (default 1/4 res) +#define USE_WEATHER_PARAMS +#ifdef Daily_Weather + flat varying vec3 dailyWeatherParams0; + flat varying vec3 dailyWeatherParams1; +#endif flat varying vec3 sunColor; flat varying vec3 moonColor; - flat varying vec3 averageSkyCol; diff --git a/shaders/dimensions/deferred2.vsh b/shaders/dimensions/deferred2.vsh index ad495e3..c5e159d 100644 --- a/shaders/dimensions/deferred2.vsh +++ b/shaders/dimensions/deferred2.vsh @@ -1,5 +1,7 @@ #include "/lib/settings.glsl" +flat varying vec3 dailyWeatherParams0; +flat varying vec3 dailyWeatherParams1; flat varying vec3 averageSkyCol; flat varying vec3 sunColor; flat varying vec3 moonColor; @@ -25,6 +27,9 @@ void main() { gl_Position = ftransform(); gl_Position.xy = (gl_Position.xy*0.5+0.5)*clamp(CLOUDS_QUALITY+0.01,0.0,1.0)*2.0-1.0; + dailyWeatherParams0 = texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0; + dailyWeatherParams1 = texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0; + averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb; sunColor = texelFetch2D(colortex4,ivec2(6,37),0).rgb; moonColor = texelFetch2D(colortex4,ivec2(13,37),0).rgb; diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index bde7565..b90011c 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -154,9 +154,9 @@ screen.Clouds = Cloud Settings option.VOLUMETRIC_CLOUDS = Volumetric Clouds option.CLOUDS_QUALITY = Cloud Resolution Scaling option.CLOUDS_SHADOWS = Cloud Shadows - option.Daily_Weather = Daily Weather option.Cloud_Speed = Cloud Speed Multiplier option.Rain_coverage = Coverage When Raining + option.Daily_Weather = Daily Weather option.CloudLayer0 = Small Cumulus Clouds option.CloudLayer0_coverage = Coverage @@ -173,7 +173,107 @@ screen.Clouds = Cloud Settings option.CloudLayer2_density = Density option.CloudLayer2_height = Height +screen.DAILY_WEATHER = Daily Weather Settings + screen.DAY0_WEATHER = Day 0 Weather + option.DAY0_l0_coverage = Small Cumulus coverage + option.DAY0_l0_density = Small Cumulus Density + option.DAY0_l1_coverage = Large Cumulus Coverage + option.DAY0_l1_density = Large Cumulus Density + option.DAY0_l2_coverage = Altostratus Clouds Coverage + option.DAY0_l2_density = Altostratus Clouds Density + option.DAY0_ufog_density = Uniform Fog Density + option.DAY0_cfog_density = Cloudy Fog Density + + screen.DAY1_WEATHER = Day 1 Weather + option.DAY1_l0_coverage = Small Cumulus coverage + option.DAY1_l0_density = Small Cumulus Density + option.DAY1_l1_coverage = Large Cumulus Coverage + option.DAY1_l1_density = Large Cumulus Density + option.DAY1_l2_coverage = Altostratus Clouds Coverage + option.DAY1_l2_density = Altostratus Clouds Density + option.DAY1_ufog_density = Uniform Fog Density + option.DAY1_cfog_density = Cloudy Fog Density + + screen.DAY2_WEATHER = Day 2 Weather + option.DAY2_l0_coverage = Small Cumulus coverage + option.DAY2_l0_density = Small Cumulus Density + option.DAY2_l1_coverage = Large Cumulus Coverage + option.DAY2_l1_density = Large Cumulus Density + option.DAY2_l2_coverage = Altostratus Clouds Coverage + option.DAY2_l2_density = Altostratus Clouds Density + option.DAY2_ufog_density = Uniform Fog Density + option.DAY2_cfog_density = Cloudy Fog Density + screen.DAY3_WEATHER = Day 3 Weather + option.DAY3_l0_coverage = Small Cumulus coverage + option.DAY3_l0_density = Small Cumulus Density + option.DAY3_l1_coverage = Large Cumulus Coverage + option.DAY3_l1_density = Large Cumulus Density + option.DAY3_l2_coverage = Altostratus Clouds Coverage + option.DAY3_l2_density = Altostratus Clouds Density + option.DAY3_ufog_density = Uniform Fog Density + option.DAY3_cfog_density = Cloudy Fog Density + + screen.DAY4_WEATHER = Day 4 Weather + option.DAY4_l0_coverage = Small Cumulus coverage + option.DAY4_l0_density = Small Cumulus Density + option.DAY4_l1_coverage = Large Cumulus Coverage + option.DAY4_l1_density = Large Cumulus Density + option.DAY4_l2_coverage = Altostratus Clouds Coverage + option.DAY4_l2_density = Altostratus Clouds Density + option.DAY4_ufog_density = Uniform Fog Density + option.DAY4_cfog_density = Cloudy Fog Density + + screen.DAY5_WEATHER = Day 5 Weather + option.DAY5_l0_coverage = Small Cumulus coverage + option.DAY5_l0_density = Small Cumulus Density + option.DAY5_l1_coverage = Large Cumulus Coverage + option.DAY5_l1_density = Large Cumulus Density + option.DAY5_l2_coverage = Altostratus Clouds Coverage + option.DAY5_l2_density = Altostratus Clouds Density + option.DAY5_ufog_density = Uniform Fog Density + option.DAY5_cfog_density = Cloudy Fog Density + + screen.DAY6_WEATHER = Day 6 Weather + option.DAY6_l0_coverage = Small Cumulus coverage + option.DAY6_l0_density = Small Cumulus Density + option.DAY6_l1_coverage = Large Cumulus Coverage + option.DAY6_l1_density = Large Cumulus Density + option.DAY6_l2_coverage = Altostratus Clouds Coverage + option.DAY6_l2_density = Altostratus Clouds Density + option.DAY6_ufog_density = Uniform Fog Density + option.DAY6_cfog_density = Cloudy Fog Density + + screen.DAY7_WEATHER = Day 7 Weather + option.DAY7_l0_coverage = Small Cumulus coverage + option.DAY7_l0_density = Small Cumulus Density + option.DAY7_l1_coverage = Large Cumulus Coverage + option.DAY7_l1_density = Large Cumulus Density + option.DAY7_l2_coverage = Altostratus Clouds Coverage + option.DAY7_l2_density = Altostratus Clouds Density + option.DAY7_ufog_density = Uniform Fog Density + option.DAY7_cfog_density = Cloudy Fog Density + + screen.DAY8_WEATHER = Day 8 Weather + option.DAY8_l0_coverage = Small Cumulus coverage + option.DAY8_l0_density = Small Cumulus Density + option.DAY8_l1_coverage = Large Cumulus Coverage + option.DAY8_l1_density = Large Cumulus Density + option.DAY8_l2_coverage = Altostratus Clouds Coverage + option.DAY8_l2_density = Altostratus Clouds Density + option.DAY8_ufog_density = Uniform Fog Density + option.DAY8_cfog_density = Cloudy Fog Density + + screen.DAY9_WEATHER = Day 9 Weather + option.DAY9_l0_coverage = Small Cumulus coverage + option.DAY9_l0_density = Small Cumulus Density + option.DAY9_l1_coverage = Large Cumulus Coverage + option.DAY9_l1_density = Large Cumulus Density + option.DAY9_l2_coverage = Altostratus Clouds Coverage + option.DAY9_l2_density = Altostratus Clouds Density + option.DAY9_ufog_density = Uniform Fog Density + option.DAY9_cfog_density = Cloudy Fog Density + screen.Climate = Climate Settings option.Seasons = Seasonal Colors @@ -528,4 +628,19 @@ option.CloudLayer2_height.comment = Configure the height at which these clouds option.SKY_GROUND.comment = §bWhat is this?§r This is the dark bottom half of the sky that WOULD be the ground, if minecraft had infinite render distance. §aPERFORMANCE COST:§r very very low. §cdisabling this is very slightly slower than having it on due to extra math.§r option.SNELLS_WINDOW.comment = §bWhat is this?§r this is the dark reflective circle you see when under-water. This is an approximation of a thing that happens in reality known as "total internal reflection". §aPERFORMANCE COST:§r very very very small. -option.entityShadowDistanceMul.comment = §bWhat is this?§r Configure how far shadows should work for entities. This is good if you want to keep entity shadows and improved performance in high entity areas. \ No newline at end of file +option.entityShadowDistanceMul.comment = §bWhat is this?§r Configure how far shadows should work for entities. This is good if you want to keep entity shadows and improved performance in high entity areas. + +screen.DISTANT_HORIZONS_SETTINGS = §2Distant Horizons §fsettings + +option.DH_KNOWN_ISSUES = +value.DH_KNOWN_ISSUES.0 = §c CLICK THIS TEXT TO LOOP THROUGH A LIST OF KNOWN ISSUES +value.DH_KNOWN_ISSUES.1 = §a the DH shadowmap is broken - do not use it. +value.DH_KNOWN_ISSUES.2 = §a GTAO, RTAO, and SSGI break on LODs - DH support unimplemented +value.DH_KNOWN_ISSUES.3 = §a fog has little lines on edges - caused by an incapable upsampler +value.DH_KNOWN_ISSUES.4 = §a LOD water has outlines of non-LOD water - depth test issue +value.DH_KNOWN_ISSUES.5 = §a Cloud shadows move a little when really high in the sky - yep + +option.DISTANT_HORIZONS_SHADOWMAP = §c(BROKEN)§r DH shadowmap support +option.DISTANT_HORIZONS_SHADOWMAP.comment = §cTHIS SETTING WILL DESTROY PERFORMANCE§r. set shadow distance to 32 chunks (or more). set shadow resolution to 4096 (or more) +option.TOGGLE_VL_FOG = Toggle Volumetric Fog +option.TOGGLE_VL_FOG.comment = one big button to just turn all the fog off. \ No newline at end of file diff --git a/shaders/lib/overworld_fog.glsl b/shaders/lib/overworld_fog.glsl index 2d94b80..c36277f 100644 --- a/shaders/lib/overworld_fog.glsl +++ b/shaders/lib/overworld_fog.glsl @@ -77,15 +77,18 @@ vec4 GetVolumetricFog( vec3 LightColor, vec3 AmbientColor ){ + + #ifndef TOGGLE_VL_FOG + return vec4(0.0,0.0,0.0,1.0); + #endif int SAMPLECOUNT = VL_SAMPLES; /// ------------- RAYMARCHING STUFF ------------- \\\ //project pixel position into projected shadowmap space - mat4 DH_shadowProjection = DH_shadowProjectionTweak(shadowProjection); vec3 wpos = mat3(gbufferModelViewInverse) * viewPosition + gbufferModelViewInverse[3].xyz; vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz; - fragposition = diagonal3(DH_shadowProjection) * fragposition + DH_shadowProjection[3].xyz; + fragposition = diagonal3(shadowProjection) * fragposition + shadowProjection[3].xyz; //project view origin into projected shadowmap space vec3 start = toShadowSpaceProjected(vec3(0.0)); @@ -169,6 +172,7 @@ vec4 GetVolumetricFog( #ifdef DISTANT_HORIZONS RLmult = 1.0; #endif + float expFactor = 11.0; for (int i=0;i 0 ? 0.0 : 1.0; float upperPlane = otherlayer; @@ -157,7 +216,7 @@ float cloudVol(int layer, in vec3 pos,in vec3 samplePos,in float cov, in int LoD if (LoD > 0) { float smallnoise = densityAtPos(samplePos * mix(450.0,600.0,upperPlane)); - noise += ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.6 * sqrt(noise); + noise += ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.6; } noise *= (1.0-cov); @@ -182,31 +241,6 @@ float GetCumulusDensity(int layer, in vec3 pos, in int LoD, float minHeight, flo } else return 0.0; } -float GetAltostratusDensity(vec3 pos){ - - float Coverage; float Density; - DailyWeather_Alto(Coverage, Density); - - float large = texture2D(noisetex, (pos.xz + cloud_movement)/100000. ).b; - float small = texture2D(noisetex, (pos.xz - cloud_movement)/10000. - vec2(-large,1-large)/5).b; - large = max(large + Coverage - 0.5, 0.0); - // float shape = (small + pow((1.0-large),2.0))/2.0; - - float weight = 0.7; - float shape = max( large*weight - small*(1.0-weight) ,0.0); - shape *= shape; - - - - // infinite vertical height will mess with lighting, so get rid of it. - // shape = max(shape - pow(abs(LAYER2_HEIGHT - pos.y)/20,1.5), 0.0); - shape = min(min(shape , clamp((LAYER2_HEIGHT + 15) - pos.y,0,1)), 1.0 - clamp(LAYER2_HEIGHT - pos.y,0,1)); - - - // shape *= Density; - - return shape; -} #ifndef CLOUDSHADOWSONLY uniform sampler2D colortex4; //Skybox @@ -233,7 +267,6 @@ vec3 DoCloudLighting( float distantfog ){ - // float powder = 1.0 - exp((CloudShape*CloudShape) * -800); float powder = 1.0 - exp(densityFaded * -10); float lesspowder = powder*0.4+0.6; @@ -251,25 +284,6 @@ vec3 DoCloudLighting( return skyLight + sunLight; } - - -vec3 layerStartingPosition( - vec3 dV_view, - vec3 cameraPos, - float dither, - - float minHeight, - float maxHeight -){ - // allow passing through/above/below the plane without limits - float flip = mix(max(cameraPos.y - maxHeight,0.0), max(minHeight - cameraPos.y,0), clamp(dV_view.y,0,1)); - - // orient the ray to be a flat plane facing up/down - vec3 position = dV_view*dither + cameraPos + dV_view/abs(dV_view.y) * flip; - - return position; -} - vec4 renderLayer( int layer, in vec3 rayProgress, @@ -309,13 +323,14 @@ if(layer == 2){ float directLight = 0.0; for (int j = 0; j < 2; j++){ - vec3 shadowSamplePos_high = rayProgress + dV_Sun * (0.1 + j * (0.5 + dither*0.05)) ; - // vec3 shadowSamplePos_high = rayProgress + dV_Sun * (j * (0.5 + dither*0.05)) ; + + vec3 shadowSamplePos_high = rayProgress + dV_Sun * (0.1 + j * (0.5 + dither*0.05)); + float shadow = GetAltostratusDensity(shadowSamplePos_high) * cloudDensity; directLight += shadow; } - float skyscatter_alto = sqrt(altostratus*0.05); + float skyscatter_alto = sqrt(altostratus*0.05) * cloudDensity; vec3 lighting = DoCloudLighting(altostratus, 1.0, skyLightCol, skyscatter_alto, directLight, sunScatter, sunMultiScatter, distantfog); COLOR += max(lighting - lighting*exp(-mult*muE),0.0) * TOTAL_EXTINCTION; @@ -329,10 +344,6 @@ if(layer == 2){ for(int i = 0; i < QUALITY; i++) { - // IntersecTerrain = length(rayProgress - cameraPosition) > lViewPosM; - - // if(IntersecTerrain) break; - /// avoid overdraw if(notVisible) break; @@ -340,43 +351,42 @@ if(layer == 2){ float fadedDensity = cloudDensity * clamp(exp( (rayProgress.y - (maxHeight - 75)) / 9.0 ),0.0,1.0); - if(cumulus > 1e-5){ + if(cumulus > 1e-5 && clamp(rayProgress.y - maxHeight,0.0,1.0) < 1.0 && clamp(rayProgress.y - minHeight,0.0,1.0) > 0.0){ // make sure no work is done on pixels with no densities float muE = cumulus * fadedDensity; float directLight = 0.0; - if(clamp(rayProgress.y - maxHeight,0.0,1.0) < 1.0 && clamp(rayProgress.y - minHeight,0.0,1.0) > 0.0){ // make sure no work is done on pixels with no densities - for (int j=0; j < 3; j++){ - vec3 shadowSamplePos = rayProgress + dV_Sun * (0.1 + j * (0.1 + dither*0.05)); - float shadow = GetCumulusDensity(layer, shadowSamplePos, 0, minHeight, maxHeight) * cloudDensity; + for (int j=0; j < 3; j++){ + vec3 shadowSamplePos = rayProgress + dV_Sun * (0.1 + j * (0.1 + dither*0.05)); + float shadow = GetCumulusDensity(layer, shadowSamplePos, 0, minHeight, maxHeight) * cloudDensity; - directLight += shadow; - } + directLight += shadow; } - #if defined CloudLayer1 && defined CloudLayer0 - if(layer == 0) directLight += CloudLayer1_density * 2.0 * GetCumulusDensity(1, rayProgress + dV_Sun/abs(dV_Sun.y) * max((LAYER1_maxHEIGHT-70) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT); - #endif - #ifdef CloudLayer2 - // cast a shadow from higher clouds onto lower clouds - vec3 HighAlt_shadowPos = rayProgress + dV_Sun/abs(dV_Sun.y) * max(LAYER2_HEIGHT - rayProgress.y,0.0); - float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density; - directLight += HighAlt_shadow; - #endif + /// shadows cast from one layer to another + #if defined CloudLayer1 && defined CloudLayer0 + if(layer == 0) directLight += LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, rayProgress + dV_Sun/abs(dV_Sun.y) * max((LAYER1_minHEIGHT+70*dither) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT); + #endif + #ifdef CloudLayer2 + // cast a shadow from higher clouds onto lower clouds + vec3 HighAlt_shadowPos = rayProgress + dV_Sun/abs(dV_Sun.y) * max(LAYER2_HEIGHT - rayProgress.y,0.0); + float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density; + directLight += HighAlt_shadow; + #endif - #if defined CloudLayer1 && defined CloudLayer0 - float upperLayerOcclusion = layer == 0 ? CloudLayer1_density * 2.0 * GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_maxHEIGHT-70) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0; - float skylightOcclusion = max(exp2((upperLayerOcclusion*upperLayerOcclusion) * -5), 0.75 + (1.0-distantfog)*0.25); - #else - float skylightOcclusion = 1.0; - #endif + #if defined CloudLayer1 && defined CloudLayer0 + float upperLayerOcclusion = layer == 0 ? LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_maxHEIGHT-70) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0; + float skylightOcclusion = max(exp2((upperLayerOcclusion*upperLayerOcclusion) * -5), 0.75 + (1.0-distantfog)*0.25); + #else + float skylightOcclusion = 1.0; + #endif - float skyScatter = clamp((maxHeight - 20 - rayProgress.y) / 275.0,0.0,1.0); + float skyScatter = clamp(((maxHeight - 20 - rayProgress.y) / 275.0) * (0.5+cloudDensity),0.0,1.0); vec3 lighting = DoCloudLighting(muE, cumulus, skyLightCol*skylightOcclusion, skyScatter, directLight, sunScatter, sunMultiScatter, distantfog); - #if defined CloudLayer1 && defined CloudLayer0 - // a horrible approximation of direct light indirectly hitting the lower layer of clouds after scattering through/bouncing off the upper layer. - lighting += indirectScatter * exp((skyScatter*skyScatter) * cumulus * -35.0) * upperLayerOcclusion * exp(-20.0 * pow(abs(upperLayerOcclusion - 0.3),2)); - #endif + // #if defined CloudLayer1 && defined CloudLayer0 + // // a horrible approximation of direct light indirectly hitting the lower layer of clouds after scattering through/bouncing off the upper layer. + // lighting += indirectScatter * exp((skyScatter*skyScatter) * cumulus * -35.0) * upperLayerOcclusion * exp(-20.0 * pow(abs(upperLayerOcclusion - 0.3),2)); + // #endif COLOR += max(lighting - lighting*exp(-mult*muE),0.0) * TOTAL_EXTINCTION; TOTAL_EXTINCTION *= max(exp(-mult*muE),0.0); @@ -390,6 +400,23 @@ if(layer == 2){ } } +vec3 layerStartingPosition( + vec3 dV_view, + vec3 cameraPos, + float dither, + + float minHeight, + float maxHeight +){ + // allow passing through/above/below the plane without limits + float flip = mix(max(cameraPos.y - maxHeight,0.0), max(minHeight - cameraPos.y,0), clamp(dV_view.y,0,1)); + + // orient the ray to be a flat plane facing up/down + vec3 position = dV_view*dither + cameraPos + dV_view/abs(dV_view.y) * flip; + + return position; +} + vec4 renderClouds( vec3 FragPosition, vec2 Dither, @@ -397,13 +424,10 @@ vec4 renderClouds( vec3 SkyColor ){ - // float lViewPosM = length(FragPosition) < dhRenderDistance *1.5? length(FragPosition) - 1.0 : 1000000000.0; - // bool IntersecTerrain = false; - - #ifndef VOLUMETRIC_CLOUDS return vec4(0.0,0.0,0.0,1.0); #endif + float total_extinction = 1.0; vec3 color = vec3(0.0); @@ -445,7 +469,7 @@ vec4 renderClouds( float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ; vec3 directScattering = LightColor * mieDay * 3.14; - vec3 directMultiScattering = LightColor * mieDayMulti * 4.0; + vec3 directMultiScattering = LightColor * mieDayMulti * 3.14; vec3 sunIndirectScattering = LightColor * phaseg(dot(mat3(gbufferModelView)*vec3(0,1,0),normalize(FragPosition)), 0.5) * 3.14; @@ -502,7 +526,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer0 - vec4 layer0 = renderLayer(0, layer0_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, CloudLayer0_density, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, false); + vec4 layer0 = renderLayer(0, layer0_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, LAYER0_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, false); total_extinction *= layer0.a; // stop overdraw. @@ -514,7 +538,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer1 - vec4 layer1 = renderLayer(1, layer1_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, CloudLayer1_density, SkyColor, directScattering, directMultiScattering,sunIndirectScattering, distantfog, notVisible); + vec4 layer1 = renderLayer(1, layer1_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, LAYER1_DENSITY, SkyColor, directScattering, directMultiScattering,sunIndirectScattering, distantfog, notVisible); total_extinction *= layer1.a; // stop overdraw. @@ -522,7 +546,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer2 - vec4 layer2 = renderLayer(2, layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, CloudLayer2_density, SkyColor, directScattering, directMultiScattering,sunIndirectScattering, distantfog, altoNotVisible); + vec4 layer2 = renderLayer(2, layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, LAYER2_DENSITY, SkyColor, directScattering, directMultiScattering,sunIndirectScattering, distantfog, altoNotVisible); total_extinction *= layer2.a; #endif @@ -583,22 +607,21 @@ float GetCloudShadow(vec3 feetPlayerPos){ // assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud. #ifdef CloudLayer0 - vec3 lowShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer0_height + 20) - playerPos.y,0.0) ; - shadow += GetCumulusDensity(0, lowShadowStart, 1, CloudLayer0_height, CloudLayer0_height+100)*CloudLayer0_density; + vec3 lowShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer0_height + 30) - playerPos.y,0.0) ; + shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100)*LAYER0_DENSITY; #endif #ifdef CloudLayer1 - vec3 higherShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer1_height + 30) - playerPos.y,0.0) ; - shadow += GetCumulusDensity(1, higherShadowStart, 0, CloudLayer1_height, CloudLayer1_height+100)*CloudLayer1_density; + vec3 higherShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer1_height + 50) - playerPos.y,0.0) ; + shadow += GetCumulusDensity(1, higherShadowStart, 0, CloudLayer1_height, CloudLayer1_height+100)*LAYER1_DENSITY; #endif #ifdef CloudLayer2 vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max(CloudLayer2_height - playerPos.y,0.0); - shadow += GetAltostratusDensity(highShadowStart) * CloudLayer2_density; + shadow += GetAltostratusDensity(highShadowStart) * LAYER2_DENSITY; #endif shadow = clamp(shadow,0.0,1.0); - shadow *= shadow; - shadow = exp2(shadow * -100.0); + shadow = exp2((shadow*shadow) * -150.0); return mix(1.0, shadow, CLOUD_SHADOW_STRENGTH); @@ -607,32 +630,32 @@ float GetCloudShadow(vec3 feetPlayerPos){ #endif } + float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){ #ifdef CLOUDS_SHADOWS float shadow = 0.0; #ifdef CloudLayer0 - vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer0_height + 20) - WorldPos.y,0.0) ; - shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height,CloudLayer0_height+100)*CloudLayer0_density; + vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer0_height + 30) - WorldPos.y,0.0) ; + shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height,CloudLayer0_height+100)*LAYER0_DENSITY; #endif #ifdef CloudLayer1 - vec3 higherShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer1_height + 20) - WorldPos.y,0.0) ; - shadow += GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100)*CloudLayer1_density; + vec3 higherShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer1_height + 70) - WorldPos.y,0.0) ; + shadow += GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100)*LAYER1_DENSITY; #endif #ifdef CloudLayer2 vec3 highShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max(CloudLayer2_height - WorldPos.y,0.0); - shadow += GetAltostratusDensity(highShadowStart)*CloudLayer2_density; + shadow += GetAltostratusDensity(highShadowStart)*LAYER2_DENSITY; #endif shadow = clamp(shadow,0.0,1.0); - shadow *= shadow; - shadow = exp2(shadow * -150.0); + shadow = exp((shadow*shadow) * -150.0); return mix(1.0, shadow, CLOUD_SHADOW_STRENGTH); #else return 1.0; #endif -} +} \ No newline at end of file diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 4907b9a..d2538de 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -16,8 +16,6 @@ beacon.beam.depth = true moon=false #endif - - #ifndef RENDER_ENTITY_SHADOWS shadowBlockEntities = false shadowEntities = false @@ -94,7 +92,7 @@ alphaTest.gbuffers_skybasic=false alphaTest.gbuffers_skytextured=false -sliders = 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 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 R_UPPER_CURVE R_LOWER_CURVE G_UPPER_CURVE G_LOWER_CURVE B_UPPER_CURVE B_LOWER_CURVE UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR CompSky_R CompSky_G CompSky_B ambientsss_brightness SSS_TYPE Cloud_Speed 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 Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance FinalR FinalG FinalB 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 +sliders = DAY3_l0_coverage DAY3_l0_density DAY3_l1_coverage DAY3_l1_density DAY3_l2_coverage DAY3_l2_density DAY3_ufog_density DAY3_cfog_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 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 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 R_UPPER_CURVE R_LOWER_CURVE G_UPPER_CURVE G_LOWER_CURVE B_UPPER_CURVE B_LOWER_CURVE UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR CompSky_R CompSky_G CompSky_B ambientsss_brightness SSS_TYPE Cloud_Speed 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 Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance FinalR FinalG FinalB 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 screen.columns=2 screen = \ @@ -103,9 +101,9 @@ BLISS_SHADERS \ [Direct_Light] [World] \ [Ambient_light] [Fog] \ [Post_Processing] [Clouds] \ -DISTANT_HORIZONS_SHADOWMAP [Climate] \ +[LabPBR] [Climate] \ \ -[Misc_Settings] [LabPBR] +[Misc_Settings] [DISTANT_HORIZONS_SETTINGS] # screen = [Direct_Light] [World] # [Ambient_light] [Fog] @@ -172,7 +170,7 @@ DISTANT_HORIZONS_SHADOWMAP [Climate] \ ######## CLIMATE screen.Climate.columns=1 - screen.Climate = Daily_Weather [Seasons] PER_BIOME_ENVIRONMENT [SWAMP] [JUNGLE] [DARKFOREST] + screen.Climate = [Seasons] PER_BIOME_ENVIRONMENT [SWAMP] [JUNGLE] [DARKFOREST] ## BIOME SPECIFICS screen.SWAMP.columns=1 @@ -209,9 +207,9 @@ DISTANT_HORIZONS_SHADOWMAP [Climate] \ ### CLOUDS screen.Clouds.columns = 3 - screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_SHADOWS Daily_Weather \ + screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_SHADOWS Cloud_Speed \ CLOUDS_QUALITY CLOUD_SHADOW_STRENGTH Rain_coverage \ - Cloud_Speed \ + \ \ CloudLayer0 CloudLayer1 CloudLayer2 \ CloudLayer0_coverage CloudLayer1_coverage CloudLayer2_coverage \ @@ -291,43 +289,80 @@ DISTANT_HORIZONS_SHADOWMAP [Climate] \ ######## MISC SETTINGS - screen.Misc_Settings = DEBUG_VIEW [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only Glass_Tint LIGHTNING_FLASH HURT_AND_DEATH_EFFECT LIT_PARTICLE_BRIGHTNESS PLANET_GROUND_BRIGHTNESS BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER CLOUDS_INFRONT_OF_WORLD DH_SHADOWPROJECTIONTWEAK SELECT_BOX + screen.Misc_Settings = DEBUG_VIEW [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only Glass_Tint LIGHTNING_FLASH HURT_AND_DEATH_EFFECT LIT_PARTICLE_BRIGHTNESS PLANET_GROUND_BRIGHTNESS BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER CLOUDS_INFRONT_OF_WORLD SELECT_BOX screen.the_orb.columns = 1 screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B + screen.DISTANT_HORIZONS_SETTINGS.columns = 1 + screen.DISTANT_HORIZONS_SETTINGS = DH_KNOWN_ISSUES DISTANT_HORIZONS_SHADOWMAP shadowDistance shadowMapResolution TOGGLE_VL_FOG VOLUMETRIC_CLOUDS - - - - - -######## PROFILES - # profile.ULTRA_PERFORMANCE=SHARPENING:1.0 Rough_reflections Specular_Reflections SKY_CONTRIBUTION_IN_SSRT VL_RENDER_RESOLUTION:1.0 Sun_specular_Strength:10 Roughness_Threshold:3.0 VL_SAMPLES:50 indirect_effect:4 BLEND_FACTOR:0.01 HQ_SSGI !Adaptive_Step_length POM CLOUDS_QUALITY:1.0 DOF_QUALITY:4 aperture:0.05 Screen_Space_Reflections MAX_DIST:400.0 SCALE_FACTOR:0.95 Sky_reflection Porosity WAVY_STRENGTH:2.0 MISC_BLOCK_SSS MAX_ITERATIONS:400 SSR_STEPS:400 shadowDistanceRenderMul:-1.0 shadowDistance:384.0 shadowMapResolution:8192 - # profile.BASELINE=SHARPENING:0.35 !Rough_reflections !Specular_Reflections !SKY_CONTRIBUTION_IN_SSRT VL_RENDER_RESOLUTION:0.5 Sun_specular_Strength:3 Roughness_Threshold:1.5 VL_SAMPLES:8 indirect_effect:1 BLEND_FACTOR:0.05 !HQ_SSGI Adaptive_Step_length !POM CLOUDS_QUALITY:0.5 DOF_QUALITY:-1 aperture:0.8 !Screen_Space_Reflections MAX_DIST:25.0 SCALE_FACTOR:0.75 !Sky_reflection !Porosity WAVY_STRENGTH:1.0 !MISC_BLOCK_SSS MAX_ITERATIONS:35 SSR_STEPS:30 - # profile.ULTRA_QUALITY=shadowDistance:64.0 SHARPENING:1.0 EMISSIVE_TYPE:0 !WATER_SUN_SPECULAR !MOB_SSS !Ambient_SSS TAA_UPSCALING VL_RENDER_RESOLUTION:0.25 !Puddles VL_SAMPLES:4 indirect_effect:0 BLEND_FACTOR:0.16 !RAYMARCH_CLOUDS_WITH_FOG !Refraction !SCREENSPACE_CONTACT_SHADOWS !WATER_BACKGROUND_SPECULAR SSS_TYPE:0 !WATER_REFLECTIONS !RENDER_ENTITY_SHADOWS !Hand_Held_lights shadowMapResolution:512 SCALE_FACTOR:0.35 !CLOUDS_SHADOWS !SCREENSPACE_REFLECTIONS shadowDistanceRenderMul:1.0 shadowDistance:128.0 shadowMapResolution:2048 - - # profile.QUALITY=GI_Strength:1.0 shadowDistance:128.0 SHARPENING:0.35 EMISSIVE_TYPE:2 ambientOcclusionLevel:1.0 MOB_SSS VOLUMETRIC_CLOUDS Max_Filter_Depth:99.0 !Specular_Reflections Ambient_SSS AO_Strength:1.0 SHADOW_FILTER_SAMPLE_COUNT:13 VL_RENDER_RESOLUTION:0.5 Roughness_Threshold:1.5 VL_SAMPLES:8 indirect_effect:1 shadowDistanceRenderMul:1.0 !HQ_SSGI !BorderFog Min_Shadow_Filter_Radius:5.0 Refraction Dynamic_SSR_quality SCREENSPACE_CONTACT_SHADOWS reflection_quality:30 WATER_BACKGROUND_SPECULAR VPS_Search_Samples:4 SSS_TYPE:2 CLOUDS_QUALITY:0.5 RENDER_ENTITY_SHADOWS Hand_Held_lights shadowMapResolution:2048 CLOUDS_SHADOWS SCREENSPACE_REFLECTIONS Max_Shadow_Filter_Radius:30.0 !Vanilla_like_water BLOOM_STRENGTH:4.0 WAVY_PLANTS SSR_STEPS:30 - # profile.PERFORMANCE=GI_Strength:0.0 shadowDistance:512.0 SHARPENING:1.0 EMISSIVE_TYPE:0 ambientOcclusionLevel:0.0 !MOB_SSS !VOLUMETRIC_CLOUDS Max_Filter_Depth:0.1 Specular_Reflections !Ambient_SSS AO_Strength:0.0 SHADOW_FILTER_SAMPLE_COUNT:128 VL_RENDER_RESOLUTION:0.25 Roughness_Threshold:10.0 VL_SAMPLES:50 indirect_effect:2 shadowDistanceRenderMul:-1.0 HQ_SSGI BorderFog Min_Shadow_Filter_Radius:0.0 !Refraction !Dynamic_SSR_quality !SCREENSPACE_CONTACT_SHADOWS reflection_quality:100.0 !WATER_BACKGROUND_SPECULAR VPS_Search_Samples:64 SSS_TYPE:0 CLOUDS_QUALITY:1.0 !RENDER_ENTITY_SHADOWS !Hand_Held_lights shadowMapResolution:512 !CLOUDS_SHADOWS !SCREENSPACE_REFLECTIONS Max_Shadow_Filter_Radius:0.0 Vanilla_like_water BLOOM_STRENGTH:0.0 !WAVY_PLANTS SSR_STEPS:400 + screen.DAILY_WEATHER.columns = 2 + screen.DAILY_WEATHER = Daily_Weather \ + [DAY0_WEATHER] [DAY5_WEATHER] \ + [DAY1_WEATHER] [DAY6_WEATHER] \ + [DAY2_WEATHER] [DAY7_WEATHER] \ + [DAY3_WEATHER] [DAY8_WEATHER] \ + [DAY4_WEATHER] [DAY9_WEATHER] + + screen.DAY0_WEATHER.columns = 2 + screen.DAY0_WEATHER = DAY0_l0_coverage DAY0_l0_density DAY0_l1_coverage DAY0_l1_density DAY0_l2_coverage DAY0_l2_density DAY0_ufog_density DAY0_cfog_density + screen.DAY1_WEATHER.columns = 2 + screen.DAY1_WEATHER = DAY1_l0_coverage DAY1_l0_density DAY1_l1_coverage DAY1_l1_density DAY1_l2_coverage DAY1_l2_density DAY1_ufog_density DAY1_cfog_density + screen.DAY2_WEATHER.columns = 2 + screen.DAY2_WEATHER = DAY2_l0_coverage DAY2_l0_density DAY2_l1_coverage DAY2_l1_density DAY2_l2_coverage DAY2_l2_density DAY2_ufog_density DAY2_cfog_density + screen.DAY3_WEATHER.columns = 2 + screen.DAY3_WEATHER = DAY3_l0_coverage DAY3_l0_density DAY3_l1_coverage DAY3_l1_density DAY3_l2_coverage DAY3_l2_density DAY3_ufog_density DAY3_cfog_density + screen.DAY4_WEATHER.columns = 2 + screen.DAY4_WEATHER = DAY4_l0_coverage DAY4_l0_density DAY4_l1_coverage DAY4_l1_density DAY4_l2_coverage DAY4_l2_density DAY4_ufog_density DAY4_cfog_density + screen.DAY5_WEATHER.columns = 2 + screen.DAY5_WEATHER = DAY5_l0_coverage DAY5_l0_density DAY5_l1_coverage DAY5_l1_density DAY5_l2_coverage DAY5_l2_density DAY5_ufog_density DAY5_cfog_density + screen.DAY6_WEATHER.columns = 2 + screen.DAY6_WEATHER = DAY6_l0_coverage DAY6_l0_density DAY6_l1_coverage DAY6_l1_density DAY6_l2_coverage DAY6_l2_density DAY6_ufog_density DAY6_cfog_density + screen.DAY7_WEATHER.columns = 2 + screen.DAY7_WEATHER = DAY7_l0_coverage DAY7_l0_density DAY7_l1_coverage DAY7_l1_density DAY7_l2_coverage DAY7_l2_density DAY7_ufog_density DAY7_cfog_density + screen.DAY8_WEATHER.columns = 2 + screen.DAY8_WEATHER = DAY8_l0_coverage DAY8_l0_density DAY8_l1_coverage DAY8_l1_density DAY8_l2_coverage DAY8_l2_density DAY8_ufog_density DAY8_cfog_density + screen.DAY9_WEATHER.columns = 2 + screen.DAY9_WEATHER = DAY9_l0_coverage DAY9_l0_density DAY9_l1_coverage DAY9_l1_density DAY9_l2_coverage DAY9_l2_density DAY9_ufog_density DAY9_cfog_density ##################################### ####### WEATHER RELATED STUFF ####### ##################################### -######## moonphase based weather +######## weather profiles. + +variable.int.maxDays = 2 +variable.int.DayCounter = worldDay - maxDays * floor(worldDay / maxDays) # in seconds... -variable.int.WeatherTransitionTime = 30 +variable.int.WeatherTransitionTime = 1 + +variable.float.LAYER0_coverage = smooth(if( \ + DayCounter == 0, 0.5, \ + 1.3 ), WeatherTransitionTime, WeatherTransitionTime) + +variable.float.LAYER0_denisty = smooth(if( \ + DayCounter == 0, 0.5, \ + 0.5 ), WeatherTransitionTime, WeatherTransitionTime) + + +uniform.vec2.LAYER0_params = vec2(LAYER0_coverage, LAYER0_denisty) + +uniform.float.EXAMPLE = smooth(if(DayCounter == 0, 5.0, 0.0 ), 5, 5) + uniform.float.Cumulus_Cov = smooth(if( \ - moonPhase == 0, 0.7, \ - moonPhase == 1, 0.9, \ - moonPhase == 2, 0.0, \ - moonPhase == 3, 0.8, \ - moonPhase == 4, 0.0, \ - moonPhase == 5, 1.2, \ - moonPhase == 6, 0.6, \ - 0.0 ), WeatherTransitionTime, WeatherTransitionTime) + DayCounter == 0, 5.0, \ + DayCounter == 1, 0.0, \ + DayCounter == 2, 0.0, \ + DayCounter == 3, 0.0, \ + DayCounter == 4, 0.0, \ + DayCounter == 5, 0.0, \ + DayCounter == 6, 0.0, \ + DayCounter == 7, 0.0, \ + DayCounter == 9, 0.0, \ + 0.0 ), WeatherTransitionTime, WeatherTransitionTime) uniform.float.Alto_Cov = smooth(if( \ moonPhase == 0, 0.1, \ @@ -349,6 +384,45 @@ uniform.float.Alto_Den = smooth(if( \ moonPhase == 6, 0.05, \ 0.0 ), WeatherTransitionTime, WeatherTransitionTime) + + + + + + + + +# uniform.float.Cumulus_Cov = smooth(if( \ +# moonPhase == 0, 0.7, \ +# moonPhase == 1, 0.9, \ +# moonPhase == 2, 0.0, \ +# moonPhase == 3, 0.8, \ +# moonPhase == 4, 0.0, \ +# moonPhase == 5, 1.2, \ +# moonPhase == 6, 0.6, \ +# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) + +# uniform.float.Alto_Cov = smooth(if( \ +# moonPhase == 0, 0.1, \ +# moonPhase == 1, 1.0, \ +# moonPhase == 2, 1.0, \ +# moonPhase == 3, 0.3, \ +# moonPhase == 4, 0.3, \ +# moonPhase == 5, 0.0, \ +# moonPhase == 6, 1.5, \ +# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) + +# uniform.float.Alto_Den = smooth(if( \ +# moonPhase == 0, 0.1, \ +# moonPhase == 1, 0.25, \ +# moonPhase == 2, 0.1, \ +# moonPhase == 3, 0.7, \ +# moonPhase == 4, 0.7, \ +# moonPhase == 5, 0.0, \ +# moonPhase == 6, 0.05, \ +# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) + + uniform.float.Uniform_Den = smooth(if( \ moonPhase == 0, 0, \ moonPhase == 1, 0, \ diff --git a/shaders/world0/dh_shadow.vsh b/shaders/world0/dh_shadow.vsh index a5e3fe2..54d3b6f 100644 --- a/shaders/world0/dh_shadow.vsh +++ b/shaders/world0/dh_shadow.vsh @@ -35,9 +35,9 @@ uniform float dhFarPlane; vec4 toClipSpace3(vec3 viewSpacePosition) { - mat4 projection = DH_shadowProjectionTweak(gl_ProjectionMatrix); + // mat4 projection = DH_shadowProjectionTweak(gl_ProjectionMatrix); - return vec4(projMAD(projection, viewSpacePosition),1.0); + return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),1.0); } diff --git a/shaders/world0/shadow.vsh b/shaders/world0/shadow.vsh index cd90564..006d5a1 100644 --- a/shaders/world0/shadow.vsh +++ b/shaders/world0/shadow.vsh @@ -106,9 +106,9 @@ uniform float dhFarPlane; vec4 toClipSpace3(vec3 viewSpacePosition) { - mat4 projection = DH_shadowProjectionTweak(gl_ProjectionMatrix); + // mat4 projection = DH_shadowProjectionTweak(gl_ProjectionMatrix); - return vec4(projMAD(projection, viewSpacePosition),1.0); + return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),1.0); }