diff --git a/shaders/composite2.fsh b/shaders/composite2.fsh index 9ace1f7..839d038 100644 --- a/shaders/composite2.fsh +++ b/shaders/composite2.fsh @@ -46,6 +46,8 @@ uniform int isEyeInWater; uniform vec2 texelSize; +// uniform int worldTime; + #include "lib/Shadow_Params.glsl" #include "lib/color_transforms.glsl" #include "lib/color_dither.glsl" diff --git a/shaders/deferred.fsh b/shaders/deferred.fsh index 91f5625..ff0d078 100644 --- a/shaders/deferred.fsh +++ b/shaders/deferred.fsh @@ -56,6 +56,8 @@ uniform ivec2 eyeBrightnessSmooth; #include "/lib/ROBOBO_sky.glsl" #include "lib/sky_gradient.glsl" +// uniform int worldTime; + #define TIMEOFDAYFOG #include "lib/volumetricClouds.glsl" diff --git a/shaders/deferred.vsh b/shaders/deferred.vsh index 55e2cfe..fa27c5d 100644 --- a/shaders/deferred.vsh +++ b/shaders/deferred.vsh @@ -44,7 +44,7 @@ uniform float far; uniform float frameTime; uniform float eyeAltitude; uniform int frameCounter; -uniform int worldTime; +// uniform int worldTime; vec3 sunVec = normalize(mat3(gbufferModelViewInverse) *sunPosition); diff --git a/shaders/lib/climate_settings.glsl b/shaders/lib/climate_settings.glsl index 13ad3ed..ec6b981 100644 --- a/shaders/lib/climate_settings.glsl +++ b/shaders/lib/climate_settings.glsl @@ -203,7 +203,7 @@ /////////////////////////////////////////////////////////////////////////////// #ifdef TIMEOFDAYFOG - uniform int worldTime; + // uniform int worldTime; void TimeOfDayFog(inout float Uniform, inout float Cloudy) { float Time = (worldTime%24000)*1.0; diff --git a/shaders/lib/end_fog.glsl b/shaders/lib/end_fog.glsl index a948c5f..8358f71 100644 --- a/shaders/lib/end_fog.glsl +++ b/shaders/lib/end_fog.glsl @@ -82,10 +82,21 @@ vec3 LightSourcePosition(vec3 WorldPos, vec3 CameraPos){ Origin.y -= 200; } else { - Origin = WorldPos - CameraPos - ManualLightPos; - float nosie = (densityAtPosFog(Origin / 30 + sin(frameTimeCounter/5)*100)-0.15) * 15 ; - Origin.xz += vec2( sin(nosie),-cos(nosie) )*50; - Origin.y -= sin(nosie)*100; + Origin = WorldPos - CameraPos ; + + #ifdef THE_ORB + if(ManualLightPos == 0.0){ + #endif + + float nosie = (densityAtPosFog(Origin / 30 + sin(frameTimeCounter/5)*100)-0.15) * 15 ; + Origin.xz += vec2( sin(nosie),-cos(nosie) )*50; + Origin.y -= sin(nosie)*100; + + #ifdef THE_ORB + } else { + Origin -= ManualLightPos; + } + #endif float cellSize = 100.0; vec3 cellPos = CameraPos - vec3(0,10,0) ; @@ -102,26 +113,29 @@ vec3 LightSourcePosition(vec3 WorldPos, vec3 CameraPos){ ///////////////// COLOR vec3 LightSourceColor(float SwirlBounds){ - vec3 Color = vec3(0.0); + vec3 Color = vec3(0.5, 0.5, 1.0); - if( SwirlBounds < 1.0) { + #ifndef THE_ORB + if( SwirlBounds < 1.0) { + // Color = vec3(0.5, 0.5, 1.0); + } else { - Color = vec3(0.5, 0.5, 1.0); + // #ifdef THE_ORB + // Color = vec3(ORB_R, ORB_G, ORB_B) * ORB_ColMult; + // #endif - } else { + // Color *= blackbody2(RandomPosition.y*4000 + 1000); + + float Timing = dot(RandomPosition, vec3(1.0/3.0)); + float Flash = max(sin(frameTimeCounter) * cos(Timing) ,0.0); + Color *= Flash; + } + #else Color = vec3(ORB_R, ORB_G, ORB_B) * ORB_ColMult; - + #endif - // Color *= blackbody2(RandomPosition.y*4000 + 1000); - - float Timing = dot(RandomPosition, vec3(1.0/3.0)); - float Flash = max(sin(frameTimeCounter) * cos(Timing) ,0.0); - Color *= Flash; - - } - return Color; } @@ -137,31 +151,30 @@ vec3 LightSourceShape(vec3 WorldPos){ float SwirlBounds = clamp(sqrt(length(Origin) / 200.0 - 1.0) ,0.0,1.0); if( SwirlBounds < 1.0) { - // vec3 Origin = WorldPos; Origin.y -= 200; vec3 Origin2 = Origin; - Origin2.y += 100 ; - Origin2.y *= 0.8; + Origin2.y = (Origin2.y + 100.0) * 0.8; float Center = length(Origin); float AltCenter = length(Origin2); - //////// STAGE 1 - // when the ender dragon is alive, restrict the fog in this shape // the max of a sphere is another smaller sphere. this creates a hollow sphere. Shapes.r = max(1.0 - AltCenter / 75.0, max(AltCenter / 150.0 - 1.0, 0.0)); + // donut to make the hurricane shape float radius = 200.0; - float thickness = 50.0 * radius; - Shapes.r = (thickness - clamp(pow(sqrt(pow(Origin2.x,2) + pow(Origin2.z,2)) - radius,2) + pow(Origin2.y*0.75,2.0) - radius,0,thickness)) / thickness ; + float thickness = 25.0 * radius; + Shapes.r = (thickness - clamp( pow( length( vec2(length(Origin2.xz) - radius, Origin2.y*0.75) ),2.0) - radius, 0.0, thickness) ) / thickness; - Shapes.r = max(Shapes.r, max(1.0 - AltCenter / 75.0, 0.0)); + Shapes.r = max(Shapes.r, max(1.0 - AltCenter / 75.0, 0.0)); - radius = 50.0; - thickness = 5.0 * radius; - Shapes.b = (thickness - clamp(pow(sqrt(pow(Origin2.x,2) + pow(Origin2.y,2)) - radius,2) + pow(Origin2.z*0.75,2.0) - radius,0,thickness)) / thickness ; + + // debug donut + // radius = 50.0; + // thickness = 5.0 * radius; + // Shapes.b = (thickness - clamp( pow( length( vec2(length(Origin2.xy) - radius, Origin2.z*0.75) ),2.0) - radius, 0.0, thickness) ) / thickness; } return Shapes; @@ -180,25 +193,20 @@ float cloudVol(in vec3 pos, int LOD){ vec3 samplePos2 = pos*vec3(1.0,1./48.,1.0); // #ifndef THE_ORB - // ender dragon battle area swirling effect. - // if(EndSequence2 < 1.0){ - float radiance = 2.39996 + samplePos.y + frameTimeCounter/10; - mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance))); + float radiance = 2.39996 + samplePos.y + frameTimeCounter/10; + mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance))); - // make the swirl only happen within a radius - float SwirlBounds = clamp(sqrt(length(vec3(pos.x,pos.y-100,pos.z)) / 200.0 - 1.0) ,0.0,1.0); + // make the swirl only happen within a radius + float SwirlBounds = clamp(sqrt(length(vec3(pos.x,pos.y-100,pos.z)) / 200.0 - 1.0) ,0.0,1.0); - samplePos.xz = mix(samplePos.xz * rotationMatrix, samplePos.xz, SwirlBounds); - samplePos2.xz = mix(samplePos2.xz * rotationMatrix, samplePos2.xz, SwirlBounds); - // } + samplePos.xz = mix(samplePos.xz * rotationMatrix, samplePos.xz, SwirlBounds); + samplePos2.xz = mix(samplePos2.xz * rotationMatrix, samplePos2.xz, SwirlBounds); // #endif samplePos2.y -= frameTimeCounter/15; - float finalfog = 0; - + float finalfog = 0.0; finalfog += max(0.6-densityAtPosFog(samplePos * 16.0) * 2,0.0); - // finalfog = exp(finalfog*5)-1; float smallnoise = max(densityAtPosFog(samplePos2 * (160. - finalfog*3))-0.1,0.0); finalfog -= ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.3; @@ -206,7 +214,6 @@ float cloudVol(in vec3 pos, int LOD){ // make the eye of the swirl have no fog, so you can actually see. finalfog = max(finalfog - Shapes.r, 0.0); - // dragon death sequence // finalfog = Shapes.b; @@ -261,7 +268,6 @@ mat2x3 getVolumetricRays(float dither,vec3 fragpos,float dither2) { vec3 LightPos = LightSourcePosition(progressW, cameraPosition); // float OrbMie = exp(length(LightPos) * -0.03) * 64.0; - // float OrbMie = max(exp2(4.0 + length(LightPos) / -20),0.0); @@ -284,9 +290,9 @@ mat2x3 getVolumetricRays(float dither,vec3 fragpos,float dither2) { vec3 CastedLight = LightColor * OrbMie * exp(CastLight * 15 * (LightColor*(1.0-CastLight/3)-1.50)) ; CastedLight += (LightColor * vec3(1.0,1.3,1.0)) * exp(abs(densityVol*2.0 - 0.3) * 15 * (LightColor*CastLight)) * (max(OrbMie - density*10,0.0)/10); - // #ifdef THE_ORB - // density += clamp((1.0 - length(LightPos) / 10.0) * 10 ,0.0,1.0) ; - // #endif + #ifdef THE_ORB + density += clamp((1.0 - length(LightPos) / 10.0) * 10 ,0.0,1.0) ; + #endif vec3 AmbientLight = fogColor * 0.05 * pow(exp(density * -2),20); diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index 66a43b2..81a0d38 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -21,6 +21,7 @@ uniform sampler2D colortex4;//Skybox #define WEATHERCLOUDS +uniform int worldTime; #include "/lib/climate_settings.glsl" // #ifdef Daily_Weather @@ -32,7 +33,8 @@ float AltostratusHeight = 2000; float rainCloudwetness = rainStrength; -float cloud_movement = frameTimeCounter * Cloud_Speed; +// float cloud_movement = frameTimeCounter * Cloud_Speed ; +float cloud_movement = (worldTime / 24.0) * Cloud_Speed ; //3D noise from 2d texture float densityAtPos(in vec3 pos){ diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 77c7019..0af112b 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -22,22 +22,22 @@ blend.gbuffers_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE # SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO # SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE -blend.gbuffers_hand_water=SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO +blend.gbuffers_hand_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO +blend.gbuffers_damagedblock = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE + blend.gbuffers_entities = off blend.gbuffers_hand = off blend.gbuffers_block= off blend.gbuffers_basic= off -blend.gbuffers_damagedblock= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_skytextured=off blend.gbuffers_water.colortex11 = off -alphaTest.gbuffers_armor_glint=false - alphaTest.gbuffers_entities=GREATER 0.1 +alphaTest.gbuffers_water=flase +alphaTest.gbuffers_armor_glint=false alphaTest.gbuffers_weather=false -alphaTest.gbuffers_water=false alphaTest.gbuffers_skybasic=false alphaTest.gbuffers_skytextured=false alphaTest.gbuffers_hand=true @@ -129,12 +129,12 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds] screen.Sky = [Sky_coefficients] [Sun_and_Moon_Colors] sunPathRotation screen.Sky_coefficients.columns=1 - screen.Sky_coefficients = Sky_Brightness sky_mieg sky_coefficientRayleighR sky_coefficientRayleighG sky_coefficientRayleighB sky_coefficientMieR sky_coefficientMieG sky_coefficientMieB + screen.Sky_coefficients = Sky_Brightness sky_mieg sky_coefficientRayleighR sky_coefficientRayleighG sky_coefficientRayleighB sky_coefficientMieR sky_coefficientMieG sky_coefficientMieB ### CLOUDS screen.Clouds.columns=2 # screen.Clouds = VOLUMETRIC_CLOUDS Altostratus cloud_LevelOfDetail cloud_ShadowLevelOfDetail CLOUDS_QUALITY cloudDensity cloudCoverage Rain_coverage fbmAmount fbmPower1 fbmPower2 Cloud_top_cutoff Cloud_base_cutoff Shadow_brightness self_shadow_samples CLOUDS_SHADOWS VL_CLOUDS_SHADOWS - screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height CLOUDS_SHADOWS Cloud_Speed Rain_coverage Cloud_Fog + screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height CLOUDS_SHADOWS Cloud_Speed Rain_coverage Cloud_Fog Daily_Weather ### FOG screen.Fog.columns=1 @@ -201,7 +201,7 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds] ######## moonphase based weather # in seconds... -variable.int.TransitionTime = 5 +variable.int.TransitionTime = 30 uniform.float.Cumulus_Cov = smooth(1, if( \ moonPhase == 0, 0.7, \