mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
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:
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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){
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
@ -58,7 +63,12 @@ void main() {
|
||||
unsigned_WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
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
|
||||
|
@ -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,23 +395,15 @@ 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
|
||||
|
||||
#if defined NETHER_SHADER || defined END_SHADER
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos0, noise_1, noise_2);
|
||||
#endif
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos0, vec2(noise_1,noise_2), directLightColor, indirectLightColor);
|
||||
#endif
|
||||
|
||||
#if defined NETHER_SHADER || defined END_SHADER
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos0, noise_1, noise_2);
|
||||
#endif
|
||||
|
||||
gl_FragData[0] = clamp(VolumetricFog, 0.0, 65000.0);
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
///////////////// BEHIND OF TRANSLUCENTS /////////////////
|
||||
//////////////////////////////////////////////////////////
|
||||
gl_FragData[0] = clamp(VolumetricFog, 0.0, 65000.0);
|
||||
|
||||
if (isEyeInWater == 1){
|
||||
|
||||
@ -426,5 +420,4 @@ void main() {
|
||||
|
||||
}
|
||||
|
||||
// gl_FragData[0] = clamp(vec4(vl,1.0),0.000001,65000.);
|
||||
}
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
||||
#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
|
||||
|
||||
|
||||
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);
|
||||
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
|
||||
|
||||
//////////////////////////////
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user