make daily weather fully functional (No defaults yet). fix damage effects from randomly happening. fix AO strength slider not function when SSAO is on.

This commit is contained in:
Xonk 2024-05-22 00:01:17 -04:00
parent 044d690a52
commit dcce8e5358
26 changed files with 278 additions and 265 deletions

View File

@ -21,6 +21,7 @@ uniform sampler2D depthtex1;
uniform sampler2D colortex12;
// uniform sampler2D colortex7;
uniform sampler2D colortex4;
uniform sampler2D colortex5;
@ -113,9 +114,12 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
uniform int isEyeInWater;
uniform float rainStrength;
#include "/lib/volumetricClouds.glsl"
#ifdef OVERWORLD_SHADER
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
#endif
float GGX(vec3 n, vec3 v, vec3 l, float r, float f0) {
r = max(pow(r,2.5), 0.0001);

View File

@ -13,6 +13,13 @@ uniform sampler2D colortex4;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
#ifdef OVERWORLD_SHADER
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
#endif
varying mat4 normalmatrix;
uniform mat4 gbufferModelViewInverse;
@ -87,6 +94,13 @@ void main() {
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
#ifdef OVERWORLD_SHADER
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
#endif
#endif
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
WsunVec2 = lightCol.a * normalize(sunPosition);

View File

@ -71,6 +71,7 @@ flat varying float HELD_ITEM_BRIGHTNESS;
#include "/lib/util.glsl"
#ifdef OVERWORLD_SHADER
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
#endif
@ -371,7 +372,7 @@ void main() {
#endif
#ifdef WEATHER
gl_FragData[1].a = TEXTURE.a; // for bloomy rain and stuff
gl_FragData[1] = vec4(0.0,0.0,0.0,TEXTURE.a); // for bloomy rain and stuff
#endif
#ifndef WEATHER
@ -410,9 +411,11 @@ void main() {
Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2);
float cloudShadow = GetCloudShadow(feetPlayerPos);
#ifdef CLOUDS_SHADOWS
Shadows *= GetCloudShadow(feetPlayerPos);
#endif
Direct_lighting = directLightColor * Shadows * cloudShadow;
Direct_lighting = directLightColor * Shadows;
#ifndef LINES
Direct_lighting *= phaseg(clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), 0.65)*2 + 0.5;

View File

@ -23,6 +23,10 @@ flat varying float exposure;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
flat varying vec3 WsunVec;
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
#endif
@ -142,6 +146,10 @@ void main() {
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
#endif
#endif

View File

@ -49,6 +49,7 @@ uniform sampler2D colortex12;
uniform sampler2D colortex14;
uniform sampler2D colortex5;
uniform sampler2D colortex3;
uniform sampler2D colortex4;
uniform sampler2D colortex6;
uniform sampler2D texture;
@ -106,9 +107,10 @@ uniform vec3 nsunColor;
#ifdef OVERWORLD_SHADER
flat varying float Flashing;
#include "/lib/lightning_stuff.glsl"
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
#else
uniform sampler2D colortex4;
uniform float nightVision;
#endif

View File

@ -23,6 +23,11 @@ flat varying float exposure;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
flat varying vec3 WsunVec;
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
#endif
varying vec4 normalMat;
@ -151,6 +156,12 @@ void main() {
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
// WsunVec = normalize(LightDir);
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
#endif
#endif
#ifdef TAA_UPSCALING

View File

@ -295,7 +295,7 @@ vec2 SSAO(
}
}
}
return max(1.0 - vec2(occlusion, sss)/n, 0.0);
return max(1.0 - vec2(occlusion*AO_Strength, sss)/n, 0.0);
}
vec4 encode (vec3 n, vec2 lightmaps){

View File

@ -31,7 +31,6 @@ const bool colortex5MipmapEnabled = true;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
#if Sun_specular_Strength != 0
#define LIGHTSOURCE_REFLECTION
#endif
@ -41,7 +40,6 @@ const bool colortex5MipmapEnabled = true;
#ifdef NETHER_SHADER
uniform float nightVision;
uniform sampler2D colortex4;
const bool colortex4MipmapEnabled = true;
uniform vec3 lightningEffect;
// #define LIGHTSOURCE_REFLECTION
@ -49,7 +47,6 @@ const bool colortex5MipmapEnabled = true;
#ifdef END_SHADER
uniform float nightVision;
uniform sampler2D colortex4;
uniform vec3 lightningEffect;
flat varying float Flashing;
@ -71,7 +68,7 @@ uniform sampler2D colortex0; //clouds
uniform sampler2D colortex1; //albedo(rgb),material(alpha) RGBA16
uniform sampler2D colortex2; //translucents(rgba)
uniform sampler2D colortex3; //filtered shadowmap(VPS)
// uniform sampler2D colortex4; //LUT(rgb), quarter res depth(alpha)
uniform sampler2D colortex4; //LUT(rgb), quarter res depth(alpha)
uniform sampler2D colortex5; //TAA buffer/previous frame
uniform sampler2D colortex6; //Noise
uniform sampler2D colortex7; //water?
@ -171,6 +168,8 @@ vec3 toScreenSpace(vec3 p) {
#include "/lib/stars.glsl"
#ifdef OVERWORLD_SHADER
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
// #define CLOUDS_INTERSECT_TERRAIN
#endif

View File

@ -5,6 +5,11 @@
flat varying float Flashing;
#endif
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
flat varying vec3 WsunVec;
flat varying vec3 unsigned_WsunVec;
flat varying vec3 averageSkyCol_Clouds;
@ -59,6 +64,11 @@ void main() {
exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
#endif
#ifdef TAA
TAA_Offset = offsets[framemod8];
#else

View File

@ -15,7 +15,7 @@ uniform sampler2D dhDepthTex1;
uniform sampler2D colortex2;
uniform sampler2D colortex3;
// uniform sampler2D colortex4;
uniform sampler2D colortex4;
uniform sampler2D colortex6;
uniform sampler2D colortex7;
@ -77,15 +77,16 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
#define TIMEOFDAYFOG
#include "/lib/lightning_stuff.glsl"
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
#include "/lib/overworld_fog.glsl"
#endif
#ifdef NETHER_SHADER
uniform sampler2D colortex4;
#include "/lib/nether_fog.glsl"
#endif
#ifdef END_SHADER
uniform sampler2D colortex4;
#include "/lib/end_fog.glsl"
#endif
@ -296,7 +297,7 @@ void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estE
}
#ifdef VL_CLOUDS_SHADOWS
sh *= GetCloudShadow_VLFOG(progressW,WsunVec);
sh *= GetCloudShadow_VLFOG(progressW, WsunVec);
#endif
@ -369,6 +370,7 @@ void main() {
#endif
float z = texture2D(depthtex1,tc).x;
#ifdef DISTANT_HORIZONS
float DH_z = texture2D(dhDepthTex1,tc).x;
#else
@ -393,10 +395,6 @@ void main() {
vec3 indirectLightColor = averageSkyCol/30.0;
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds/30.0;
////////////////////////////////////////////////////////////
///////////////// IN FRONT OF TRANSLUCENTS /////////////////
////////////////////////////////////////////////////////////
#ifdef OVERWORLD_SHADER
vec4 VolumetricFog = GetVolumetricFog(viewPos0, vec2(noise_1,noise_2), directLightColor, indirectLightColor);
#endif
@ -407,10 +405,6 @@ void main() {
gl_FragData[0] = clamp(VolumetricFog, 0.0, 65000.0);
//////////////////////////////////////////////////////////
///////////////// BEHIND OF TRANSLUCENTS /////////////////
//////////////////////////////////////////////////////////
if (isEyeInWater == 1){
float estEyeDepth = clamp(eyeBrightnessSmooth.y/240.0,0.,1.0);
@ -426,5 +420,4 @@ void main() {
}
// gl_FragData[0] = clamp(vec4(vl,1.0),0.000001,65000.);
}

View File

@ -6,6 +6,13 @@ flat varying vec4 lightCol;
flat varying vec3 averageSkyCol;
flat varying vec3 averageSkyCol_Clouds;
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
flat varying vec3 WsunVec;
flat varying vec3 refractedSunVec;
@ -47,6 +54,15 @@ void main() {
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
dailyWeatherParams0.a = texelFetch2D(colortex4,ivec2(3,1),0).x/150.0;
dailyWeatherParams1.a = texelFetch2D(colortex4,ivec2(3,1),0).y/150.0;
#endif
#endif
#ifdef NETHER_SHADER

View File

@ -30,9 +30,7 @@ uniform sampler2D colortex13;
uniform sampler2D colortex15;
uniform vec2 texelSize;
#if defined NETHER_SHADER || defined END_SHADER
uniform sampler2D colortex4;
#endif
uniform sampler2D colortex4;
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
flat varying vec3 WsunVec;
@ -70,13 +68,14 @@ uniform float darknessLightFactor;
#ifdef OVERWORLD_SHADER
#include "/lib/sky_gradient.glsl"
#include "/lib/lightning_stuff.glsl"
#include "/lib/volumetricClouds.glsl"
#endif
#ifndef OVERWORLD_SHADER
#include "/lib/climate_settings.glsl"
// #define CLOUDSHADOWSONLY
// #include "/lib/volumetricClouds.glsl"
#endif
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)

View File

@ -2,12 +2,7 @@
#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;
@ -139,6 +134,7 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
#define TEST
#define TIMEOFDAYFOG
#include "/lib/lightning_stuff.glsl"
#include "/lib/volumetricClouds.glsl"
#include "/lib/overworld_fog.glsl"
@ -192,12 +188,13 @@ if (gl_FragCoord.x > pixelPos6.x && gl_FragCoord.x < pixelPos6.x + 1 && gl_FragC
#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){
if (gl_FragCoord.x > 1 && gl_FragCoord.x < 4 && 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;
if(gl_FragCoord.x < 2) gl_FragData[0] = vec4(dailyWeatherParams0.rgb,1.0);
if(gl_FragCoord.x > 2) gl_FragData[0] = vec4(dailyWeatherParams1.rgb,1.0);
if(gl_FragCoord.x > 3) gl_FragData[0] = vec4(dailyWeatherParams0.a, dailyWeatherParams1.a, 0.0, 1.0);
}
#endif

View File

@ -94,6 +94,14 @@ void getWeatherParams(
weatherParams1 = vec4(layer0_density, layer1_density, layer2_density, cloudyFog_density);
}
float hash11(float p)
{
p = fract(p * .1031);
p *= p + 33.33;
p *= p + p;
return fract(p);
}
void main() {
gl_Position = ftransform()*0.5+0.5;
@ -168,18 +176,47 @@ void main() {
//////////////////////////////////
#ifdef Daily_Weather
int dayCounter = int(mod(worldDay, 10));
// this is horrid and i hate it
// store 8 values that control cloud parameters.
// as the day counter changes, switch to a different set of stored values.
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);
#ifdef CHOOSE_RANDOM_WEATHER_PROFILE
int dayCounter = clamp(int(hash11(float(mod(worldDay, 1000))) * 11.0), 0,10);
#else
int dayCounter = int(mod(worldDay, 10));
#endif
vec4 weatherParameters_A[10] = vec4[](
vec4( DAY0_l0_coverage, DAY0_l1_coverage, DAY0_l2_coverage, DAY0_ufog_density),
vec4( DAY1_l0_coverage, DAY1_l1_coverage, DAY1_l2_coverage, DAY1_ufog_density),
vec4( DAY2_l0_coverage, DAY2_l1_coverage, DAY2_l2_coverage, DAY2_ufog_density),
vec4( DAY3_l0_coverage, DAY3_l1_coverage, DAY3_l2_coverage, DAY3_ufog_density),
vec4( DAY4_l0_coverage, DAY4_l1_coverage, DAY4_l2_coverage, DAY4_ufog_density),
vec4( DAY5_l0_coverage, DAY5_l1_coverage, DAY5_l2_coverage, DAY5_ufog_density),
vec4( DAY6_l0_coverage, DAY6_l1_coverage, DAY6_l2_coverage, DAY6_ufog_density),
vec4( DAY7_l0_coverage, DAY7_l1_coverage, DAY7_l2_coverage, DAY7_ufog_density),
vec4( DAY8_l0_coverage, DAY8_l1_coverage, DAY8_l2_coverage, DAY8_ufog_density),
vec4( DAY9_l0_coverage, DAY9_l1_coverage, DAY9_l2_coverage, DAY9_ufog_density)
);
vec4 weatherParameters_B[10] = vec4[](
vec4(DAY0_l0_density, DAY0_l1_density, DAY0_l2_density, DAY0_cfog_density),
vec4(DAY1_l0_density, DAY1_l1_density, DAY1_l2_density, DAY1_cfog_density),
vec4(DAY2_l0_density, DAY2_l1_density, DAY2_l2_density, DAY2_cfog_density),
vec4(DAY3_l0_density, DAY3_l1_density, DAY3_l2_density, DAY3_cfog_density),
vec4(DAY4_l0_density, DAY4_l1_density, DAY4_l2_density, DAY4_cfog_density),
vec4(DAY5_l0_density, DAY5_l1_density, DAY5_l2_density, DAY5_cfog_density),
vec4(DAY6_l0_density, DAY6_l1_density, DAY6_l2_density, DAY6_cfog_density),
vec4(DAY7_l0_density, DAY7_l1_density, DAY7_l2_density, DAY7_cfog_density),
vec4(DAY8_l0_density, DAY8_l1_density, DAY8_l2_density, DAY8_cfog_density),
vec4(DAY9_l0_density, DAY9_l1_density, DAY9_l2_density, DAY9_cfog_density)
);
dailyWeatherParams0 = weatherParameters_A[dayCounter];
dailyWeatherParams1 = weatherParameters_B[dayCounter];
#endif
//////////////////////////////

View File

@ -1,12 +1,6 @@
#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;
@ -107,10 +101,13 @@ uniform int dhRenderDistance;
#include "/lib/lightning_stuff.glsl"
#include "/lib/sky_gradient.glsl"
#include "/lib/res_params.glsl"
// #define CLOUDS_INTERSECT_TERRAIN
#include "/lib/volumetricClouds.glsl"
#include "/lib/res_params.glsl"

View File

@ -1,7 +1,10 @@
#include "/lib/settings.glsl"
flat varying vec3 dailyWeatherParams0;
flat varying vec3 dailyWeatherParams1;
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
flat varying vec3 averageSkyCol;
flat varying vec3 sunColor;
// flat varying vec3 moonColor;
@ -27,8 +30,10 @@ 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;
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
#endif
averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
sunColor = texelFetch2D(colortex4,ivec2(6,37),0).rgb;

View File

@ -24,7 +24,6 @@ uniform vec3 cameraPosition;
#include "/lib/color_transforms.glsl"
#include "/lib/color_dither.glsl"
#include "/lib/res_params.glsl"
#include "/lib/gameplay_effects.glsl"
uniform int hideGUI;
@ -118,6 +117,28 @@ float interleaved_gradientNoise(){
}
#include "/lib/gameplay_effects.glsl"
void doCameraGridLines(inout vec3 color, vec2 UV){
float lineThicknessY = 0.0025;
float lineThicknessX = lineThicknessY/aspectRatio;
float horizontalLines = abs(UV.x-0.33);
horizontalLines = min(abs(UV.x-0.66), horizontalLines);
float verticalLines = abs(UV.y-0.33);
verticalLines = min(abs(UV.y-0.66), verticalLines);
float gridLines = horizontalLines < lineThicknessX || verticalLines < lineThicknessY ? 1.0 : 0.0;
if(hideGUI > 0.0) gridLines = 0.0;
color = mix(color, vec3(1.0), gridLines);
}
void main() {
#ifdef BICUBIC_UPSCALING
vec3 col = SampleTextureCatmullRom(colortex7,texcoord,1.0/texelSize).rgb;
@ -165,6 +186,10 @@ void main() {
applyGameplayEffects(FINAL_COLOR, texcoord, interleaved_gradientNoise());
#endif
#ifdef CAMERA_GRIDLINES
doCameraGridLines(FINAL_COLOR, texcoord);
#endif
gl_FragColor.rgb = FINAL_COLOR;
#if DEBUG_VIEW == debug_SHADOWMAP

View File

@ -21,7 +21,7 @@ uniform sampler2D dhDepthTex1;
uniform sampler2D colortex2;
uniform sampler2D colortex3;
// uniform sampler2D colortex4;
uniform sampler2D colortex4;
uniform sampler2D colortex6;
uniform sampler2D colortex7;
uniform sampler2D colortex11;
@ -89,16 +89,16 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
#define TIMEOFDAYFOG
#include "/lib/lightning_stuff.glsl"
#define CLOUDSHADOWSONLY
#include "/lib/volumetricClouds.glsl"
#include "/lib/overworld_fog.glsl"
#endif
#ifdef NETHER_SHADER
uniform sampler2D colortex4;
#include "/lib/nether_fog.glsl"
#endif
#ifdef END_SHADER
uniform sampler2D colortex4;
#include "/lib/end_fog.glsl"
#endif
@ -353,17 +353,13 @@ void main() {
lightmap.y = 1.0;
#endif
float Vdiff = distance(viewPos1, viewPos0) * 2.0;
float VdotU = playerPos.y;
float estimatedDepth = Vdiff * abs(VdotU) ; //assuming water plane
float estimatedSunDepth = estimatedDepth / abs(WsunVec.y); //assuming water plane
indirectLightColor_dynamic *= ambient_brightness * pow(1.0-pow(1.0-lightmap.y,0.5),3.0) ;
float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) ;
// float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) ;
// indirectLightColor_dynamic += vec3(TORCH_R,TORCH_G,TORCH_B) * TorchBrightness_autoAdjust * pow(1.0-sqrt(1.0-clamp(lightmap.x,0.0,1.0)),2.0) * 2.0;
vec4 VolumetricFog2 = vec4(0,0,0,1);

View File

@ -6,6 +6,11 @@ flat varying vec4 lightCol;
flat varying vec3 averageSkyCol;
flat varying vec3 averageSkyCol_Clouds;
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
flat varying vec3 WsunVec;
flat varying vec3 refractedSunVec;
@ -49,6 +54,15 @@ void main() {
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
#if defined Daily_Weather
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb/150.0, 0.0);
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0, 0.0);
dailyWeatherParams0.a = texelFetch2D(colortex4,ivec2(3,1),0).x/150.0;
dailyWeatherParams1.a = texelFetch2D(colortex4,ivec2(3,1),0).y/150.0;
#endif
#endif
#ifdef NETHER_SHADER

View File

@ -206,7 +206,8 @@ screen.Clouds = Cloud Settings
option.CloudLayer2_height = Height
screen.DAILY_WEATHER = Daily Weather Settings
screen.DAY0_WEATHER = Day 0 Weather
option.CHOOSE_RANDOM_WEATHER_PROFILE = Random Weather Profile
screen.DAY0_WEATHER = Day 0 Weather Profile
option.DAY0_l0_coverage = Small Cumulus coverage
option.DAY0_l0_density = Small Cumulus Density
option.DAY0_l1_coverage = Large Cumulus Coverage
@ -216,7 +217,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY0_ufog_density = Uniform Fog Density
option.DAY0_cfog_density = Cloudy Fog Density
screen.DAY1_WEATHER = Day 1 Weather
screen.DAY1_WEATHER = Day 1 Weather Profile
option.DAY1_l0_coverage = Small Cumulus coverage
option.DAY1_l0_density = Small Cumulus Density
option.DAY1_l1_coverage = Large Cumulus Coverage
@ -226,7 +227,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY1_ufog_density = Uniform Fog Density
option.DAY1_cfog_density = Cloudy Fog Density
screen.DAY2_WEATHER = Day 2 Weather
screen.DAY2_WEATHER = Day 2 Weather Profile
option.DAY2_l0_coverage = Small Cumulus coverage
option.DAY2_l0_density = Small Cumulus Density
option.DAY2_l1_coverage = Large Cumulus Coverage
@ -236,7 +237,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY2_ufog_density = Uniform Fog Density
option.DAY2_cfog_density = Cloudy Fog Density
screen.DAY3_WEATHER = Day 3 Weather
screen.DAY3_WEATHER = Day 3 Weather Profile
option.DAY3_l0_coverage = Small Cumulus coverage
option.DAY3_l0_density = Small Cumulus Density
option.DAY3_l1_coverage = Large Cumulus Coverage
@ -246,7 +247,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY3_ufog_density = Uniform Fog Density
option.DAY3_cfog_density = Cloudy Fog Density
screen.DAY4_WEATHER = Day 4 Weather
screen.DAY4_WEATHER = Day 4 Weather Profile
option.DAY4_l0_coverage = Small Cumulus coverage
option.DAY4_l0_density = Small Cumulus Density
option.DAY4_l1_coverage = Large Cumulus Coverage
@ -256,7 +257,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY4_ufog_density = Uniform Fog Density
option.DAY4_cfog_density = Cloudy Fog Density
screen.DAY5_WEATHER = Day 5 Weather
screen.DAY5_WEATHER = Day 5 Weather Profile
option.DAY5_l0_coverage = Small Cumulus coverage
option.DAY5_l0_density = Small Cumulus Density
option.DAY5_l1_coverage = Large Cumulus Coverage
@ -266,7 +267,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY5_ufog_density = Uniform Fog Density
option.DAY5_cfog_density = Cloudy Fog Density
screen.DAY6_WEATHER = Day 6 Weather
screen.DAY6_WEATHER = Day 6 Weather Profile
option.DAY6_l0_coverage = Small Cumulus coverage
option.DAY6_l0_density = Small Cumulus Density
option.DAY6_l1_coverage = Large Cumulus Coverage
@ -276,7 +277,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY6_ufog_density = Uniform Fog Density
option.DAY6_cfog_density = Cloudy Fog Density
screen.DAY7_WEATHER = Day 7 Weather
screen.DAY7_WEATHER = Day 7 Weather Profile
option.DAY7_l0_coverage = Small Cumulus coverage
option.DAY7_l0_density = Small Cumulus Density
option.DAY7_l1_coverage = Large Cumulus Coverage
@ -286,7 +287,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY7_ufog_density = Uniform Fog Density
option.DAY7_cfog_density = Cloudy Fog Density
screen.DAY8_WEATHER = Day 8 Weather
screen.DAY8_WEATHER = Day 8 Weather Profile
option.DAY8_l0_coverage = Small Cumulus coverage
option.DAY8_l0_density = Small Cumulus Density
option.DAY8_l1_coverage = Large Cumulus Coverage
@ -296,7 +297,7 @@ screen.DAILY_WEATHER = Daily Weather Settings
option.DAY8_ufog_density = Uniform Fog Density
option.DAY8_cfog_density = Cloudy Fog Density
screen.DAY9_WEATHER = Day 9 Weather
screen.DAY9_WEATHER = Day 9 Weather Profile
option.DAY9_l0_coverage = Small Cumulus coverage
option.DAY9_l0_density = Small Cumulus Density
option.DAY9_l1_coverage = Large Cumulus Coverage
@ -596,7 +597,8 @@ screen.Clouds.comment = Configure settings related to the raymarched volumetric
option.VOLUMETRIC_CLOUDS.comment = Toggle the clouds. §aPERFORMANCE COST:§r medium to high
option.CLOUDS_QUALITY.comment = Configure the resolution of the volumetric clouds. §aPERFORMANCE COST:§r high
option.CLOUDS_SHADOWS.comment = Toggle shadows that are casted from the clouds onto the ground, and fog below them. §aPERFORMANCE COST:§r low to medium
option.Daily_Weather.comment = Toggle the daily weather. There are 8 weather profiles i have set, that the shader cycles through every day. You cannot change any cloud coverage settings when this is enabled. §aPERFORMANCE COST:§r low
option.Daily_Weather.comment = Toggle the weather that changes every day. §bWhat is this?§r There are 10 weather profiles that the shader cycles through every day. You cannot change any cloud coverage settings when this is enabled. §aPERFORMANCE COST:§r low
option.CHOOSE_RANDOM_WEATHER_PROFILE.comment = §bWhat is this?§r Configure the shader to randomly choose the weather from one of the days below. When this is turned off, the shader will choose the day in order.
option.Cloud_Speed.comment = Configure how fast the clouds move as the day goes by.
option.Rain_coverage.comment = Configure how much of the sky the clouds cover during rain.

View File

@ -118,66 +118,6 @@
// return the final color of the year, because it contains all the other colors, at some point.
return SpringToSummer;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
////////////////////////////// DAILY WEATHER //////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifdef WEATHERCLOUDS
uniform float Cumulus_Cov;
float DailyWeather_Cumulus(
float Coverage
){
#ifdef Daily_Weather
Coverage += mix(Cumulus_Cov, Rain_coverage, rainStrength);
#else
Coverage += mix(CloudLayer0_coverage, Rain_coverage, rainStrength);
#endif
return Coverage;
}
uniform float Alto_Cov;
uniform float Alto_Den;
void DailyWeather_Alto(
inout float Coverage,
inout float Density
){
#ifdef Daily_Weather
Coverage = Alto_Cov;
Density = Alto_Den;
#else
Coverage = CloudLayer2_coverage;
Density = CloudLayer2_density;
#endif
}
#endif
#ifdef Daily_Weather
uniform float Uniform_Den;
uniform float Cloudy_Den;
void DailyWeather_FogDensity(
inout vec4 UniformDensity,
inout vec4 CloudyDensity
){
// set fog Profiles for each of the 8 days in the cycle.
// U = uniform fog || C = cloudy fog
// vec4( morning, noon, evening, night )
UniformDensity.rgb += vec3(Uniform_Den);
CloudyDensity.rgb += vec3(Cloudy_Den);
}
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////// BIOME SPECIFICS /////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
@ -273,7 +213,7 @@
#ifdef TIMEOFDAYFOG
// uniform int worldTime;
void TimeOfDayFog(
inout float Uniform, inout float Cloudy, float maxDistance
inout float Uniform, inout float Cloudy, float maxDistance, float DailyWeather_UniformFogDensity, float DailyWeather_CloudyFogDensity
) {
float Time = worldTime%24000;
@ -288,9 +228,11 @@
vec4 UniformDensity = TOD_Fog_mult * vec4(Morning_Uniform_Fog, Noon_Uniform_Fog, Evening_Uniform_Fog, Night_Uniform_Fog);
vec4 CloudyDensity = TOD_Fog_mult * vec4(Morning_Cloudy_Fog, Noon_Cloudy_Fog, Evening_Cloudy_Fog, Night_Cloudy_Fog);
#ifdef Daily_Weather
DailyWeather_FogDensity(UniformDensity, CloudyDensity); // let daily weather influence fog densities.
// let daily weather influence fog densities.
UniformDensity = max(UniformDensity, DailyWeather_UniformFogDensity * 50.0);
CloudyDensity = max(CloudyDensity, DailyWeather_CloudyFogDensity * 50.0);
// DailyWeather_FogDensity(UniformDensity, CloudyDensity);
#endif
#ifdef PER_BIOME_ENVIRONMENT

View File

@ -11,6 +11,7 @@
#endif
uniform float exitWater;
// uniform float exitPowderSnow;
uniform int isEyeInWater;
// uniform float currentPlayerHunger;
@ -65,10 +66,10 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
scale.xy = (isEyeInWater == 1 ? vec2(0.3) : vec2(0.5, 0.25 + (exitWater*exitWater)*0.25 ) ) * vec2(aspectRatio,1.0);
scale.z = isEyeInWater == 1 ? 0.0 : exitWater;
float waterDrops = texture2D(noisetex, (texcoord - vec2(0.0, scale.z)) * scale.xy).r;
float waterDrops = texture2D(noisetex, (texcoord - vec2(0.0, scale.z)) * scale.xy).r ;
if(isEyeInWater == 1) waterDrops = waterDrops*waterDrops * 0.3;
if(isEyeInWater == 0) waterDrops = sqrt(min(max(waterDrops - (1.0-sqrt(exitWater))*0.7,0.0) * (1.0 + exitWater),1.0)) * 0.3;
if(isEyeInWater == 0 && exitWater > 0.0) waterDrops = sqrt(min(max(waterDrops - (1.0-sqrt(exitWater))*0.7,0.0) * (1.0 + exitWater),1.0)) * 0.3;
// apply distortion effects for exiting water and under water
distortmask = max(distortmask, waterDrops);
@ -80,6 +81,14 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
vec2 zoomUV = 0.5 + (texcoord - 0.5) * (1.0 - distortmask);
vec3 distortedColor = texture2D(colortex7, zoomUV).rgb;
#ifdef TONE_CURVE
distortedColor = toneCurve(distortedColor);
#endif
#ifdef COLOR_GRADING_ENABLED
distortedColor = colorGrading(distortedColor);
#endif
applyContrast(distortedColor, CONTRAST);
#ifdef WATER_ON_CAMERA_EFFECT
// apply the distorted water color to the scene, but revert back to before when it ends
if(exitWater > 0.01) color = distortedColor;
@ -105,4 +114,5 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
if(isDead) color = distortedColorLuma * 0.3;
#endif
}

View File

@ -1,6 +1,5 @@
uniform float noPuddleAreas;
float densityAtPosFog(in vec3 pos){
pos /= 18.;
pos.xz *= 0.5;
@ -40,7 +39,7 @@ float cloudVol(in vec3 pos, float maxDistance ){
if(sandStorm > 0 || snowStorm > 0) CloudyFog = mix(CloudyFog, max(densityAtPosFog((samplePos2 - vec3(frameTimeCounter,0,frameTimeCounter)*10) * 100.0 ) - 0.2,0.0) * heightlimit, sandStorm+snowStorm);
#endif
TimeOfDayFog(UniformFog, CloudyFog, maxDistance);
TimeOfDayFog(UniformFog, CloudyFog, maxDistance, dailyWeatherParams0.a, dailyWeatherParams1.a);
float noise = densityAtPosFog(samplePos * 12.0);
float erosion = 1.0-densityAtPosFog(samplePos2 * (125 - (1-pow(1-noise,5))*25));

View File

@ -407,7 +407,9 @@ uniform int moonPhase;
#define HQ_CLOUDS
// #define Daily_Weather
// #define CHOOSE_RANDOM_WEATHER_PROFILE
#ifdef Daily_Weather
// DAY 0 WEATHER PARAMETERS
#define DAY0_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
@ -498,7 +500,7 @@ uniform int moonPhase;
#define DAY9_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#endif
//////////////////////////////////////
@ -590,6 +592,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
//#define BICUBIC_UPSCALING
// #define CAMERA_GRIDLINES
///////////////////////////////////////////////////////
// ----- GAMEPLAY POST EFFECT RELATED SETTINGS ----- //
@ -603,6 +606,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
#endif
#define WATER_ON_CAMERA_EFFECT
#define POWDERSNOW_FROST_CAMERA_EFFECT
#ifdef LOW_HEALTH_EFFECT
#endif

View File

@ -1,36 +1,27 @@
#ifdef HQ_CLOUDS
int maxIT_clouds = minRayMarchSteps;
int maxIT = maxRayMarchSteps;
#else
int maxIT_clouds = minRayMarchStepsLQ;
int maxIT = maxRayMarchStepsLQ;
#endif
#ifdef HQ_CLOUDS
const int cloudLoD = cloud_LevelOfDetail;
const int cloudShadowLoD = cloud_ShadowLevelOfDetail;
#else
int maxIT_clouds = minRayMarchStepsLQ;
int maxIT = maxRayMarchStepsLQ;
const int cloudLoD = cloud_LevelOfDetailLQ;
const int cloudShadowLoD = cloud_ShadowLevelOfDetailLQ;
#endif
// uniform float viewHeight;
// uniform float viewWidth;
uniform int worldTime;
#define WEATHERCLOUDS
#include "/lib/climate_settings.glsl"
#ifdef Daily_Weather
#ifndef USE_WEATHER_PARAMS
vec3 dailyWeatherParams0 = vec3(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage);
vec3 dailyWeatherParams1 = vec3(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density);
#endif
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#else
vec3 dailyWeatherParams0 = vec3(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage);
vec3 dailyWeatherParams1 = vec3(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density);
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
#endif
float LAYER0_minHEIGHT = CloudLayer0_height;
@ -50,10 +41,9 @@ float LAYER1_DENSITY = dailyWeatherParams1.y;
float LAYER2_DENSITY = dailyWeatherParams1.z;
float rainCloudwetness = rainStrength;
// float cloud_movement = frameTimeCounter * Cloud_Speed ;
// float cloud_movement = abs((12000 - worldTime) * Cloud_Speed ) * 0.05;
// float cloud_movement = (worldTime / 24.0) * Cloud_Speed;
uniform int worldDay;
float cloud_movement = (worldTime + mod(worldDay,100)*24000.0) / 24.0 * Cloud_Speed;
//3D noise from 2d texture
@ -75,7 +65,6 @@ float densityAtPos(in vec3 pos){
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;
@ -610,7 +599,6 @@ vec4 renderClouds(
float GetCloudShadow(vec3 feetPlayerPos){
#ifdef CLOUDS_SHADOWS
vec3 playerPos = feetPlayerPos + cameraPosition;
float shadow = 0.0;
@ -618,15 +606,15 @@ 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 + 30) - playerPos.y,0.0) ;
shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100)*LAYER0_DENSITY;
shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100)*dailyWeatherParams1.x;
#endif
#ifdef CloudLayer1
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;
shadow += GetCumulusDensity(1, higherShadowStart, 0, CloudLayer1_height, CloudLayer1_height+100)*dailyWeatherParams1.y;
#endif
#ifdef CloudLayer2
vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max(CloudLayer2_height - playerPos.y,0.0);
shadow += GetAltostratusDensity(highShadowStart) * LAYER2_DENSITY;
shadow += GetAltostratusDensity(highShadowStart) * dailyWeatherParams1.z;
#endif
shadow = clamp(shadow,0.0,1.0);
@ -648,15 +636,15 @@ float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){
#ifdef CloudLayer0
vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer0_height + 30) - WorldPos.y,0.0) ;
shadow += max(GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height,CloudLayer0_height+100),0.0)*LAYER0_DENSITY;
shadow += max(GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100),0.0)*dailyWeatherParams1.x;
#endif
#ifdef CloudLayer1
vec3 higherShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer1_height + 30) - WorldPos.y,0.0) ;
shadow += max(GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100) ,0.0)*LAYER1_DENSITY;
shadow += max(GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100) ,0.0)*dailyWeatherParams1.y;
#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)*LAYER2_DENSITY * 0.5;
shadow += GetAltostratusDensity(highShadowStart)*dailyWeatherParams1.z * 0.5;
#endif
shadow = clamp(shadow,0.0,1.0);

View File

@ -113,8 +113,7 @@ alphaTest.gbuffers_water = false
alphaTest.gbuffers_skybasic = false
alphaTest.gbuffers_skytextured = false
sliders = sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS 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 UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR 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 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_NORMAL_STRENGTH
sliders = 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 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 UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR 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 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_NORMAL_STRENGTH
screen.columns=2
screen = \
@ -127,12 +126,6 @@ BLISS_SHADERS <empty> \
<empty> <empty> \
[Misc_Settings] [DISTANT_HORIZONS_SETTINGS] \
# screen = [Direct_Light] [World]
# [Ambient_light] [Fog]
# [Post_Processing] [Clouds]
# [Misc_Settings] [Climate]
######## LIGHTING
### DIRECT LIGHT
screen.Direct_Light.columns=1
@ -235,7 +228,7 @@ BLISS_SHADERS <empty> \
screen.Clouds.columns = 3
screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_SHADOWS Cloud_Speed \
CLOUDS_QUALITY CLOUD_SHADOW_STRENGTH Rain_coverage \
<empty> <empty> <empty> \
<empty> [DAILY_WEATHER] <empty> \
CloudLayer0 CloudLayer1 CloudLayer2 \
CloudLayer0_coverage CloudLayer1_coverage CloudLayer2_coverage \
CloudLayer0_density CloudLayer1_density CloudLayer2_density \
@ -289,7 +282,7 @@ BLISS_SHADERS <empty> \
######## POST
screen.Post_Processing.columns=2
screen.Post_Processing = [TAA_OPTIONS] [Tonemapping] [Exposure] [DepthOfField] [Purkinje_effect] [COLOR_GRADING] [GAMEPLAY_EFFECTS] <empty> SHARPENING BLOOM_STRENGTH
screen.Post_Processing = [TAA_OPTIONS] [Tonemapping] [Exposure] [DepthOfField] [Purkinje_effect] [COLOR_GRADING] [GAMEPLAY_EFFECTS] <empty> SHARPENING BLOOM_STRENGTH CAMERA_GRIDLINES
### TAA
screen.TAA_OPTIONS.columns = 1
screen.TAA_OPTIONS= SCREENSHOT_MODE <empty> TAA BLEND_FACTOR <empty> TAA_UPSCALING SCALE_FACTOR
@ -317,6 +310,7 @@ BLISS_SHADERS <empty> \
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
### COOL GAMEPLAY EFFECTS
screen.GAMEPLAY_EFFECTS = MOTION_AMOUNT DAMAGE_TAKEN_EFFECT LOW_HEALTH_EFFECT WATER_ON_CAMERA_EFFECT
@ -333,7 +327,7 @@ BLISS_SHADERS <empty> \
screen.DISTANT_HORIZONS_SETTINGS = DH_KNOWN_ISSUES <EMPTY> DISTANT_HORIZONS_SHADOWMAP shadowDistance shadowMapResolution <empty> DH_OVERDRAW_PREVENTION TOGGLE_VL_FOG VOLUMETRIC_CLOUDS
screen.DAILY_WEATHER.columns = 2
screen.DAILY_WEATHER = Daily_Weather <empty> \
screen.DAILY_WEATHER = Daily_Weather CHOOSE_RANDOM_WEATHER_PROFILE \
[DAY0_WEATHER] [DAY5_WEATHER] \
[DAY1_WEATHER] [DAY6_WEATHER] \
[DAY2_WEATHER] [DAY7_WEATHER] \
@ -365,63 +359,6 @@ BLISS_SHADERS <empty> \
####### WEATHER RELATED STUFF #######
#####################################
######## weather profiles.
# in seconds...
variable.int.WeatherTransitionTime = 1
uniform.float.Cumulus_Cov = smooth(if( \
moonPhase == 0, 5.0, \
moonPhase == 1, 0.0, \
moonPhase == 2, 0.0, \
moonPhase == 3, 0.0, \
moonPhase == 4, 0.0, \
moonPhase == 5, 0.0, \
moonPhase == 6, 0.0, \
moonPhase == 7, 0.0, \
moonPhase == 9, 0.0, \
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, \
moonPhase == 2, 10, \
moonPhase == 3, 0, \
moonPhase == 4, 0, \
moonPhase == 5, 0, \
moonPhase == 6, 5, \
0 ), WeatherTransitionTime, WeatherTransitionTime)
uniform.float.Cloudy_Den = smooth(if( \
moonPhase == 0, 0, \
moonPhase == 1, 0, \
moonPhase == 2, 0, \
moonPhase == 3, 0, \
moonPhase == 4, 0, \
moonPhase == 5, 0, \
moonPhase == 6, 50, \
0 ), WeatherTransitionTime, WeatherTransitionTime)
# thank you sixthsurge!
#ifdef LIGHTNING_FLASH
#ifdef IS_IRIS
@ -483,6 +420,7 @@ uniform.float.noPuddleAreas = smooth(if(in(biome, 3, 4, 16, 37, 39, 48, 49, 31,
#if defined WATER_ON_CAMERA_EFFECT
uniform.float.exitWater = smooth(if(isEyeInWater == 1,1,0),0.0,5.0)
#endif
# uniform.float.exitPowderSnow = smooth(if(isEyeInWater == 3,1,0),0.0,5.0)
#if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT
#ifdef IS_IRIS
@ -490,17 +428,17 @@ uniform.float.noPuddleAreas = smooth(if(in(biome, 3, 4, 16, 37, 39, 48, 49, 31,
uniform.float.oneHeart = smooth(if(Currenthealth <= 2.0 && currentPlayerHealth > -1.0, 1,0), 0.0,1.0)
uniform.float.threeHeart = smooth(if(Currenthealth <= 6.0 && currentPlayerHealth > -1.0, 1,0), 0.0,1.0)
# let the binary value last slightly longer after it becomes false, to remove any failures to detect damage,
variable.bool.isHurtSmooth = smooth(if(is_hurt, 0.0, 1.0), 0.0, 1.0) < 1.0
# detect over 2 hearts of damage taken
variable.float.detectSmallDamage = smooth(if(isHurtSmooth, 0.0, Currenthealth), 0.0, 0.5)
uniform.float.MinorDamageTaken = smooth(if(Currenthealth < detectSmallDamage && currentPlayerHealth > -1.0, 1.0, 0.0), 0.0, 1.0)
variable.float.interpolatedHealth = smooth(if(is_hurt, 0.0, Currenthealth), 0.0, 1.0)
# detect over 5 hearts of damage taken
variable.float.detectLargeDamage = smooth(if(isHurtSmooth, 0.0, Currenthealth), 0.0, 0.13)
variable.float.critHit = smooth(if(Currenthealth < detectLargeDamage && currentPlayerHealth > -1.0, 1.0, 0.0), 0.0, 1.0)
uniform.float.CriticalDamageTaken = smooth(if(critHit > 0.01, 1.0, 0.0), 0.5, 3.0)
variable.bool.largeHealthDifference = (interpolatedHealth - Currenthealth) >= 10.0
variable.bool.delayedCritDamage = smooth(if(largeHealthDifference, 1.0, 0.0), 0.0, 1.0) > 0.01
uniform.float.CriticalDamageTaken = smooth(if(delayedCritDamage && currentPlayerHealth > -1.0, 1.0, 0.0), 0.5, 3.0)
# detect over 2 hearts of damage taken
variable.bool.smallHealthDifference = (interpolatedHealth - Currenthealth) >= 4.0
uniform.float.MinorDamageTaken = smooth(if(smallHealthDifference && currentPlayerHealth > -1.0, 1.0, 0.0), 0.5, 1.0)
#else
uniform.bool.isDead = !is_alive