mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-26 18:22:33 +08:00
more setup for scene controller, replace old weather stuff with it. fix vignette when entering/exitings water. added a water enter effect
This commit is contained in:
@ -122,14 +122,7 @@ uniform float rainStrength;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#define CLOUDSHADOWSONLY
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
#endif
|
||||
|
@ -14,10 +14,7 @@ flat varying vec3 averageSkyCol_Clouds;
|
||||
flat varying vec4 lightCol;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#endif
|
||||
|
||||
varying mat4 normalmatrix;
|
||||
@ -105,10 +102,7 @@ void main() {
|
||||
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)/2.0, 0.0);
|
||||
dailyWeatherParams1 = vec4((texelFetch2D(colortex4,ivec2(2,1),0).rgb/150.0)/2.0, 0.0);
|
||||
#endif
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -74,13 +74,8 @@ uniform vec3 previousCameraPosition;
|
||||
#include "/lib/projections.glsl"
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
#define CLOUDSHADOWSONLY
|
||||
|
||||
|
@ -24,11 +24,7 @@ flat varying float exposure;
|
||||
flat varying vec4 lightCol;
|
||||
flat varying vec3 WsunVec;
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#endif
|
||||
|
||||
|
||||
@ -133,14 +129,10 @@ void main() {
|
||||
#ifdef OVERWORLD_SHADER
|
||||
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
|
||||
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 / 1500.0, 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
#endif
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -115,13 +115,7 @@ uniform float waterEnteredAltitude;
|
||||
flat varying float Flashing;
|
||||
#include "/lib/lightning_stuff.glsl"
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
#define CLOUDSHADOWSONLY
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
|
@ -24,11 +24,7 @@ uniform sampler2D noisetex;
|
||||
flat varying vec4 lightCol;
|
||||
flat varying vec3 WsunVec;
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#endif
|
||||
|
||||
varying vec4 normalMat;
|
||||
@ -215,11 +211,7 @@ void main() {
|
||||
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
|
||||
#if defined Daily_Weather
|
||||
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb / 1500.0, 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
#endif
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -158,13 +158,7 @@ float convertHandDepth_2(in float depth, bool hand) {
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
#define CLOUDSHADOWSONLY
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
@ -1346,7 +1340,7 @@ void main() {
|
||||
}
|
||||
|
||||
|
||||
if(translucentMasks > 0.0 && isEyeInWater != 1){
|
||||
if(translucentMasks > 0.0 ){
|
||||
// water absorbtion will impact ALL light coming up from terrain underwater.
|
||||
gl_FragData[0].rgb *= Absorbtion;
|
||||
|
||||
|
@ -5,11 +5,7 @@
|
||||
flat varying float Flashing;
|
||||
#endif
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
flat varying vec3 WmoonVec;
|
||||
@ -78,10 +74,7 @@ void main() {
|
||||
|
||||
exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
|
||||
|
||||
#if defined Daily_Weather
|
||||
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb / 1500.0, 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
#endif
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
|
||||
#ifdef TAA
|
||||
TAA_Offset = offsets[framemod8];
|
||||
|
@ -154,16 +154,11 @@ uniform float nightVision;
|
||||
uniform sampler2DShadow shadowtex0;
|
||||
uniform sampler2DShadow shadowtex1;
|
||||
#endif
|
||||
|
||||
flat varying vec3 refractedSunVec;
|
||||
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
|
||||
// uniform int dhRenderDistance;
|
||||
@ -479,6 +474,7 @@ vec4 raymarchTest(
|
||||
return vec4(color, totalAbsorbance);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -565,7 +561,6 @@ void main() {
|
||||
// VolumetricFog = raymarchTest2(viewPos0, BN.x);
|
||||
// VolumetricFog = raymarchTest(viewPos0, BN);
|
||||
|
||||
|
||||
gl_FragData[0] = clamp(VolumetricFog, 0.0, 65000.0);
|
||||
|
||||
}
|
@ -10,12 +10,7 @@ flat varying vec3 averageSkyCol_Clouds;
|
||||
flat varying float exposure;
|
||||
#endif
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
@ -36,17 +31,17 @@ flat varying vec2 TAA_Offset;
|
||||
uniform int framemod8;
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
|
||||
|
||||
uniform float frameTimeCounter;
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
#include "/lib/sky_gradient.glsl"
|
||||
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
|
||||
void main() {
|
||||
gl_Position = ftransform();
|
||||
|
||||
@ -58,14 +53,7 @@ void main() {
|
||||
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 / 1500.0, 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
|
||||
dailyWeatherParams0.a = texelFetch2D(colortex4,ivec2(3,1),0).x/1500.0;
|
||||
dailyWeatherParams1.a = texelFetch2D(colortex4,ivec2(3,1),0).y/1500.0;
|
||||
#endif
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef NETHER_SHADER
|
||||
|
@ -638,7 +638,7 @@ void main() {
|
||||
|
||||
////// --------------- FINALIZE
|
||||
#ifdef display_LUT
|
||||
float zoomLevel = 1.0;
|
||||
float zoomLevel = 75.0;
|
||||
vec3 thingy = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy/zoomLevel),0).rgb /1200.0;
|
||||
|
||||
if(luma(thingy) > 0.0){
|
||||
|
@ -163,17 +163,7 @@ float invLinZ (float lindepth){
|
||||
#define TIMEOFDAYFOG
|
||||
#include "/lib/lightning_stuff.glsl"
|
||||
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
|
||||
flat varying vec4 CurrentFrame_dailyWeatherParams0;
|
||||
flat varying vec4 CurrentFrame_dailyWeatherParams1;
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
|
||||
#define VL_CLOUDS_DEFERRED
|
||||
@ -208,6 +198,9 @@ vec2 R2_samples(float n){
|
||||
uniform float dayChangeSmooth;
|
||||
uniform bool worldTimeChangeCheck;
|
||||
|
||||
uniform int hideGUI;
|
||||
|
||||
|
||||
void main() {
|
||||
/* DRAWBUFFERS:4 */
|
||||
|
||||
@ -224,18 +217,19 @@ float mixhistory = 0.06;
|
||||
|
||||
// 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 < 4 && gl_FragCoord.y > 1 && gl_FragCoord.y < 2){
|
||||
|
||||
mixhistory = clamp(dayChangeSmooth*dayChangeSmooth*dayChangeSmooth*0.1, frameTime*0.1, 1.0);
|
||||
|
||||
if(gl_FragCoord.x < 2) gl_FragData[0] = vec4(CurrentFrame_dailyWeatherParams0.rgb * 10.0,1.0);
|
||||
if(gl_FragCoord.x > 2) gl_FragData[0] = vec4(CurrentFrame_dailyWeatherParams1.rgb * 10.0,1.0);
|
||||
if(gl_FragCoord.x > 3) gl_FragData[0] = vec4(CurrentFrame_dailyWeatherParams0.a * 10.0, CurrentFrame_dailyWeatherParams1.a * 10.0, 0.0, 1.0);
|
||||
// #ifdef Daily_Weather
|
||||
if (gl_FragCoord.x > 1 && gl_FragCoord.x < 4 && gl_FragCoord.y > 1 && gl_FragCoord.y < 4){
|
||||
mixhistory = 10.0 * frameTime;
|
||||
|
||||
gl_FragData[0].rgb = writeSceneControllerParameters(gl_FragCoord.xy, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
}
|
||||
#endif
|
||||
|
||||
// vec4 superSampledHistory = texture2D(colortex5, previousPosition.xy);
|
||||
// vec3 superSampledResult = superSampledHistory.rgb * superSampledHistory.a + currentFrame;
|
||||
|
||||
// return vec4(superSampledResult/(superSampledHistory.a+1.0), superSampledHistory.a+1.0);
|
||||
|
||||
// #endif
|
||||
|
||||
///////////////////////////////
|
||||
/// --- STORE COLOR LUT --- ///
|
||||
@ -432,7 +426,7 @@ vec3 frameHistory = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy),0).rgb;
|
||||
vec3 currentFrame = gl_FragData[0].rgb*150.;
|
||||
|
||||
|
||||
gl_FragData[0].rgb = clamp(mix(frameHistory, currentFrame, mixhistory),0.0,65000.);
|
||||
gl_FragData[0].rgb = clamp(mix(frameHistory, currentFrame, clamp(mixhistory,0.0,1.0)),0.0,65000.);
|
||||
|
||||
//Exposure values
|
||||
if (gl_FragCoord.x > 10. && gl_FragCoord.x < 11. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
|
||||
|
@ -23,13 +23,9 @@ flat varying float rodExposure;
|
||||
flat varying float avgL2;
|
||||
flat varying float centerDepth;
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
uniform int hideGUI;
|
||||
flat varying vec4 CurrentFrame_dailyWeatherParams0;
|
||||
flat varying vec4 CurrentFrame_dailyWeatherParams1;
|
||||
|
||||
uniform sampler2D colortex4;
|
||||
uniform sampler2D colortex6;
|
||||
@ -188,84 +184,72 @@ void main() {
|
||||
moonColor = vec3(0.0);
|
||||
#endif
|
||||
|
||||
//////////////////////////////////
|
||||
/// --- WEATHER PARAMETERS --- ///
|
||||
//////////////////////////////////
|
||||
///////////////////////////////////////////
|
||||
/// --- SCENE CONTROLLER PARAMETERS --- ///
|
||||
///////////////////////////////////////////
|
||||
|
||||
parameters.smallCumulus = vec2(CloudLayer0_coverage, CloudLayer0_density);
|
||||
parameters.largeCumulus = vec2(CloudLayer1_coverage, CloudLayer1_density);
|
||||
parameters.altostratus = vec2(CloudLayer2_coverage, CloudLayer2_density);
|
||||
parameters.fog = vec2(1.0, 1.0);
|
||||
|
||||
#ifdef Daily_Weather
|
||||
// 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 = int(clamp(hash11(float(mod(worldDay, 1000))) * 10.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)
|
||||
//----------- cloud coverage
|
||||
vec3 weatherProfile_cloudCoverage[10] = vec3[](
|
||||
vec3(DAY0_l0_coverage, DAY0_l1_coverage, DAY0_l2_coverage),
|
||||
vec3(DAY1_l0_coverage, DAY1_l1_coverage, DAY1_l2_coverage),
|
||||
vec3(DAY2_l0_coverage, DAY2_l1_coverage, DAY2_l2_coverage),
|
||||
vec3(DAY3_l0_coverage, DAY3_l1_coverage, DAY3_l2_coverage),
|
||||
vec3(DAY4_l0_coverage, DAY4_l1_coverage, DAY4_l2_coverage),
|
||||
vec3(DAY5_l0_coverage, DAY5_l1_coverage, DAY5_l2_coverage),
|
||||
vec3(DAY6_l0_coverage, DAY6_l1_coverage, DAY6_l2_coverage),
|
||||
vec3(DAY7_l0_coverage, DAY7_l1_coverage, DAY7_l2_coverage),
|
||||
vec3(DAY8_l0_coverage, DAY8_l1_coverage, DAY8_l2_coverage),
|
||||
vec3(DAY9_l0_coverage, DAY9_l1_coverage, DAY9_l2_coverage)
|
||||
);
|
||||
|
||||
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)
|
||||
//----------- cloud density
|
||||
vec3 weatherProfile_cloudDensity[10] = vec3[](
|
||||
vec3(DAY0_l0_density, DAY0_l1_density, DAY0_l2_density),
|
||||
vec3(DAY1_l0_density, DAY1_l1_density, DAY1_l2_density),
|
||||
vec3(DAY2_l0_density, DAY2_l1_density, DAY2_l2_density),
|
||||
vec3(DAY3_l0_density, DAY3_l1_density, DAY3_l2_density),
|
||||
vec3(DAY4_l0_density, DAY4_l1_density, DAY4_l2_density),
|
||||
vec3(DAY5_l0_density, DAY5_l1_density, DAY5_l2_density),
|
||||
vec3(DAY6_l0_density, DAY6_l1_density, DAY6_l2_density),
|
||||
vec3(DAY7_l0_density, DAY7_l1_density, DAY7_l2_density),
|
||||
vec3(DAY8_l0_density, DAY8_l1_density, DAY8_l2_density),
|
||||
vec3(DAY9_l0_density, DAY9_l1_density, DAY9_l2_density)
|
||||
);
|
||||
|
||||
vec3 getWeatherProfile_coverage = weatherProfile_cloudCoverage[dayCounter];
|
||||
vec3 getWeatherProfile_density = weatherProfile_cloudDensity[dayCounter];
|
||||
|
||||
parameters.smallCumulus = vec2(getWeatherProfile_coverage.x, getWeatherProfile_density.x);
|
||||
parameters.largeCumulus = vec2(getWeatherProfile_coverage.y, getWeatherProfile_density.y);
|
||||
parameters.altostratus = vec2(getWeatherProfile_coverage.z, getWeatherProfile_density.z);
|
||||
|
||||
CurrentFrame_dailyWeatherParams0 = weatherParameters_A[dayCounter];
|
||||
CurrentFrame_dailyWeatherParams1 = weatherParameters_B[dayCounter];
|
||||
|
||||
vec4 rainyWeatherParameters_A[3] = vec4[](
|
||||
// vec4(DAY0_l0_coverage, DAY0_l1_coverage, DAY0_l2_coverage, DAY0_ufog_density),
|
||||
vec4(1.3,0.0,0.0,0.0),
|
||||
vec4(0.5,0.0,0.0,0.0),
|
||||
vec4(0.0,0.0,0.0,0.0)
|
||||
);
|
||||
vec4 rainyWeatherParameters_B[3] = vec4[](
|
||||
// vec4(DAY7_l0_density, DAY7_l1_density, DAY7_l2_density, DAY7_cfog_density),
|
||||
vec4(0.1,0.0,0.0,0.0),
|
||||
vec4(0.1,0.0,0.0,0.0),
|
||||
vec4(0.0,0.0,0.0,0.0)
|
||||
//----------- fog density
|
||||
vec2 weatherProfile_fogDensity[10] = vec2[](
|
||||
vec2(DAY0_ufog_density, DAY0_cfog_density),
|
||||
vec2(DAY1_ufog_density, DAY1_cfog_density),
|
||||
vec2(DAY2_ufog_density, DAY2_cfog_density),
|
||||
vec2(DAY3_ufog_density, DAY3_cfog_density),
|
||||
vec2(DAY4_ufog_density, DAY4_cfog_density),
|
||||
vec2(DAY5_ufog_density, DAY5_cfog_density),
|
||||
vec2(DAY6_ufog_density, DAY6_cfog_density),
|
||||
vec2(DAY7_ufog_density, DAY7_cfog_density),
|
||||
vec2(DAY8_ufog_density, DAY8_cfog_density),
|
||||
vec2(DAY9_ufog_density, DAY9_cfog_density)
|
||||
);
|
||||
|
||||
// if(hideGUI == 1){
|
||||
// CurrentFrame_dailyWeatherParams0 = rainyWeatherParameters_A[worldDay%2];
|
||||
// CurrentFrame_dailyWeatherParams1 = rainyWeatherParameters_B[worldDay%2];
|
||||
// } else {
|
||||
// CurrentFrame_dailyWeatherParams0 = vec4(0.5,0.0,0.0,0.0);
|
||||
// CurrentFrame_dailyWeatherParams1 = vec4(0.1,0.5,0.0,0.0);
|
||||
// }
|
||||
|
||||
#if defined Daily_Weather
|
||||
dailyWeatherParams0 = vec4(sqrt(texelFetch2D(colortex4,ivec2(1,1),0).rgb/ 1500.0), 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
|
||||
dailyWeatherParams0.a = texelFetch2D(colortex4,ivec2(3,1),0).x/1500.0;
|
||||
dailyWeatherParams1.a = texelFetch2D(colortex4,ivec2(3,1),0).y/1500.0;
|
||||
#endif
|
||||
|
||||
parameters.fog = weatherProfile_fogDensity[dayCounter];
|
||||
#endif
|
||||
|
||||
//////////////////////////////
|
||||
@ -307,8 +291,6 @@ void main() {
|
||||
|
||||
|
||||
exposure = max(targetExposure, 0.0);
|
||||
// exposure = mix(0.0, 1.0, min(targetExposure,1.0));
|
||||
// exposure = 1;
|
||||
|
||||
float currCenterDepth = ld(texture2D(depthtex2, vec2(0.5)*RENDER_SCALE).r);
|
||||
centerDepth = mix(sqrt(texelFetch2D(colortex4,ivec2(14,37),0).g/65000.0), currCenterDepth, clamp(DoF_Adaptation_Speed*exp(-0.016/frameTime+1.0)/(6.0+currCenterDepth*far),0.0,1.0));
|
||||
|
@ -8,6 +8,7 @@ uniform sampler2D depthtex0;
|
||||
uniform sampler2D depthtex1;
|
||||
uniform sampler2D depthtex2;
|
||||
uniform sampler2D noisetex;
|
||||
uniform sampler2D shadowcolor1;
|
||||
|
||||
varying vec2 texcoord;
|
||||
uniform vec2 texelSize;
|
||||
@ -19,6 +20,12 @@ uniform float aspectRatio;
|
||||
|
||||
uniform int hideGUI;
|
||||
|
||||
uniform vec3 previousCameraPosition;
|
||||
// uniform vec3 cameraPosition;
|
||||
uniform mat4 gbufferPreviousModelView;
|
||||
// uniform mat4 gbufferModelViewInverse;
|
||||
// uniform mat4 gbufferModelView;
|
||||
|
||||
#include "/lib/color_transforms.glsl"
|
||||
#include "/lib/color_dither.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
@ -37,6 +44,17 @@ float blueNoise(){
|
||||
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter);
|
||||
}
|
||||
|
||||
float convertHandDepth_2(in float depth, bool hand) {
|
||||
if(!hand) return depth;
|
||||
|
||||
float ndcDepth = depth * 2.0 - 1.0;
|
||||
ndcDepth /= MC_HAND_DEPTH;
|
||||
return ndcDepth * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
#include "/lib/projections.glsl"
|
||||
|
||||
#include "/lib/gameplay_effects.glsl"
|
||||
|
||||
void doCameraGridLines(inout vec3 color, vec2 UV){
|
||||
@ -56,21 +74,6 @@ void doCameraGridLines(inout vec3 color, vec2 UV){
|
||||
color = mix(color, vec3(1.0), gridLines);
|
||||
}
|
||||
|
||||
uniform vec3 previousCameraPosition;
|
||||
// uniform vec3 cameraPosition;
|
||||
uniform mat4 gbufferPreviousModelView;
|
||||
// uniform mat4 gbufferModelViewInverse;
|
||||
// uniform mat4 gbufferModelView;
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
#include "/lib/projections.glsl"
|
||||
vec3 tonemap(vec3 col){
|
||||
return col/(1+luma(col));
|
||||
}
|
||||
vec3 invTonemap(vec3 col){
|
||||
return col/(1-luma(col));
|
||||
}
|
||||
|
||||
vec3 doMotionBlur(vec2 texcoord, float depth, float noise, bool hand){
|
||||
|
||||
float samples = 4.0;
|
||||
@ -103,16 +106,6 @@ vec3 doMotionBlur(vec2 texcoord, float depth, float noise, bool hand){
|
||||
return color / samples;
|
||||
}
|
||||
|
||||
float convertHandDepth_2(in float depth, bool hand) {
|
||||
if(!hand) return depth;
|
||||
|
||||
float ndcDepth = depth * 2.0 - 1.0;
|
||||
ndcDepth /= MC_HAND_DEPTH;
|
||||
return ndcDepth * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
uniform sampler2D shadowcolor1;
|
||||
|
||||
float doVignette( in vec2 texcoord, in float noise){
|
||||
|
||||
float vignette = 1.0-clamp(1.0-length(texcoord-0.5),0.0,1.0);
|
||||
@ -142,15 +135,15 @@ void main() {
|
||||
vec3 COLOR = texture2D(colortex7,texcoord).rgb;
|
||||
#endif
|
||||
|
||||
#ifdef VIGNETTE
|
||||
COLOR *= doVignette(texcoord, noise);
|
||||
#endif
|
||||
|
||||
#if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT || defined WATER_ON_CAMERA_EFFECT
|
||||
// for making the fun, more fun
|
||||
applyGameplayEffects(COLOR, texcoord, noise);
|
||||
#endif
|
||||
|
||||
#ifdef VIGNETTE
|
||||
COLOR *= doVignette(texcoord, noise);
|
||||
#endif
|
||||
|
||||
#ifdef CAMERA_GRIDLINES
|
||||
doCameraGridLines(COLOR, texcoord);
|
||||
#endif
|
||||
|
@ -90,15 +90,7 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
|
||||
|
||||
flat varying vec3 refractedSunVec;
|
||||
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#else
|
||||
vec4 dailyWeatherParams0 = vec4(CloudLayer0_coverage, CloudLayer1_coverage, CloudLayer2_coverage, 0.0);
|
||||
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#include "/lib/diffuse_lighting.glsl"
|
||||
|
||||
#define TIMEOFDAYFOG
|
||||
|
@ -6,11 +6,7 @@ flat varying vec4 lightCol;
|
||||
flat varying vec3 averageSkyCol;
|
||||
flat varying vec3 averageSkyCol_Clouds;
|
||||
|
||||
#ifdef Daily_Weather
|
||||
flat varying vec4 dailyWeatherParams0;
|
||||
flat varying vec4 dailyWeatherParams1;
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
flat varying vec3 refractedSunVec;
|
||||
@ -40,6 +36,7 @@ uniform float frameTimeCounter;
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
#include "/lib/sky_gradient.glsl"
|
||||
|
||||
|
||||
void main() {
|
||||
gl_Position = ftransform();
|
||||
|
||||
@ -57,14 +54,7 @@ void main() {
|
||||
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 / 1500.0, 0.0);
|
||||
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
||||
|
||||
dailyWeatherParams0.a = texelFetch2D(colortex4,ivec2(3,1),0).x/1500.0;
|
||||
dailyWeatherParams1.a = texelFetch2D(colortex4,ivec2(3,1),0).y/1500.0;
|
||||
#endif
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef NETHER_SHADER
|
||||
|
@ -218,12 +218,6 @@
|
||||
|
||||
Rainy = Rainy*RainFog_amount;
|
||||
|
||||
#ifdef Daily_Weather
|
||||
// let daily weather influence fog densities.
|
||||
UniformDensity = max(UniformDensity, DailyWeather_UniformFogDensity);
|
||||
CloudyDensity = max(CloudyDensity, DailyWeather_CloudyFogDensity);
|
||||
#endif
|
||||
|
||||
#ifdef PER_BIOME_ENVIRONMENT
|
||||
BiomeFogDensity(UniformDensity, CloudyDensity, maxDistance); // let biome fog hijack to control densities, and overrride any other density controller...
|
||||
#endif
|
||||
|
@ -11,6 +11,7 @@
|
||||
#endif
|
||||
|
||||
uniform float exitWater;
|
||||
uniform float enterWater;
|
||||
// uniform float exitPowderSnow;
|
||||
uniform int isEyeInWater;
|
||||
|
||||
@ -32,7 +33,6 @@ uniform int isEyeInWater;
|
||||
// uniform bool is_on_ground;
|
||||
// uniform bool isSpectator;
|
||||
|
||||
|
||||
void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
|
||||
|
||||
// detect when health is zero
|
||||
@ -74,6 +74,12 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
|
||||
// apply distortion effects for exiting water and under water
|
||||
distortmask = max(distortmask, waterDrops);
|
||||
}
|
||||
if(enterWater > 0.0){
|
||||
vec2 zoomTC = 0.5 + (texcoord - 0.5) * (1.0 - (1.0-sqrt(1.0-enterWater)));
|
||||
float waterSplash = texture2D(noisetex, zoomTC * vec2(aspectRatio,1.0)).r * (1.0-enterWater);
|
||||
|
||||
distortmask = max(distortmask, waterSplash);
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////// APPLY DISTORTION /////////////////////
|
||||
@ -86,6 +92,7 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
|
||||
if(exitWater > 0.01) color = distortedColor;
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////// APPLY COLOR EFFECTS /////////////////////
|
||||
#if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT
|
||||
vec3 distortedColorLuma = vec3(1.0, 0.0, 0.0) * dot(distortedColor, vec3(0.21, 0.72, 0.07));
|
||||
|
@ -42,7 +42,7 @@ float cloudVol(in vec3 pos, float maxDistance ){
|
||||
medium_gradientFog = 1.0;
|
||||
}
|
||||
|
||||
FogDensities(medium_gradientFog, cloudyFog, rainyFog, maxDistance, dailyWeatherParams0.a, dailyWeatherParams1.a);
|
||||
FogDensities(medium_gradientFog, cloudyFog, rainyFog, maxDistance, 1.0, 1.0);
|
||||
|
||||
return uniformFog + medium_gradientFog + cloudyFog;
|
||||
}
|
||||
|
76
shaders/lib/scene_controller.glsl
Normal file
76
shaders/lib/scene_controller.glsl
Normal file
@ -0,0 +1,76 @@
|
||||
// write various parameters within singular pixels of a texture, which is a non-clearing buffer reprojecting the previous frame of itself, onto itself.
|
||||
// this allows smooth interpolation over time from any old parameter value, to any new parameter value.
|
||||
|
||||
// read in vertex stage of post processing passes (deferred, composite), so it only runs on 4 vertices
|
||||
// pass to fragment stage for use.
|
||||
|
||||
// the parameters are stored as such:
|
||||
// smallCumulus = (coverage, density)
|
||||
// largeCumulus = (coverage, density)
|
||||
// altostratus = (coverage, density)
|
||||
// fog = (uniform fog density, cloudy fog density)
|
||||
// ... and more, eventually
|
||||
|
||||
flat varying struct sceneController {
|
||||
vec2 smallCumulus;
|
||||
vec2 largeCumulus;
|
||||
vec2 altostratus;
|
||||
vec2 fog;
|
||||
} parameters;
|
||||
|
||||
vec3 writeSceneControllerParameters(
|
||||
vec2 uv,
|
||||
vec2 smallCumulus,
|
||||
vec2 largeCumulus,
|
||||
vec2 altostratus,
|
||||
vec2 fog
|
||||
){
|
||||
|
||||
// in colortex4, data is written in a 3x3 pixel area from (1,1) to (3,3)
|
||||
// avoiding use of any variation of (0,0) to avoid weird textture wrapping issues
|
||||
// 4th compnent/alpha is storing 1/4 res depth so i cant store there lol
|
||||
|
||||
/* (1,3) */ bool topLeft = uv.x > 1 && uv.x < 2 && uv.y > 3 && uv.y < 4;
|
||||
/* (2,3) */ bool topMiddle = uv.x > 2 && uv.x < 3 && uv.y > 3 && uv.y < 4;
|
||||
// /* (3,3) */ bool topRight = uv.x > 3 && uv.x < 5 && uv.y > 3 && uv.y < 4;
|
||||
// /* (1,2) */ bool middleLeft = uv.x > 1 && uv.x < 2 && uv.y > 2 && uv.y < 3;
|
||||
// /* (2,2) */ bool middleMiddle = uv.x > 2 && uv.x < 3 && uv.y > 2 && uv.y < 3;
|
||||
// /* (3,2) */ bool middleRight = uv.x > 3 && uv.x < 5 && uv.y > 2 && uv.y < 3;
|
||||
// /* (1,1) */ bool bottomLeft = uv.x > 1 && uv.x < 2 && uv.y > 1 && uv.y < 2;
|
||||
// /* (2,1) */ bool bottomMiddle = uv.x > 2 && uv.x < 3 && uv.y > 1 && uv.y < 2;
|
||||
// /* (3,1) */ bool bottomRight = uv.x > 3 && uv.x < 5 && uv.y > 1 && uv.y < 2;
|
||||
|
||||
vec3 data = vec3(0.0,0.0,0.0);
|
||||
|
||||
if(topLeft) data = vec3(smallCumulus.xy, largeCumulus.x);
|
||||
if(topMiddle) data = vec3(largeCumulus.y, altostratus.xy);
|
||||
|
||||
// if(topRight) data = vec4(groundSunColor,fogSunColor.r);
|
||||
// if(middleLeft) data = vec4(groundAmbientColor,fogSunColor.g);
|
||||
// if(middleMiddle) data = vec4(fogAmbientColor,fogSunColor.b);
|
||||
// if(middleRight) data = vec4(cloudSunColor,cloudAmbientColor.r);
|
||||
// if(bottomLeft) data = vec4(cloudAmbientColor.gb,0.0,0.0);
|
||||
// if(bottomMiddle) data = vec4(0.0);
|
||||
// if(bottomRight) data = vec4(0.0);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void readSceneControllerParameters(
|
||||
sampler2D colortex,
|
||||
out vec2 smallCumulus,
|
||||
out vec2 largeCumulus,
|
||||
out vec2 altostratus,
|
||||
out vec2 fog
|
||||
){
|
||||
|
||||
// in colortex4, read the data stored within the 3 components of the sampled pixels, and pass it to the fragment stage
|
||||
// 4th compnent/alpha is storing 1/4 res depth so i cant store there lol
|
||||
vec3 data1 = texelFetch2D(colortex,ivec2(1,3),0).rgb/150.0;
|
||||
vec3 data2 = texelFetch2D(colortex,ivec2(2,3),0).rgb/150.0;
|
||||
|
||||
smallCumulus = vec2(data1.x,data1.y);
|
||||
largeCumulus = vec2(data1.z,data2.x);
|
||||
altostratus = vec2(data2.y,data2.z);
|
||||
fog = vec2(0.0);
|
||||
}
|
@ -31,7 +31,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
|
||||
if(LayerIndex == ALTOSTRATUS_LAYER){
|
||||
|
||||
coverage = dailyWeatherParams0.z;
|
||||
coverage = parameters.altostratus.x;
|
||||
|
||||
largeCloud = texture2D(noisetex, (position.xz + cloud_movement)/100000. * CloudLayer2_scale).b;
|
||||
smallCloud = 1.0 - texture2D(noisetex, ((position.xz - cloud_movement)/7500. - vec2(1.0-largeCloud, -largeCloud)/5.0) * CloudLayer2_scale).b;
|
||||
@ -45,7 +45,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
return shape;
|
||||
}
|
||||
if(LayerIndex == LARGECUMULUS_LAYER){
|
||||
coverage = dailyWeatherParams0.y;
|
||||
coverage = parameters.largeCumulus.x;
|
||||
|
||||
largeCloud = texture2D(noisetex, (samplePos.zx + cloud_movement*2.0)/10000.0 * CloudLayer1_scale).b;
|
||||
smallCloud = texture2D(noisetex, (samplePos.zx - cloud_movement*2.0)/2500.0 * CloudLayer1_scale).b;
|
||||
@ -58,7 +58,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
|
||||
}
|
||||
if(LayerIndex == SMALLCUMULUS_LAYER){
|
||||
coverage = dailyWeatherParams0.x;
|
||||
coverage = parameters.smallCumulus.x;
|
||||
|
||||
largeCloud = texture2D(noisetex, (samplePos.xz + cloud_movement)/5000.0 * CloudLayer0_scale).b;
|
||||
smallCloud = 1.0-texture2D(noisetex, (samplePos.xz - cloud_movement)/500.0 * CloudLayer0_scale).r;
|
||||
@ -139,15 +139,15 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
||||
|
||||
#ifdef CloudLayer0
|
||||
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer0_height + 20.0) - playerPos.y, 0.0);
|
||||
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height+90.0)*dailyWeatherParams1.x;
|
||||
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height+90.0)*parameters.smallCumulus.y;
|
||||
#endif
|
||||
#ifdef CloudLayer1
|
||||
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer1_height + 20.0) - playerPos.y, 0.0);
|
||||
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height+90.0)*dailyWeatherParams1.y;
|
||||
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height+90.0)*parameters.largeCumulus.y;
|
||||
#endif
|
||||
#ifdef CloudLayer2
|
||||
startPosition = playerPos + sunVector / abs(sunVector.y) * max(CloudLayer2_height - playerPos.y, 0.0);
|
||||
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height)*dailyWeatherParams1.z * (1.0-abs(WsunVec.y));
|
||||
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height)*parameters.altostratus.y * (1.0-abs(WsunVec.y));
|
||||
#endif
|
||||
|
||||
cloudShadows *= CLOUD_SHADOW_STRENGTH;
|
||||
@ -265,7 +265,7 @@ vec4 raymarchCloud(
|
||||
densityTresholdCheck = mix(1e-5, densityTresholdCheck, dither);
|
||||
|
||||
if(LayerIndex == ALTOSTRATUS_LAYER){
|
||||
float density = dailyWeatherParams1.z;
|
||||
float density = parameters.altostratus.y;
|
||||
|
||||
bool ifAboveOrBelowPlane = max(mix(-1.0, 1.0, clamp(cameraPosition.y - minHeight,0.0,1.0)) * normalize(rayDirection).y,0.0) > 0.0;
|
||||
|
||||
@ -312,15 +312,15 @@ vec4 raymarchCloud(
|
||||
if(LayerIndex < ALTOSTRATUS_LAYER){
|
||||
|
||||
|
||||
float density = dailyWeatherParams1.x;
|
||||
float density = parameters.smallCumulus.y;
|
||||
|
||||
if(LayerIndex == LARGECUMULUS_LAYER) density = dailyWeatherParams1.y;
|
||||
if(LayerIndex == LARGECUMULUS_LAYER) density = parameters.largeCumulus.y;
|
||||
|
||||
float skylightOcclusion = 1.0;
|
||||
#if defined CloudLayer1 && defined CloudLayer0
|
||||
if(LayerIndex == SMALLCUMULUS_LAYER) {
|
||||
float upperLayerOcclusion = getCloudShape(LARGECUMULUS_LAYER, 0, rayPosition + vec3(0.0,1.0,0.0) * max((CloudLayer1_height+20) - rayPosition.y,0.0), CloudLayer1_height, CloudLayer1_height+100.0);
|
||||
skylightOcclusion = mix(mix(0.0,0.2,dailyWeatherParams1.y), 1.0, pow(1.0 - upperLayerOcclusion*dailyWeatherParams1.y,2));
|
||||
skylightOcclusion = mix(mix(0.0,0.2,parameters.largeCumulus.y), 1.0, pow(1.0 - upperLayerOcclusion*parameters.largeCumulus.y,2));
|
||||
}
|
||||
|
||||
skylightOcclusion = mix(1.0, skylightOcclusion, distanceFade);
|
||||
@ -359,13 +359,13 @@ vec4 raymarchCloud(
|
||||
#if defined CloudLayer0 && defined CloudLayer1
|
||||
if(LayerIndex == SMALLCUMULUS_LAYER){
|
||||
vec3 shadowStartPos = rayPosition + sunVector / abs(sunVector.y) * max((CloudLayer1_height + 20.0) - rayPosition.y, 0.0);
|
||||
sunShadowMask += 3.0 * getCloudShape(LARGECUMULUS_LAYER, 0, shadowStartPos, CloudLayer1_height, CloudLayer1_height+100.0)*dailyWeatherParams1.y;
|
||||
sunShadowMask += 3.0 * getCloudShape(LARGECUMULUS_LAYER, 0, shadowStartPos, CloudLayer1_height, CloudLayer1_height+100.0)*parameters.largeCumulus.y;
|
||||
}
|
||||
#endif
|
||||
// altostratus layer -> all cumulus layers
|
||||
#if defined CloudLayer2
|
||||
vec3 shadowStartPos = rayPosition + sunVector / abs(sunVector.y) * max(CloudLayer2_height - rayPosition.y, 0.0);
|
||||
sunShadowMask += getCloudShape(ALTOSTRATUS_LAYER, 0, shadowStartPos, CloudLayer2_height, CloudLayer2_height) * dailyWeatherParams1.z * (1.0-abs(sunVector.y));
|
||||
sunShadowMask += getCloudShape(ALTOSTRATUS_LAYER, 0, shadowStartPos, CloudLayer2_height, CloudLayer2_height) * parameters.altostratus.y * (1.0-abs(sunVector.y));
|
||||
#endif
|
||||
|
||||
vec3 lighting = getCloudLighting(shapeWithDensity, shapeWithDensityFaded, sunShadowMask, sunScattering, sunMultiScattering, indirectShadowMask, skyScattering * skylightOcclusion, distanceFade);
|
||||
|
@ -112,6 +112,7 @@ blend.gbuffers_hand_water.colortex11 = off
|
||||
blend.gbuffers_basic.colortex11 = off
|
||||
blend.gbuffers_entities_translucent.colortex11 = off
|
||||
|
||||
# blend.colortex4 = off
|
||||
blend.composite.colortex5 = off
|
||||
blend.composite.colortex12 = off
|
||||
blend.composite.colortex13 = off
|
||||
@ -471,6 +472,7 @@ uniform.bool.worldTimeChangeCheck = abs(smooth(sunAngle, 1.0, 1.0) - sunAngle) >
|
||||
|
||||
#if defined WATER_ON_CAMERA_EFFECT
|
||||
uniform.float.exitWater = smooth(if(isEyeInWater == 1,1,0),0.0,5.0)
|
||||
uniform.float.enterWater = smooth(if(isEyeInWater == 1,1,0),1.5,0.0)
|
||||
#endif
|
||||
|
||||
#if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT
|
||||
|
Reference in New Issue
Block a user